Open
Description
In order to evaluate the physical properties of models, it is crucial to be able to compute the moments of inertia of the model and its sections - Ixx, Iyy, Izz. As of now, it is possible to get this information from OCC layer.
from OCP.GProp import GProp_GProps
from OCP.BRepGProp import BRepGProp
box_section_occ = cq.Workplane().box(1,1,1).faces("<Z").toOCC()
properties = GProp_GProps()
BRepGProp.SurfaceProperties_s(box_section_occ, properties)
matrix_of_inertia = properties.MatrixOfInertia()
Ixx, Iyy, Izz = matrix_of_inertia.Value(1,1), matrix_of_inertia.Value(2,2), matrix_of_inertia.Value(3,3)
Possible implementation - corresponding methods of the Sketch and Workplane.
Links to OCCT documentation: