Fracture Voronoi

290 votes

This script breaks any mesh while preserving its volume.

Additional Info: 

v1.0: The object is broken in a number of chunks equal to 'Nb Parts' to the power of 'Iterations', using Voronoi cells. The final number appears on the 'Break' button.
The creation process is visible in the viewport.
For a similar result, it is faster to use several iterations with a small number of parts than creating all the parts in one iteration.
Note that the original object is just hidden, not deleted.

v1.1: In this version, the code has been improved and runs much faster. But there is no viewport feedback any more.
- the outer faces keep their original material IDs and the new faces are assigned a unique ID. The value that appears by default is the highest ID in use (by the original object) + 1.
- mapping coordinates (if any) are preserved and somehow 'projected' onto the new faces.
- an extra planar mapping is applied to all the pieces at once and set on its own channel, typically for use with 3D procedural maps, so the pattern flows continuously from piece to piece but sticks to them when they are moved apart.
- when using several iterations, it is possible to keep the intermediate generations of parts.
- when linked, each part is parented to the one it is derived from.
- generations are set on their own layers, which are hidden except for the last one.

Enjoy :)

FractureVoronoi_v1.1.ms10.85 KB
FractureVoronoi_v1.0.ms4.67 KB


Comment viewing options

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

Thanks for the speedy reply

Thanks for the speedy reply Garp :)

Garp's picture

Thanks for the feedback,

Thanks for the feedback, tumblingweed.

I haven't played much with particles, but surely there's a way to keep materials and mapping when replacing particles with objects. Someone else might step in.
Or maybe you're better off asking on a regular 3ds max forum, like
Sorry I can't be of more help mate.

tumblingweed's picture

Awsome script I'v been having

Awsome script I'v been having endless hours of fun with it. I'm fairly new to Max and I'm having some trouble with keeping my materials on the object i want to fracture, After I break my object up the texture remains on it but when I use particle flow to destroy the object (using sdeflectors with some scripting I picked up from a tutorial) the materials on my object disappear leaving a stock bland colour. After I hide the original object and use the particle flow to generate the new object it doesnt appear on my view port anymore either. I have hunted all over google for an answer and just decided to ask for help. Attatched is the image of my object after I use the break option.

Kind Regards

planet_rendered.jpg 34.78 KB
Garp's picture

The script uses repeatedly

The script uses repeatedly Slice (with Remove Top or Bottom) + Cap Holes modifiers. So it has the same limitations. With hollow objects, like a Tube primitive, max does a 'best guess' to cap holes with a concave contour and sometimes a polygon goes the wrong way.
Try to break the object manually a couple of times first.

SepiaRainfall's picture

Hi, thanks for sharing this

Hi, thanks for sharing this script.

I tried using this script to break a hollow object. It creates geometries inside the object. Is there a way to change that?

Garp's picture

Nice tip, artrager. To save

Nice tip, artrager.
To save time, you can use the hold/fetch shortcuts instead of saving ;)

artrager's picture

Perfect for stone walls! I

Perfect for stone walls! I use the manual iteration technique: Make an initial break, choose the largest resultant, break, choose again, break, and so on... This can be done rather quickly and is somewhat controllable. Since there is no undo, I save the scene each time if the result was satisfactory or reopen the last save if it wasn't. When all the stones are created I chamfer the edges, check for flaws, make repairs, then add modifiers to taste!

Garp's picture

The amount of calculation

The amount of calculation grows exponentially with Nb Parts as it deals with pairs of cells, not just cells. That's why I added an Iterations parameter. But as you noticed, the lower the number of iterations the more fractures across the whole model for the same amount of final pieces.
However it shouldn't be that long on your machine. On a 5 years old computer (a single Athlon at 1.97GHz and 1GB of RAM on XP32) 1 iteration of 100 parts takes about 50 seconds (and around 20 minutes for 1000 parts). With your specs it should be a lot faster.

But for a stone wall this script might not be the best way to go, as you'll probably get some very big chunks and some very small ones.

birket's picture

Really great script and just

Really great script and just might save me on a difficult stone wall I am trying to model.

It seems the best way to break a wall into, for example, 1000 parts is to have Nb Parts as 10 and Iterations set to 3. However, this creates large, visible straight lines in the finished wall.

Presumably, leaving iterations to 1 but upping Nb Parts instead would solve this, however, even trying to set Nb Parts to 100 on my machine (quad core, 8GB, XP64) the machine sits there for ages (as yet it hasn't finished building!).

Is this just the nature of the script?


Garp's picture

Yeah! Joey's here!! Thanks

Yeah! Joey's here!!
Thanks for the point, buddy :)
(and about time too!)

Comment viewing options

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