From: Dzmitry Razmyslovich Date: Tue, 30 Mar 2021 05:27:47 +0000 (+0200) Subject: 0032265: Modeling Algorithms - some trivial code improvements in GCPnts_TangentialDef... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=b3100f20d79ed7d1b38ff3b242d33dc7633a87e4;p=occt-copy.git 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 --- 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)