]> OCCT Git - occt-copy.git/commitdiff
# accomodate patch V5
authormsv <msv@opencascade.com>
Wed, 8 Aug 2018 14:54:58 +0000 (17:54 +0300)
committermsv <msv@opencascade.com>
Fri, 5 Oct 2018 17:04:34 +0000 (20:04 +0300)
src/GCPnts/GCPnts_TangentialDeflection.cxx
src/GCPnts/GCPnts_TangentialDeflection.pxx

index 7019e58c9b8924e99636706352d1daad8be5bf6c..a68a6fc6a3e0e5da47a528e0779e9ed2353a5823 100644 (file)
@@ -71,7 +71,7 @@ static Standard_Real EstimAngl(const gp_Pnt& P1, const gp_Pnt& Pm, const gp_Pnt&
   //
   if(L > gp::Resolution())
   {
-    return V1.CrossMagnitude(V2)/L;
+    return V1.Dot(V2)/L;
   }
   else
   {
index 440363df8f56a20380e2f0afbff5788d98526f09..d10dfc7c190f77d67894319a8c97d6ca6b1d31be 100644 (file)
@@ -306,7 +306,6 @@ void GCPnts_TangentialDeflection::PerformCurve (const TheCurve& C)
       ;}
       ////
       Standard_Real param = 0.;
-      gp_Pnt prevMiddlePoint = CurrentPoint;
       for (i = 1; i <= NbInterv && IsLine; ++i)
       {
         // Avoid usage intervals out of [firstu, lastu].
@@ -342,12 +341,10 @@ void GCPnts_TangentialDeflection::PerformCurve (const TheCurve& C)
             // Check if points on line are subsequent
             if(IsLine && IsSequential)
             {
-                gp_XYZ V3 = MiddlePoint.XYZ() - prevMiddlePoint.XYZ();
-                Standard_Real L3 = V3.Modulus();
-                IsSequential = (L2 <= L1 && L3 <= L1);
+                gp_XYZ V3 = LastPoint.XYZ() - MiddlePoint.XYZ();
+                IsSequential = (V3.Dot(V2) > 0);
             }
           }
-          prevMiddlePoint = MiddlePoint;
         }
       }
 
@@ -609,6 +606,9 @@ void GCPnts_TangentialDeflection::PerformCurve (const TheCurve& C)
   //Additional check for intervals
   Standard_Real MinLen2 = myMinLen * myMinLen;
   Standard_Integer MaxNbp = 10 * Nbp;
+
+  Standard_Real CosAngleMax = sqrt(1 - AngleMax * AngleMax);
+
   for(i = 1; i < Nbp; ++i)
   {
     U1 = parameters(i);
@@ -622,7 +622,7 @@ void GCPnts_TangentialDeflection::PerformCurve (const TheCurve& C)
     const gp_Pnt& P2 = points(i+1);
     D0(C, umax, MiddlePoint);
     amax = EstimAngl(P1, MiddlePoint, P2);
-    if(dmax > curvatureDeflection || amax AngleMax)
+    if(dmax > curvatureDeflection || amax < CosAngleMax)
     {
       if(umax - U1 > uTol && U2 - umax > uTol)
       {