0.2.5 • Published 1 year ago

@rbxts/poisson-disk-sampling v0.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Poisson Disk Sampling for roblox-ts

This module provides an implementation of Bridson's algorithm for Poisson Disk Sampling, a technique for randomly generating points within a given region while ensuring that they are distributed with a minimum and maximum distance from each other.

Installation

You can install this module using npm:

npm install @rbxts/poisson-disk-sampling

For navigable documentation,

Usage

import { PoissonDiskSampler } from "@rbxts/poisson-disk-sampling";

function example() {
  const sampler = new PoissonDiskSampler(
    { xMin: 0, xMax: 100, yMin: 0, yMax: 100 }, // region
    5, // minDistance
    5, // density (not yet implemented)
    30 // maxAttempts
  );

  sampler.getPoints().forEach((point) => {
    print(point.x, point.y);
  });
}

Todo

  • An implementation of Bridson's algorithm
  • Enable configuration of the algorithm, such as max attempts to generate a new random point in an annulus around each active point.
  • Various algorithm implementations, such as those that support variable density and parallelization.
  • N-dimensional generation
  • Documentation
0.2.1

1 year ago

0.2.0

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.1.0

1 year ago