From b3100f20d79ed7d1b38ff3b242d33dc7633a87e4 Mon Sep 17 00:00:00 2001 From: Dzmitry Razmyslovich Date: Tue, 30 Mar 2021 07:27:47 +0200 Subject: [PATCH] 0032265: Modeling Algorithms - some trivial code improvements in GCPnts_TangentialDeflection GCPnts_TangentialDeflection::PerformCurve consider near points not only by parameter value, but also by 3D location --- src/GCPnts/GCPnts_TangentialDeflection.pxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/GCPnts/GCPnts_TangentialDeflection.pxx b/src/GCPnts/GCPnts_TangentialDeflection.pxx index 5cc7038773..73e1637871 100644 --- a/src/GCPnts/GCPnts_TangentialDeflection.pxx +++ b/src/GCPnts/GCPnts_TangentialDeflection.pxx @@ -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) -- 2.39.5