TESTER

poissondiscsampling

poissondiscsampling(x1, y1, x2, y2, min, max)

Poisson Disc Sampling - Produces points via Poisson-disc sampling, inside the bounding box. No two points will be closer than the defined radius r. Return a list of points.

Syntaxe

var pts = poissondiscsampling(x1=0, y1=0, x2=width(), y2=height(), min=100, max=30) ; // [x1,y1, x2,y2, x3,y3...]

Arguments

NameRequiredDefaultDescription
x1yes-x of bbox min
y1yes-y of bbox min
x2yes-x of bbox max
y2yes-y of bbox max
minyes-min distance between points
maxyes-max attempts to add neighboring point