]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #196: Implemented verification of zero distance in SketchSolver
authorazv <azv@opencascade.com>
Mon, 10 Nov 2014 05:28:57 +0000 (08:28 +0300)
committerazv <azv@opencascade.com>
Mon, 10 Nov 2014 05:28:57 +0000 (08:28 +0300)
src/SketchSolver/SketchSolver_ConstraintGroup.cpp

index 7eff7e79bbab58a89e0d69f4eddabaa26e48494c..d6550ed528e699d3c4171e0310486326ffec8f92 100644 (file)
@@ -241,6 +241,10 @@ bool SketchSolver_ConstraintGroup::changeConstraint(
       theConstraint->data()->attribute(SketchPlugin_Constraint::VALUE()));
   if (aDistAttr) {
     aDistance = aDistAttr->value();
+    // Issue #196: checking the positivity of the distance constraint
+    if (aDistance < tolerance &&
+       (aConstrType == SLVS_C_PT_PT_DISTANCE || aConstrType == SLVS_C_PT_LINE_DISTANCE))
+      return false;
     // SketchPlugin circle defined by its radius, but SolveSpace uses constraint for diameter
     if (aConstrType == SLVS_C_DIAMETER)
       aDistance *= 2.0;