pub fn offset(
tx: &mut Transaction<'_>,
options: &OffsetOptions,
) -> Result<OffsetReport>Expand description
Moves every live vertex along its smooth normal by distance.
- Region: every live vertex, displaced by
distance * normalwherenormalis its smooth normal. Vertices with a zero normal (used by no non-degenerate triangle) or a non-finite displacement stay put. - The move is written once, in a single
set_positionscall over the vertices whose displacement is above 0; an empty move writes nothing. - Cleanup:
remove_degeneratewith the default options runs over the result and drops the triangles the offset pinched down to nothing (and the vertices left unused), reported asdegenerate_removedandvertices_removed. History is untouched.
ยงErrors
OpsError::InvalidInputwhen the distance is not finite, or the mesh buffers are not a valid mesh.OpsError::Storewhen memory runs out.
Nothing is written in any of these cases.