From: abn Date: Thu, 7 Jun 2018 07:17:54 +0000 (+0200) Subject: ArcCSegIntersector fix: more precise usage of machine epsilon. X-Git-Tag: SHAPER_V9_1_0RC1~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f769439f092b5b78f065630e8ed9a2b455828104;p=tools%2Fmedcoupling.git ArcCSegIntersector fix: more precise usage of machine epsilon. --- diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.cxx index 429cd0cb6..a0b3b9d23 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.cxx @@ -348,8 +348,8 @@ void ArcCSegIntersector::areOverlappedOrOnlyColinears(const Bounds *whereToFind, // Ah ah: we will be taking a square root later. If we want the user to be able to use an epsilon finer than 1.0e-8, then we need // to prevent ourselves going below machine precision (typ. 1.0e-16 for double). const double eps_machine = std::numeric_limits::epsilon(); - diff = fabs(diff) < 10*eps_machine ? 0.0 : diff; - add = fabs(add) < 10*eps_machine ? 0.0 : add; + diff = fabs(diff/R) < eps_machine ? 0.0 : diff; + add = fabs(add/R) < eps_machine ? 0.0 : add; double d = add*diff; // Compute deltaRoot_div_dr := sqrt(delta)/dr, where delta has the meaning of Wolfram. // Then 2*deltaRoot_div_dr is the distance between the two intersection points of the line with the circle. This is what we compare to eps.