pub struct Edges { /* private fields */ }Implementations§
Source§impl Edges
impl Edges
pub fn empty() -> Self
pub fn from_edges<I: IntoIterator<Item = Edge>>(it: I) -> Self
Sourcepub fn from_polygon(p: &Polygon) -> Self
pub fn from_polygon(p: &Polygon) -> Self
Edges of a single polygon — the hull plus every hole boundary, in traversal order.
Sourcepub fn from_region(r: &Region) -> Self
pub fn from_region(r: &Region) -> Self
Edges of every polygon in a region.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn edges(&self) -> &[Edge]
pub fn into_inner(self) -> Vec<Edge>
Sourcepub fn centers(&self, length: i64) -> Edges
pub fn centers(&self, length: i64) -> Edges
Replace each edge with a length-long segment centered at its
midpoint, oriented along the source edge. Edges shorter than
length are emitted unchanged.
Sourcepub fn extended(&self, before: i64, after: i64) -> Edges
pub fn extended(&self, before: i64, after: i64) -> Edges
Extend each edge by before along the −direction at a and by
after along the +direction at b. Useful for converting an
edge to a “ray” with finite extent.
Sourcepub fn with_angle(&self, angle_deg: f64, tolerance_deg: f64) -> Edges
pub fn with_angle(&self, angle_deg: f64, tolerance_deg: f64) -> Edges
Filter edges whose angle (mod 180°) is within tolerance_deg of
angle_deg.
pub fn not_with_angle(&self, angle_deg: f64, tolerance_deg: f64) -> Edges
pub fn length_at_least(&self, min: i64) -> Edges
pub fn length_at_most(&self, max: i64) -> Edges
Sourcepub fn interacting(&self, other: &Edges) -> Edges
pub fn interacting(&self, other: &Edges) -> Edges
Keep edges whose bbox overlaps any edge in other. v1 uses bbox
intersection — sufficient for axis-aligned edge interaction
(where touching edges share a bbox boundary point).
Sourcepub fn outside_part(&self, region: &Region) -> Edges
pub fn outside_part(&self, region: &Region) -> Edges
Keep the parts of each edge that lie strictly outside region.
Implemented for axis-aligned edges over axis-aligned regions —
non-axis-aligned edges are returned unchanged.
Sourcepub fn inside_part(&self, region: &Region) -> Edges
pub fn inside_part(&self, region: &Region) -> Edges
Keep the parts of each edge that lie inside region.