I want to calculate the inertia matrix of a cube. It is calculated this way :
// Cube creation
BRepPrimAPI_MakeBox MakeBox(Pnt1, Pnt2);
TopoDS_Shell myBlock = MakeBox.Shell();
// The cube is created
// We get back the barycenter of the cube
origin = Props.CentreOfMass();
// We have the barycenter
// We get back the Inertia matrix
Mat = VProps.MatrixOfInertia();
The matrix I get back is diagonal. But it never changes even if I apply a rotation on the cube. The matrix is always diagonal. Is it accurate ?
Unlike the cube, the inertia matrix of a cylinder is not always diagonal. It changes if the cylinder rotates.
Have I forget something ? Do I an error somewhere ?
Thank you for your help.