CAD_Sketcher
CAD_Sketcher copied to clipboard
Add missing solve return values
According to C headers there are values 4 and 5 possible.
This currently is missing two things:
- it does not force re-solving. Maybe this should be done for every new release/code anyway?
- It does not show which constraints are redundant.
Nice fix! I think the documentation was wrong as the 5th error was never explained. Now that all the possible errors are implemented the "Solver returned unknown error" could probably be removed.
This currently is missing two things:
- it does not force re-solving. Maybe this should be done for every new release/code anyway?
- It does not show which constraints are redundant.
-
I don't really get what you mean here.
-
Afaik solvespace doesn't have support to report which exact constraints are redundant/overconstrained, same with degree of freedom.
I don't really get what you mean here.
Since previously the code did clamp e.g. 5 to 4 if you open a blender file with the new code it shows thus the error message for 4 - which is actually wrong (the value should now be 5). Maybe a good idea to force reevaluating of all cached state when loading a new version of the AddOn.
Afaik solvespace doesn't have support to report which exact constraints are redundant/overconstrained, same with degree of freedom.
I am not sure. Looking at the C code where they do further redundant handling it seems like they do some more processing. Will try to look into this the next days some more.
Ahh i see, IMO this is really just a minor issue which isn't a big deal in pre 1.0 versions. Otherwis it could be adjusted in versioning.py.
So since SolveSpaceUI::SolveGroupAndReport
runs solving twice when it returns redundancies - maybe we should adopt the same mechanism?
Just re-try solving again whenever the solver fails or just with a specific return value of the solver?
@abergmeier This PR is IMO in a good state but is still marked as WIP... I'd say not re-solving old files when opening isn't a big deal as we haven't reached 1.0 yet and we also have a manual update button. Additional changes like solving twice for redundant error is also better kept in a separate PR.
Seems to work brilliantly, except perhaps for the "redundant" + Ok warning message.
Maybe a good idea to force reevaluating of all cached state when loading a new version of the AddOn.
Great point btw, perhaps we should consider this before merging to master? Perhaps we can make a test/develop branch and create a new PR for the reevaluation-on-update feature?
This seems to work great, just some minor notes:
- It's easy to overlook the text change to "Redundant OK", maybe we could use a different icon if there's just a note, maybe the "INFO" icon?
- The constraints that are reported by the solver will be marked with "Failed" which might be a bit misleading.
Seems to work brilliantly, except perhaps for the "redundant" + Ok warning message.
I would also just go with "Redundant" and the info icon.
The constraints that are reported by the solver will be marked with "Failed" which might be a bit misleading.
I think it is OK given there is no other way to know which constraints are redundant atm.