VoronoiDiagram

class VoronoiDiagram(val delaunayTriangulation: DelaunayTriangulation, val bounds: Rectangle) : AbstractVoronoiDiagram(source)

Constructors

Link copied to clipboard
constructor(delaunayTriangulation: DelaunayTriangulation, bounds: Rectangle)

Properties

Link copied to clipboard
open override val bounds: Rectangle

The rectangular region cells are clipped to.

Link copied to clipboard
val circumcenters: List<Vector2>
Link copied to clipboard

The triangulation whose points are the Voronoi sites.

Link copied to clipboard
val vectors: List<Vector2>

Functions

Link copied to clipboard
open fun cellArea(i: Int, contour: ShapeContour = cellPolygon(i)): Double

The (signed) area of cell i.

Link copied to clipboard
open fun cellCentroid(i: Int, contour: ShapeContour = cellPolygon(i)): Vector2

The centroid of cell i.

Link copied to clipboard
open fun cellCentroids(): List<Vector2>

The centroids of every cell, in point order.

Link copied to clipboard
open override fun cellPolygon(i: Int): ShapeContour

The Voronoi cell polygon for site i (index into triangulation's points), clipped to bounds.

Link copied to clipboard
open fun cellPolygons(): List<ShapeContour>

The Voronoi cell polygons for every site, in point order.

Link copied to clipboard
open override fun internalEdges(): Pair<List<Vector2>, List<IntArray>>

The edges dual to the interior halfedges of the Delaunay triangulation (connecting the circumcenters of adjacent triangles), restricted to those with both endpoints strictly inside bounds. Since bounds is convex such an edge never touches the boundary.

Link copied to clipboard
open override fun neighbors(cellIndex: Int): Sequence<Int>

Indices of the cells adjacent to cell cellIndex.