Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface PoissonOpts

Options for samplePoisson.

Hierarchy

  • PoissonOpts

Index

Properties

density

density: number | DensityFunction

Density field function. Called for each new candidate point created by point generator and should return the poisson disc exclusion radius for the given point location. The related candidate point can only be placed if no other points are already existing within the given radius/distance. If this option is given as number, uses this value to create a uniform distance field.

index

index: ISpatialSet<ReadonlyVec>

Spatial indexing implementation for nearest neighbor searches of candidate points. Currently only @thi.ng/geom-accel types are supported and must be pre-initialized. The data structure is used to store all successful sample points.

Pre-seeding the data structure allows already indexed points to participate in the sampling process and so can be used to define exclusion zones. It also can be used as mechanism for progressive sampling, i.e. generating a large number of samples and distributing the process over multiple invocations of smaller sample sizes (see max option) to avoid long delays.

Optional iter

iter: number

Number of random walk steps performed before giving up on a candidate point. Increasing this value improves overall quality.

defaultvalue

1

Optional jitter

jitter: number

Step distance for the random walk each failed candidate point is undergoing. This distance should be adjusted depending on overall sampling area/bounds.

defaultvalue

1

max

max: number

Max number of samples to produce. Must be given, no default.

points

Point generator function. Responsible for producing a new candidate point within user defined bounds using provided RNG.

Optional quality

quality: number

Number of allowed failed consecutive candidate points before stopping entire sampling process (most likely due to not being able to place any further points). As with the iter param, increasing this value improves overall quality, especially in dense regions with small radii.

defaultvalue

500

Optional rnd

rnd: IRandom

Random number generator instance.

defaultvalue

SYSTEM (aka Math.random)

Generated using TypeDoc