From c805f9a8f8e17e529096b323c2a4417090beebe1 Mon Sep 17 00:00:00 2001 From: ifv Date: Mon, 4 Dec 2017 16:20:19 +0300 Subject: [PATCH] 0028722: Conversion of a spherical face to a spline produces an invalid shape Correction of 2d tolerance calculation for BSpline/Bezier surfaces Test cases are corrected according to current behavior of algorithm --- src/BRepTools/BRepTools_WireExplorer.cxx | 18 ++++++++++++++---- tests/bugs/iges/buc60610 | 2 -- tests/bugs/modalg_7/bug28722 | 1 - tests/de/iges_1/K8 | 1 - 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/BRepTools/BRepTools_WireExplorer.cxx b/src/BRepTools/BRepTools_WireExplorer.cxx index 9fa20bdeba..4a086589fe 100644 --- a/src/BRepTools/BRepTools_WireExplorer.cxx +++ b/src/BRepTools/BRepTools_WireExplorer.cxx @@ -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); } diff --git a/tests/bugs/iges/buc60610 b/tests/bugs/iges/buc60610 index 8a3c00da31..0da3fb955c 100755 --- a/tests/bugs/iges/buc60610 +++ b/tests/bugs/iges/buc60610 @@ -1,5 +1,3 @@ -puts "TODO OCC12345 ALL: Faulty shapes in variables faulty_1 to faulty_" - puts "========================" puts "BUC60610" puts "========================" diff --git a/tests/bugs/modalg_7/bug28722 b/tests/bugs/modalg_7/bug28722 index 684f25d875..352bd68e93 100644 --- a/tests/bugs/modalg_7/bug28722 +++ b/tests/bugs/modalg_7/bug28722 @@ -1,4 +1,3 @@ -puts "TODO OCC28722 ALL: Faulty shapes in variables faulty_1 to faulty_" puts "========" puts "OCC28722" diff --git a/tests/de/iges_1/K8 b/tests/de/iges_1/K8 index a12818f9f2..929bf615dd 100644 --- a/tests/de/iges_1/K8 +++ b/tests/de/iges_1/K8 @@ -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