Skip to main content

split_solid_by_plane

Function split_solid_by_plane 

Source
pub fn split_solid_by_plane(
    solid: &BrepSolid,
    plane_point: Vec3,
    plane_normal: Vec3,
) -> Result<(BrepSolid, BrepSolid), String>
Expand description

Split solid into two pieces by the plane through plane_point with normal plane_normal. Returns (below, above) where below is the piece on the −n side of the plane and above the piece on the +n side.

Contract: when the plane misses the solid’s box this returns Err("split_solid_by_plane: plane does not intersect the solid"); when a cut fails the error names the boolean’s own refusal; when the plane meets the box but a piece comes out empty (a tangent plane, or a plane through the box beside the body) the error says which piece. It never returns a degenerate or empty piece.