0031939: Coding - correction of spelling errors in comments [part 7]
[occt.git] / tests / bugs / xde / bug6542
1 puts "========"
2 puts "OCC6542"
3 puts "========"
4 puts ""
5 ######################################################
6 # Circle is translated to IGES as NURBS
7 ######################################################
8
9 set BugNumber    OCC6542
10 set TheFileName  OCC6542.igs
11 set TheFileName2 ${TheFileName}-2.igs
12
13 igesbrep [locate_data_file ${TheFileName}] a *
14 set comp [tpcompound res1]
15
16 set status 0
17 set result [checkshape res1]
18 set index [lsearch $result Faulty]
19 if {$index > -1} {
20     puts "Faulty ${BugNumber} : checkshape is wrong for source file"
21     incr status
22 } else {
23     puts "OK ${BugNumber} : checkshape is good for source file"
24
25     set dumpList [split [dump res1] "\n\t :,"]
26     set index1 [lsearch -exact ${dumpList} Circle]
27
28     if {${index1} == -1} {
29         puts "Faulty ${BugNumber} : there is not a circle in source file"
30         incr status
31     } else {
32         puts "OK ${BugNumber} : there is a circle in source file"
33         set Center_X_1 [lindex ${dumpList} [expr ${index1} + 5]]
34         set Center_Y_1 [lindex ${dumpList} [expr ${index1} + 7]]
35         set Center_Z_1 [lindex ${dumpList} [expr ${index1} + 9]]
36         set Axis_X_1   [lindex ${dumpList} [expr ${index1} + 17]]
37         set Axis_Y_1   [lindex ${dumpList} [expr ${index1} + 19]]
38         set Axis_Z_1   [lindex ${dumpList} [expr ${index1} + 21]]
39         set XAxis_X_1  [lindex ${dumpList} [expr ${index1} + 28]]
40         set XAxis_Y_1  [lindex ${dumpList} [expr ${index1} + 30]]
41         set XAxis_Z_1  [lindex ${dumpList} [expr ${index1} + 32]]
42         set YAxis_X_1  [lindex ${dumpList} [expr ${index1} + 39]]
43         set YAxis_Y_1  [lindex ${dumpList} [expr ${index1} + 41]]
44         set YAxis_Z_1  [lindex ${dumpList} [expr ${index1} + 43]]
45         set Radius_1   [lindex ${dumpList} [expr ${index1} + 49]]
46         puts "Center_X_1 = ${Center_X_1}"
47         puts "Center_Y_1 = ${Center_Y_1}"
48         puts "Center_Z_1 = ${Center_Z_1}"
49         puts "Axis_X_1   = ${Axis_X_1}"
50         puts "Axis_Y_1   = ${Axis_Y_1}"
51         puts "Axis_Z_1   = ${Axis_Z_1}"
52         puts "XAxis_X_1  = ${XAxis_X_1}"
53         puts "XAxis_Y_1  = ${XAxis_Y_1}"
54         puts "XAxis_Z_1  = ${XAxis_Z_1}"
55         puts "YAxis_X_1  = ${YAxis_X_1}"
56         puts "YAxis_Y_1  = ${YAxis_Y_1}"
57         puts "YAxis_Z_1  = ${YAxis_Z_1}"
58         puts "Radius_1   = ${Radius_1}"
59     }
60
61     brepiges res1 ${imagedir}/${TheFileName2}
62
63     dall
64     if [catch { igesbrep ${imagedir}/${TheFileName2} b * } res] {
65         puts "Error ${BugNumber}: there is reading problem"
66     } else {
67         set comp [tpcompound res]
68         set result [checkshape res]
69         set index [lsearch $result Faulty]
70         if {$index > -1} {
71             puts "Faulty ${BugNumber} : checkshape is wrong for writing file"
72             incr status
73         } else {
74             puts "OK ${BugNumber} : checkshape is good for writing file"
75
76             set dumpList2 [split [dump res] "\n\t :,"]
77             set index2 [lsearch -exact ${dumpList2} Circle]
78
79             if {${index2} == -1} {
80                 puts "Faulty ${BugNumber} : there is not a circle in writing file"
81                 incr status
82             } else {
83                 puts "OK ${BugNumber} : there is a circle in writing file"
84                 set Center_X_2 [lindex ${dumpList2} [expr ${index2} + 5]]
85                 set Center_Y_2 [lindex ${dumpList2} [expr ${index2} + 7]]
86                 set Center_Z_2 [lindex ${dumpList2} [expr ${index2} + 9]]
87                 set Axis_X_2   [lindex ${dumpList2} [expr ${index2} + 17]]
88                 set Axis_Y_2   [lindex ${dumpList2} [expr ${index2} + 19]]
89                 set Axis_Z_2   [lindex ${dumpList2} [expr ${index2} + 21]]
90                 set XAxis_X_2  [lindex ${dumpList2} [expr ${index2} + 28]]
91                 set XAxis_Y_2  [lindex ${dumpList2} [expr ${index2} + 30]]
92                 set XAxis_Z_2  [lindex ${dumpList2} [expr ${index2} + 32]]
93                 set YAxis_X_2  [lindex ${dumpList2} [expr ${index2} + 39]]
94                 set YAxis_Y_2  [lindex ${dumpList2} [expr ${index2} + 41]]
95                 set YAxis_Z_2  [lindex ${dumpList2} [expr ${index2} + 43]]
96                 set Radius_2   [lindex ${dumpList2} [expr ${index2} + 49]]
97                 puts "Center_X_2 = ${Center_X_2}"
98                 puts "Center_Y_2 = ${Center_Y_2}"
99                 puts "Center_Z_2 = ${Center_Z_2}"
100                 puts "Axis_X_2   = ${Axis_X_2}"
101                 puts "Axis_Y_2   = ${Axis_Y_2}"
102                 puts "Axis_Z_2   = ${Axis_Z_2}"
103                 puts "XAxis_X_2  = ${XAxis_X_2}"
104                 puts "XAxis_Y_2  = ${XAxis_Y_2}"
105                 puts "XAxis_Z_2  = ${XAxis_Z_2}"
106                 puts "YAxis_X_2  = ${YAxis_X_2}"
107                 puts "YAxis_Y_2  = ${YAxis_Y_2}"
108                 puts "YAxis_Z_2  = ${YAxis_Z_2}"
109                 puts "Radius_2   = ${Radius_2}"
110
111                 checkreal "Center_X" ${Center_X_2} ${Center_X_1} 0 0.001
112                 checkreal "Center_Y" ${Center_Y_2} ${Center_Y_1} 0 0.001
113                 checkreal "Center_Z" ${Center_Z_2} ${Center_Z_1} 0 0.001
114
115                 checkreal "Axis_X" ${Axis_X_2} ${Axis_X_1} 0 0.001
116                 checkreal "Axis_Y" ${Axis_Y_2} ${Axis_Y_1} 0 0.001
117                 checkreal "Axis_Z" ${Axis_Z_2} ${Axis_Z_1} 0 0.001
118
119                 checkreal "XAxis_X" ${XAxis_X_2} ${XAxis_X_1} 0 0.001
120                 checkreal "XAxis_Y" ${XAxis_Y_2} ${XAxis_Y_1} 0 0.001
121                 checkreal "XAxis_Z" ${XAxis_Z_2} ${XAxis_Z_1} 0 0.001
122
123                 checkreal "YAxis_X" ${YAxis_X_2} ${YAxis_X_1} 0 0.001
124                 checkreal "YAxis_Y" ${YAxis_Y_2} ${YAxis_Y_1} 0 0.001
125                 checkreal "YAxis_Z" ${YAxis_Z_2} ${YAxis_Z_1} 0 0.001
126
127                 checkreal "Radius" ${Radius_2} ${Radius_1} 0 0.001
128             }
129         }
130     }
131 }
132
133 puts ""
134 if {${status} != 0} {
135     puts "${BugNumber}: Error"
136 }
137
138