]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2130: arc is done not as desired
authorazv <azv@opencascade.com>
Wed, 12 Apr 2017 10:16:32 +0000 (13:16 +0300)
committerazv <azv@opencascade.com>
Wed, 12 Apr 2017 10:16:41 +0000 (13:16 +0300)
Fix problem with adjusting parameter to a period of a circle, the built arc is tangent

src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp

index c1dd4cd32936b495d6eaa71a91c411ba782c6732..6ae62b929644a08106da15b6c70934eca34c3a15 100644 (file)
@@ -432,14 +432,19 @@ private:
   }
 
 
-  // boundary parameters of curve are NOT applied
-  static bool isParamInCurve(double& theParameter, const CurveAdaptorPtr& theCurve)
+  static void adjustPeriod(double& theParameter, const CurveAdaptorPtr& theCurve)
   {
     if (theCurve->Curve()->IsPeriodic()) {
       theParameter = ElCLib::InPeriod(theParameter,
                                       theCurve->FirstParameter(),
                                       theCurve->FirstParameter() + theCurve->Period());
     }
+  }
+
+  // boundary parameters of curve are NOT applied
+  static bool isParamInCurve(double& theParameter, const CurveAdaptorPtr& theCurve)
+  {
+    adjustPeriod(theParameter, theCurve);
     return theParameter > theCurve->FirstParameter() &&
            theParameter < theCurve->LastParameter();
   }
@@ -447,11 +452,7 @@ private:
   // boundary parameters of curve are applied too
   static bool isParamOnCurve(double& theParameter, const CurveAdaptorPtr& theCurve)
   {
-    if (theCurve->IsPeriodic()) {
-      theParameter = ElCLib::InPeriod(theParameter,
-                                      theCurve->FirstParameter(),
-                                      theCurve->FirstParameter() + theCurve->Period());
-    }
+    adjustPeriod(theParameter, theCurve);
     return theParameter >= theCurve->FirstParameter() &&
            theParameter <= theCurve->LastParameter();
   }