#sampling #distribution #poisson-disk #sampling-distribution #bridson

fast_poisson

An implementation of Bridson's algorithm for fast Poisson disk sampling

9 releases (2 stable)

1.0.2 Mar 26, 2025
1.0.1 Jun 26, 2023
1.0.0 Apr 28, 2023
0.5.2 Jul 12, 2022
0.2.0 Mar 29, 2021

#495 in Algorithms

Download history 222/week @ 2025-06-13 207/week @ 2025-06-20 129/week @ 2025-06-27 194/week @ 2025-07-04 220/week @ 2025-07-11 362/week @ 2025-07-18 218/week @ 2025-07-25 274/week @ 2025-08-01 221/week @ 2025-08-08 283/week @ 2025-08-15 327/week @ 2025-08-22 325/week @ 2025-08-29 337/week @ 2025-09-05 382/week @ 2025-09-12 355/week @ 2025-09-19 386/week @ 2025-09-26

1,530 downloads per month
Used in 3 crates

MIT/Apache

35KB
417 lines

fast_poisson

Docs Crates.io CI

This is a library for generating Poisson disk distributions using Bridson's algorithm.

Properties of Poisson disk distributions include no two points being closer than a certain radius and the distribution uniformly filling the space. Poisson disk distributions' blue noise properties have a variety of applications in procedural generation, including textures, worlds, meshes, and item placement.

Usage

A simple example to generate a Vec containing a 2D Poisson distribution within [0, 1) in each dimension:

use fast_poisson::Poisson2D;

fn main() {
    let poisson = Poisson2D::new().generate();
}

See the documentation for more.

MSRV

Testing is only performed on the current stable and beta versions of Rust. While older versions may have no problems, no guarantees are made.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~5–24MB
~406K SLoC