From 1132ba6b4a17b6acbd0ecf727ea455e0499fc7e2 Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 14 Jun 2017 15:07:34 +0300 Subject: [PATCH] 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. --- src/SketchPlugin/SketchPlugin_MacroCircle.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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( -- 2.39.2