pub struct Ring2D {
pub points: Vec<CoordNm>,
pub segs: Vec<RingSeg>,
}Expand description
Closed 2D ring in whole nanometres (+Y up).
Fields§
§points: Vec<CoordNm>§segs: Vec<RingSeg>Implementations§
Source§impl Ring2D
impl Ring2D
Sourcepub fn from_points_oriented(pts: &[CoordNm], ccw: bool) -> Option<Self>
pub fn from_points_oriented(pts: &[CoordNm], ccw: bool) -> Option<Self>
Build a straight-segment ring oriented CCW (ccw = true) or CW (ccw = false).
Sourcepub fn ensure_orientation(self, ccw: bool) -> Self
pub fn ensure_orientation(self, ccw: bool) -> Self
Reorient a ring (including circular arc segments) to requested winding.
Sourcepub fn flatten_polygon(&self, max_arc_steps: usize) -> Vec<CoordNm>
pub fn flatten_polygon(&self, max_arc_steps: usize) -> Vec<CoordNm>
Flatten arcs into a polyline ring for area/containment/polygon export.
Sourcepub fn signed_area(&self) -> f64
pub fn signed_area(&self) -> f64
Signed area in square nanometres (> 0 for CCW, < 0 for CW).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Ring2D
impl<'de> Deserialize<'de> for Ring2D
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Ring2D
impl StructuralPartialEq for Ring2D
Auto Trait Implementations§
impl Freeze for Ring2D
impl RefUnwindSafe for Ring2D
impl Send for Ring2D
impl Sync for Ring2D
impl Unpin for Ring2D
impl UnsafeUnpin for Ring2D
impl UnwindSafe for Ring2D
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.