]> OCCT Git - occt-copy.git/commitdiff
#return back to original patch by denix56
authormsv <msv@opencascade.com>
Wed, 8 Aug 2018 09:15:08 +0000 (12:15 +0300)
committermsv <msv@opencascade.com>
Fri, 5 Oct 2018 17:04:32 +0000 (20:04 +0300)
src/GCPnts/GCPnts_TangentialDeflection.pxx

index 11f44bbb664d96ad355bab3e73c91c4a72b99eea..65a30a01f6a348209f9689477fbc5406efdf724c 100644 (file)
@@ -327,6 +327,8 @@ void GCPnts_TangentialDeflection::PerformCurve (const TheCurve& C)
         }
 
         Standard_Real delta = (Intervs(i+1) - Intervs(i))/(NbPoints-1);
+        gp_Pnt prevMiddlePoint = CurrentPoint;
+
         for (j = 1; j < NbPoints && IsLine; ++j)
         {
           param = Intervs(i) + j*delta;
@@ -341,9 +343,12 @@ void GCPnts_TangentialDeflection::PerformCurve (const TheCurve& C)
             // Check if points on line are subsequent
             if(IsLine && IsSequential)
             {
-                IsSequential = (L2 <= L1);
+                gp_XYZ V3 = MiddlePoint.XYZ() - prevMiddlePoint.XYZ();
+                Standard_Real L3 = V3.Modulus();
+                IsSequential = (L3 <= L1);
             }
           }
+          prevMiddlePoint = MiddlePoint;
         }
       }