Struct geom::ring::Ring [−][src]
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]
&self,
pt1: Pt2D,
pt2: Pt2D
) -> Option<(PolyLine, PolyLine)>
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for Ring
[src]
impl From<LineString<f64>> for Ring
[src]
impl PartialEq<Ring> for Ring
[src]
impl Serialize for Ring
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,