Voronoi Cells

26 votes
Version: 
1

Simple script that divides a box (bounding volume) in the specified number of Voronoi cells.

Additional Info: 

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)

Random notes:
- 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.

Enjoy :)

Version Requirement: 
3ds max 9 or higher
Video URL: 
AttachmentSize
VoronoiCells.ms25.48 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Garp's picture

It's very different. It works

It's very different.
It works only on boxes (using an object's bounding box).
It has complete control over the positions of the cell centers.
There are no iterations.
So I guess it depends on what you're after.

W DIGITAL's picture

is fracture voronoi the

is fracture voronoi the better script, or does this do something else?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.