Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintDistance.cpp
index 940ecff5c9796bd6835afddcd9a8e938a058981c..1f827a3c637b279b4b2ea6bfa56a99ea96897757 100644 (file)
@@ -167,8 +167,14 @@ void SketchSolver_ConstraintDistance::removeConstraintsKeepingSign()
   aParams.insert(myOddPoint->y);
   aStorage->removeParameters(aParams);
 
-  aGCSConstraints.pop_back();
-  aGCSConstraints.pop_back();
+  // remove constraints keeping sign of point-line distance,
+  // not more than 2 additional constraints is possible
+  if (!aGCSConstraints.empty())
+    aGCSConstraints.pop_back();
+  if (!aGCSConstraints.empty())
+    aGCSConstraints.pop_back();
   aConstraint->setConstraints(aGCSConstraints);
   aStorage->addConstraint(myBaseConstraint, aConstraint);
+
+  myIsSigned = false;
 }