mass-props

Crates.iomass-props
lib.rsmass-props
version0.2.0
sourcesrc
created_at2024-08-13 11:09:42.210694
updated_at2024-08-15 13:05:07.332284
descriptionCLI to calculate mass properties of triangle meshes
homepage
repositoryhttps://codeberg.org/mo8it/polyhedral_mass_properties
max_upload_size
id1335839
size13,778
Mo (mo8it)

documentation

README

mass-props

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.

Installation

cargo install mass-props

Usage

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

Output

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
  }
}
Commit count: 0

cargo fmt