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: TriangulationA 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 duplicate 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: PartialOrd + Coord + Vector<C>> PartialOrd for VoronoiDiagram<C>
impl<C: PartialOrd + Coord + Vector<C>> PartialOrd for VoronoiDiagram<C>
impl<C: Eq + Coord + Vector<C>> Eq for VoronoiDiagram<C>
impl<C: Coord + Vector<C>> StructuralPartialEq for VoronoiDiagram<C>
Auto Trait Implementations§
impl<C> Freeze for VoronoiDiagram<C>
impl<C> RefUnwindSafe for VoronoiDiagram<C>where
C: RefUnwindSafe,
impl<C> Send for VoronoiDiagram<C>
impl<C> Sync for VoronoiDiagram<C>
impl<C> Unpin for VoronoiDiagram<C>where
C: Unpin,
impl<C> UnwindSafe for VoronoiDiagram<C>where
C: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more