]> OCCT Git - occt-copy.git/commitdiff
0029510: IntWalk_PWalking:: PutToBoundary(...) method results in appearing several...
authornbv <nbv@opencascade.com>
Thu, 15 Feb 2018 11:38:59 +0000 (14:38 +0300)
committernbv <nbv@opencascade.com>
Thu, 15 Feb 2018 11:47:12 +0000 (14:47 +0300)
Places have been detected where coincident points are created. The problem has been fixed.

(cherry picked from commit 7c7cda9f73f8762d4999657a925f65cd02bc6864)

src/IntWalk/IntWalk_PWalking.cxx

index 54c42a130432c7bf3e58e08a6a0d239e626e1a26..e38bfd0535fc87aca1b248eab828dba80f59c37d 100644 (file)
@@ -2361,7 +2361,16 @@ SeekPointOnBoundary(const Handle(Adaptor3d_HSurface)& theASurf1,
       {
         aP1.SetXYZ(line->Value(aPInd).Value().XYZ());
         if (aP1.SquareDistance(aPInt) > Precision::SquareConfusion())
+        {
           break;
+        }
+        else if (aPInd == 1)
+        {
+          // After insertion, we will obtain
+          // two coincident points in the line.
+          // Therefore, insertion is forbidden.
+          return isOK;
+        }
       }
 
       for (++aPInd; aPInd <= aNbPnts; aPInd++)
@@ -2402,7 +2411,16 @@ SeekPointOnBoundary(const Handle(Adaptor3d_HSurface)& theASurf1,
       {
         aPCurr.SetXYZ(line->Value(aPInd).Value().XYZ());
         if (aPCurr.SquareDistance(aPInt) > Precision::SquareConfusion())
+        {
           break;
+        }
+        else if (aPInd == aNbPnts)
+        {
+          // After insertion, we will obtain
+          // two coincident points in the line.
+          // Therefore, insertion is forbidden.
+          return isOK;
+        }
       }
 
       for (--aPInd; aPInd > 0; aPInd--)