]> OCCT Git - occt.git/commitdiff
0030154: [REGRESSION] Modeling Algorithms - Boolean Operation on planar geometry...
authoremv <emv@opencascade.com>
Fri, 21 Sep 2018 13:22:37 +0000 (16:22 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 28 Sep 2018 08:07:35 +0000 (11:07 +0300)
Do not allow the precision with which the valid range is found to be less than the epsilon of the max parameter of the edge's range.
Test cases for the issue.

src/BRepLib/BRepLib_1.cxx
tests/bugs/modalg_7/bug30154_1 [new file with mode: 0644]
tests/bugs/modalg_7/bug30154_2 [new file with mode: 0644]

index a5cca9289668737ac82352cbcb17c57a088fce68..30bcd8aedce6fc643d33f4f773439d11900420c9 100644 (file)
@@ -158,8 +158,10 @@ Standard_Boolean BRepLib::FindValidRange
 {
   if (theParV2 - theParV1 < Precision::PConfusion())
     return Standard_False;
-  
-  Standard_Real anEps = Max(theCurve.Resolution(theTolE) * 0.1, Precision::PConfusion());
+
+  Standard_Real anEps = Max(Max(theCurve.Resolution(theTolE) * 0.1,
+                                Epsilon(Max(Abs(theParV1), Abs(theParV2)))),
+                            Precision::PConfusion());
 
   if (Precision::IsInfinite(theParV1))
     theFirst = theParV1;
diff --git a/tests/bugs/modalg_7/bug30154_1 b/tests/bugs/modalg_7/bug30154_1
new file mode 100644 (file)
index 0000000..76f046c
--- /dev/null
@@ -0,0 +1,15 @@
+puts "========"
+puts "0030154: Modeling Algorithms - Boolean Operation on planar geometry hangs inside BRepLib::FindValidRange()"
+puts "========"
+puts ""
+
+plane p 165424660 597500 42834196 -1 0 0
+mkface f p
+box b -94190864 -46229000 -17178478.4 519231048 93653000 120025348.8
+invert b
+
+bcut result f b
+
+checkshape result
+checkprops result -s 1.12407e+16
+checknbshapes result -wire 1 -face 1
diff --git a/tests/bugs/modalg_7/bug30154_2 b/tests/bugs/modalg_7/bug30154_2
new file mode 100644 (file)
index 0000000..e2a7819
--- /dev/null
@@ -0,0 +1,23 @@
+puts "========"
+puts "0030154: Modeling Algorithms - Boolean Operation on planar geometry hangs inside BRepLib::FindValidRange()"
+puts "========"
+puts ""
+
+set toler 3.e-7
+
+box b -94190864 -46229000 -17178478.4 519231048 93653000 120025348.8
+
+foreach e [explode b e] {
+  mkcurve c $e
+  regexp {Parameters : ([-0-9.+eE]*) ([-0-9.+eE]*)} [dump c] full t1 t2
+  set range [validrange $e]
+  set ts1 [lindex $range 0]
+  set ts2 [lindex $range 1]
+
+  set delta1 [expr $ts1 - $t1]
+  set delta2 [expr $t2 - $ts2]
+
+  if {$delta1 < 1.e-7 || $delta1 > $toler || $delta2 < 1.e-7 || $delta2 > $toler} {
+    puts "Error: incorrect computation of the valid range"
+  }
+}
\ No newline at end of file