0026855: Draw commands to debug Boolean Operations Algorithm
[occt.git] / tests / bugs / moddata_3 / bug25782_1
CommitLineData
b70d2b09 1puts "========"
2puts "OCC25782"
3puts "========"
4puts ""
5######################################################
6# The result of intersection between two cylinders is incorrect
7# Algorithm must find one curves only
8######################################################
9
10set GoodNbCurv 1
11
12restore [locate_data_file bug25782_fz19.brep] b1
13restore [locate_data_file bug25782_fz53.brep] b2
14
15mksurface s1 b1
16mksurface s2 b2
17
18intersect res s1 s2
19
20set che [whatis res]
21set ind [string first "3d curve" $che]
22if {${ind} >= 0} {
23 #Only variable "res" exists
24
25 copy res res_1
26}
27
28set ic 1
29set AllowRepeate 1
30while { $AllowRepeate != 0 } {
31 set che [whatis res_$ic]
32 set ind [string first "3d curve" $che]
33 if {${ind} < 0} {
34 set AllowRepeate 0
35 } else {
6d368502 36 xdistcs res_$ic s1 0 100 10 1e-7
37 xdistcs res_$ic s2 0 100 10 1e-7
b70d2b09 38
39 incr ic
40 }
41}
42
43if {[expr {$ic - 1}] == $GoodNbCurv} {
44 puts "OK: Curve Number is good!"
45} else {
46 puts "Error: Curves Number is bad!"
47}
48
49set log [bopcurves b1 b2]
50
51regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
52set MaxTol 1.e-7
53if {${Toler} > ${MaxTol}} {
54 puts "Error: Tolerance is too big!"
55}
56
57if {$NbCurv != $GoodNbCurv} {
58 puts "Error: Curves Number is bad!"
59}
60
61for {set i 1} {$i <= ${NbCurv}} {incr i} {
62 bounds c_$i U1 U2
63
64 if {[dval U2-U1] < 1.0e-9} {
65 puts "Error: Wrong curve's range!"
66 }
67
6d368502 68 xdistcs c_$i s1 U1 U2 10 1e-7
69 xdistcs c_$i s2 U1 U2 10 1e-7
b70d2b09 70}