1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
|
puts "========"
puts "OCC6542"
puts "========"
puts ""
######################################################
# Circle is translated to IGES as NURBS
######################################################
set BugNumber OCC6542
set TheFileName OCC6542.igs
set TheFileName2 ${TheFileName}-2.igs
set percent_max 0.1
igesbrep [locate_data_file ${TheFileName}] a *
set comp [tpcompound res1]
set status 0
set result [checkshape res1]
set index [lsearch $result Faulty]
if {$index > -1} {
puts "Faulty ${BugNumber} : checkshape is wrong for source file"
incr status
} else {
puts "OK ${BugNumber} : checkshape is good for source file"
set dumpList [split [dump res1] "\n\t :,"]
set index1 [lsearch -exact ${dumpList} Circle]
if {${index1} == -1} {
puts "Faulty ${BugNumber} : there is not a cirle in source file"
incr status
} else {
puts "OK ${BugNumber} : there is a cirle in source file"
set Center_X_1 [lindex ${dumpList} [expr ${index1} + 5]]
set Center_Y_1 [lindex ${dumpList} [expr ${index1} + 7]]
set Center_Z_1 [lindex ${dumpList} [expr ${index1} + 9]]
set Axis_X_1 [lindex ${dumpList} [expr ${index1} + 17]]
set Axis_Y_1 [lindex ${dumpList} [expr ${index1} + 19]]
set Axis_Z_1 [lindex ${dumpList} [expr ${index1} + 21]]
set XAxis_X_1 [lindex ${dumpList} [expr ${index1} + 28]]
set XAxis_Y_1 [lindex ${dumpList} [expr ${index1} + 30]]
set XAxis_Z_1 [lindex ${dumpList} [expr ${index1} + 32]]
set YAxis_X_1 [lindex ${dumpList} [expr ${index1} + 39]]
set YAxis_Y_1 [lindex ${dumpList} [expr ${index1} + 41]]
set YAxis_Z_1 [lindex ${dumpList} [expr ${index1} + 43]]
set Radius_1 [lindex ${dumpList} [expr ${index1} + 49]]
puts "Center_X_1 = ${Center_X_1}"
puts "Center_Y_1 = ${Center_Y_1}"
puts "Center_Z_1 = ${Center_Z_1}"
puts "Axis_X_1 = ${Axis_X_1}"
puts "Axis_Y_1 = ${Axis_Y_1}"
puts "Axis_Z_1 = ${Axis_Z_1}"
puts "XAxis_X_1 = ${XAxis_X_1}"
puts "XAxis_Y_1 = ${XAxis_Y_1}"
puts "XAxis_Z_1 = ${XAxis_Z_1}"
puts "YAxis_X_1 = ${YAxis_X_1}"
puts "YAxis_Y_1 = ${YAxis_Y_1}"
puts "YAxis_Z_1 = ${YAxis_Z_1}"
puts "Radius_1 = ${Radius_1}"
}
brepiges res1 ${imagedir}/${TheFileName2}
dall
if [catch { igesbrep ${imagedir}/${TheFileName2} b * } res] {
puts "Error ${BugNumber}: there is reading problem"
} else {
set comp [tpcompound res]
set result [checkshape res]
set index [lsearch $result Faulty]
if {$index > -1} {
puts "Faulty ${BugNumber} : checkshape is wrong for writing file"
incr status
} else {
puts "OK ${BugNumber} : checkshape is good for writing file"
set dumpList2 [split [dump res] "\n\t :,"]
set index2 [lsearch -exact ${dumpList2} Circle]
if {${index2} == -1} {
puts "Faulty ${BugNumber} : there is not a cirle in writing file"
incr status
} else {
puts "OK ${BugNumber} : there is a cirle in writing file"
set Center_X_2 [lindex ${dumpList2} [expr ${index2} + 5]]
set Center_Y_2 [lindex ${dumpList2} [expr ${index2} + 7]]
set Center_Z_2 [lindex ${dumpList2} [expr ${index2} + 9]]
set Axis_X_2 [lindex ${dumpList2} [expr ${index2} + 17]]
set Axis_Y_2 [lindex ${dumpList2} [expr ${index2} + 19]]
set Axis_Z_2 [lindex ${dumpList2} [expr ${index2} + 21]]
set XAxis_X_2 [lindex ${dumpList2} [expr ${index2} + 28]]
set XAxis_Y_2 [lindex ${dumpList2} [expr ${index2} + 30]]
set XAxis_Z_2 [lindex ${dumpList2} [expr ${index2} + 32]]
set YAxis_X_2 [lindex ${dumpList2} [expr ${index2} + 39]]
set YAxis_Y_2 [lindex ${dumpList2} [expr ${index2} + 41]]
set YAxis_Z_2 [lindex ${dumpList2} [expr ${index2} + 43]]
set Radius_2 [lindex ${dumpList2} [expr ${index2} + 49]]
puts "Center_X_2 = ${Center_X_2}"
puts "Center_Y_2 = ${Center_Y_2}"
puts "Center_Z_2 = ${Center_Z_2}"
puts "Axis_X_2 = ${Axis_X_2}"
puts "Axis_Y_2 = ${Axis_Y_2}"
puts "Axis_Z_2 = ${Axis_Z_2}"
puts "XAxis_X_2 = ${XAxis_X_2}"
puts "XAxis_Y_2 = ${XAxis_Y_2}"
puts "XAxis_Z_2 = ${XAxis_Z_2}"
puts "YAxis_X_2 = ${YAxis_X_2}"
puts "YAxis_Y_2 = ${YAxis_Y_2}"
puts "YAxis_Z_2 = ${YAxis_Z_2}"
puts "Radius_2 = ${Radius_2}"
set Center_X_percent [GetPercent ${Center_X_2} ${Center_X_1}]
set Center_Y_percent [GetPercent ${Center_Y_2} ${Center_Y_1}]
set Center_Z_percent [GetPercent ${Center_Z_2} ${Center_Z_1}]
set Axis_X_percent [GetPercent ${Axis_X_2} ${Axis_X_1}]
set Axis_Y_percent [GetPercent ${Axis_Y_2} ${Axis_Y_1}]
set Axis_Z_percent [GetPercent ${Axis_Z_2} ${Axis_Z_1}]
set XAxis_X_percent [GetPercent ${XAxis_X_2} ${XAxis_X_1}]
set XAxis_Y_percent [GetPercent ${XAxis_Y_2} ${XAxis_Y_1}]
set XAxis_Z_percent [GetPercent ${XAxis_Z_2} ${XAxis_Z_1}]
set YAxis_X_percent [GetPercent ${YAxis_X_2} ${YAxis_X_1}]
set YAxis_Y_percent [GetPercent ${YAxis_Y_2} ${YAxis_Y_1}]
set YAxis_Z_percent [GetPercent ${YAxis_Z_2} ${YAxis_Z_1}]
set Radius_percent [GetPercent ${Radius_2} ${Radius_1}]
if {${Center_X_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : Center_X is wrong"
incr status
}
if {${Center_Y_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : Center_Y is wrong"
incr status
}
if {${Center_Z_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : Center_Z is wrong"
incr status
}
if {${Axis_X_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : Axis_X is wrong"
incr status
}
if {${Axis_Y_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : Axis_Y is wrong"
incr status
}
if {${Axis_Z_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : Axis_Z is wrong"
incr status
}
if {${XAxis_X_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : XAxis_X is wrong"
incr status
}
if {${XAxis_Y_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : XAxis_Y is wrong"
incr status
}
if {${XAxis_Z_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : XAxis_Z is wrong"
incr status
}
if {${YAxis_X_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : YAxis_X is wrong"
incr status
}
if {${YAxis_Y_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : YAxis_Y is wrong"
incr status
}
if {${YAxis_Z_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : YAxis_Z is wrong"
incr status
}
if {${Radius_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : Radius is wrong"
incr status
}
}
}
}
}
puts ""
if {${status} == 0} {
puts "${BugNumber}: OK"
} else {
puts "${BugNumber}: Error"
}
|