Write params if system is solved as REDUNDANT_OKAY.

A system solved as REDUNDANT_OKAY is still solved correctly,
even if the UI would consider this an error, in case that
g->allowRedundant==false. So there's no reason to discard this
solution; we might find it useful if a system loses a degree of
freedom while dragging, or to avoid regeneration after redundant
constraints are allowed.

This commit also reverts commit 3ff236c, as that is not necessary
anymore.
This commit is contained in:
Evil-Spirit 2016-08-15 01:38:13 +07:00 committed by whitequark
parent 8a96ca894c
commit bc43365eff
2 changed files with 21 additions and 24 deletions

View File

@ -463,10 +463,8 @@ int System::Solve(Group *g, int *dof, List<hConstraint> *bad,
if(!rankOk) {
if(!g->allowRedundant) {
if(andFindBad) FindWhichToRemoveToFixJacobian(g, bad);
return System::REDUNDANT_OKAY;
}
}
} else {
// This is not the full Jacobian, but any substitutions or single-eq
// solves removed one equation and one unknown, therefore no effect
// on the number of DOF.
@ -492,7 +490,7 @@ int System::Solve(Group *g, int *dof, List<hConstraint> *bad,
}
}
}
}
// System solved correctly, so write the new values back in to the
// main parameter table.
for(i = 0; i < param.n; i++) {

View File

@ -469,7 +469,6 @@ void TextWindow::ScreenAllowRedundant(int link, uint32_t v) {
Group *g = SK.GetGroup(SS.TW.shown.group);
g->allowRedundant = true;
SS.MarkGroupDirty(g->h);
SS.GenerateAll();
SS.TW.shown.screen = SCREEN_GROUP_INFO;