#procedural-generation #distribution #sampling #poisson-disk #bridson

fast_poisson

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

8 releases (1 stable)

1.0.1 Jun 26, 2023
1.0.0 Apr 28, 2023
0.5.2 Jul 12, 2022
0.5.0 May 7, 2021
0.1.0 Mar 25, 2021

#840 in Algorithms

Download history 97/week @ 2024-07-24 149/week @ 2024-07-31 127/week @ 2024-08-07 113/week @ 2024-08-14 195/week @ 2024-08-21 175/week @ 2024-08-28 131/week @ 2024-09-04 183/week @ 2024-09-11 137/week @ 2024-09-18 135/week @ 2024-09-25 92/week @ 2024-10-02 141/week @ 2024-10-09 118/week @ 2024-10-16 107/week @ 2024-10-23 120/week @ 2024-10-30 112/week @ 2024-11-06

466 downloads per month
Used in 3 crates

MIT/Apache

34KB
415 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

fast_poisson is tested and supported for Rust version 1.67 or later.

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

~6MB
~114K SLoC