poissoned is an R implementation of the Poisson disk sampling
algorithm from Bridson’s paper - Fast Poisson Disk Sampling in
Arbitrary
Dimensions
poisson2d() generate samples in the XY planepoisson3d() generate samples in 3DThis package can be installed from CRAN
install.packages('ctypesio')
You can install from GitHub with:
# install.packages("devtools")
devtools::install_github("coolbutuseless/poissoned")
Pre-built source/binary versions can also be installed from R-universe
install.packages('poissoned', repos = c('https://coolbutuseless.r-universe.dev', 'https://cloud.r-project.org'))
library(poissoned)
pts <- poisson2d(w = 80, h = 60, r = 2)
par(mai = c(0, 0, 0, 0))
plot(pts, asp = 1, ann = FALSE, axes = FALSE, pch = 19, cex = 0.5)

library(rgl)
library(poissoned)
set.seed(1)
pts <- poisson3d(w = 10, h = 10, d = 10, r = 0.5)
rgl::points3d(pts, color = rainbow(nrow(pts)))
rgl::box3d()
