0030315: Data Exchange - Crash reading views during STEP import.
[occt.git] / tests / bugs / modalg_6 / bug23177_1
1 puts "========"
2 puts "OCC23177"
3 puts "========"
4 puts ""
5 ####################################################################
6 # Intersection of plane and torus misses a result and never produces analytical result
7 ####################################################################
8
9 set GoodNbCurv 2
10
11 torus s1 100 10
12 plane s2 0 0 0 0 1 0
13 intersect res s1 s2
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 set ic 1
23 set AllowRepeate 1
24 while { $AllowRepeate != 0 } {
25   set che [whatis res_$ic]
26   set ind [string first "3d curve" $che]
27   if {${ind} < 0} {
28     set AllowRepeate 0
29     break;
30   } else {
31     if { ![regexp "Circle" [dump res_$ic]] } {
32       puts "Error: Intersection result must be circle"
33     }
34     
35     bounds res_$ic U1 U2
36     
37     checkreal CurveBoundaries [dval U2-U1] [dval 2*pi] 1.0e-10 0.0
38     
39     xdistcs res_$ic s1 U1 U2 10 1.0e-7
40     xdistcs res_$ic s2 U1 U2 10 1.0e-7
41     incr ic    
42   }  
43 }
44
45 if {[expr {$ic - 1}] == $GoodNbCurv} {
46   puts "OK: Number of curves is good!"
47 } else {
48   puts "Error: $GoodNbCurv is expected but [expr {$ic - 1}] is found!"
49 }
50   
51   
52 smallview
53 don res_*
54 fit
55 don s1 s2
56 disp res_*
57
58 checkview -screenshot -2d -path ${imagedir}/${test_image}.png