Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Point ¶
Point is a 2D point.
func Sample2D ¶
func Sample2D(distance float64, kTries int, bounds Bounds, start *Point, source rand.Source) []Point
Sample2D generates a set of 2D points using Poisson-disc sampling, which ensures that no two points are closer than a specified minimum distance.
Parameters:
- distance: The minimum distance between any two points.
- kTries: The number of attempts to generate a new point around an active point before removing the active point from consideration.
- bounds: The rectangular bounds within which points should be generated.
- start: An optional starting point. If nil, a random point within the bounds is used.
- source: A random source for repeatability.
Returns:
- A slice of points that satisfy the Poisson-disc sampling criteria.
Click to show internal directories.
Click to hide internal directories.