Model.hm_getmoiofsolid#

Model.hm_getmoiofsolid(solid, density=DBL_MAX)#

Return 6 values defining the moment and product of inertia values from the specified solid entity:

Ixx Iyy Izz Ixy Iyz Izx

These values will be calculated relative to the center of gravity/center of mass of the solid (obtained using Model.hm_getcentroid()) and the global coordinate system “translated” to the COG. The user will specify the density value to use for the calculations.

If a density is not given, then the returned values are the “mass normalized” values, where the MOI values are reported normalized by value of volume*1.0. The volume can be calculated using volume dataname in a solid entity.

Parameters:
  • solid (Entity) – The object describing the solid entity.

  • density (double) – Density value of the solid. If specified, must be > 0.

Returns:

Examples#

Get the “ true “ MOI for a solid with ID 10 and a density of 1e-9#
import hm
import hm.entities as ent

model = hm.Model()


_, result = model.hm_getmoiofsolid(solid=ent.Solid(model, 10), density=10 ** (-9))

print("MOI values:", result.moiValues)
Get the “ mass normalized “ MOI for the solid with ID 10#
import hm
import hm.entities as ent

model = hm.Model()


_, result = model.hm_getmoiofsolid(solid=ent.Solid(model, 10))

print("MOI values:", result.moiValues)