0030315: Data Exchange - Crash reading views during STEP import.
[occt.git] / tests / bugs / modalg_7 / bug30082_2
1 puts "========"
2 puts "0030082: Intersection algorithm returns curve with big tolerance value"
3 puts "========"
4 puts ""
5
6 foreach a [directory res*] {unset $a}
7
8 set aTol 1.0e-4
9 set GoodNbCurves 4
10
11 cylinder s1 -106.471129473161 -64.3442185874231 -19.25 1 0 0 0 0 -1 0.25
12 cylinder s2 -124.971129473161 -67.0942185874231 -20.5 0 0 1 1 0 -0 3
13 intersect res s1 s2 $aTol
14
15 set che [whatis res]
16 set ind [string first "3d curve" $che]
17 if {${ind} >= 0} {
18   #Only variable "res" exists
19   renamevar res res_1
20 }
21
22 bclearobjects
23 bcleartools
24
25 set ic 1
26 set AllowRepeat 1
27 while { $AllowRepeat != 0 } {
28   set che [whatis res_$ic]
29   set ind [string first "3d curve" $che]
30   if {${ind} < 0} {
31     set AllowRepeat 0
32   } else {
33     bounds res_$ic U1 U2
34     
35     if {[dval U2-U1] < 1.0e-9} {
36       puts "Error: Wrong curve's range!"
37     }
38     
39     xdistcs res_$ic s1 U1 U2 100 $aTol
40     xdistcs res_$ic s2 U1 U2 100 $aTol
41     
42     mkedge ee res_$ic
43     baddobjects ee
44     incr ic
45   }
46 }
47
48 incr ic -1
49
50 if { $ic != $GoodNbCurves } {
51   puts "Error: $GoodNbCurves curves are expected but $ic ones are found"
52 }
53
54 bfillds
55 bbuild result
56
57 smallview
58 don result
59 fit
60
61 # Check gaps between edges in ce
62 checksection result -r 0
63 checkmaxtol result -min_tol 2.0e-7
64
65 checknbshapes result -edge 4 -vertex 3
66
67 checkview -screenshot -2d -path ${imagedir}/${test_image}.png