multiScatter

fun ShapeProvider.multiScatter(radii: List<Pair<Double, Double>>, distanceToEdge: Double = 0.0, tries: Int = 30, random: Random = Random.Default): List<Pair<Double, List<Vector2>>>(source)

Returns a list of pairs in which the first component is a radius and the second component a list of Vector2 positions of items with that radius.

multiScatter is a variation of scatter not limited to items of equal radius.

The radii argument contains a list of pairs with placementRadius and objectRadius.

The algorithm iterates a maximum of tries times trying to find 2D points that maintain the separations to each other specified via radii while keeping a distanceToEdge distance to the contour of the shape.