poissoned

Multi-dimensional Poisson disk sampling

poissoned is an R implementation of the Poisson disk sampling algorithm from Bridson’s paper - Fast Poisson Disk Sampling in Arbitrary Dimensions

What’s in the box

Installation

This 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'))

2D Poisson Disk Sampling

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)

3D Poisson Disk Sampling

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()