pub fn cut_by_plane(
tx: &mut Transaction<'_>,
plane: &Plane,
options: &CutOptions,
) -> Result<CutOutput>Expand description
Splits the mesh of tx with plane: the + side stays, the - side is
returned as a mesh with the same origin. Triangles crossing the plane are
split along it; with options.cap both openings are closed with flat,
unfaired fill_holes patches over the cut rim.
A rim is capped when it closes: by vertex index, or, on a mesh with UVs, by exact position across seams (see the module docs for the cap’s UVs). One that runs into a real boundary of an open mesh stays open. On a mesh without UVs split vertices are such a boundary: weld them first.
§Errors
OpsError::InvalidInputwhen the plane does not cut the mesh (every triangle on one side), when a cut point leavesf32range, or, withcap, when a rim cannot be capped: see the module docs.OpsError::StaleLoopswhen a rim loop vanished between listing and filling (defensive: both come from the same mesh state).OpsError::Storewhen memory runs out. Nothing is written then: the plan is read from the untouched mesh before the first write.