From: azv Date: Wed, 31 Aug 2016 07:44:59 +0000 (+0300) Subject: Fix fail on the Fillet unit test X-Git-Tag: V_2.5.0~103 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=9ba9d933ec63ba4d5521df7710e5d3374ac036f7;p=modules%2Fshaper.git Fix fail on the Fillet unit test --- diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp index 059e6b005..d0f503aba 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp @@ -212,7 +212,7 @@ GCS::SolveStatus PlaneGCSSolver_Solver::solveWithoutTangent() bool PlaneGCSSolver_Solver::isTangentTruth(GCS::Constraint* theTangent) const { static const double aTol = 1e-5; - static const double aTol2 = aTol *aTol; + double aTol2 = aTol *aTol; if (theTangent->getTypeId() == GCS::TangentCircumf) { GCS::VEC_pD aParams = theTangent->params(); @@ -221,8 +221,9 @@ bool PlaneGCSSolver_Solver::isTangentTruth(GCS::Constraint* theTangent) const double aDist2 = dx * dx + dy * dy; double aRadSum = *(aParams[4]) + *(aParams[5]); double aRadDiff = *(aParams[4]) - *(aParams[5]); - return fabs(aDist2 - aRadSum * aRadSum) <= aTol2 * aDist2 || - fabs(aDist2 - aRadDiff * aRadDiff) <= aTol2 * aDist2; + aTol2 *= aDist2 > 1.0 ? aDist2 : 1.0; + return fabs(aDist2 - aRadSum * aRadSum) <= aTol2 || + fabs(aDist2 - aRadDiff * aRadDiff) <= aTol2; } if (theTangent->getTypeId() == GCS::P2LDistance) { GCS::VEC_pD aParams = theTangent->params();