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<ArcArrangement, OverlayError>
pub fn new( rings: &[ArcRing], tolerance: Tolerance, ) -> Result<ArcArrangement, 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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ArcArrangement
impl RefUnwindSafe for ArcArrangement
impl Send for ArcArrangement
impl Sync for ArcArrangement
impl Unpin for ArcArrangement
impl UnwindSafe for ArcArrangement
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more