Open zevv opened 5 months ago
I have the same problem. Did you find a solution by any chance?
No, I still remove them one by one until I find the offending combination :)
We're limited by the capability of the solver which doesn't mark the offending constraints unfortunately. There was a recent addition to avoid creating the same constraints multiple times at least, see: https://github.com/hlorus/CAD_Sketcher/commit/14762356659dfc39cd9386c2dc4b8db169b06b84
Is this something we could bring up with the solvespace people? I don't know a single thing about the CAD sketcher implementation, but I guess it would be a sensible feature for a solver to offer this kind of feedback on a failure.
I just tried Solvespace for the first time, using it is a breeze because I already know how to use CAD sketcher :)
However, Solvespace actually is able to indicate the source of redundant constraints, it tells me to "remove any of these to fix this" and shows a list of the constraints causing the conflict. This suggests that the info is available in solvespace itself, so the question would be how to get that out and propagate it to CAD sketcher, right?
In solvespace the case SolveResult::REDUNDANT_OKAY:
is handled and the list of problematic constraints is dumped:
for(int i = 0; i < g->solved.remove.n; i++) {
hConstraint hc = g->solved.remove[i];
Constraint *c = SK.constraint.FindByIdNoOops(hc);
if(!c) continue;
Printf(false, "%Bp %Fl%Ll%D%f%h%s%E",
(i & 1) ? 'd' : 'a',
c->h.v, (&TextWindow::ScreenSelectConstraint),
(&TextWindow::ScreenHoverConstraint),
c->DescriptionString().c_str());
}
This suggests the required info should be available at this point, but I'm not sure if this is all available through the Python binding of course.
Solvespace unfortunately doesn't ship python bindings. We're using this python library by realthunder which has some memory improvements but also seems to be pinne to a rather old version of solvespace. The solver does already provide a list of failed constraints (which CAD Sketcher uses and paints in red). Redundant constraints don't seem to be communicated, maybe it was added in a later version of the solver or is just not exposed in the python bi dings we're using. @vespakoen was looking into adding official solvespace python bindings a while back, this would obviously be the perfect solution but i guess his efforts never made it into the trunk. Here's some more info on the topic: https://github.com/hlorus/CAD_Sketcher/pull/320
Every now and then I run into the problem where the solver tells me I have redundant constraints; no constraints are specifically marked, so the only way to solve this for me is to remove them one by one until I find the offending combination.
This is quite cumbersome, and I'm sure I'm doing something wrong here. What's the proper way to handle this situation?