Description
There are two different functions to calculate the volume properties in the BRepGProp (GProp_GProps, GProp_PrincipalProps) class:
- VolumeProperties
- VolumePropertiesGK
Both calculate the shape volume correctly. However, when calculating the inertia properties of the system, it seems that the former produces the correct results but the latter does not.
For a box and a cylinder:
Principal moments of inertia
Cylinder
Volume: 196349.54084936203
Ixx, Iyy, Izz: (194317337.4428578, 194291128.82151097, 61359231.51543226)
Cylinder GK
Volume: 196349.5408493644
Ixx, Iyy, Izz: (6.122366410532748e-40, -2.2351741790771484e-07, -3.5762786865234375e-07)
Box
Volume: 124999.99999999999
Ixx, Iyy, Izz: (52083333.33333338, 52083333.33333331, 52083333.333333276)
Box GK
Volume: 124999.99999999999
Ixx, Iyy, Izz: (1.6326310428087332e-40, -8.940696716308594e-08, -8.940696716308594e-08)