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.
{
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;
--- /dev/null
+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
--- /dev/null
+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