pub fn principal_frame(
mesh: &Triangulation,
tol: Tolerances,
) -> OgeomResult<Frame>Expand description
The frame a mesh’s area spreads along: its origin at the area centroid,
x along the greatest spread, y the next and z the least, from the
second moments of the surface’s area, integrated exactly over each
triangle.
Each of x and y points the way the area’s third moment along it is
positive, the way the area reaches further; z completes a
right-handed frame. A third moment smaller than moving the vertices by
the confusion distance could change it does not decide, and the sense
whose largest component is positive is taken instead. Spreads equal to
within what that move could change do not tell their axes apart either:
among them, the frame takes the world axes’ projections, X first, the
longest of them where it has a choice.
§Errors
OgeomError::Domain for a triangle
indexing a vertex the mesh does not have, and
OgeomError::Construction for a
mesh with no area.