From 75150f714725f2d393c760ad32e4fe909374e5e2 Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 10 Nov 2014 09:43:40 +0300 Subject: [PATCH] Issue #196: Implemented verification of zero distance in SketchSolver --- src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp index 2e22f0c32..3ad9b6842 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp @@ -123,6 +123,10 @@ AISObjectPtr SketchPlugin_ConstraintDistance::getAISObject(AISObjectPtr thePrevi boost::shared_ptr aValueAttr = boost::dynamic_pointer_cast< ModelAPI_AttributeDouble>(aData->attribute(SketchPlugin_Constraint::VALUE())); double aValue = aValueAttr->value(); + // Issue #196: checking the positivity of the distance constraint + // there is a validator for a distance constraint, that the value should be positive + if (aValue <= 0) + return AISObjectPtr(); AISObjectPtr anAIS = thePrevious; if (!anAIS) -- 2.39.2