public final class PoissonDistributionJRUS extends Object
The algorithm in this class is a Fork of Martin Roberts’s tweak to Bridson's Algorithm for Poisson Disk sampling. This approach is faster and better than the Bridson Algorithm, and balances performance with distribution quality compared to Robert's tweak.
For more, see this anaylsis of different Poisson disk sampling functions.
Constructor and Description |
---|
PoissonDistributionJRUS() |
PoissonDistributionJRUS(long seed) |
Modifier and Type | Method and Description |
---|---|
List<processing.core.PVector> |
generate(double xmin,
double ymin,
double xmax,
double ymax,
double minDist)
Generates a random point set, having a poisson/blue noise distribution.
|
List<processing.core.PVector> |
generate(double xmin,
double ymin,
double xmax,
double ymax,
double minDist,
int rejectionLimit)
Generates a random point set, having a poisson/blue noise distribution.
|
List<processing.core.PVector> |
generate(double xmin,
double ymin,
double xmax,
double ymax,
int n)
Generates a poisson point set having
N points. |
List<processing.core.PVector> |
getPoints()
Returns the point set generated by most recent call to
generate() . |
public PoissonDistributionJRUS()
public PoissonDistributionJRUS(long seed)
public List<processing.core.PVector> getPoints()
generate()
.public List<processing.core.PVector> generate(double xmin, double ymin, double xmax, double ymax, double minDist, int rejectionLimit)
xmin
- x-coordinate of boundary minimumymin
- y-coordinate of boundary minimumxmax
- x-coordinate of boundary maximumymax
- y-coordinate of boundary maximumminDist
- minimum euclidean distance between any two pointsrejectionLimit
- the limit on the number of attempts to generate a
random valid point around the previous point. Generally
6 is sufficient.public List<processing.core.PVector> generate(double xmin, double ymin, double xmax, double ymax, double minDist)
xmin
- x-coordinate of boundary minimumymin
- y-coordinate of boundary minimumxmax
- x-coordinate of boundary maximumymax
- y-coordinate of boundary maximumminDist
- minimum euclidean distance between any two pointspublic List<processing.core.PVector> generate(double xmin, double ymin, double xmax, double ymax, int n)
N
points. After generating
an initial set of approximately N (hereafter N'
) points (the
actual number tends to overshoot the target by a few percent),
N'-N
points are removed from the initial set.xmin
- x-coordinate of boundary minimumymin
- y-coordinate of boundary minimumxmax
- x-coordinate of boundary maximumymax
- y-coordinate of boundary maximumn
- target size of poisson point setCopyright © 2023. All rights reserved.