Struct plane_split::Clipper
source · pub struct Clipper<A> { /* private fields */ }
Expand description
A helper object to clip polygons by a number of planes.
Implementations
sourceimpl<A: Copy + Debug> Clipper<A>
impl<A: Copy + Debug> Clipper<A>
sourcepub fn frustum_planes(
t: &Transform3D<f64>,
bounds: Option<Rect<f64>>
) -> Result<impl Iterator<Item = Plane>, NegativeHemisphereError>
pub fn frustum_planes(
t: &Transform3D<f64>,
bounds: Option<Rect<f64>>
) -> Result<impl Iterator<Item = Plane>, NegativeHemisphereError>
Extract the clipping planes that define the frustum for a given transformation.
sourcepub fn add(&mut self, plane: Plane)
pub fn add(&mut self, plane: Plane)
Add a clipping plane to the list. The plane will clip everything behind it, where the direction is set by the plane normal.
sourcepub fn clip(&mut self, polygon: Polygon<A>) -> &[Polygon<A>]
pub fn clip(&mut self, polygon: Polygon<A>) -> &[Polygon<A>]
Clip specified polygon by the contained planes, return the fragmented polygons.
sourcepub fn clip_transformed<'a>(
&'a mut self,
polygon: Polygon<A>,
transform: &'a Transform3D<f64>,
bounds: Option<Rect<f64>>
) -> Result<impl 'a + Iterator<Item = Polygon<A>>, NegativeHemisphereError>
pub fn clip_transformed<'a>(
&'a mut self,
polygon: Polygon<A>,
transform: &'a Transform3D<f64>,
bounds: Option<Rect<f64>>
) -> Result<impl 'a + Iterator<Item = Polygon<A>>, NegativeHemisphereError>
Clip the primitive with the frustum of the specified transformation, returning a sequence of polygons in the transformed space. Returns None if the transformation can’t be frustum clipped.
Trait Implementations
Auto Trait Implementations
impl<A> RefUnwindSafe for Clipper<A>where
A: RefUnwindSafe,
impl<A> Send for Clipper<A>where
A: Send,
impl<A> Sync for Clipper<A>where
A: Sync,
impl<A> Unpin for Clipper<A>where
A: Unpin,
impl<A> UnwindSafe for Clipper<A>where
A: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more