From 5a75e65eb4493ebd520e98507981290da4bcfcc1 Mon Sep 17 00:00:00 2001 From: kgv Date: Thu, 25 Oct 2018 10:13:44 +0300 Subject: [PATCH] 0030292: Modeling Algorithms - BRepBndLib should avoid using Poly_Polygon3D when called with useTriangulation set to false --- src/BRepBndLib/BRepBndLib.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/BRepBndLib/BRepBndLib.cxx b/src/BRepBndLib/BRepBndLib.cxx index 6aa8c2dd49..f0eac8a3ef 100644 --- a/src/BRepBndLib/BRepBndLib.cxx +++ b/src/BRepBndLib/BRepBndLib.cxx @@ -136,6 +136,13 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria for (ex.Init(S,TopAbs_EDGE,TopAbs_FACE); ex.More(); ex.Next()) { const TopoDS_Edge& E = TopoDS::Edge(ex.Current()); + if (!useTriangulation && BRep_Tool::IsGeometric(E)) + { + BC.Initialize(E); + BndLib_Add3dCurve::Add(BC, BRep_Tool::Tolerance(E), B); + continue; + } + Handle(Poly_Polygon3D) P3d = BRep_Tool::Polygon3D(E, l); if (!P3d.IsNull()) { @@ -152,7 +159,7 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria else { BRep_Tool::PolygonOnTriangulation(E, Poly, T, l); - if (useTriangulation && !Poly.IsNull()) + if (!Poly.IsNull()) { const TColStd_Array1OfInteger& Indices = Poly->Nodes(); const TColgp_Array1OfPnt& Nodes = T->Nodes(); -- 2.39.5