Crates.io | mass-props |
lib.rs | mass-props |
version | 0.2.0 |
source | src |
created_at | 2024-08-13 11:09:42.210694 |
updated_at | 2024-08-15 13:05:07.332284 |
description | CLI to calculate mass properties of triangle meshes |
homepage | |
repository | https://codeberg.org/mo8it/polyhedral_mass_properties |
max_upload_size | |
id | 1335839 |
size | 13,778 |
CLI to calculate the mass properties (mass, center of mass and inertia matrix/tensor) of triangle meshes.
Built on the library polyhedral_mass_properties
.
Currently, only gltf
and glb
files are supported.
cargo install mass-props
Usage: mass-props [OPTIONS] <PATH>
Arguments:
<PATH> Path to a gltf/glb file
Options:
-d, --density <DENSITY> Default: 1.0
-m, --mesh <MESH> The mesh index in the glTF file [default: 0]
-h, --help Print help
The output is in JSON.
Example:
{
"density": 0.001,
"mass": 9.445518773048825,
"center_of_mass": [
9.28871623915268e-7,
-0.00313705591303723,
-1.067953785584565e-6
],
"inertia": {
"xx": 1373.3185987256663,
"yy": 1198.2310241502155,
"zz": 1373.318537829056,
"xy": 0.00003549312284551729,
"xz": 0.00003393459310569918,
"yz": -0.000040233995830622396
}
}