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>
impl<'a, V, DE, UE, F> VoronoiVertex<'a, V, DE, UE, F>
Sourcepub fn position(&self) -> Option<Point2<V::Scalar>>
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.
Sourcepub fn as_delaunay_face(&self) -> Option<FaceHandle<'a, InnerTag, V, DE, UE, F>>
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.
Sourcepub fn out_edges(&self) -> Option<[DirectedVoronoiEdge<'a, V, DE, UE, F>; 3]>
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.
Sourcepub fn out_edge(&self) -> DirectedVoronoiEdge<'a, V, DE, UE, F>
pub fn out_edge(&self) -> DirectedVoronoiEdge<'a, V, DE, UE, F>
Returns a voronoi edge going out of this vertex.