Struct voronator::VoronoiDiagram
source · pub struct VoronoiDiagram<C: Coord + Vector<C>> {
pub sites: Vec<C>,
pub delaunay: Triangulation,
pub centers: Vec<C>,
pub neighbors: Vec<Vec<usize>>,
/* private fields */
}
Expand description
Represents a Voronoi diagram.
Fields§
§sites: Vec<C>
Contains the input data
delaunay: Triangulation
A Triangulation
struct that contains the Delaunay triangulation information.
centers: Vec<C>
Stores the circumcenter of each triangle
neighbors: Vec<Vec<usize>>
Stores the neighbor of each cell
Implementations§
source§impl<C: Coord + Vector<C>> VoronoiDiagram<C>
impl<C: Coord + Vector<C>> VoronoiDiagram<C>
sourcepub fn new(min: &C, max: &C, points: &[C]) -> Option<Self>
pub fn new(min: &C, max: &C, points: &[C]) -> Option<Self>
Creates a Voronoi diagram, if it exists, for a given set of points.
Points are represented here as anything that implements [delaunator::Coord
and delaunator::Vector<Coord>
].
delaunator::Coord
: ./delaunator/trait.Coord.html
sourcepub fn with_bounding_polygon(
points: Vec<C>,
clip_polygon: &Polygon<C>
) -> Option<Self>
pub fn with_bounding_polygon( points: Vec<C>, clip_polygon: &Polygon<C> ) -> Option<Self>
Creates a Voronoi diagram, if it exists, for a given set of points bounded by the supplied polygon.
Points are represented here as anything that implements [delaunator::Coord
and delaunator::Vector<Coord>
].
delaunator::Coord
: ./delaunator/trait.Coord.html
Trait Implementations§
source§impl<C: Clone + Coord + Vector<C>> Clone for VoronoiDiagram<C>
impl<C: Clone + Coord + Vector<C>> Clone for VoronoiDiagram<C>
source§fn clone(&self) -> VoronoiDiagram<C>
fn clone(&self) -> VoronoiDiagram<C>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<C: Ord + Coord + Vector<C>> Ord for VoronoiDiagram<C>
impl<C: Ord + Coord + Vector<C>> Ord for VoronoiDiagram<C>
source§fn cmp(&self, other: &VoronoiDiagram<C>) -> Ordering
fn cmp(&self, other: &VoronoiDiagram<C>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<C: PartialEq + Coord + Vector<C>> PartialEq<VoronoiDiagram<C>> for VoronoiDiagram<C>
impl<C: PartialEq + Coord + Vector<C>> PartialEq<VoronoiDiagram<C>> for VoronoiDiagram<C>
source§fn eq(&self, other: &VoronoiDiagram<C>) -> bool
fn eq(&self, other: &VoronoiDiagram<C>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<C: PartialOrd + Coord + Vector<C>> PartialOrd<VoronoiDiagram<C>> for VoronoiDiagram<C>
impl<C: PartialOrd + Coord + Vector<C>> PartialOrd<VoronoiDiagram<C>> for VoronoiDiagram<C>
source§fn partial_cmp(&self, other: &VoronoiDiagram<C>) -> Option<Ordering>
fn partial_cmp(&self, other: &VoronoiDiagram<C>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more