]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2058: Fatal error when create split constraint
authorazv <azv@opencascade.com>
Wed, 29 Mar 2017 10:56:21 +0000 (13:56 +0300)
committerazv <azv@opencascade.com>
Wed, 29 Mar 2017 10:56:44 +0000 (13:56 +0300)
Fix wrong processing of tangent constraint between line and circle having one coincident point.

src/SketchSolver/SketchSolver_ConstraintTangent.cpp

index 709d09185bfe2ad3e4fe89ec65b5584d63321c8e..1c42ac69af7fdceca28e1eeb1f3de71e094165e1 100644 (file)
@@ -307,12 +307,13 @@ ConstraintWrapperPtr createArcLineTangency(EntityWrapperPtr theEntity1,
 
   std::shared_ptr<GCS::Circle> aCirc =
       std::dynamic_pointer_cast<GCS::Circle>(anEntCirc->entity());
+  std::shared_ptr<GCS::Arc> anArc = std::dynamic_pointer_cast<GCS::Arc>(aCirc);
+
   std::shared_ptr<GCS::Line> aLine =
       std::dynamic_pointer_cast<GCS::Line>(anEntLine->entity());
 
   GCSConstraintPtr aNewConstr;
-  if (theSharedPoint) {
-    std::shared_ptr<GCS::Arc> anArc = std::dynamic_pointer_cast<GCS::Arc>(aCirc);
+  if (theSharedPoint && anArc) { // do not process shared point between circle and line
     GCSPointPtr aPoint =
         std::dynamic_pointer_cast<PlaneGCSSolver_PointWrapper>(theSharedPoint)->point();