Sketcher: Treat malformed solver constraints as an error during recompute

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

Sometimes it happens that malformed constraints are arrived to.

Example:
https://forum.freecadweb.org/viewtopic.php?f=3&t=53780#p463271

It is not the first time. They usually go under the radar and when they are
detected is too late to know what caused them. The user is desperate too.

This commit makes malformed constraints to prevent the recompute of the project.

This is in the best interest of the user.
This commit is contained in:
Abdullah Tahiri
2021-01-03 18:47:45 +01:00
committed by abdullahtahiriyo
parent 83d039101c
commit 150e50c700

View File

@@ -216,6 +216,9 @@ App::DocumentObjectExecReturn *SketchObject::execute(void)
else if (err == -1) { // Solver failed
return new App::DocumentObjectExecReturn("Solving the sketch failed",this);
}
else if (solvedSketch.hasMalformedConstraints()) {
return new App::DocumentObjectExecReturn("Sketch has malformed constraints");
}
// this is not necessary for sketch representation in edit mode, unless we want to trigger an update of
// the objects that depend on this sketch (like pads)