From: azv Date: Wed, 11 Jan 2017 05:57:49 +0000 (+0300) Subject: Fix problem with jumping sketch while movement (issue #1446) X-Git-Tag: V_2.7.0~346^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=12af6d8df76070408d14574eb65ede9c27a51d8d;p=modules%2Fshaper.git Fix problem with jumping sketch while movement (issue #1446) --- diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp index b1097be97..a16a3bbde 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp @@ -127,6 +127,7 @@ SketchSolver_SolveStatus PlaneGCSSolver_Solver::solve() // Additionally check redundant constraints if (aResult == GCS::Success || aResult == GCS::Converged) { + bool isSolveWithoutTangent = !aRedundantID.empty(); GCS::VEC_I aRedundantLocal; myEquationSystem->getRedundant(aRedundantLocal); aRedundantID.insert(aRedundantID.end(), aRedundantLocal.begin(), aRedundantLocal.end()); @@ -137,7 +138,15 @@ SketchSolver_SolveStatus PlaneGCSSolver_Solver::solve() // if the entities are coupled smoothly. // Sometimes tangent constraints are fall to both conflicting and redundant constraints. // Need to check if there are redundant constraints without these tangencies. - if (!aRedundantID.empty()) + if (!aRedundantID.empty() && !isSolveWithoutTangent) { + GCS::VEC_I::iterator aCIt = aRedundantID.begin(); + for (; aCIt != aRedundantID.end(); ++ aCIt) + if (myTangent.find(*aCIt) != myTangent.end()) { + isSolveWithoutTangent = true; + break; + } + } + if (isSolveWithoutTangent) aResult = myTangent.empty() ? GCS::Failed : solveWithoutTangent(); else aResult = GCS::Success;