From 270f4858b68cacf5a14f932de1762dd89c7be35b Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 5 Feb 2020 08:06:51 +0300 Subject: [PATCH] Do not increase tolerance for UnifySameDomain (issue #18608) --- .../GeomAlgoAPI_UnifySameDomain.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) 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; } //================================================================================================== -- 2.39.2