[][src]Struct geom::ring::Ring

pub struct Ring {
    pts: Vec<Pt2D>,
}

Maybe a misnomer, but like a PolyLine, but closed.

Fields

pts: Vec<Pt2D>

Implementations

impl Ring[src]

pub fn new(pts: Vec<Pt2D>) -> Result<Ring, String>[src]

pub fn must_new(pts: Vec<Pt2D>) -> Ring[src]

pub fn to_outline(&self, thickness: Distance) -> Polygon[src]

Draws the ring with some thickness, with half of it straddling the interor of the ring, and half on the outside.

pub fn to_polygon(self) -> Polygon[src]

pub fn points(&self) -> &Vec<Pt2D>[src]

pub fn into_points(self) -> Vec<Pt2D>[src]

pub fn all_intersections(&self, other: &PolyLine) -> Vec<Pt2D>[src]

Be careful with the order of results. Hits on an earlier line segment of other show up first, but if the ring hits a line segment at multiple points, who knows. Dedupes.

pub fn get_both_slices_btwn(
    &self,
    pt1: Pt2D,
    pt2: Pt2D
) -> Option<(PolyLine, PolyLine)>
[src]

pub fn get_shorter_slice_btwn(&self, pt1: Pt2D, pt2: Pt2D) -> PolyLine[src]

pub fn split_points(
    pts: &Vec<Pt2D>
) -> Result<(Vec<PolyLine>, Vec<Ring>), String>
[src]

Extract all PolyLines and Rings. Doesn't handle crazy double loops and stuff.

pub fn contains_pt(&self, pt: Pt2D) -> bool[src]

Trait Implementations

impl Clone for Ring[src]

impl Debug for Ring[src]

impl<'de> Deserialize<'de> for Ring[src]

impl Display for Ring[src]

impl PartialEq<Ring> for Ring[src]

impl Serialize for Ring[src]

impl StructuralPartialEq for Ring[src]

Auto Trait Implementations

impl RefUnwindSafe for Ring

impl Send for Ring

impl Sync for Ring

impl Unpin for Ring

impl UnwindSafe for Ring

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.