From: azv Date: Sat, 6 May 2017 13:15:42 +0000 (+0300) Subject: Issue #2158: Crash when trimming a circle X-Git-Tag: V_2.7.1~32 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c33163e98065686e0ffe81b882ebffe309ca5537;p=modules%2Fshaper.git 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), --- 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));