meshmagick.inertia module

This module defines a RigidBodyInertia class to handle 3D rotational inertia of rigid bodies

class meshmagick.inertia.AngularVelocityVector(array)[source]

Bases: numpy.ndarray

class meshmagick.inertia.RigidBodyInertia(mass, cog, xx, yy, zz, yz, xz, xy, point=None)[source]

Bases: object

Parameters
  • mass (float) – The mass of the body in kg

  • cog (array_like) – The 3D coordinates of the center of gravity

  • xx (float) – The principal inertia moment around x axis

  • yy (float) – The principal inertia moment around y axis

  • zz (float) – The principal inertia moment around z axis

  • yz (float) – Inertia product

  • xz (float) – Inertia product

  • xy (float) – Inertia product

  • point (array_like, optional) – The reduction point. If None, it is set to be cog

property at_cog

Returns a new inertia object that is expressed at cog.

It makes a copy of itself.

Returns

Return type

ndarray

property gravity_center

The position of the center of gravity

property inertia_matrix

The 3D rotational inertia matrix

is_at_cog()[source]

Returns whether the object is expressed at cog

Returns

Return type

bool

property mass

The mass of the body

property reduction_point

The reduction point of the inertia matrix

Returns

Return type

ndarray

set_cog(cog)[source]

Set a new center of gravity.

Parameters
  • cog (array_like) –

  • 3D coordinates of the center of gravity (The) –

shift_at_cog()[source]

Shift the inertia matrix internally at cog.

The reduction point is then cog.

property xx

Get the principal inertia moment around x

Returns

Return type

float

property xy

Get the xy inertia product

Returns

Return type

float

property xz

Get the xz inertia product

Returns

Return type

float

property yy

Get the principal inertia moment around y

Returns

Return type

float

property yz

Get the yz inertia product

Returns

Return type

float

property zz

Get the principal inertia moment around z

Returns

Return type

float

class meshmagick.inertia.RotationalInertia3D(xx, xy, yy, xz, yz, zz, point)[source]

Bases: numpy.ndarray

property array
meshmagick.inertia.circular_cone_shell(R, height, density=7850.0, thickness=0.02)[source]

Get the inertia of a circular cone shell

Returns

Return type

RigidBodyInertia

Note

The center of gravity is located at an altitude of z=H/3 over the circular basis center

meshmagick.inertia.cube(a, density=1.0)[source]

Get the inertia of a cube

Returns

Return type

RigidBodyInertia

meshmagick.inertia.ellipsoid(a, b, c, density=1.0)[source]

Get the inertia of an ellipsoid

Returns

Return type

RigidBodyInertia

Note

  • a is along z axis (ellipse semi axis)

  • b is along x axis (ellipse semi axis)

  • c is along y axis (ellipse semi axis)

meshmagick.inertia.elliptical_cylinder(a, b, length, density=1.0)[source]

Get the inertia of an elliptical cylinder

Returns

Return type

RigidBodyInertia

Note

  • The center of gravity is located at an altitude of z=H/2 over the elliptical basis center

  • a is along x axis (ellipse semi axis)

  • b is along y axis (ellipse semi axis)

  • length is along z axis

meshmagick.inertia.frustrum_of_circular_cone_shell(r, R, height, density=7850.0, thickness=0.02)[source]

Get the inertia of a frustrum of circular cone shell

Returns

Return type

RigidBodyInertia

Note

The center of gravity is located at an altitude of z=(H/3)*(2*r+R)/(r+R)

meshmagick.inertia.hemisphere(radius, density=1.0)[source]

Get the inertia of a hemisphere

Returns

Return type

RigidBodyInertia

Note

The center of gravity is situated at the altitude of z = 3R/8 over the circular basis center

meshmagick.inertia.hemispherical_shell(R, density=7850.0, thickness=0.02)[source]

Get the inertia of a hemispherical shell

Returns

Return type

RigidBodyInertia

Note

The center of gravity is located at an altitude of z=R/2 over the circular basis center

meshmagick.inertia.hollow_right_circular_cylinder(int_radius, ext_radius, length, density=1.0)[source]

Get the inertia of a hollow right circular cylinder

Returns

Return type

RigidBodyInertia

meshmagick.inertia.hollow_sphere(int_radius, ext_radius, density=1.0)[source]

Get the inertia of a hollow sphere

Returns

Return type

RigidBodyInertia

meshmagick.inertia.isoceles_wedge(base, height, length, density=1.0)[source]

Get the inertia of an isocele wedge

Returns

Return type

RigidBodyInertia

meshmagick.inertia.lateral_cylindrical_shell(R, H, density=7850.0, thickness=0.02)[source]

Get the inertia of a lateral cylindrical shell

Returns

Return type

RigidBodyInertia

meshmagick.inertia.rectangular_prism(a, b, h, density=1.0)[source]

Get the inertia of a rectangular prism

Returns

Return type

RigidBodyInertia

Note

  • a is along x

  • b is along y

  • h is along z

meshmagick.inertia.right_angle_wedge(base, height, length, density=1.0)[source]

Get the inertia of a right angle wedge

Returns

Return type

RigidBodyInertia

meshmagick.inertia.right_circular_cone(radius, length, density=1.0)[source]

Get the inertia of a right circular cone

Returns

Return type

RigidBodyInertia

Note

The center of gravity is at an altitude of z = H/4 over the circular basis center

meshmagick.inertia.right_circular_cylinder(radius, length, density=1.0)[source]

Get the inertia of a right circular cylinder

Returns

Return type

RigidBodyInertia

meshmagick.inertia.right_rectangular_pyramid(a, b, height, density=1.0)[source]

Get the inertia of a right rectangular pyramid

Returns

Return type

RigidBodyInertia

Note

The center of gravity is located at the altitude z=H/4 over the rectangular basis center

meshmagick.inertia.sphere(radius, density=1.0)[source]

Get the inertia of a sphere

Returns

Return type

RigidBodyInertia

meshmagick.inertia.spherical_shell(R, density=7850.0, thickness=0.02)[source]

Get the inertia of a spherical shell

Returns

Return type

RigidBodyInertia

meshmagick.inertia.torus(chord_radius, tube_radius, density=1.0)[source]

Get the inertia of a torus

Returns

Return type

RigidBodyInertia

meshmagick.inertia.total_cylindrical_shell(R, H, density=7850.0, thickness=0.02)[source]

Get the inertia of a total cylindrical shell

Returns

Return type

RigidBodyInertia