From: azv Date: Wed, 5 Feb 2020 05:06:51 +0000 (+0300) Subject: Do not increase tolerance for UnifySameDomain (issue #18608) X-Git-Tag: V9_5_0a1~32 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=270f4858b68cacf5a14f932de1762dd89c7be35b;p=modules%2Fshaper.git Do not increase tolerance for UnifySameDomain (issue #18608) --- diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp index 496ec9079..b8d49ef67 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -72,29 +73,18 @@ void GeomAlgoAPI_UnifySameDomain::build(const ListOfShape& theShapes) } // calculates maximum possible tolerance on edges of shape -// (method from GEOM module BlockFix_UnionFaces.cxx) static Standard_Real defineLinearTolerance(const TopoDS_Shape& theShape) { - Standard_Real aTol = Precision::Confusion(); + Standard_Real aMaxTol = Precision::Confusion(); - Standard_Real MinSize = RealLast(); TopExp_Explorer Explo(theShape, TopAbs_EDGE); for (; Explo.More(); Explo.Next()) { const TopoDS_Edge& anEdge = TopoDS::Edge(Explo.Current()); - Bnd_Box aBox; - BRepBndLib::Add(anEdge, aBox); - Standard_Real Xmin, Ymin, Zmin, Xmax, Ymax, Zmax; - aBox.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); - Standard_Real MaxSize = Max(Xmax - Xmin, Max(Ymax - Ymin, Zmax - Zmin)); - if (MaxSize < MinSize) - MinSize = MaxSize; + aMaxTol = Max(aMaxTol, BRep_Tool::Tolerance(anEdge)); } - if (!Precision::IsInfinite(MinSize)) - aTol = 0.1 * MinSize; - - return aTol; + return aMaxTol; } //==================================================================================================