Scattering Ellipses Without Overlapping
Seohyo asks "Is it possible to make scattered ellipses without overlapping?" She provides an example with ellipses of different sizes.
Attached is one way of doing this using the "Scatter_Evenly" node from my Cartan Node Library. This node requires a custom code module, poisson.py (included in the zipped example).
Scatter_Evenly fills a rectangular space (defined by the width and height parameters) with points that are guaranteed to be a minimum distance apart (based on a supplied "Point Size" parameter) using a Poisson distribution. The smaller the point size, the more points you get. Each seed produces a different random distribution.
You cannot predict ahead of time exactly how many points you will get. So if this matters to you, adjust the point size to produce more points than you need and then use a slice node to use just the first N points.
In the example shown here, I use a numbers node to define the total number of points and feed that both into a slice node and a random_numbers node. The random_number node defines the size (diameter) of each object. If all the objects were the same size you would not need the random_numbers node.
To get an attractive distribution you can adjust the seed value in the scatter_evenly node to produce different scatters and the seed value in the random_numbers node to try different size distributions. Of course you can also adjust the total number of points and the size range of each point.
If you want to produce a tightly packed distribution of randomly-sized objects you can set the point size parameter to a value slightly smaller than the maximum size of the objects and then reduce this value until overlaps begin to occur.
If this method doesn't work for you, please respond to this thread with your additional constraints and I will attempt another method.
John
- Scatter_Evenly_Screenshot.png 334 KB
- scatter_evenly.zip 4.29 KB
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac