From 5e758aecbe49c1039394eadad61a6ce397fb9935 Mon Sep 17 00:00:00 2001 From: azv Date: Sat, 1 Apr 2017 12:16:22 +0300 Subject: [PATCH] GeomAPI_Circ2d: correct checking of parameter on periodic tangent curve --- src/GeomAPI/GeomAPI_Circ2d.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/GeomAPI/GeomAPI_Circ2d.cpp b/src/GeomAPI/GeomAPI_Circ2d.cpp index ca6be46f3..9061473b0 100644 --- a/src/GeomAPI/GeomAPI_Circ2d.cpp +++ b/src/GeomAPI/GeomAPI_Circ2d.cpp @@ -187,7 +187,7 @@ private: gp_Pnt2d aTgPnt; for (int i = 1; i <= aNbSol && aCurve; ++i) { theBuilder->Tangency1(i, aParSol, aPonTgCurve, aTgPnt); - if (aPonTgCurve >= aCurve->FirstParameter() && aPonTgCurve <= aCurve->LastParameter()) { + if (isParamOnCurve(aPonTgCurve, aCurve)) { aResult = new gp_Circ2d(theBuilder->ThisSolution(i)); break; } @@ -316,18 +316,15 @@ private: bool isApplicable = false; if (myTangentShapes.size() >= 1) { theBuilder->Tangency1(i, aParSol, aPonTgCurve, aTgPnt); - isApplicable = aPonTgCurve >= myTangentShapes[0]->FirstParameter() && - aPonTgCurve <= myTangentShapes[0]->LastParameter(); + isApplicable = isParamOnCurve(aPonTgCurve, myTangentShapes[0]); } if (myTangentShapes.size() >= 2 && isApplicable) { theBuilder->Tangency2(i, aParSol, aPonTgCurve, aTgPnt); - isApplicable = aPonTgCurve >= myTangentShapes[1]->FirstParameter() && - aPonTgCurve <= myTangentShapes[1]->LastParameter(); + isApplicable = isParamOnCurve(aPonTgCurve, myTangentShapes[1]); } if (myTangentShapes.size() >= 3 && isApplicable) { theBuilder->Tangency3(i, aParSol, aPonTgCurve, aTgPnt); - isApplicable = aPonTgCurve >= myTangentShapes[2]->FirstParameter() && - aPonTgCurve <= myTangentShapes[2]->LastParameter(); + isApplicable = isParamOnCurve(aPonTgCurve, myTangentShapes[2]); } if (isApplicable) { -- 2.39.2