Struct ArcArrangement

Source
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

Source

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.

Source

pub fn vertices(&self) -> &[Point2] ⓘ

Distinct vertices, each an exact point rounded once.

Source

pub fn edges(&self) -> &[ArrangementEdge]

Pieces of the subdivision.

Source

pub fn ring_count(&self) -> usize

Number of input rings.

Source

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.

Source

pub fn ring(&self, uses: &[EdgeUse]) -> ArcRing

A region boundary as an ArcRing over the rounded vertices.

Trait Implementations§

Source§

impl Debug for ArcArrangement

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.