Skip to main content

Arc

Struct Arc 

Source
pub struct Arc {
    pub nodes: [NodeId; 2],
    pub sources: [EdgeId; 2],
}
Expand description

An edge of the skeleton graph: a straight segment traced by one wavefront vertex as it moved.

§Provenance

Every arc separates the faces of exactly two input edges — the two in Arc::sources — and every point along it is equidistant from those two edges’ supporting lines. This is not an approximation or a post-hoc lookup: it is what an arc is. A wavefront vertex exists precisely where two shrinking edges meet, and it carries those two edge ids with it as it sweeps the arc out.

So tracing an arc back to the input it came from is a field access, at zero cost. See Node::sources for the one caveat: on a non-convex polygon these are the edges whose faces meet here, which is not always the same as the Euclidean-nearest edges.

Fields§

§nodes: [NodeId; 2]

The arc’s two endpoints. nodes[0] is always the lower-offset end, so arcs point “uphill”, away from the boundary.

§sources: [EdgeId; 2]

The two input edges whose faces this arc separates.

Implementations§

Source§

impl Arc

Source

pub fn lower(&self) -> NodeId

The endpoint nearer the input boundary.

Source

pub fn upper(&self) -> NodeId

The endpoint further from the input boundary.

Source

pub fn other(&self, n: NodeId) -> Option<NodeId>

The endpoint that is not n, or None if n is not an endpoint.

Trait Implementations§

Source§

impl Clone for Arc

Source§

fn clone(&self) -> Arc

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Arc

Source§

impl Debug for Arc

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Arc

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Arc

Source§

impl PartialEq for Arc

Source§

fn eq(&self, other: &Arc) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Arc

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Arc

Auto Trait Implementations§

§

impl Freeze for Arc

§

impl RefUnwindSafe for Arc

§

impl Send for Arc

§

impl Sync for Arc

§

impl Unpin for Arc

§

impl UnsafeUnpin for Arc

§

impl UnwindSafe for Arc

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.