{
bool aResolved = false;
bool isGroupEmpty = isEmpty() && myStorage->isEmpty();
- if (myStorage->isNeedToResolve() && !isGroupEmpty) {
+ if (myStorage->isNeedToResolve() &&
+ (!isGroupEmpty || !myConflictingConstraints.empty() || myPrevResult == STATUS_FAILED)) {
if (!mySketchSolver)
mySketchSolver = SketchSolver_Manager::instance()->builder()->createSolver();
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;
updateMultiConstraints(myConstraints);
if (myPrevResult != STATUS_OK || myPrevResult == STATUS_UNKNOWN) {
getWorkplane()->string(SketchPlugin_Sketch::SOLVER_ERROR())->setValue("");
- // the error message should be changed before sending the message
- sendMessage(EVENT_SOLVER_REPAIRED, myConflictingConstraints);
+ std::set<ObjectPtr> aConflicting = myConflictingConstraints;
myConflictingConstraints.clear();
myPrevResult = STATUS_OK;
+ // the error message should be changed before sending the message
+ sendMessage(EVENT_SOLVER_REPAIRED, aConflicting);
}
} else {
mySketchSolver->undo();