curve_fit_nd: fix assert caused by too small epsilon
authorCampbell Barton <ideasman42@gmail.com>
Thu, 11 Apr 2019 14:58:15 +0000 (00:58 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 11 Apr 2019 15:01:49 +0000 (01:01 +1000)
Curve decimate would assert in some cases.

extern/curve_fit_nd/intern/curve_fit_cubic.c

index ed855d3..0005cbe 100644 (file)
@@ -462,7 +462,7 @@ static double points_calc_circumference_factor(
                 * We could try support this but will likely cause extreme >1 scales which could cause other issues. */
                // assert(angle >= len_tangent);
                double factor = (angle / len_tangent);
-               assert(factor < (M_PI / 2) + (DBL_EPSILON * 10));
+               assert(factor < (M_PI / 2) + 1e-6);
                return factor;
        }
        else {