spade::handles

Enum VoronoiVertex

Source
pub enum VoronoiVertex<'a, V, DE, UE, F> {
    Inner(FaceHandle<'a, InnerTag, V, DE, UE, F>),
    Outer(DirectedVoronoiEdge<'a, V, DE, UE, F>),
}
Expand description

A handle to a vertex of the voronoi diagram.

Refer to DelaunayTriangulation for an example on how to extract the voronoi diagram from a triangulation.

Variants§

§

Inner(FaceHandle<'a, InnerTag, V, DE, UE, F>)

Refers to an inner vertex of the voronoi diagram.

An inner vertex refers to an inner face of the original Delaunay triangulation. Its position is the circumcenter of that face.

Displays several inner voronoi vertices in blue and an arrow towards the inner face to which they belong. Note that voronoi vertices are not necessarily located inside the convex hull.

Tuple Fields

§0: FaceHandle<'a, InnerTag, V, DE, UE, F>

The inner face handle to which this voronoi vertex refers.

§

Outer(DirectedVoronoiEdge<'a, V, DE, UE, F>)

Refers to an outer vertex of the voronoi diagram.

These vertices don’t have a well-defined position as they don’t have a dual inner face in the Delaunay triangulation. Instead, they are characterized by a dual outer edge (an edge that is part of the convex hull) of the underlying triangulation.

Rather than a position, these vertices can be better described by a half open line segment: The voronoi vertex is placed infinitely far away in the direction the line segment is pointing to. The line segment’s direction is the dual edge’s normal (i.e., the dual edge rotated by 90 degrees).

Displays 3 out of 6 outer Delaunay vertices. For each vertex, its dual outer edge is shown in blue. The line segment that points toward this vertex is shown in orange.

Tuple Fields

§0: DirectedVoronoiEdge<'a, V, DE, UE, F>

The outer directed edge handle dual to this voronoi vertex.

Implementations§

Source§

impl<'a, V, DE, UE, F> VoronoiVertex<'a, V, DE, UE, F>
where V: HasPosition, V::Scalar: Float,

Source

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

The position of this voronoi vertex.

Returns None if this vertex is an outer voronoi vertex. Otherwise, the returned position is the circumcenter of the dual Delaunay face.

Source

pub fn as_delaunay_face(&self) -> Option<FaceHandle<'a, InnerTag, V, DE, UE, F>>

Returns the dual delaunay face of this voronoi vertex.

Returns None if this is an outer voronoi vertex.

Source

pub fn out_edges(&self) -> Option<[DirectedVoronoiEdge<'a, V, DE, UE, F>; 3]>

Returns all directed voronoi edges going out of this vertex.

The edges are returned in counterclockwise order. Returns None if this is an outer voronoi vertex.

Source

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

Returns a voronoi edge going out of this vertex.

Auto Trait Implementations§

§

impl<'a, V, DE, UE, F> Freeze for VoronoiVertex<'a, V, DE, UE, F>

§

impl<'a, V, DE, UE, F> RefUnwindSafe for VoronoiVertex<'a, V, DE, UE, F>

§

impl<'a, V, DE, UE, F> Send for VoronoiVertex<'a, V, DE, UE, F>
where V: Sync, F: Sync, UE: Sync, DE: Sync,

§

impl<'a, V, DE, UE, F> Sync for VoronoiVertex<'a, V, DE, UE, F>
where V: Sync, F: Sync, UE: Sync, DE: Sync,

§

impl<'a, V, DE, UE, F> Unpin for VoronoiVertex<'a, V, DE, UE, F>

§

impl<'a, V, DE, UE, F> UnwindSafe for VoronoiVertex<'a, V, DE, UE, F>

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.