commit 980c19e338c6ad4255d4ddcc07a3f540d738413b
parent c1303e068cd1319a86ed863c921b15aa3f9eda6b
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Wed, 3 May 2017 17:18:33 +0200
Fix issue #1 (default meshing of an hemisphere).
Diffstat:
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/ssol_shape.c b/src/ssol_shape.c
@@ -1272,12 +1272,9 @@ hemisphere_compute_slices_count
(const struct priv_hemisphere_data* hemisphere, const double radius)
{
size_t nslices;
- double pt[2];
- double max_z = -DBL_MAX;
- ASSERT(hemisphere && radius > 0);
- d2(pt, 0, radius);
- max_z = MMAX(max_z, hemisphere_z(pt, hemisphere));
- nslices = MMIN(50, (size_t)(3 + sqrt(max_z) * 6));
+ ASSERT(hemisphere && radius > 0 && hemisphere->radius >= radius);
+ /* default ranging from 5 to 16 */
+ nslices = (size_t)(5.5 + 11 * radius / hemisphere->radius);
return nslices;
}