e55dec57c808718e113ec26d1824aec0248736c3
[occt.git] / tests / bugs / modalg_7 / bug29807_i5002
1 puts "========"
2 puts "0029807: Impossible to cut cone from prism"
3 puts "========"
4 puts ""
5
6 foreach a [directory res*] {unset $a}
7
8 cone s1 11.4307383137554 3.49999999999979 -89.7537975119388 0 0 1 1 0 0 80.000725670142287835190342147806 9.45659107381736
9 cone s2 -3.6479413426839 -11.578679656441 -89.9782110643133 0 0 1 0 1 0 5 0.250951325477062
10
11 intersect res s1 s2 1.0e-4
12
13 set che [whatis res]
14 set ind [string first "3d curve" $che]
15 if {${ind} >= 0} {
16   #Only variable "res" exists
17   renamevar res res_1
18 }
19
20 bclearobjects
21 bcleartools
22
23 set ic 1
24 set AllowRepeat 1
25 while { $AllowRepeat != 0 } {
26   set che [whatis res_$ic]
27   set ind [string first "3d curve" $che]
28   if {${ind} < 0} {
29     set AllowRepeat 0
30   } else {
31    
32     bounds res_$ic U1 U2
33     
34     if {[dval U2-U1] < 1.0e-20} {
35       puts "Error: Wrong curve's range!"
36     }
37     
38     xdistcs res_$ic s1 U1 U2 100 2.0e-7
39     xdistcs res_$ic s2 U1 U2 100 2.0e-7
40     
41     mkedge ee res_$ic
42     baddobjects ee
43     incr ic
44   }
45 }
46
47 bfillds
48 bbuild result
49
50 smallview
51 don result*
52 fit
53
54 # Check gaps between edges in ce
55 checksection result -r 0
56 checkmaxtol result -min_tol 2.0e-7
57
58 checknbshapes result -edge 3 -vertex 3
59
60 checkview -screenshot -2d -path ${imagedir}/${test_image}.png