PoissonDiscArray Op

PoissonDiscArray

Generates an array of evenly-spaced random points using Bridson's Poisson Disc sampling algorithm. Unlike RandomNumbersArray, points are guaranteed to maintain a minimum distance from each other, producing organic, non-overlapping distributions — ideal for natural-looking layouts such as particle fields, scatter patterns, or instanced object placement. Supports both 2D (XY) and 3D (XYZ) modes. Output is a flat array compatible with ArrayIterator (stride 2 or 3). Seeded PRNG ensures reproducible results.


Inputs

Port Type Default Description
Max Points Integer 100 Maximum number of points to generate. Actual count may be lower if the domain cannot fit more at the given minimum distance.
Mode Switch XY XY (2D) or XYZ (3D). Sets the array stride accordingly.
Random Seed Float 0 Seed for deterministic output.
Min Distance Float 0.1 Minimum spacing between any two points. Lower values = denser packing.
Max Candidates Integer 30 Attempts per active point before rejection. Higher values produce tighter packing but cost more.
Width Float 2 Sampling domain width.
Height Float 2 Sampling domain height.
Depth Float 2 Sampling domain depth. Only active in XYZ mode.
Center Origin Bool true When enabled, offsets all points so the distribution is centered around (0, 0, 0).

Outputs

Port Type Description
Array Out Array Flat coordinate array (stride 2 or 3), ready for ArrayIterator or PointCloudFromArray.
Total Points Number Number of points actually generated.
Array Length Number Total length of the output array.

Usage

Drop-in replacement for RandomNumbersArray in any patch using ArrayIterator. Connect Array Out to an ArrayIterator and use Transform to position instanced geometry at each sample point.

Algorithm

Uses Bridson's fast Poisson Disc sampling (O(n) complexity) with a seeded Mulberry32 PRNG for reproducibility.


Full Name
  • Ops.Patch.Pl397Wc.PoissonDiscArray
VisibilityLicense
  • MIT
Author


I see you

Click to redistribute 👀

Credits to https://cables.gl/user/Tibbrs for eyes blinking

New PoissonDiscArray Op based on Poisson Disc Distribution by Bridson https://cables.gl/op/Ops.Patch.Pl397Wc.PoissonDiscArray

Open In Editor

INPUT PORTS


Sampling

Max Points (Number: integer)
Mode index (Number: integer) XY  XYZ 

Sampling

Random Seed (Number)
Min Distance (Number)
Max Candidates (Number: integer)

Domain

Width (Number)
Height (Number)
Depth (Number)
Center Origin (Number: boolean)

OUTPUT PORTS


Array Out (Array)
Total Points (Number)
Array Length (Number)

Changelog

Patches using PoissonDiscArray

  • Examples
  • Public
  • My Patches