From f769439f092b5b78f065630e8ed9a2b455828104 Mon Sep 17 00:00:00 2001 From: abn Date: Thu, 7 Jun 2018 09:17:54 +0200 Subject: [PATCH] ArcCSegIntersector fix: more precise usage of machine epsilon. --- .../Geometric2D/InterpKernelGeo2DEdgeArcCircle.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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. -- 2.39.2