Fracture Voronoi

284 votes
Version: 
1.1

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.
Materials:
- 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.
Hierarchy:
- 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 :)

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

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
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?

----------------------
www.blinkimage.com

Garp's picture

Yeah! Joey's here!! Thanks

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

Joe007's picture

Great script Garp!

Great script Garp!

Garp's picture

Sorry for the late answer. I

Sorry for the late answer.
I tried the various solutions and they all seem to do the trick. Thank you guys.
I'll go for the 'at time 0' though. Not because it's mine, but it's the shortest to type! ;)

And a big thanks to everybody else for the kind words.
Much appreciated.

artrager's picture

Thanks Garp! I have been

Thanks Garp!

I have been modeling landscape elements of rocks and stones by hand. With a few clicks this script produces far better results in a fraction of the time! (pun intended ;)

Comment viewing options

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