Algorithm 2:
Fast Variable Density Poisson-Disc Sampling
| Inputs: rmin, background array, parameter k | 
| Select a point at random, add it to the list of points, add index 1 to the active list, and set N = 1 | 
| While: active list is not empty | 
| Randomly select index i from the active list | 
| Identify the poisson-disc parameter for this point, r(xi) | 
| Create k new points uniformly at random in the spherical annulus between radii r(xi) and 2r(xi) centered on xi | 
| For each: created point yj | 
| If yj is not within domain bounds, continue | 
| Compute the distance to those points with indices in the list of the background grid element that contains yj. | 
| If the minimum computed distance > r(yj) | 
| Add yj to the list of points, add index N + 1 to the active list and the lists of the background grid elements with points that may be within r(yj) according to Fig. 1b, and then increment N by 1. | 
| End If | 
| End For | 
| If none of the k points were valid, remove i from the active list. | 
| End While | 
| Outputs: List of points |