Shatter a figure along its own structure

Breaking a rock is a solved problem: scatter seeds, take the cells, done. A figure is not a rock. It is mostly thin parts, and a cell pattern that ignores where those parts are will cut along them rather than between them.

The same posed figure breaking into twelve pieces. Left: cells seeded on a jittered grid. Right: one seed per body part.

On the left the seams ignore the body. The head is fused to a shoulder in one piece, both legs come away as a single slab, a hand is a detached sliver, and a diagonal cut runs across the torso that no impact would produce. On the right the same twelve cells give a head, a chest, a belly, a pelvis, and two segments per limb, because every cell is centered on material and every seam falls in a gap.

The rule underneath it

A Voronoi cell boundary is the set of points equidistant from two seeds, so where the boundary falls is decided entirely by where the seeds are. Put a seed on each part and the boundaries land in the gaps between parts, because that is where the equidistant points are. Put seeds anywhere else and the boundaries land anywhere else.

That gives a one-line version of the whole technique: a seed is a claim that this piece of material stays together. Everything about how a shatter reads follows from the seed positions, and nothing about it follows from the cell code, which is identical in both halves above.

Sizing the seeds against the parts

The failure only appears when cells are large relative to the parts. Here the limbs are 0.15 across and fourteen uniform seeds give cells around 0.42, nearly three times the limb width, so a boundary crossing an arm has room to leave a shard with no thickness. Push the seed count up until cells are smaller than the limbs and both approaches look similar, at the cost of a great many pieces.

Which is the useful trade to know: seed placement matters most when you want few, large, readable pieces. A thousand-piece disintegration does not need any of this. A body breaking into a dozen recognizable parts needs all of it.

Where to put the seeds

Cut the blended field, not the parts

One thing worth getting right the first time. The figure is built with smin, so the shoulder is a blend of torso and arm and belongs to neither. If you cut each part separately and then union the pieces, the blend region is claimed twice and the pieces overlap there.

float body  = figure(p, hero);    // the whole blended field
float piece = max(body, gap - edge);   // cut THAT

Cutting the finished field means the pieces tile it exactly: every point inside the figure belongs to exactly one cell, so the pieces fit together with no overlap and no hole, whatever the blend did.

Rules of thumb

  1. Seed placement is the entire look of a shatter. The cell code is the same either way.
  2. A seed says "this material stays together". Put one on each part you want to survive.
  3. Never seed a joint. Seed the bones, and the joints become the seams.
  4. The problem only exists when cells are bigger than the parts, which is exactly the case where you wanted few readable pieces.
  5. Cut the blended field, not the individual parts, or pieces overlap at every blend.
  6. The cell boundary is (F2 − F1)/2. F1 alone gives you blobs, not seams.

All 61 notes How to use them Credits