1 # check write / read set of shapes with names to FSD archive and reading its back
5 box b2 100 0 0 20 30 40
6 box b3 200 0 0 30 40 50
7 box b4 300 0 0 40 50 60
8 box b5 400 0 0 50 60 70
9 box b6 500 0 0 60 70 80
10 box b7 600 0 0 70 80 90
12 # calculate mass of each shape and keep to 'wb%' variable
13 regexp {Mass +: +([-0-9.+eE]+)} [vprops b1] full wb1
14 regexp {Mass +: +([-0-9.+eE]+)} [vprops b2] full wb2
15 regexp {Mass +: +([-0-9.+eE]+)} [vprops b3] full wb3
16 regexp {Mass +: +([-0-9.+eE]+)} [vprops b4] full wb4
17 regexp {Mass +: +([-0-9.+eE]+)} [vprops b5] full wb5
18 regexp {Mass +: +([-0-9.+eE]+)} [vprops b6] full wb6
19 regexp {Mass +: +([-0-9.+eE]+)} [vprops b7] full wb7
21 # remove old file if exist
22 catch {file delete ${imagedir}/test29402.cmp}
24 # write set of shapes to the file
25 fsdwrite b1 b2 b3 b4 b5 b6 b7 ${imagedir}/test29402.cmp cmp
28 unset b1 b2 b3 b4 b5 b6 b7
31 fsdread ${imagedir}/test29402.cmp restore_with_names
33 # calculate mass of each shape and keep to 'rb%' variable
34 regexp {Mass +: +([-0-9.+eE]+)} [vprops b1] full rb1
35 regexp {Mass +: +([-0-9.+eE]+)} [vprops b2] full rb2
36 regexp {Mass +: +([-0-9.+eE]+)} [vprops b3] full rb3
37 regexp {Mass +: +([-0-9.+eE]+)} [vprops b4] full rb4
38 regexp {Mass +: +([-0-9.+eE]+)} [vprops b5] full rb5
39 regexp {Mass +: +([-0-9.+eE]+)} [vprops b6] full rb6
40 regexp {Mass +: +([-0-9.+eE]+)} [vprops b7] full rb7
42 # compare mass property of old and new shapes
45 puts " Faulty : incorrect shape $b1"; incr NumBad
48 puts " Faulty : incorrect shape $b2"; incr NumBad
51 puts " Faulty : incorrect shape $b3"; incr NumBad
54 puts " Faulty : incorrect shape $b4"; incr NumBad
57 puts " Faulty : incorrect shape $b5"; incr NumBad
60 puts " Faulty : incorrect shape $b6"; incr NumBad
63 puts " Faulty : incorrect shape $b7"; incr NumBad
66 puts " BUG29402 OK : All shapes kept properly"
68 puts " Faulty : Found $NumBad bad shapes"