]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
GeomAPI_Circ2d: correct checking of parameter on periodic tangent curve
authorazv <azv@opencascade.com>
Sat, 1 Apr 2017 09:16:22 +0000 (12:16 +0300)
committerazv <azv@opencascade.com>
Sat, 1 Apr 2017 09:16:22 +0000 (12:16 +0300)
src/GeomAPI/GeomAPI_Circ2d.cpp

index ca6be46f31f1c892da0eb572105d70c07049a84c..9061473b0cc0576dbd6e9468a20ea444736167d0 100644 (file)
@@ -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) {