pub struct ArcArrangement { /* private fields */ }Expand description
The plane cut by several simple arc rings.
Built once, queried many times: Self::regions selects any set of
faces by a predicate over ring membership and links them into regions,
all over the same vertices.
Implementations§
Source§impl ArcArrangement
impl ArcArrangement
Sourcepub fn new(
rings: &[ArcRing],
tolerance: Tolerance,
) -> Result<Self, OverlayError>
pub fn new( rings: &[ArcRing], tolerance: Tolerance, ) -> Result<Self, OverlayError>
Subdivide the plane by rings.
Each ring must pass validate_arc_ring and be simple; its winding
does not matter (each is read as the region it encloses). Rings may
cross, touch and share boundary pieces with each other.
§Errors
Any validate_arc_ring refusal, with the ring’s own reason.
Sourcepub fn edges(&self) -> &[ArrangementEdge]
pub fn edges(&self) -> &[ArrangementEdge]
Pieces of the subdivision.
Sourcepub fn ring_count(&self) -> usize
pub fn ring_count(&self) -> usize
Number of input rings.
Sourcepub fn regions(
&self,
inside: impl Fn(&[bool]) -> bool,
) -> Result<Vec<ArrangementRegion>, OverlayError>
pub fn regions( &self, inside: impl Fn(&[bool]) -> bool, ) -> Result<Vec<ArrangementRegion>, OverlayError>
The regions where inside holds, as linked boundaries.
inside receives one flag per input ring (whether a point lies in
that ring) and says whether the point belongs to the wanted set. A
piece bounds the set exactly when inside differs across it; it is
traversed so that the set lies on its left.
§Errors
OverlayError::SelfIntersection if the boundary cannot be linked,
which simple input rings cannot produce.