From c5ff5d9d484e8b398acfc90822a2964c8243df63 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Mon, 22 Apr 2019 14:59:25 +0200 Subject: [PATCH] Sketch: Verbose to console output malformed constraints that are ignored by the solver --- src/Mod/Sketcher/App/Sketch.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index 6c34c07e2f..aaff3c7087 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -1488,10 +1488,16 @@ int Sketch::addConstraint(const Constraint *constraint) int Sketch::addConstraints(const std::vector &ConstraintList) { int rtn = -1; + int cid = 0; - for (std::vector::const_iterator it = ConstraintList.begin();it!=ConstraintList.end();++it) + for (std::vector::const_iterator it = ConstraintList.begin();it!=ConstraintList.end();++it,++cid) { rtn = addConstraint (*it); + if(rtn == -1) { + Base::Console().Error("Sketcher constraint number %d is malformed!\n",cid); + } + } + return rtn; } @@ -1504,6 +1510,10 @@ int Sketch::addConstraints(const std::vector &ConstraintList, for (std::vector::const_iterator it = ConstraintList.begin();it!=ConstraintList.end();++it,++cid) { if (!unenforceableConstraints[cid] && (*it)->Type != Block) { rtn = addConstraint (*it); + + if(rtn == -1) { + Base::Console().Error("Sketcher constraint number %d is malformed!\n",cid); + } } else { ++ConstraintsCounter; // For correct solver redundant reporting