Skip to main content

certify_unit_winding

Function certify_unit_winding 

Source
pub fn certify_unit_winding<M: TriangleMeshView + ?Sized>(
    mesh: &M,
    tolerance: Tolerance,
    max_excess: f64,
) -> Result<VolumeInterval, WindingError>
Expand description

Certifies that the winding excess E = integral of w(w-1)/2 of a closed oriented cycle, an upper bound on the volume with w not in {0, 1} that equals it where w is in {-1..2}, is at most max_excess, and returns the bracket of E (upper <= max_excess; the interval’s “volume” is E, not the bad volume).

max_excess must be a small positive volume scaled to the model: the bracket is outward-rounded, so a budget of 0 can never be met.

§Errors

WindingError::InvalidBudget for a zero, negative or non-finite max_excess, WindingError::NonFinite for a non-finite position, WindingError::NotClosedOrientedCycle with the audit when the mesh is not a closed oriented cycle, WindingError::Exceeds when the excess is certified above the budget and WindingError::Undecided when its bracket straddles it.