const IntSurf_PntOn2S& aPntLWL1 = aWLine1->Point(aWLine1->NbPnts());
const IntSurf_PntOn2S aPntCur = theSPnt.Value(aNbPnt).PntOn2S();
- if (aPntCur.IsSame(aPntFWL1, Precision::Confusion()) ||
- aPntCur.IsSame(aPntLWL1, Precision::Confusion()))
+ if (aPntCur.IsSame(aPntFWL1, aTol3D) ||
+ aPntCur.IsSame(aPntLWL1, aTol3D))
{
theSPnt.Remove(aNbPnt);
aNbPnt--;
--- /dev/null
+puts "============================================================================================="
+puts "OCC31499: Boolean Operations - Custom fuzzy value corrupts the result of CUT"
+puts "============================================================================================="
+puts ""
+
+restore [locate_data_file bug31499.brep] s
+
+# perform operation with default fuzzy value
+bfuzzyvalue 1.e-7
+
+tcopy s s1
+explode s1 So
+
+bclearobjects
+bcleartools
+baddobjects s1_1
+baddtools s1_2 s1_3 s1_4
+bfillds
+
+bbop r1_0 0
+bbop r1_1 1
+bbop r1_2 2
+bbop r1_3 3
+bbop r1_4 4
+bbuild r1_5
+
+
+# perform operation with custom fuzzy value
+bfuzzyvalue 1.e-5
+
+tcopy s s2
+explode s2 So
+
+bclearobjects
+bcleartools
+baddobjects s2_1
+baddtools s2_2 s2_3 s2_4
+bfillds
+
+bbop r2_0 0
+bbop r2_1 1
+bbop r2_2 2
+bbop r2_3 3
+bbop r2_4 4
+bbuild r2_5
+
+foreach j {1 2} {
+ foreach i {0 1 2 3 4 5} {
+ checkshape r${j}_$i
+ if {![regexp "OK" [bopcheck r${j}_$i]]} {
+ puts "Error: r${j}_$i is self-intersecting shape"
+ }
+ }
+}
+
+checkprops r1_0 -s 858.419 -v 687.948
+checknbshapes r1_0 -wire 21 -face 21 -shell 3 -solid 3 -t
+
+checkprops r1_1 -s 29829.2 -v 219732
+checknbshapes r1_1 -wire 34 -face 34 -shell 1 -solid 1 -t
+
+checkprops r1_2 -s 1987.39 -v 6408.07
+checknbshapes r1_2 -wire 19 -face 19 -shell 1 -solid 1 -t
+
+checkprops r1_3 -s 37868.2 -v 212636
+checknbshapes r1_3 -wire 60 -face 60 -shell 6 -solid 6 -t
+
+checkprops r1_4 -l 379.04
+checksection r1_4 -r 0
+
+checkprops r1_5 -s 40714 -v 219732
+checknbshapes r1_5 -wire 79 -face 79 -shell 10 -solid 10 -t
+
+foreach i {0 1 2 3 4 5} {
+ checkprops r2_$i -equal r1_$i
+ checknbshapes r2_$i -ref [nbshapes r2_$i]
+}
+
+checkview -display r2_2 -2d -path ${imagedir}/${test_image}.png
--- /dev/null
+puts "============================================================================================="
+puts "OCC31499: Boolean Operations - Custom fuzzy value corrupts the result of CUT"
+puts "============================================================================================="
+puts ""
+
+restore [locate_data_file bug31499.brep] s
+
+explode s So
+explode s_1 f; copy s_1_3 f1
+explode s_2 f; copy s_2_4 f2
+
+foreach c [directory c_*] { unset $c }
+
+bfuzzyvalue 1.e-7
+regexp {Tolerance Reached=([-0-9.+eE]*)} [bopcurves f1 f2 -2d] full tol3D1
+
+set length1 0.0
+foreach c [directory c_*] {
+ set length1 [dval $length1+[dval [lindex [length $c] 4]]]
+}
+
+foreach c [directory c_*] { unset $c }
+
+bfuzzyvalue 1.e-5
+regexp {Tolerance Reached=([-0-9.+eE]*)} [bopcurves f1 f2 -2d] full tol3D2
+
+set length2 0.0
+foreach c [directory c_*] {
+ set length2 [dval $length2+[dval [lindex [length $c] 4]]]
+}
+
+checkreal "Length of curves" $length2 $length1 1.e-7 1.e-7
+
+if {$tol3D2 > 1.e-5} {
+ puts "Error: Face/Face intersection tolerance is too big when using fuzzy value"
+}