From 0da601303c01e0d4f8d92e3afa8efe806ffd53df Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 9 Jun 2016 13:19:26 +0300 Subject: [PATCH] Inconsistency constraint maintenance (issue #1558) --- src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp | 5 ++++- src/SketchSolver/SketchSolver_Group.cpp | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp index 2fc9185d2..40c524e94 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp @@ -149,8 +149,11 @@ bool PlaneGCSSolver_Storage::update(EntityWrapperPtr theEntity) if (theEntity->baseAttribute()) { isUpdated = updateValues(theEntity); - if (isUpdated) + if (isUpdated) { setNeedToResolve(true); + if (theEntity->type() == ENTITY_POINT && theEntity->group() != myGroupID) + updateCoincident(theEntity); + } } // update parameters diff --git a/src/SketchSolver/SketchSolver_Group.cpp b/src/SketchSolver/SketchSolver_Group.cpp index 144adbfe3..a39aab6e6 100644 --- a/src/SketchSolver/SketchSolver_Group.cpp +++ b/src/SketchSolver/SketchSolver_Group.cpp @@ -254,6 +254,9 @@ void SketchSolver_Group::moveFeature(FeaturePtr theFeature) myStorage->blockEvents(true); myStorage->refresh(true); + // Secondly, search attributes of the feature in the list of the Multi constraints and update them + updateMultiConstraints(myConstraints, theFeature); + // Then, create temporary Fixed constraint SolverConstraintPtr aConstraint = aBuilder->createMovementConstraint(theFeature); if (!aConstraint) @@ -262,9 +265,6 @@ void SketchSolver_Group::moveFeature(FeaturePtr theFeature) if (aConstraint->error().empty()) setTemporary(aConstraint); - // Secondly, search attributes of the feature in the list of the Multi constraints and update them - updateMultiConstraints(myConstraints, theFeature); - // Workaround to process arcs. // When move unconstrained arc, add temporary constraint to fix radius. if (theFeature->getKind() == SketchPlugin_Arc::ID()) { -- 2.39.2