Skip to main content

cycle_volume_properties

Function cycle_volume_properties 

Source
pub fn cycle_volume_properties<M>(
    mesh: &M,
    tolerance: Tolerance,
) -> Result<VolumeProperties, CycleVolumeError>
where M: TriangleMeshView + ?Sized,
Expand description

Signed volume and centroid of a mesh whose triangles form a closed oriented cycle, the weaker input volume_properties does not accept.

A cycle is a mesh in which every undirected edge is used equally often in each direction (see axiolid_mesh::MeshCycleHealth). It may hold shells that touch along an edge, or an edge shared by four triangles. The divergence sum of such a mesh does not depend on its base point and equals the integral of the integer winding number w of the surface; on two-manifold input the result is bit-identical to volume_properties.

The result is the enclosed volume only when w is 0 or 1 everywhere, which is the contract volume_properties has always had: overlapping or duplicated shells count twice and an inverted shell subtracts. No edge audit can see that; axiolid_inspect::certify_unit_winding certifies it (ADR 0099 D6), bounding the volume where w is neither 0 nor 1 by the winding excess.

A T-junction leaves three unbalanced edges and is refused. Run axiolid_heal::split_t_junctions (or RepairAction::SplitTJunctions) first; it is opt-in because it only splits edges and creates no vertex. A mesh whose vector area vanishes without being closed, such as a box without top and bottom, is refused by the same audit.