pub struct ConvexPlanRegion { /* private fields */ }Expand description
A convex plan polygon, anticlockwise, in canonical metres.
Implementations§
Source§impl ConvexPlanRegion
impl ConvexPlanRegion
Sourcepub fn try_new(ring: PlanRing) -> Result<Self, ProximityError>
pub fn try_new(ring: PlanRing) -> Result<Self, ProximityError>
A region from its vertices, in order and without repeating the first. They must be finite, at least three, turn anticlockwise at every vertex (collinear vertices are accepted) and enclose a positive area.
Sourcepub fn bounds(&self) -> ([f64; 2], [f64; 2])
pub fn bounds(&self) -> ([f64; 2], [f64; 2])
The least and greatest corner of the region’s plan box.
Sourcepub fn area_square_metres(&self) -> f64
pub fn area_square_metres(&self) -> f64
The region’s area in square metres.
Sourcepub fn separation(&self, other: &Self) -> f64
pub fn separation(&self, other: &Self) -> f64
Signed separation from other: the plan distance between the two
regions when they are apart, zero when they touch, and minus the
least depth one reaches into the other along an edge normal when
they overlap with positive area.
Both are convex, so they are apart exactly when an edge normal of one separates them, and their distance is then the least distance from a vertex of one to an edge of the other.