Skip to main content

poisson_disk_sampling

Function poisson_disk_sampling 

Source
pub fn poisson_disk_sampling(
    points: &[DVector<f64>],
    n_points: usize,
    min_distance: f64,
    seed: u64,
    max_iter: usize,
) -> Vec<DVector<f64>> ⓘ
Expand description

Poisson disk sampling.

Randomly selects points while enforcing a minimum distance between all selected points. If the desired number of points cannot be reached within max_iter attempts, fewer points are returned.

§Arguments

  • points - Original N-dimensional points.
  • n_points - Desired number of points to sample.
  • min_distance - Minimum distance between any pair of selected points.
  • seed - Random seed.
  • max_iter - Maximum number of random selection attempts.

§Returns

A vector of sampled points (at most n_points).