From 5c13fa0e68725babdd09541b028c186896e27b4f Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 12 Apr 2017 13:16:32 +0300 Subject: [PATCH] Issue #2130: arc is done not as desired Fix problem with adjusting parameter to a period of a circle, the built arc is tangent --- src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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(); } -- 2.39.2