From: azv Date: Wed, 12 Apr 2017 10:16:32 +0000 (+0300) Subject: Issue #2130: arc is done not as desired X-Git-Tag: V_2.7.0~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5c13fa0e68725babdd09541b028c186896e27b4f;p=modules%2Fshaper.git Issue #2130: arc is done not as desired Fix problem with adjusting parameter to a period of a circle, the built arc is tangent --- diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp index c1dd4cd32..6ae62b929 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp @@ -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(); }