From c33163e98065686e0ffe81b882ebffe309ca5537 Mon Sep 17 00:00:00 2001 From: azv Date: Sat, 6 May 2017 16:15:42 +0300 Subject: [PATCH] Issue #2158: Crash when trimming a circle Do not cast tangent curves to arcs when they have a shared point (i.e. arc and circle may have shared point or constraint has been changed by not processed by solver), --- src/SketchSolver/SketchSolver_ConstraintTangent.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/SketchSolver/SketchSolver_ConstraintTangent.cpp b/src/SketchSolver/SketchSolver_ConstraintTangent.cpp index ff72f310d..8fa16bc68 100644 --- a/src/SketchSolver/SketchSolver_ConstraintTangent.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintTangent.cpp @@ -351,14 +351,12 @@ ConstraintWrapperPtr createArcArcTangency(EntityWrapperPtr theEntity1, GCSConstraintPtr aNewConstr; if (theSharedPoint) { - std::shared_ptr anArc1 = std::dynamic_pointer_cast(aCirc1); - std::shared_ptr anArc2 = std::dynamic_pointer_cast(aCirc2); GCSPointPtr aPoint = std::dynamic_pointer_cast(theSharedPoint)->point(); - adjustAngleBetweenCurves(anArc1, anArc2, aPoint, theAngle); + adjustAngleBetweenCurves(aCirc1, aCirc2, aPoint, theAngle); aNewConstr = - GCSConstraintPtr(new GCS::ConstraintAngleViaPoint(*anArc1, *anArc2, *aPoint, theAngle)); + GCSConstraintPtr(new GCS::ConstraintAngleViaPoint(*aCirc1, *aCirc2, *aPoint, theAngle)); } else { aNewConstr = GCSConstraintPtr(new GCS::ConstraintTangentCircumf(aCirc1->center, aCirc2->center, aCirc1->rad, aCirc2->rad, theInternalTangency)); -- 2.39.2