0024910: Offset of solid is not created
[occt.git] / tests / bugs / modalg_5 / bug24484
1 puts "==========="
2 puts "OCC24484"
3 puts "==========="
4 puts ""
5 #########################################################
6 # sprops gives incorrect matrix of inertia and moments
7 #########################################################
8
9 set IX_ch 2.66667e+08
10 set IY_ch 1.33333e+08
11 set IZ_ch 1.33333e+08
12 set iner_ch1 1.33333e+08
13 set iner_ch2 2.66667e+08
14 set iner_ch3 1.33333e+08
15 restore [locate_data_file bug24484_Face_2.brep] result
16 set info [sprops result]
17
18 regexp {IX += +([-0-9.+eE]+)} $info full IX
19 regexp {IY += +([-0-9.+eE]+)} $info full IY
20 regexp {IZ += +([-0-9.+eE]+)} $info full IZ
21 regexp -all {Matrix of Inertia :[\t\n]*[\s\t]*([-0-9.+eE]+)[\s\t]*[-0-9.+eE]+[\s\t]*[-0-9.+eE]+[\t\n]*[\s\t]*[-0-9.+eE]+[\s\t]*([-0-9.+eE]+)[\s\t]*[-0-9.+eE]+[\t\n]*[\s\t]*[-0-9.+eE]+[\s\t]*[-0-9.+eE]+[\s\t]*([-0-9.+eE]+)} $info full iner1 iner2 iner3
22
23 if { $IX != $IX_ch || $IY != $IY_ch || $IZ != $IZ_ch } {
24     puts "Error : Moments are incorrect"
25 } else {
26     puts "OK : Moments are correct"
27 }
28
29 if { $iner1 != $iner_ch1 || $iner2 != $iner_ch2 || $iner3 != $iner_ch3 } {
30     puts "Error : Matrix of Inertia is incorrect"
31 } else {
32     puts "OK : Matrix of Inertia is correct"
33 }
34
35 set 2dviewer 1