newton.geometry.compute_shape_inertia#

newton.geometry.compute_shape_inertia(type, scale, src, density, is_solid=True, thickness=0.001)[source]#

Computes the mass, center of mass and 3x3 inertia tensor of a shape

Parameters:
  • type (int) – The type of shape (GEO_SPHERE, GEO_BOX, etc.)

  • scale (list[float] | tuple[float, float, float] | vec3f) – The scale of the shape

  • src (SDF | Mesh | None) – The source shape (Mesh or SDF)

  • density (float) – The density of the shape

  • is_solid (bool) – Whether the shape is solid or hollow

  • thickness (list[float] | float) – The thickness of the shape (used for collision detection, and inertia computation of hollow shapes)

Returns:

The mass, center of mass and 3x3 inertia tensor of the shape

Return type:

tuple[float, vec3f, mat33f]