File Exchange

image thumbnail

Rigid body parameters of closed surface meshes

version (858 KB) by Anton Semechko
Fast computation of exact rigid body parameters of closed triangular surface meshes using divergence theorem


Updated 08 May 2019

GitHub view license on GitHub

In order to simulate dynamic behaviour of a rigid-body, one requires knowledge of a set of rigid-body parameters such as the total mass of the rigid-body, the center of mass, as well as the moments and products of inertia. The purpose of this submission is to provide a function that can compute exact rigid-body parameters of objects represented by closed, triangular surface meshes. The principles underlying all computations are based on the divergence theorem and are explained in detail in the attached document.

This submission also includes two functions that take as input an arbitrary mesh and output parameters of a primitive object, such as an ellipsoid or a cuboid, with exactly the same inertial parameters as the input object.

Finally, ‘VisualizeLocaFrame’ function can be used for visualizing local frames of reference constructed from principal axes of inertia.

To get started, un-zip the folder titled 'Rigid Body Parameters' and add it to your MATLAB path. Then enter the following code into your command prompt:


If you run into problems using submitted functions, please report them here:

Cite As

Anton Semechko (2019). Rigid body parameters of closed surface meshes (, GitHub. Retrieved .

Comments and Ratings (3)

Excellent program.Thank you very much!


- submission description update

- migrated to GitHub

- no changes were made

Forgot to include a number of auxiliary functions used during visualization. This submission contains all of the necessary functions.

- Made corrections to the attached document explaining the calculations implemented in this submission.
- Added a function to help visualize local frame of reference constructed from principal axes of inertia

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux