Generating random points with defined minimum and maximum distance

前端 未结 4 1684
我在风中等你
我在风中等你 2020-12-11 06:34

I need algorithm ideas for generating points in 2D space with defined minimum and maximum possible distances between points.

Bassicaly, i want to find a good way to

4条回答
  •  温柔的废话
    2020-12-11 06:53

    A good option for this is to use Poisson-Disc sampling. The algorithm is efficient (O(n)) and "produces points that are tightly-packed, but no closer to each other than a specified minimum distance, resulting in a more natural pattern".

    https://www.jasondavies.com/poisson-disc/

提交回复
热议问题