(require("compute/makeGeography/lloydVoronoi"))(w, h, n, tolFraction)
Calculate a voronoi diagram with some degree of equal capacity between voronoi cells.
Uses Lloyd's method.
Parameters:
Name | Type | Description |
---|---|---|
w |
number | number of discrete points wide of space to divide |
h |
number | number of points high |
n |
number | number of voronoi cells |
tolFraction |
number | fractional tolerance for relaxation. Maybe .01 is good. |
Returns:
Centroids (list of points) and voronoi d3 object