[][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>[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(crate) 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) -> Option<PolyLine>[src]

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

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

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

pub fn to_geojson(&self, gps: Option<&GPSBounds>) -> Geometry[src]

Produces a GeoJSON polygon, optionally mapping the world-space points back to GPS.

pub fn translate(self, dx: f64, dy: f64) -> Ring[src]

Translates the ring by a fixed offset.

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 From<LineString<f64>> for Ring[src]

impl From<Ring> for LineString<f64>[src]

impl PartialEq<Ring> for Ring[src]

impl Serialize for Ring[src]

impl StructuralPartialEq for Ring[src]

Auto Trait Implementations

impl RefUnwindSafe for Ring[src]

impl Send for Ring[src]

impl Sync for Ring[src]

impl Unpin for Ring[src]

impl UnwindSafe for Ring[src]

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> Same<T> for T

type Output = T

Should always be Self

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.