]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2158: Crash when trimming a circle
authorazv <azv@opencascade.com>
Sat, 6 May 2017 13:15:42 +0000 (16:15 +0300)
committerazv <azv@opencascade.com>
Sat, 6 May 2017 13:15:42 +0000 (16:15 +0300)
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

index ff72f310dc99ae5ce40d3a41f87a6c9fb85971fa..8fa16bc685ac00b9188e1aff1d6f6d2799852c14 100644 (file)
@@ -351,14 +351,12 @@ ConstraintWrapperPtr createArcArcTangency(EntityWrapperPtr theEntity1,
 
   GCSConstraintPtr aNewConstr;
   if (theSharedPoint) {
-    std::shared_ptr<GCS::Arc> anArc1 = std::dynamic_pointer_cast<GCS::Arc>(aCirc1);
-    std::shared_ptr<GCS::Arc> anArc2 = std::dynamic_pointer_cast<GCS::Arc>(aCirc2);
     GCSPointPtr aPoint =
         std::dynamic_pointer_cast<PlaneGCSSolver_PointWrapper>(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));