From 1d53219a28ca939a78d5c4f8934957355e1214cf Mon Sep 17 00:00:00 2001 From: msv Date: Tue, 30 Jan 2018 16:03:06 +0300 Subject: [PATCH] 0029463: Regression relation to 691 version: Method BndBox::IsOut() returns true for point lying on the planar face Correct the method BRepBndLib::Add so that to enlarge the bounding box on the tolerance of edges which curves participate in calculation of the box. --- src/BRepBndLib/BRepBndLib.cxx | 5 +++-- tests/lowalgos/bnd/bug29463 | 16 ++++++++++++++++ tests/lowalgos/grids.list | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 tests/lowalgos/bnd/bug29463 diff --git a/src/BRepBndLib/BRepBndLib.cxx b/src/BRepBndLib/BRepBndLib.cxx index f89d559254..b7396836b2 100644 --- a/src/BRepBndLib/BRepBndLib.cxx +++ b/src/BRepBndLib/BRepBndLib.cxx @@ -115,8 +115,9 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria } else { for (;ex2.More();ex2.Next()) { - BC.Initialize(TopoDS::Edge(ex2.Current())); - BndLib_Add3dCurve::Add(BC, BRep_Tool::Tolerance(F), B); + const TopoDS_Edge& anEdge = TopoDS::Edge(ex2.Current()); + BC.Initialize(anEdge); + BndLib_Add3dCurve::Add(BC, BRep_Tool::Tolerance(anEdge), B); } B.Enlarge(BRep_Tool::Tolerance(F)); } diff --git a/tests/lowalgos/bnd/bug29463 b/tests/lowalgos/bnd/bug29463 new file mode 100644 index 0000000000..5df0b05647 --- /dev/null +++ b/tests/lowalgos/bnd/bug29463 @@ -0,0 +1,16 @@ +puts "========" +puts "OCC29463" +puts "========" +puts "" +################################################# +# Method BndBox::IsOut() returns true for point lying on the planar face +################################################# + +restore [locate_data_file bug29463_face13_691.brep] f + +vertex v 165.16888924444618 16.119975403493935 6.6799998283386177 +set res [isbbinterf f v] + +if [regexp "The shapes are NOT interfered by AABB" $res] { + puts "Error: bounding box works incorrect" +} diff --git a/tests/lowalgos/grids.list b/tests/lowalgos/grids.list index 8b614e18bc..6a82606186 100644 --- a/tests/lowalgos/grids.list +++ b/tests/lowalgos/grids.list @@ -1 +1,2 @@ 001 2dinter +002 bnd -- 2.20.1