From: azv Date: Mon, 10 Nov 2014 05:28:57 +0000 (+0300) Subject: Issue #196: Implemented verification of zero distance in SketchSolver X-Git-Tag: V_0.5~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=80b120ed40d0141c08170c5b8bbb11d6a2ededcd;p=modules%2Fshaper.git Issue #196: Implemented verification of zero distance in SketchSolver --- diff --git a/src/SketchSolver/SketchSolver_ConstraintGroup.cpp b/src/SketchSolver/SketchSolver_ConstraintGroup.cpp index 7eff7e79b..d6550ed52 100644 --- a/src/SketchSolver/SketchSolver_ConstraintGroup.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintGroup.cpp @@ -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;