inertia
Queries · api.md § inertia · all operations
definition
inertia(s: Solid) -> Number[3][3]
Measures how the solid's material is spread about its centroid, as if it were of uniform density 1.
Returns ∭ (|d|²·I − d dᵀ) dV over s, in mm⁵, where d is the offset of each point from the centroid. The diagonal holds the moments about axes through the centroid, and the other entries hold the negated products. The matrix is symmetric, so its rows and its columns are the same. Every entry is zero when s is empty.
Example. Solid 1 is a 10 × 20 × 30 mm box with one corner at the origin.
> {"cmd": "inertia", "s": 1}
< {"ok": [[650000.0, -0.0, 0.0], [-0.0, 500000.0, 0.0], [0.0, 0.0, 250000.0]]}common to queries
| Function | Fields | Returns |
|---|---|---|
volume | s | Volume |
area | s | Area |
classify | s, points | list<"in" or "on" or "out"> |
closest | s, points | list<Point3> |
normal | s, points | list<Vector3 or null> |
curvature | s, points | list<Number[2] or null> |
check | s | list<string> |
centroid | s | Point3 or null |
inertia | s | Number[3][3] |
distance | a, b | Length |
interference | a, b | {volume: Volume, gap: Length} |
betti | s | Count[3] |
section_area | s, origin, normal | Area |
section | s, origin, normal, tolerance | list<list<Point3>> |
project | s, direction, tolerance | {visible: list<list<Point2>>, hidden: list<list<Point2>>} |
bounding_box | s | Point3[2] |
split | s, origin, normal | Solid[2] |
mesh | s, tolerance | {positions: list<Point3>, triangles: list<Index[3]>} |
display | s, tolerance | {faces: list<Face>, edges: list<list<Point3>>} |
raycast | s, origin, direction; or s, rays | list<Length>; or list<list<Length>> |