Struct voronator::CentroidDiagram
source · pub struct CentroidDiagram<C: Coord + Vector<C>> {
pub sites: Vec<C>,
pub delaunay: Triangulation,
pub centers: Vec<C>,
pub cells: Vec<Polygon<C>>,
pub neighbors: Vec<Vec<usize>>,
}
Expand description
Represents a centroidal tesselation 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 centroid of each triangle
cells: Vec<Polygon<C>>
Stores the coordinates of each vertex of a cell, in counter-clockwise order
neighbors: Vec<Vec<usize>>
Stores the neighbor of each cell
Implementations§
source§impl<C: Coord + Vector<C>> CentroidDiagram<C>
impl<C: Coord + Vector<C>> CentroidDiagram<C>
sourcepub fn new(points: &[C]) -> Option<Self>
pub fn new(points: &[C]) -> Option<Self>
Creates a centroidal tesselation, if it exists, for a given set of points.
Points are represented here as a delaunator::Point
.
sourcepub fn from_tuple(coords: &[(f64, f64)]) -> Option<Self>
pub fn from_tuple(coords: &[(f64, f64)]) -> Option<Self>
Creates a centroidal tesselation, if it exists, for a given set of points.
Points are represented here as a (f64, f64)
tuple.
Trait Implementations§
source§impl<C: Clone + Coord + Vector<C>> Clone for CentroidDiagram<C>
impl<C: Clone + Coord + Vector<C>> Clone for CentroidDiagram<C>
source§fn clone(&self) -> CentroidDiagram<C>
fn clone(&self) -> CentroidDiagram<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 CentroidDiagram<C>
impl<C: Ord + Coord + Vector<C>> Ord for CentroidDiagram<C>
source§fn cmp(&self, other: &CentroidDiagram<C>) -> Ordering
fn cmp(&self, other: &CentroidDiagram<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<CentroidDiagram<C>> for CentroidDiagram<C>
impl<C: PartialEq + Coord + Vector<C>> PartialEq<CentroidDiagram<C>> for CentroidDiagram<C>
source§fn eq(&self, other: &CentroidDiagram<C>) -> bool
fn eq(&self, other: &CentroidDiagram<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<CentroidDiagram<C>> for CentroidDiagram<C>
impl<C: PartialOrd + Coord + Vector<C>> PartialOrd<CentroidDiagram<C>> for CentroidDiagram<C>
source§fn partial_cmp(&self, other: &CentroidDiagram<C>) -> Option<Ordering>
fn partial_cmp(&self, other: &CentroidDiagram<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