Struct geom::ring::Ring [−][src]
Maybe a misnomer, but like a PolyLine, but closed.
Fields
pts: Vec<Pt2D>
Implementations
impl Ring
[src]
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 into_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: &[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<'de> Deserialize<'de> 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 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> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,