Simple script that divides a box (bounding volume) in the specified number of Voronoi cells.
There are several ways to define the bounding volume and cell centers.
Bounding volume from:
- picked object's bounding box
- already defined cell centers (plus offset)
Cell centers from:
- selection (uses each selected object's position)
- already defined bounding volume (minus offset), positionned at random
- text file (format: XXX YYY ZZZ per line)
- A bounding cage and cell points are created for visual feedback. They are not interactive. If you want to move the cell points to adjust the cell centers, you need to reselect them and click on From Selection to update the values in memory.
- Bounding volume and cell centers can be redefined any number of times before creation.
- Picked and selected objects are just hidden, not deleted.
- The From Text File option tests the validity of the values and allows corrections.
- Comments are possible in the text file after the coordinates. For example:
43.8 125.871 -37.85 south-east corner
is a valid line.
- The script expects at least two cell centers within the bounding volume. You can create a single center with From Selection and use From Cell Centers (plus an offset) to make a cubic bounding volume, then fill it with more cell points.
- The method being a brute force approach with no optimization, large numbers of cells should be avoided, unless you have plenty of time. The number of operations performed grows exponentially.
Etc. You can refer to the comments in the code for more info.