0024484: sprops gives incorrect matrix of inertia and moments
[occt.git] / tests / bugs / modalg_5 / bug24484
CommitLineData
a24c75d9 1puts "==========="
2puts "OCC24484"
3puts "==========="
4puts ""
5#########################################################
6# sprops gives incorrect matrix of inertia and moments
7#########################################################
8
9set IX_ch 2.66667e+08
10set IY_ch 1.33333e+08
11set IZ_ch 1.33333e+08
12set iner_ch1 1.33333e+08
13set iner_ch2 2.66667e+08
14set iner_ch3 1.33333e+08
15restore [locate_data_file bug24484_Face_2.brep] result
16set info [sprops result]
17
18regexp {IX += +([-0-9.+eE]+)} $info full IX
19regexp {IY += +([-0-9.+eE]+)} $info full IY
20regexp {IZ += +([-0-9.+eE]+)} $info full IZ
21regexp -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
23if { $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
29if { $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
35set 2dviewer 1