1 if { [info exists square] } {
4 if { [info exists tol_square] } {
5 # tol_square - The epsilon defines relative precision of computation
6 regexp {Mass +: +([-0-9.+eE]+)} [sprops result $tol_square] full m
8 regexp {Mass +: +([-0-9.+eE]+)} [sprops result] full m
11 if { [info exists length] } {
14 regexp {Mass +: +([-0-9.+eE]+)} [lprops result] full m
17 puts [checksection result]
20 #if mass (length or square) is empty in test case then result should be an empty shape.
21 if { [info exists mass] } {
22 if { [string compare $subgroup "moddata"] != 0 } {
27 if { [string compare "$mass" "empty"] != 0 } {
29 puts "Error : The command is not valid. The $prop is 0."
32 puts "The expected $prop is $mass"
34 #check of change of square is < 1%
35 if { ($mass != 0 && [expr 1.*abs($mass - $m)/$mass] > 0.01) || ($mass == 0 && $m != 0) } {
36 puts "Error : The $prop of result shape is $m"
40 puts "Error : The command is not valid. The $prop is $m"
45 set glob_inf [info global nb_*_good]
46 if { [regexp "nb_.*_good" $glob_inf] == 1 } {
47 if { [info exists nbsh_t] } {
48 set nb_info [nbshapes result -t]
50 set nb_info [nbshapes result]
54 if { [info exists nb_v_good] } {
55 regexp {VERTEX +: +([-0-9.+eE]+)} $nb_info full nb_v
56 if { ${nb_v} != ${nb_v_good} } {
57 puts "Error : Result shape is WRONG because it must contains ${nb_v_good} vertices instead of ${nb_v}"
59 puts "Result shape contains ${nb_v} vertices"
63 if { [info exists nb_e_good] } {
64 regexp {EDGE +: +([-0-9.+eE]+)} $nb_info full nb_e
65 if { ${nb_e} != ${nb_e_good} } {
66 puts "Error : Result shape is WRONG because it must contains ${nb_e_good} edges instead of ${nb_e}"
68 puts "Result shape contains ${nb_e} edges"
72 if { [info exists nb_w_good] } {
73 regexp {WIRE +: +([-0-9.+eE]+)} $nb_info full nb_w
74 if { ${nb_w} != ${nb_w_good} } {
75 puts "Error : Result shape is WRONG because it must contains ${nb_w_good} wires instead of ${nb_w}"
77 puts "Result shape contains ${nb_w} wires"
81 if { [info exists nb_f_good] } {
82 regexp {FACE +: +([-0-9.+eE]+)} $nb_info full nb_f
83 if { ${nb_f} != ${nb_f_good} } {
84 puts "Error : Result shape is WRONG because it must contains ${nb_f_good} faces instead of ${nb_f}"
86 puts "Result shape contains ${nb_f} faces"
90 if { [info exists nb_sh_good] } {
91 regexp {SHELL +: +([-0-9.+eE]+)} $nb_info full nb_sh
92 if { ${nb_sh} != ${nb_sh_good} } {
93 puts "Error : Result shape is WRONG because it must contains ${nb_sh_good} shells instead of ${nb_sh}"
95 puts "Result shape contains ${nb_sh} shells"
99 if { [info exists nb_sol_good] } {
100 regexp {SOLID +: +([-0-9.+eE]+)} $nb_info full nb_sol
101 if { ${nb_sol} != ${nb_sol_good} } {
102 puts "Error : Result shape is WRONG because it must contains ${nb_sol_good} solids instead of ${nb_sol}"
104 puts "Result shape contains ${nb_sol} solids"
108 if { [info exists nb_compsol_good] } {
109 regexp {COMPSOLID +: +([-0-9.+eE]+)} $nb_info full nb_compsol
110 if { ${nb_compsol} != ${nb_compsol_good} } {
111 puts "Error : Result shape is WRONG because it must contains ${nb_compsol_good} compsolids instead of ${nb_compsol}"
113 puts "Result shape contains ${nb_compsol} compsolids"
117 if { [info exists nb_compound_good] } {
118 regexp {COMPOUND +: +([-0-9.+eE]+)} $nb_info full nb_compound
119 if { ${nb_compound} != ${nb_compound_good} } {
120 puts "Error : Result shape is WRONG because it must contains ${nb_compound_good} compounds instead of ${nb_compound}"
122 puts "Result shape contains ${nb_compound} compounds"
126 if { [info exists nb_shape_good] } {
127 regexp {SHAPE +: +([-0-9.+eE]+)} $nb_info full nb_shape
128 if { ${nb_shape} != ${nb_shape_good} } {
129 puts "Error : Result shape is WRONG because it must contains ${nb_shape_good} shapes instead of ${nb_shape}"
131 puts "Result shape contains ${nb_shape} shapes"
135 if { [info exists nb_fe_good] && [info exists nb_fe] } {
136 if { ${nb_fe} != ${nb_fe_good} } {
137 puts "Error : Result shape is WRONG because it must contains ${nb_shape_good} shapes instead of ${nb_shape}"
139 puts "Result shape contains ${nb_fe} free edges"
143 if { [info exists rel_tol] } {
144 puts "\nChecking triangulation area (triarea command)..."
145 set rel_err [expr abs([CheckTriArea result $area_eps])]
146 if { $rel_err > $rel_tol } {
147 puts "Error : area by triangles differs from the actual area by $rel_err %"
149 if { $rel_tol > 1 && $rel_tol < 100 } {
150 puts "Error: Improvement: The current area difference is $rel_err instead of $rel_tol"
155 if { [isdraw result] } {
156 if { [info exists 2dviewer] } {
161 xwd $imagedir/${test_image}.png
163 if { [info exists 3dviewer] } {
164 #for multiview support: dump result from all opened views
165 set view_str [vviewlist long]
166 set view_list [regexp -all -inline {\S+} $view_str]
167 foreach {view_name} $view_list {
174 vdump $imagedir/${test_image}_[regsub -all {/} $view_name {_}].png
179 if { [info exists only_screen] } {
180 #for multiview support: dump result from all opened views
181 set view_str [vviewlist long]
182 set view_list [regexp -all -inline {\S+} $view_str]
183 foreach {view_name} $view_list {
185 vdump $imagedir/${test_image}_[regsub -all {/} $view_name {_}].png
189 if { [info exists only_screen_axo] } {
190 xwd $imagedir/${test_image}.png
193 # to end a test script
194 puts "TEST COMPLETED"