3 if { [string compare ${TheFileName} ""] != 0 } {
4 set is_brep [regexp "\.brep" $TheFileName]
6 set is_brep [regexp "\.rle" $TheFileName]
9 puts [brestore [locate_data_file $TheFileName] res]
11 if { [array get Draw_Groups "DE: STEP"] == "" } {
15 stepread [locate_data_file ${TheFileName}] a *
24 if { [string compare $command "shading"] == 0 } {
28 if { [info exists view_mode] } {
30 QASetViewCharac ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z}
35 if { [string compare $command "incmesh"] == 0 } {
37 if {[array get env os_type] != ""} {
40 if { $parallel != 1 || [info exists count_parallel] == 0 } {
43 for {set i 1} {$i <= $count_parallel} {incr i} {
46 incmesh res ${Deflection} ${parallel}
50 if { [string compare $command "mesh"] == 0 } {
51 set ResultList [mesh res_mesh res ${Deflection}]
54 # Collect TODO for area
55 if { [string compare $bug_area ""] != 0 } {
56 # The difference between square of geometry surface and square of mesh triangles should be less rel_tol value.
57 # If rel_tol is 100 we suppose the mesh con not be created.
58 if { $rel_tol == 100 } {
59 puts "TODO $bug_area All:^\\s*Error : Meshing algo cannot create mesh.\\s*$"
61 puts "TODO $bug_area All:^\\s*Error : area by triangles differs from true area by \[-.0-9\]+ %\\s*$"
65 # Collect TODO for number of triangles without mesh
66 if { [string compare $bug_withouttri ""] != 0 } {
67 # It may be different for different OS
68 foreach os_withouttri [array names nbwithouttri] {
69 if { $nbwithouttri($os_withouttri) != 0 } {
70 puts "TODO $bug_withouttri $os_withouttri:^\\s*Error: Faces without triangulation: $nbwithouttri($os_withouttri)\\b\\s*"
75 # Collect TODO for number of free links
76 if { [string compare $bug_freelinks ""] != 0 } {
77 # It may be different for different OS
78 foreach os_freelinks [array names nbfree] {
79 if { $nbfree($os_freelinks) != 0 } {
80 puts "TODO $bug_freelinks $os_freelinks:^\\s*Error: Free links: $nbfree($os_freelinks)\\b\\s*"
85 # Collect TODO for number of cross faces
86 if { [string compare $bug_cross ""] != 0 } {
87 # It may be different for different OS
88 foreach os_cross [array names nbcross] {
89 if { $nbcross($os_cross) != 0 } {
90 puts "TODO $bug_cross $os_cross:^\\s*Error: Cross face errors: $nbcross($os_cross)\\b\\s*"
95 # Collect TODO for number of async edges
96 if { [string compare $bug_async ""] != 0 } {
97 # It may be different for different OS
98 foreach os_async [array names nbasync] {
99 if { $nbasync($os_async) != 0 } {
100 puts "TODO $bug_async $os_async:^\\s*Error: Async edges: $nbasync($os_async)\\b\\s*"
105 # Collect TODO for number of free nodes
106 if { [string compare $bug_freenodes ""] != 0 } {
107 # It may be different for different OS
108 foreach os_freenodes [array names nbfreenodes] {
109 if { $nbfreenodes($os_freenodes) != 0 } {
110 puts "TODO $bug_freenodes $os_freenodes:^\\s*Error: Free nodes: $nbfreenodes($os_freenodes)\\b\\s*"
115 # Number of triangles
122 # Collect number of triangles, number ofof nodes and deflection.
123 if { [string compare $command "mesh"] != 0 } {
124 set full [trinfo res]
125 regexp "(\[0-9\]+) +triangles.*\[^0-9]\(\[0-9\]+) +nodes.*deflection +(\[0-9\]|\.+)" $full reg_out tri nod def
127 set full [split $ResultList "()"]
128 set tri [lindex [lindex $full 2] 0]
129 set lin [lindex [lindex $full 4] 0]
130 set nod [lindex [lindex $full 6] 0]
133 if { $tri == 0 || $nod == 0 } {
135 puts "Error : Meshing algo cannot create mesh."
139 puts "XML property: triangles $tri"
140 puts "XML property: nodes $nod"
143 # Check if area of triangles is valid
144 proc CheckTriArea {shape {eps 0}} {
146 set area [triarea a $eps]
147 set t_area [lindex $area 0]
148 set g_area [expr abs([lindex $area 1])]
149 puts "area by triangles: $t_area"
150 puts "area by geometry: $g_area"
151 expr ($t_area - $g_area) / $g_area * 100
154 puts "\nChecking triangulation area (triarea command)..."
155 set rel_err [expr abs([CheckTriArea res $area_eps])]
156 if { $rel_err > $rel_tol } {
157 puts "Error : area by triangles differs from true area by $rel_err %"
159 if { $rel_tol > 1 && $rel_tol < 100 } {
160 puts "Error: Improvement: The current area difference is $rel_err instead of $rel_tol"
164 # Check if topology of mesh is valid
165 puts "\nChecking mesh topology (tricheck command)..."
169 set withouttri [regsub -all "face \[0-9\]+ has no triangulation" $l "FOUND" ll]
170 if { $withouttri != 0 } {
171 puts "Error: Faces without triangulation: $withouttri"
173 if { [regexp "Free_links +(\[0-9\]+) +Cross_face_errors +(\[0-9\]+) +Async_edges +(\[0-9\]+) +Free_nodes +(\[0-9\]+)" $l full freelinks crossfaces asyncedges freenodes] } {
174 if { $freelinks != 0 } {
175 puts "Error: Free links: $freelinks"
177 if { $crossfaces != 0 } {
178 puts "Error: Cross face errors: $crossfaces"
180 if { $asyncedges != 0 } {
181 puts "Error: Async edges: $asyncedges"
183 if { $freenodes != 0 } {
184 puts "Error: Free nodes: $freenodes"
189 if { [info exists imagedir] == 0 } {
192 if { [info exists test_image ] == 0 } {
196 if { [string compare $command "shading"] == 0 } {
197 vdump $imagedir/${test_image}.png
204 xwd $imagedir/${test_image}.png
208 puts "TEST COMPLETED"