0028722: Conversion of a spherical face to a spline produces an invalid shape
authorifv <ifv@opencascade.com>
Mon, 4 Dec 2017 13:20:19 +0000 (16:20 +0300)
committerbugmaster <bugmaster@opencascade.com>
Wed, 20 Dec 2017 15:51:13 +0000 (18:51 +0300)
Correction of 2d tolerance calculation for BSpline/Bezier surfaces
Test cases are corrected according to current behavior of algorithm

src/BRepTools/BRepTools_WireExplorer.cxx
tests/bugs/iges/buc60610
tests/bugs/modalg_7/bug28722
tests/de/iges_1/K8

index 9fa20bd..4a08658 100644 (file)
@@ -159,10 +159,20 @@ void  BRepTools_WireExplorer::Init(const TopoDS_Wire& W,
       if( aGAS.GetType() == GeomAbs_BSplineSurface || 
          aGAS.GetType() == GeomAbs_BezierSurface )
        {
-         Standard_Real maxTol = Max(myTolU,myTolV);
-         myTolU = maxTol;
-         myTolV = maxTol;
-       }
+          Standard_Real maxTol = Max(myTolU, myTolV);
+          gp_Pnt aP;
+          gp_Vec aDU, aDV;
+          Standard_Real u1, u2, v1, v2;
+          BRepTools::UVBounds(myFace, u1, u2, v1, v2);
+          aGAS.D1((u2 - u1) / 2., (v2 - v1) / 2., aP, aDU, aDV);
+          Standard_Real mod = Sqrt(aDU*aDU + aDV*aDV);
+          if (mod * maxTol / dfVertToler < 1.5)
+          {
+            maxTol = 1.5 * dfVertToler / mod;
+          }
+          myTolU = maxTol;
+          myTolV = maxTol;
+        }
 
       myReverse = (myFace.Orientation() == TopAbs_REVERSED);
     }
index 8a3c00d..0da3fb9 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO OCC12345 ALL: Faulty shapes in variables faulty_1 to faulty_"
-
 puts "========================"
 puts "BUC60610"
 puts "========================"
index 684f25d..352bd68 100644 (file)
@@ -1,4 +1,3 @@
-puts "TODO OCC28722 ALL: Faulty shapes in variables faulty_1 to faulty_"
 
 puts "========"
 puts "OCC28722"
index a12818f..929bf61 100644 (file)
@@ -1,5 +1,4 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
-puts "TODO CR23096 ALL: CHECKSHAPE : Faulty" 
 
 
 set filename sim6114.igs