VoronoiGrid
Quick facts | |
---|---|
Grid | VoronoiGrid |
CellType | NGonCellType |
CellDir | CellDir |
CellRotation | CellRotation |
Bound | None |
Properties | 2d, Planar, Finite |
Creates a grid from a Voronoi diagram based on a set of input points. RedBlobGames has a good description of using a Voronoi grid in games.
VoronoiGridOptions
ClipMin/ClipMax
Limits the area in which cells are considered to be. Defaults to "large enough".
This ensures that all cells are finite, which makes a lot of Voronoi algorithms simpler.
LloydRelaxationIterations
Smooths the positions of the points with Lloyd's Algorithm. Larger values gives a smoother result.
BorderRelaxation
Affects behaviour during Lloyd relaxation.
BorderRelaxation.Pin
keeps outermost points fixed, while BorderRelaxation.Relax
allows them to move, causing the points to contract inwards with each iteration.
Cell co-ordinates
The x value is corresponds to the index of the input point that this cell is based on. y and z values are unused.