From: oan Date: Wed, 4 Dec 2019 09:26:10 +0000 (+0300) Subject: 0031199: BRepMesh fails on thin faces X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=90dfe2ccb0eacae3de8e47d178ae82efd30db996;p=occt-copy.git 0031199: BRepMesh fails on thin faces Use real tolerance of a face to define threshold for tolerance of discrete model instead of empirical values based on discrete model itself --- diff --git a/src/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx b/src/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx index a72cdfec2d..ae5041418e 100644 --- a/src/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx +++ b/src/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx @@ -18,6 +18,7 @@ #include #include #include +#include //======================================================================= // Function: Reset @@ -125,9 +126,14 @@ void BRepMesh_DefaultRangeSplitter::computeTolerance( const Standard_Real aDiffU = myRangeU.second - myRangeU.first; const Standard_Real aDiffV = myRangeV.second - myRangeV.first; + 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 aDeflectionUV = 1.e-05; - myTolerance.first = Max(Min(aDeflectionUV, 0.1 * aDiffU), 1e-7 * aDiffU); - myTolerance.second = Max(Min(aDeflectionUV, 0.1 * aDiffV), 1e-7 * aDiffV); + myTolerance.first = Max(Min(aDeflectionUV, aResU), 1e-7 * aDiffU); + myTolerance.second = Max(Min(aDeflectionUV, aResV), 1e-7 * aDiffV); } //=======================================================================