Struct rinmath::Polyline[][src]

pub struct Polyline<T: Real> { /* fields omitted */ }

Methods

impl<T: Real + NumCast> Polyline<T>
[src]

creates an empty polyline

creates a new polyline from the vector of points but orders them CCW first

returns the area of the polygon, only works if the polyline represents a polygon

centroid of the polyline, should work for any collection of points although it will only make sense if it's a polygon

mark this polyline as being a closed shape, although not necesarily a polygon. Any rendering or calculation will take into account that the first and last points are joined

returns true if the polyline is closed

returns total number of points

add a new point at the end of the polyline

Returns a smoothed version of the polyline.

window_size is the size of the smoothing window. So if window_size is 2, then 2 points from the left, 1 in the center, and 2 on the right (5 total) will be used for smoothing each point.

window_shape describes whether to use a triangular window (0) or box window (1) or something in between (for example, .5).

Important traits for Iter<'a, T>

Trait Implementations

impl<T: Clone + Real> Clone for Polyline<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Debug + Real> Debug for Polyline<T>
[src]

Formats the value using the given formatter. Read more

impl<T: Real> AsRef<[Pnt2<T>]> for Polyline<T>
[src]

Important traits for &'a [u8]

Performs the conversion.

impl<T: Real> Index<usize> for Polyline<T>
[src]

The returned type after indexing.

Performs the indexing (container[index]) operation.

impl<T: Real> IndexMut<usize> for Polyline<T>
[src]

Performs the mutable indexing (container[index]) operation.

impl<T> FromIterator<Pnt2<T>> for Polyline<T> where
    T: Real
[src]

Creates a value from an iterator. Read more

impl<T> Into<Vec<Pnt2<T>>> for Polyline<T> where
    T: Real
[src]

Important traits for Vec<u8>

Performs the conversion.

Auto Trait Implementations

impl<T> Send for Polyline<T>

impl<T> Sync for Polyline<T>