Skip to main content

BoundaryLoop

Struct BoundaryLoop 

Source
pub struct BoundaryLoop {
    pub id: LoopId,
    pub vertices: Vec<VertexId>,
    pub perimeter: f64,
    pub area: f64,
    pub closed: bool,
    pub clean: bool,
}
Expand description

A chain of boundary edges, closed unless the walk could not close it.

Fields§

§id: LoopId

The loop’s content fingerprint, which callers pass back to pick this loop (for example to fill it). It matches as long as the loop’s vertex sequence is unchanged, across edits and transactions.

§vertices: Vec<VertexId>

The vertices in loop order. The loop runs along each boundary edge in the direction its one triangle uses it, so a hole in an outward-facing surface runs clockwise seen from outside. A closed loop starts at id.min_vertex and its polygon closes from the last vertex back to the first. An open chain runs from one end to the other, unrotated.

§perimeter: f64

The length of the polygon closed from the last vertex back to the first, in local units (for an open chain, including that closing step).

§area: f64

The vector area |sum p_i x p_(i+1)| / 2 of the same closed polygon.

§closed: bool

true when the walk came back to its first edge. false for an open chain, which ends at a vertex where no boundary edge continues it (for example at a non-manifold edge). An open chain is never clean, so it is never filled.

§clean: bool

false when the edges at some vertex of the loop could not be ordered by the fan walk: the vertex touches a non-manifold edge, or it is a pinch whose fan pieces are wound against each other, so the walk fell back to pairing by edge key. The loop may then be open or join openings that are not one hole. Also false when the loop crosses an orientation seam: it walks some boundary edge against its triangle’s direction, or it passes a vertex where outgoing and incoming boundary edges do not balance (a reversed triangle on the rim), so it may run backwards around its hole. This fails safe: unclean loops are skipped by fill_holes unless allowed, and orienting first makes a wound-against pinch or a flipped rim triangle clean.

Trait Implementations§

Source§

impl Clone for BoundaryLoop

Source§

fn clone(&self) -> BoundaryLoop

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 Debug for BoundaryLoop

Source§

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

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

impl PartialEq for BoundaryLoop

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BoundaryLoop

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> 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> 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.