Voronoi class

A Voronoi diagram computed from a Delaunay triangulation.

The Voronoi diagram is the dual of the Delaunay triangulation. Each Voronoi cell corresponds to an input point and contains all locations closer to that point than any other.

Constructors

Voronoi(Delaunay delaunay, {List<double>? bounds})
Creates a Voronoi diagram from a Delaunay triangulation.
Voronoi.fromPoints(List<Point> points, {List<double>? bounds})
Creates a Voronoi diagram from a list of points.
factory

Properties

cellCount int
Returns the number of cells (same as number of input points).
no setter
circumcenters List<Point>
The circumcenters of the Delaunay triangles (Voronoi vertices).
latefinal
delaunay Delaunay
The underlying Delaunay triangulation.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
xmax double
final
xmin double
The bounding box for clipping Voronoi cells.
final
ymax double
final
ymin double
final

Methods

cellArea(int i) double?
Returns the area of cell i.
cellCentroid(int i) Point?
Returns the centroid of cell i.
cellNeighbors(int i) List<int>
Returns the neighbors of cell i (cells sharing an edge).
cellPolygon(int i) List<Point>?
Returns the Voronoi cell polygon for point i. Returns null if the cell is degenerate or empty.
cellPolygons() Iterable<List<Point>>
Returns an iterable of all Voronoi cell polygons. Each polygon is a list of points forming the cell boundary.
contains(Point cellPoint, double x, double y) bool
Returns true if point (x, y) is inside the Voronoi cell for the given cellPoint.
containsIndex(int cellIndex, double x, double y) bool
Returns true if point (x, y) is inside the Voronoi cell at index cellIndex.
edges() Iterable<(Point, Point)>
Returns all Voronoi edges as pairs of points.
find(double x, double y) int
Finds the Voronoi cell containing point (x, y). Returns the index of the cell, or -1 if outside all cells.
findPoint(Point p) int
Finds the Voronoi cell containing point p.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited