tsParticles - v0.0.0
    Preparing search index...

    A Poisson Disc Sampling routine - randomly but evenly place dots on the screen..

    Index

    Constructors

    • Create a new disc sampler

      Parameters

      • size: IDimension

        Size of the display in pixels

      • radius: number

        The minimum distance between points

      • retries: number

        Number of tries to make a new point before giving up

      • dimensions: number

        n-dimensional grid

      • OptionalfirstPoint: ICoordinates

        The first point position (optional)

      Returns PoissonDisc

    Properties

    active: number[]

    Array of active points indices

    cellSize: number

    The size of the grid cell = radius / sqrt(dimensions)

    cols: number

    Number of columns in the grid

    dimensions: number

    n-dimensional grid

    firstPoint: { x: number; y: number } | undefined
    grid: number[][]

    Grid array of point indices

    points: IPoissonPoint[]

    Array of points already plotted

    radius: number

    The minimum distance between points

    retries: number

    Number of tries to make a new point before giving up

    rows: number

    Number of rows in the grid

    Size of the display in pixels

    Methods

    • Add a new point to the points, grid and active arrays. Points array holds the point data and grid / active hold indices to the points array.

      Parameters

      Returns void

    • Get a random integer between min and max

      Parameters

      • min: number

        The minimum value

      • max: number

        The maximum value

      Returns number

      Random number from min to max

    • Take a single or n steps through the algorithm

      Parameters

      • steps: number

        Number of steps to take

      Returns Promise<void>