logo
pub struct Path<'k, B> where
    B: Reborrow,
    B::Target: AsStorage<Arc<<B as Parametric>::Data>> + AsStorage<Vertex<<B as Parametric>::Data>> + Consistent + Parametric, 
{ /* private fields */ }
Expand description

Non-intersecting path.

A path is an ordered set of vertices that are joined by arcs. Paths are notated as either sequences or sets. An open path over vertices $A$, $B$, and $C$ is notated $\overrightarrow{(A,B,C)}$ and a closed path over the same vertices is notated $\overrightarrow{\{A,B,C\}}$.

Path represents non-intersecting paths of the form $\overrightarrow{(A,\cdots,B)}$, where $A$ is the back of the path and $B$ is the front of the path. Note that closed paths are always of the form $\overrightarrow{(A,\cdots,A)}$, where the back and front vertices are both $A$ (the same).

Path maintains an ordered set of keys and uses copy-on-write semantics to avoid allocations and copies.

Implementations

Converts the path into its opposite path.

Gets the opposite path.

Pushes a vertex onto the back of the path.

The back of a path $\overrightarrow{(A,\cdots)}$ is the vertex $A$. This is the source vertex of the first arc that forms the path.

The given vertex must be a source vertex of an arc formed with the back of the path. That is, if the given vertex is $X$, then $\overrightarrow{XA}$ must exist.

Returns the key of the arc $\overrightarrow{XA}$ inserted into the path using the given source vertex $X$.

Errors

Returns an error if the path is closed, the given vertex is not found, or the given vertex does not form an arc with the back of the path.

Pushes the source vertex of the previous arc onto the back of the path.

Pops a vertex from the back of the path.

Pushes a vertex onto the front of the path.

The front of a path $\overrightarrow{(\cdots,B)}$ is the vertex $B$. This is the destination vertex of the last arc that forms the path.

The given vertex must be a destination vertex of an arc formed with the front of the path. That is, if the given vertex is $X$, then $\overrightarrow{BX}$ must exist.

Returns the key of the arc $\overrightarrow{BX}$ inserted into the path using the given source vertex $X$.

Errors

Returns an error if the path is closed, the given vertex is not found, or the given vertex does not form an arc with the front of the path.

Pushes the destination vertex of the next arc onto the front of the path.

Pops a vertex from the front of the path.

Gets the vertex at the back of the path.

Gets the vertex at the front of the path.

Returns true if the path is open.

An open path is a path that terminates and does not form a loop.

Returns true if the path is closed.

A closed path is a path that forms a loop by starting and ending at the same vertex.

Converts a mutable view into an immutable view.

Splits the path into two immutable paths at the given vertex.

Given a path $\overrightarrow{(A,\cdots,M,\cdots,B)}$, splitting at the vertex $M$ results in the paths $\overrightarrow{(A,\cdots,M)}$ and $\overrightarrow{(M,\cdots,B)}$.

Splitting a path does not mutate its graph in any way (unlike ArcView::split_with or FaceView::split, for example). To split a graph along a path (and thus mutate the graph) use MeshGraph::split_at_path.

It is not possible to split a path at its back or front vertices.

Errors

Returns an error if the given vertex cannot be found or the path cannot be split at that vertex.

Gets an iterator over the vertices in the path.

Gets an iterator over the arcs in the path.

Extrudes the contour of a boundary path.

A path is a boundary path if all of its arcs are boundary arcs. Extruding the path transforms the vertices along the path in order using the given function and inserts a face between the path and its extruded contour.

Unlike extruding individual arcs, extruding the contour of a path inserts a single face in which all involved arcs participate.

Returns the inserted face.

Errors

Returns an error if the path is not a boundary path.

Extrudes the surface of a closed path.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

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

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.