]> OCCT Git - occt-copy.git/commitdiff
0029463: Regression relation to 691 version: Method BndBox::IsOut() returns true...
authormsv <msv@opencascade.com>
Tue, 30 Jan 2018 13:03:06 +0000 (16:03 +0300)
committeremv <emv@opencascade.com>
Mon, 5 Feb 2018 08:20:08 +0000 (11:20 +0300)
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
tests/lowalgos/begin [new file with mode: 0644]
tests/lowalgos/bnd/bug29463 [new file with mode: 0644]
tests/lowalgos/end [new file with mode: 0644]
tests/lowalgos/grids.list [new file with mode: 0644]
tests/lowalgos/parse.rules [new file with mode: 0644]

index f89d559254d012bbddbd8e3dc2913f23e6b0fd0e..b7396836b24404abc549aeb30ec65bf23fba3254 100644 (file)
@@ -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/begin b/tests/lowalgos/begin
new file mode 100644 (file)
index 0000000..b752ad2
--- /dev/null
@@ -0,0 +1,14 @@
+if { [array get Draw_Groups "TOPOLOGY Check commands"] == "" } {
+    pload TOPTEST
+    pload AISV
+}
+# To prevent loops limit to 1 minutes
+cpulimit 60
+
+if { [info exists imagedir] == 0 } {
+   set imagedir .
+}
+
+if { [info exists test_image ] == 0 } {
+   set test_image photo
+}
diff --git a/tests/lowalgos/bnd/bug29463 b/tests/lowalgos/bnd/bug29463
new file mode 100644 (file)
index 0000000..35a8fad
--- /dev/null
@@ -0,0 +1,21 @@
+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
+
+set x 165.16888924444618
+set y 16.119975403493935
+set z 6.6799998283386177
+
+# check that vertex with coordinates (x, y, z) is inside the bounding box of f
+
+boundingstr f xmin ymin zmin xmax ymax zmax
+
+if {$x < [dval xmin] || $x > [dval xmax] || $y < [dval ymin] || $y > [dval ymax] || $z < [dval zmin] || $z > [dval zmax]} {
+  puts "Error: bounding box works incorrect"
+}
diff --git a/tests/lowalgos/end b/tests/lowalgos/end
new file mode 100644 (file)
index 0000000..57901e2
--- /dev/null
@@ -0,0 +1,2 @@
+# to end a test script
+puts "TEST COMPLETED"
diff --git a/tests/lowalgos/grids.list b/tests/lowalgos/grids.list
new file mode 100644 (file)
index 0000000..6a82606
--- /dev/null
@@ -0,0 +1,2 @@
+001 2dinter
+002 bnd
diff --git a/tests/lowalgos/parse.rules b/tests/lowalgos/parse.rules
new file mode 100644 (file)
index 0000000..610d206
--- /dev/null
@@ -0,0 +1 @@
+FAILED /\bFaulty\b/ bad shape