5d6cb907627e35b7d34bd7fa5c045b06859602e3
[occt.git] / tests / bugs / modalg_6 / bug27431
1 puts "============"
2 puts "OCC27431"
3 puts "============"
4 puts ""
5 ###############################
6 ## [Regression to 6.9.1] Huge tolerance obtained during intersection of cylinder and sphere
7 ###############################
8
9 pload ALL
10
11 set GoodNbCurv 4
12
13 restore [locate_data_file OCC13116_sh1.brep] b1
14 restore [locate_data_file OCC13116_sh2.brep] b2
15
16 explode b1 f
17 explode b2 f
18
19 set log1 [bopcurves b1_3 b2_1 -2d]
20
21 regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log1} full Toler NbCurv
22
23 if { ${Toler} > 0.0005} {
24    puts "Error: bad tolerance of result"
25 }
26
27 smallview
28 don b1_3 b2_1 c_*
29 fit
30
31 checkview -screenshot -2d -path ${imagedir}/${test_image}_3d_1.png
32
33 v2d
34 don c2d*
35 2dfit
36 checkview -screenshot -2d -path ${imagedir}/${test_image}_2d_1.png
37
38 if {${NbCurv} != ${GoodNbCurv}} {
39   puts "Error: Number of curves is bad!"
40 }
41
42 # increasing tolerance values of the faces on Precision::Confusion()
43 # dramatically increased (before fixing) the tolerance of 
44 # the produced section curves
45
46 settolerance b1_3 2.34623727264857e-007
47 settolerance b2_1 2.e-7
48
49 set log2 [bopcurves b1_3 b2_1 -2d]
50
51 regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log2} full Toler NbCurv
52
53 if { ${Toler} > 0.0005} {
54    puts "Error: bad tolerance of result"
55 }
56
57 smallview
58 don b1_3 b2_1 c_*
59 fit
60
61 checkview -screenshot -2d -path ${imagedir}/${test_image}_3d_2.png
62
63 v2d
64 don c2d*
65 2dfit
66 checkview -screenshot -2d -path ${imagedir}/${test_image}_2d_2.png