spade::handles

Type Alias UndirectedEdgeHandle

Source
pub type UndirectedEdgeHandle<'a, V, DE = (), UE = (), F = ()> = DynamicHandleImpl<'a, V, DE, UE, F, UndirectedEdgeTag, InnerTag>;
Expand description

Handle to an undirected edge of a triangulation.

Use this handle to examine the edge’s surroundings, e.g. its origin and destination vertices or the adjacent face.

§Method overview

An undirected edge handle allows to explore the surroundings of an edge. This diagram shows which methods are available to extract information about the edge’s neighboring elements.

DirectedEdgeHandle

See also the handles module

Aliased Type§

struct UndirectedEdgeHandle<'a, V, DE = (), UE = (), F = ()> { /* private fields */ }

Implementations§

Source§

impl<'a, V, DE, UE, F> UndirectedEdgeHandle<'a, V, DE, UE, F>

Source

pub fn vertices(&self) -> [VertexHandle<'a, V, DE, UE, F>; 2]

Returns the edge’s two vertices.

The vertices are returned in any order.

Source

pub fn as_directed(&self) -> DirectedEdgeHandle<'a, V, DE, UE, F>

Converts this directed edge into an undirected edge handle.

Source

pub fn as_voronoi_edge(&self) -> UndirectedVoronoiEdge<'a, V, DE, UE, F>

Returns the dual edge in the Voronoi diagram.

Source

pub fn data(&self) -> &UE

Returns a reference to the data associated with this directed edge.

Use Triangulation::undirected_edge_data_mut to modify the edge data.

Source

pub fn is_part_of_convex_hull(&self) -> bool

Returns true if the outer face is adjacent to any side of this undirected edge.

Source§

impl<V, DE, UE, F> UndirectedEdgeHandle<'_, V, DE, UE, F>
where V: HasPosition,

Source

pub fn positions(&self) -> [Point2<V::Scalar>; 2]

Returns the end positions of this edge.

The positions are returned in any order.

Source

pub fn length_2(&self) -> V::Scalar

Returns the squared length of this edge

Source§

impl<V, DE, UE, F> UndirectedEdgeHandle<'_, V, DE, UE, F>
where V: HasPosition, V::Scalar: Float,

Source

pub fn distance_2(&self, query_point: Point2<V::Scalar>) -> V::Scalar

Returns the squared distance of a point to this edge.

Source

pub fn nearest_point(&self, query_point: Point2<V::Scalar>) -> Point2<V::Scalar>

Yields the nearest point on this edge.

Source

pub fn center(&self) -> Point2<V::Scalar>

Returns the center of this edge.

Source§

impl<V, DE, UE, F> UndirectedEdgeHandle<'_, V, DE, CdtEdge<UE>, F>

Source

pub fn is_constraint_edge(self) -> bool

Returns true if this edge is a constraint edge.

Trait Implementations§

Source§

impl<V, DE, UE, F> AsRef<UE> for UndirectedEdgeHandle<'_, V, DE, UE, F>

Source§

fn as_ref(&self) -> &UE

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<V, DE, UE, F> Debug for UndirectedEdgeHandle<'_, V, DE, UE, F>

Source§

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

Formats the value using the given formatter. Read more