pub struct FixedPolygon<const N: usize> { /* private fields */ }Expand description
A polygon with a statically-allocated vertex array of capacity N.
Vertices are stored inline; no heap allocation is performed.
Implementations§
Source§impl<const N: usize> FixedPolygon<N>
impl<const N: usize> FixedPolygon<N>
Sourcepub fn try_push(&mut self, p: Point2D) -> bool
pub fn try_push(&mut self, p: Point2D) -> bool
Attempts to push a vertex. Returns false if the polygon is full.
Sourcepub fn signed_area(&self) -> f64
pub fn signed_area(&self) -> f64
Computes the signed shoelace area (positive for CCW).
Trait Implementations§
Auto Trait Implementations§
impl<const N: usize> Freeze for FixedPolygon<N>
impl<const N: usize> RefUnwindSafe for FixedPolygon<N>
impl<const N: usize> Send for FixedPolygon<N>
impl<const N: usize> Sync for FixedPolygon<N>
impl<const N: usize> Unpin for FixedPolygon<N>
impl<const N: usize> UnsafeUnpin for FixedPolygon<N>
impl<const N: usize> UnwindSafe for FixedPolygon<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more