]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix problem with jumping sketch while movement (issue #1446)
authorazv <azv@opencascade.com>
Wed, 11 Jan 2017 05:57:49 +0000 (08:57 +0300)
committerazv <azv@opencascade.com>
Wed, 11 Jan 2017 05:58:23 +0000 (08:58 +0300)
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp

index b1097be9716f9cdbf3e34dfe914ffa180eb4478b..a16a3bbde75b2a93983f6cc735c36db1543f846c 100644 (file)
@@ -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;