From c4ca00a26f56a089f17cd3e349729b9b948eb4ac Mon Sep 17 00:00:00 2001 From: oan Date: Fri, 8 Jul 2022 13:49:11 +0300 Subject: [PATCH] 0033060: [Regression to 7.4.0] Mesh - Sub-precisional links provoke failure on face Slightly increase exact resolution so to cover links with approximate length equal to resolution itself on sub-resolution differences. --- src/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx | 6 ++++-- tests/bugs/mesh/bug33060 | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 tests/bugs/mesh/bug33060 diff --git a/src/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx b/src/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx index 89557796a2..1f9ff1b9a5 100644 --- a/src/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx +++ b/src/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx @@ -126,10 +126,12 @@ void BRepMesh_DefaultRangeSplitter::computeTolerance( const Standard_Real aDiffU = myRangeU.second - myRangeU.first; const Standard_Real aDiffV = myRangeV.second - myRangeV.first; + // Slightly increase exact resolution so to cover links with approximate + // length equal to resolution itself on sub-resolution differences. const Standard_Real aTolerance = BRep_Tool::Tolerance (myDFace->GetFace()); const Adaptor3d_Surface& aSurface = GetSurface()->Surface(); - const Standard_Real aResU = aSurface.UResolution (aTolerance); - const Standard_Real aResV = aSurface.VResolution (aTolerance); + const Standard_Real aResU = aSurface.UResolution (aTolerance) * 1.1; + const Standard_Real aResV = aSurface.VResolution (aTolerance) * 1.1; const Standard_Real aDeflectionUV = 1.e-05; myTolerance.first = Max(Min(aDeflectionUV, aResU), 1e-7 * aDiffU); diff --git a/tests/bugs/mesh/bug33060 b/tests/bugs/mesh/bug33060 new file mode 100644 index 0000000000..ba63924da5 --- /dev/null +++ b/tests/bugs/mesh/bug33060 @@ -0,0 +1,17 @@ +puts "========" +puts "0033060: Mesh - Sub-precisional links provoke f a i l u r e on face" +puts "========" +puts "" + +restore [locate_data_file bug33060.brep] result + +tclean result + +checkview -display result -3d -path ${imagedir}/${test_image}.png + +set log [tricheck result] +if { [llength $log] != 0 } { + puts "Error : Invalid mesh" +} else { + puts "Mesh is OK" +}