From: azv Date: Wed, 14 Jun 2017 12:07:34 +0000 (+0300) Subject: Issue #2190: Sketcher : 2 successive circles having the same center (the origin) X-Git-Tag: V_2.7.1.1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1132ba6b4a17b6acbd0ecf727ea455e0499fc7e2;p=modules%2Fshaper.git Issue #2190: Sketcher : 2 successive circles having the same center (the origin) Improve calculating of intermediate circle if the center is coincident with another point. --- diff --git a/src/SketchPlugin/SketchPlugin_MacroCircle.cpp b/src/SketchPlugin/SketchPlugin_MacroCircle.cpp index c2c47a60e..2b6829c72 100644 --- a/src/SketchPlugin/SketchPlugin_MacroCircle.cpp +++ b/src/SketchPlugin/SketchPlugin_MacroCircle.cpp @@ -227,10 +227,15 @@ void SketchPlugin_MacroCircle::fillByCenterAndPassed() if (!aCenterAttr->isInitialized() || !aPassedAttr->isInitialized()) return; - AttributeRefAttrPtr aPassedRef = refattr(PASSED_POINT_REF_ID()); // Calculate circle parameters - std::shared_ptr aCenter = - std::dynamic_pointer_cast(aCenterAttr)->pnt(); + AttributeRefAttrPtr aCenterRef = refattr(CENTER_POINT_REF_ID()); + std::shared_ptr aCenter; + std::shared_ptr aCurve; + SketchPlugin_Tools::convertRefAttrToPointOrTangentCurve( + aCenterRef, aCenterAttr, aCurve, aCenter); + if (!aCenter) + aCenter = std::dynamic_pointer_cast(aCenterAttr)->pnt(); + AttributeRefAttrPtr aPassedRef = refattr(PASSED_POINT_REF_ID()); std::shared_ptr aPassedPoint; std::shared_ptr aTangentCurve; SketchPlugin_Tools::convertRefAttrToPointOrTangentCurve(