From ea5f35f4e575b097ea55bfc0f64dd9e73a4a4a5f Mon Sep 17 00:00:00 2001 From: oan Date: Fri, 8 Jul 2022 23:32:39 +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 ae5041418e..0a61cb8610 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..4f0a348903 --- /dev/null +++ b/tests/bugs/mesh/bug33060 @@ -0,0 +1,17 @@ +puts "========" +puts "0033060: Mesh - Sub-precisional links provoke failure 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" +}