From 1befbb0b34eb487de4b738036260ae660552629c Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 2 Jun 2016 10:24:26 +0300 Subject: [PATCH] Conflicting constraints when Translation (issue #1542) --- src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp | 4 ++++ src/SketchSolver/SketchSolver_Group.cpp | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp index 36e8bfc9c..0c00e3064 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp @@ -361,6 +361,10 @@ void PlaneGCSSolver_Storage::verifyFixed() void PlaneGCSSolver_Storage::processArc(const EntityWrapperPtr& theArc) { + // no need to constraint a fixed arc + if (theArc->group() == GID_OUTOFGROUP) + return; + // Calculate additional parameters necessary for PlaneGCS const std::list& aSubs = theArc->subEntities(); std::list::const_iterator aSubIt = aSubs.begin(); diff --git a/src/SketchSolver/SketchSolver_Group.cpp b/src/SketchSolver/SketchSolver_Group.cpp index ed6b91239..52ff77c13 100644 --- a/src/SketchSolver/SketchSolver_Group.cpp +++ b/src/SketchSolver/SketchSolver_Group.cpp @@ -328,7 +328,8 @@ bool SketchSolver_Group::resolveConstraints() { bool aResolved = false; bool isGroupEmpty = isEmpty() && myStorage->isEmpty(); - if (myStorage->isNeedToResolve() && (!isGroupEmpty || !myConflictingConstraints.empty())) { + if (myStorage->isNeedToResolve() && + (!isGroupEmpty || !myConflictingConstraints.empty() || myPrevResult == STATUS_FAILED)) { if (!mySketchSolver) mySketchSolver = SketchSolver_Manager::instance()->builder()->createSolver(); @@ -341,7 +342,7 @@ bool SketchSolver_Group::resolveConstraints() try { if (myStorage->hasDuplicatedConstraint()) aResult = STATUS_INCONSISTENT; - else { + else if (!isGroupEmpty) { // To avoid overconstraint situation, we will remove temporary constraints one-by-one // and try to find the case without overconstraint bool isLastChance = false; -- 2.39.2