]> OCCT Git - occt-copy.git/commitdiff
Condition for surface of revolution is changed to fix case bug25892_13.
authoraml <aml@opencascade.com>
Tue, 16 Feb 2016 15:46:34 +0000 (18:46 +0300)
committeraml <aml@opencascade.com>
Tue, 16 Feb 2016 15:46:34 +0000 (18:46 +0300)
src/ProjLib/ProjLib_CompProjectedCurve.cxx

index 2105dd09c2bc8588aa5ff679a2c4abf6ac119e5d..9fd1059cae84456162db95c6588e074a54351e4e 100644 (file)
@@ -1622,11 +1622,17 @@ void ProjLib_CompProjectedCurve::UpdateTripleByTrapCriteria(gp_Pnt &thePoint) co
   // Check possible traps cases:
 
   // 25892 bug.
-  if (mySurface->GetType() == GeomAbs_SurfaceOfRevolution &&
-     (Abs (thePoint.Z() - mySurface->FirstVParameter()) < Precision::PConfusion() ||
-      Abs (thePoint.Z() - mySurface->LastVParameter() ) < Precision::PConfusion() ))
+  if (mySurface->GetType() == GeomAbs_SurfaceOfRevolution)
   {
-    isProblemsPossible = Standard_True;
+    // Compute maximal deviation from 3D and choose the biggest one.
+    Standard_Real aVRes = mySurface->VResolution(Precision::Confusion());
+    Standard_Real aMaxTol = Max(Precision::PConfusion(), aVRes);
+
+    if (Abs (thePoint.Z() - mySurface->FirstVParameter()) < aMaxTol ||
+        Abs (thePoint.Z() - mySurface->LastVParameter() ) < aMaxTol )
+    {
+      isProblemsPossible = Standard_True;
+    }
   }
 
   // 27135 bug. Trap on degenerated edge.