Functions | |
| def | rand |
| Returns a random integer in the range [0, n-1] inclusive. | |
| def | sqr_dist |
| The square of the distance between the given points. | |
| def | sqr_dist_3d |
| The square of the distance between the given points. | |
| def | sample_poisson_uniform |
| Gives a Poisson sample of points of a rectangle. | |
| def | sample_poisson |
| Gives a Poisson sample of points of a rectangle with an arbitrary distance function between points. | |
| def | sample_poisson_3d |
| Gives a Poisson sample of points of a box (3D rectangle). | |
Tutorial: http://www.luma.co.za/labs/2008/02/27/poisson-disk-sampling/
| def poisson_disk.rand | ( | n | ) |
Returns a random integer in the range [0, n-1] inclusive.
Definition at line 27 of file poisson_disk.py.
| def poisson_disk.sample_poisson | ( | width, | ||
| height, | ||||
| r_grid, | ||||
| k | ||||
| ) |
Gives a Poisson sample of points of a rectangle with an arbitrary distance function between points.
| width | The width of the rectangle to sample | |
| height | The height of the rectangle to sample | |
| r_grid | r_grid[x, y] is the mimum distance between points around x, y, in terms of rectangle units. | |
| k | The algorithm generates k points around points already in the sample, and then check if they are not too close to other points. Typically, k = 30 is sufficient. The larger k is, the slower th algorithm, but the more sample points are produced. |
Definition at line 137 of file poisson_disk.py.
| def poisson_disk.sample_poisson_3d | ( | width, | ||
| height, | ||||
| depth, | ||||
| r_grid, | ||||
| k | ||||
| ) |
Gives a Poisson sample of points of a box (3D rectangle).
| width | The width of the box to sample | |
| height | The height of the box to sample | |
| depth | The depth of the box to sample. | |
| r_grid | r_grid[x, y, z] is the mimum distance between points around x, y, z, in terms of rectangle units. | |
| k | The algorithm generates k points around points already in the sample, and then check if they are not too close to other points. Typically, k = 30 is sufficient. The larger k is, the slower th algorithm, but the more sample points are produced. |
Definition at line 220 of file poisson_disk.py.
| def poisson_disk.sample_poisson_uniform | ( | width, | ||
| height, | ||||
| r, | ||||
| k | ||||
| ) |
Gives a Poisson sample of points of a rectangle.
| width | The width of the rectangle to sample | |
| height | The height of the rectangle to sample | |
| r | The mimum distance between points, in terms of rectangle units. For example, in a 10 by 10 grid, a mimum distance of 10 will probably only give you one sample point. | |
| k | The algorithm generates k points around points already in the sample, and then check if they are not too close to other points. Typically, k = 30 is sufficient. The larger k is, the slower th algorithm, but the more sample points are produced. |
Definition at line 59 of file poisson_disk.py.
| def poisson_disk.sqr_dist | ( | x0, | ||
| y0, | ||||
| x1, | ||||
| y1 | ||||
| ) |
| def poisson_disk.sqr_dist_3d | ( | x0, | ||
| y0, | ||||
| z0, | ||||
| x1, | ||||
| y1, | ||||
| z1 | ||||
| ) |
1.5.8