Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

clip_convex_plane

Function clip_convex_plane 

Source
pub unsafe fn clip_convex_plane<Vertex: Copy, Plane: AttributedClipPlane<Vertex>, const CHECK_CAPACITY: bool>(
    source: &[Vertex],
    destination: &mut [Vertex],
    plane: &Plane,
    traversal: ClipTraversal,
) -> usize
👎Deprecated:

use the safe clip_to_plane (checked) or clip_to_plane_unchecked (proven capacity)

Expand description

Clip one convex attributed polygon against one half-space.

With CHECK_CAPACITY true this is clip_to_plane returning the count written before an overflow; with it false, clip_to_plane_unchecked.

§Safety

When CHECK_CAPACITY is false, clip_to_plane_unchecked’s contract. source.len() + 1 slots are enough only for a convex source and a plane whose inside answer is stable per vertex; 2 * source.len() always is.