0030402: Data Exchange - exported VRML file has broken location information
[occt.git] / tests / bugs / xde / bug30402
CommitLineData
1d441d1a 1puts "========="
2puts "OCC30402"
3puts "========="
4puts ""
5############################################################################
6# Data Exchange - exported VRML file has broken location information
7############################################################################
8
9set filename bug26657
10param xstep.cascade.unit MM
11ReadStep D [locate_data_file bug26657.stp]
12XGetOneShape a D
13incmesh a 0.001
14vinit Driver1/Viewer1/View1
15vdisplay a
16vfit
17vdump ${imagedir}/${test_image}_1.png
18
19file delete -force ${imagedir}/${filename}.wrl
20WriteVrml D ${imagedir}/${filename}.wrl
21loadvrml b ${imagedir}/${filename}.wrl
22vinit Driver1/Viewer2/View1
23vdisplay b
24vfit
25vdump ${imagedir}/${test_image}_2.png
26
27set sprops_a [sprops a]
28regexp {Mass\s*:\s*([0-9.e+-]+)} $sprops_a prop_s res_a_Area
29regexp {X += +([-0-9.+eE]+)} $sprops_a full res_a_X
30regexp {Y += +([-0-9.+eE]+)} $sprops_a full res_a_Y
31regexp {Z += +([-0-9.+eE]+)} $sprops_a full res_a_Z
32
33set sprops_b [sprops b]
34regexp {Mass\s*:\s*([0-9.e+-]+)} $sprops_b prop_s res_b_Area
35regexp {X += +([-0-9.+eE]+)} $sprops_b full res_b_X
36regexp {Y += +([-0-9.+eE]+)} $sprops_b full res_b_Y
37regexp {Z += +([-0-9.+eE]+)} $sprops_b full res_b_Z
38
39if { ([expr abs($res_a_Area - $res_b_Area)] > 1.e-4) } {
40 puts "Error: Bad area of face"
41}
42
43if { ([expr abs($res_a_X - $res_b_X)] > 1.e-4) ||
44 ([expr abs($res_a_Y - $res_b_Y)] > 1.e-4) ||
45 ([expr abs($res_a_Z - $res_b_Z)] > 1.e-4) } {
46 puts "Error: Location problem"
47}