Skip to content
brep-conformancegithub

inertia

Queries · api.md § inertia · all operations

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]]}
FunctionFieldsReturns
volumesVolume
areasArea
classifys, pointslist<"in" or "on" or "out">
closests, pointslist<Point3>
normals, pointslist<Vector3 or null>
curvatures, pointslist<Number[2] or null>
checkslist<string>
centroidsPoint3 or null
inertiasNumber[3][3]
distancea, bLength
interferencea, b{volume: Volume, gap: Length}
bettisCount[3]
section_areas, origin, normalArea
sections, origin, normal, tolerancelist<list<Point3>>
projects, direction, tolerance{visible: list<list<Point2>>, hidden: list<list<Point2>>}
bounding_boxsPoint3[2]
splits, origin, normalSolid[2]
meshs, tolerance{positions: list<Point3>, triangles: list<Index[3]>}
displays, tolerance{faces: list<Face>, edges: list<list<Point3>>}
raycasts, origin, direction; or s, rayslist<Length>; or list<list<Length>>