From e49ce1df4ed0e4e95c80ebb2216d71f926f7d606 Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 1 Sep 2016 08:16:35 +0300 Subject: [PATCH] Fix for complementary angle constraint (incorrect calculation of direct angle) --- src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp | 5 +++-- src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp b/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp index 219f684ea..65ac80b15 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp @@ -228,8 +228,9 @@ void SketchPlugin_ConstraintAngle::updateConstraintValueByAngleValue() /// an angle value should be corrected by the current angle type aValueAttr = std::dynamic_pointer_cast< ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_Constraint::VALUE())); - bool isObtuse = aValueAttr->isInitialized() && aValueAttr->value() > 180.0; - anAngle = getAngleForType(anAngle, isObtuse); + if (!aValueAttr->isInitialized()) + calculateAngle(); + anAngle = getAngleForType(anAngle, aValueAttr->value() > 180.0); aValueAttr->setValue(anAngle); } diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp index 2b83759b8..6619c372b 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp @@ -428,8 +428,8 @@ void PlaneGCSSolver_Storage::processArc(const EntityWrapperPtr& theArc) *aEndAngle += anAngle; } - // no need to constraint a fixed or a copied arc - if (theArc->group() == GID_OUTOFGROUP || anArcFeature->isCopy()) + // no need to constraint a copied arc + if (anArcFeature->isCopy()) return; // No need to add constraints if they are already exist std::map >::const_iterator -- 2.39.2