]> OCCT Git - occt-copy.git/commitdiff
0032265: Modeling Algorithms - some trivial code improvements in GCPnts_TangentialDef... CR0032265
authorDzmitry Razmyslovich <razmyslovich@volumegraphics.com>
Tue, 30 Mar 2021 05:27:47 +0000 (07:27 +0200)
committermsv <msv@opencascade.com>
Tue, 6 Apr 2021 09:21:16 +0000 (12:21 +0300)
GCPnts_TangentialDeflection::PerformCurve consider near points not only by parameter value, but also by 3D location

src/GCPnts/GCPnts_TangentialDeflection.pxx

index 5cc703877374c79c6eb894d38e6eeb44d6b10d2c..73e1637871410771cc467154fe4c059c921a868a 100644 (file)
@@ -596,7 +596,11 @@ void GCPnts_TangentialDeflection::PerformCurve (const TheCurve& C)
     U1 = parameters(i);
     U2 = parameters(i + 1);
 
-    if (U2 - U1 <= uTol)
+    const gp_Pnt& P1 = points(i);
+    const gp_Pnt& P2 = points(i+1);
+
+    if ((U2 - U1) <= uTol  ||
+        (P1.XYZ () - P2.XYZ ()).SquareModulus () <= gp::Resolution ())
     {
       continue;
     }
@@ -606,8 +610,6 @@ void GCPnts_TangentialDeflection::PerformCurve (const TheCurve& C)
     Standard_Real umax = 0.;
     Standard_Real amax = 0.;
     EstimDefl(C, U1, U2, dmax, umax);
-    const gp_Pnt& P1 = points(i);
-    const gp_Pnt& P2 = points(i+1);
     D0(C, umax, MiddlePoint);
     amax = EstimAngl(P1, MiddlePoint, P2);
     if(dmax > curvatureDeflection || amax > AngleMax)