0029510: IntWalk_PWalking:: PutToBoundary(...) method results in appearing several...
authornbv <nbv@opencascade.com>
Thu, 15 Feb 2018 11:38:59 +0000 (14:38 +0300)
committerapn <apn@opencascade.com>
Fri, 16 Feb 2018 12:11:12 +0000 (15:11 +0300)
Places have been detected where coincident points are created. The problem has been fixed.

src/IntWalk/IntWalk_PWalking.cxx

index 987bf63..e5b36a4 100644 (file)
@@ -2427,7 +2427,16 @@ Standard_Boolean IntWalk_PWalking::
       {
         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++)
@@ -2468,7 +2477,16 @@ Standard_Boolean IntWalk_PWalking::
       {
         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--)