From 449fd71f4418f1f67a2ecc51ba497035b6ffed7d Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Thu, 23 Jul 2015 00:15:43 -0700 Subject: [PATCH] don't diagnose every time --- web/app/sketcher/constr/solver.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/web/app/sketcher/constr/solver.js b/web/app/sketcher/constr/solver.js index 193cead5..93be203e 100644 --- a/web/app/sketcher/constr/solver.js +++ b/web/app/sketcher/constr/solver.js @@ -248,15 +248,17 @@ TCAD.parametric.prepare = function(constrs, locked, aux, alg) { error : 0, returnCode : 1 }; - + + var conflict = TCAD.parametric.diagnose(sys).conflict; + if (conflict) { + console.log("Conflicting or redundant constraints. Please fix your system."); + return nullResult; + } + function solve(rough, alg) { + if (conflict) return nullResult; if (constrs.length == 0) return nullResult; if (sys.params.length == 0) return nullResult; - if (TCAD.parametric.diagnose(sys).conflict) { - console.log("Conflicting or redundant constraints. Please fix your system."); - return nullResult; - } - switch (alg) { case 2: return TCAD.parametric.solve_lm(sys, model, jacobian, rough);