From c2ab51314d1610c56f265be70c2eb848254c17f0 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sat, 26 Dec 2020 17:16:24 +0100 Subject: [PATCH] GCS: Return a zero sized reduced Jacobian if only driven constraints present ============================================================================= The reduced Jacobian defaults to the size of the full Jacobian, where driven constraints and parameters are not considered to build the reduced Jacobian and thus empty rows remain. This is generally not a problem as QR decomposition ignores this rows, except in case where only driven constraints exist. In such a case no QR decomposition is necessary, and in fact relying on the size of the QR decomposition leads to the incorrect result that the sketch is fully constraint, when the opposite is true. This commit resizes an effectively empty reduced Jacobian to avoid this issue. Fixes the problem that a line with a single reference constraint is shown as fully constraint. --- src/Mod/Sketcher/App/planegcs/GCS.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Mod/Sketcher/App/planegcs/GCS.cpp b/src/Mod/Sketcher/App/planegcs/GCS.cpp index 97ac7f6413..636f9899fe 100644 --- a/src/Mod/Sketcher/App/planegcs/GCS.cpp +++ b/src/Mod/Sketcher/App/planegcs/GCS.cpp @@ -3822,6 +3822,9 @@ void System::makeReducedJacobian(Eigen::MatrixXd &J, jacobianconstraintmap[jacobianconstraintcount-1] = allcount-1; } } + + if(jacobianconstraintcount == 0) // only driven constraints + J.resize(0,0); } int System::diagnose(Algorithm alg)