Sketcher: Solver information: Bug fix

=====================================

When the solver converged (but did not succeed) or when the solver succeded but the solution is not OCC-valid, no error message was shown in the solver messages dialog.
This commit is contained in:
Abdullah Tahiri
2015-10-05 17:24:03 +02:00
committed by wmayer
parent 4fb15f2a1b
commit fc128d357d
4 changed files with 17 additions and 6 deletions

View File

@@ -141,6 +141,9 @@ App::DocumentObjectExecReturn *SketchObject::execute(void)
lastConflicting=solvedSketch.getConflicting();
lastRedundant=solvedSketch.getRedundant();
lastSolveTime=0.0;
lastSolverStatus=GCS::Failed; // Failure is default for notifying the user unless otherwise proven
solverNeedsUpdate=false;
if (lastDoF < 0) { // over-constrained sketch
@@ -211,8 +214,14 @@ int SketchObject::solve(bool updateGeoAfterSolving/*=true*/)
err = -3;
else {
lastSolverStatus=solvedSketch.solve();
if (lastSolverStatus != 0) // solving
if (lastSolverStatus != 0){ // solving
err = -2;
// if solver failed, geometry was never updated, but invalid constraints were likely added before
// solving (see solve in addConstraint), so solver information is definitely invalid.
this->Constraints.touch();
}
}
lastHasRedundancies = solvedSketch.hasRedundancies();