Place an object on the scene at a random position

You may look into poison disk sampling like this lib does. There are also various other methods, including distribution patterns that won’t need intersection checks at all with some restrictions. @prisoner849 also made a example with a distribution pattern.

The most simple you can do is iterating over a grid, randomly skipping steps and those steps you place a object you displace it randomly by a minor displacement not too far than the cell, ideally voronoi can help but will define the radius of space.

Poison disk might suit your case best but you didn’t further describe your scenario and usecase.

1 Like