new PointDistribution()
This module is used to create different point distributions that can be
turned into different tile sets when made into a graph format. There are
various different distributions that can be used to create interesting
tile patterns when turned into a voronoi diagram.
- Tutorials:
-
- Tutorial: Point-Distributions
Methods
-
staticPointDistribution.exports.circular(bbox, d){Array.<Vector>}
Not Implemented Yet
-
Creates a circular distribution of points in a particular bounding box with a particular average distance between points.
Name Type Description bboxRectangle The bounding box to create the points in dnumber Average distance between points Returns:
Type Description Array.<Vector> The list of randomly distributed points -
staticPointDistribution.exports.hexagon(bbox, d, flatTop, w, h){Array.<Vector>}
-
Creates a uniform hexagonal distribution of points in a particular bounding box with a particular distance between points. The hexagons can also be specified to have a particular width or height as well as creating hexagons that have "pointy" tops or "flat" tops. By default it makes flat tops.
Name Type Default Description bboxRectangle The bounding box to create the points in dnumber Average distance between points flatTopboolean true optional Create hecagons with flat tops by default. Otherwise go with the pointy top hexagons. wnumber The width of the hexagon tiles hnumber The height of the hexagon tiles Returns:
Type Description Array.<Vector> The list of randomly distributed points -
staticPointDistribution.exports.jitteredGrid(bbox, d, seed, m){Array.<Vector>}
Create a jittered grid based random blue noise point distribution.
-
Creates a blue noise distribution of points in a particular bounding box with a particular average distance between points. This is done by creating a grid system and picking a random point in each grid. This has the effect of creating a less random distribution of points. The second parameter m determins the spacing between points in the grid. This ensures that no two points are in the same grid.
Name Type Default Description bboxRectangle The bounding box to create the points in dnumber Average distance between points seednumber null optional If specified use a local seed for creating the point distribution. Otherwise, use the current global seed for generation mnumber 0 optional Maximum distance away from the edge of the grid that a point can be placed. This acts to increase the padding between points. This makes the noise less random. This number must be smaller than d. Returns:
Type Description Array.<Vector> The list of randomly distributed points -
staticPointDistribution.exports.poisson(bbox, d){Array.<Vector>}
Create a blue noise distribution of points using poisson disk sampling.
-
Creates a poisson, or blue noise distribution of points in a particular bounding box with a particular average distance between points. This is done by using poisson disk sampling which tries to create points so that the distance between neighbors is as close to a fixed number (the distance d) as possible. This algorithm is implemented using the poisson dart throwing algorithm.
Name Type Description bboxRectangle The bounding box to create the points in dnumber Average distance between points Returns:
Type Description Array.<Vector> The list of randomly distributed points -
staticPointDistribution.exports.random(bbox, d, seed){Array.<Vector>}
-
Creates a random distribution of points in a particular bounding box with a particular average distance between points.
Name Type Default Description bboxRectangle The bounding box to create the points in dnumber Average distance between points seednumber null optional If specified use a local seed for creating the point distribution. Otherwise, use the current global seed for generation Returns:
Type Description Array.<Vector> The list of randomly distributed points -
staticPointDistribution.exports.recursiveWang(bbox, d){Array.<Vector>}
Not Implemented Yet
-
Creates a blue noise distribution of points in a particular bounding box with a particular average distance between points. This is done by using recursive wang tiles to create this distribution of points.
Name Type Description bboxRectangle The bounding box to create the points in dnumber Average distance between points Returns:
Type Description Array.<Vector> The list of randomly distributed points -
staticPointDistribution.exports.square(bbox, d){Array.<Vector>}
-
Creates a square grid like distribution of points in a particular bounding box with a particular distance between points.
Name Type Description bboxRectangle The bounding box to create the points in dnumber Average distance between points Returns:
Type Description Array.<Vector> The list of randomly distributed points