From 80b120ed40d0141c08170c5b8bbb11d6a2ededcd Mon Sep 17 00:00:00 2001 From: azv Date: Mon, 10 Nov 2014 08:28:57 +0300 Subject: [PATCH] Issue #196: Implemented verification of zero distance in SketchSolver --- src/SketchSolver/SketchSolver_ConstraintGroup.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.39.2