HRLW Fracture POP
Replaces Nothing in TouchDesigner. Prefracture normally comes from another package; here it is a POP in the network, wired in ahead of HRLW Bodies.
Operator type
Hrlwfracture, labelHRLW Fracture.
What it does#
Cuts meshes into solid pieces. Each mesh is filled with seed points and cut into Voronoi cells, one plane at a time, with every cut filled in, so each piece is a closed solid: a sphere breaks into chunks, not shells, and concave meshes (a torus, a mug) cut exactly. A cell that crosses two separate parts is split into two pieces (Separate Disconnected Parts, on). It runs on the CPU when its input or a parameter changes, not every frame (Info CHOP cut_ms).
Quick start (beginner)#
- Triangles or quads into the first input (a Sphere POP, a Box POP, or an imported mug). Several objects: give each a
meshid. - Add an HRLW Fracture POP. Leave Pieces per Mesh at 20.
- Wire it straight into an HRLW Bodies POP (input 1) and turn Glue Prefractured Pieces on (default). Press Reset.
- Drop it on the ground: a glass dropped from about a metre onto a hard floor shatters; a ball thrown hard at its side knocks out the pieces it hits.
- To see just the cut, set meshid Output to Pieceid (every piece loose) or wire the Fracture POP into an HRLW Geometry POP directly.
Inputs and output#
| Input | What goes in |
|---|---|
| 1 | Triangles/quads split into meshes by meshid (none: one mesh). N, Tex, Color/Cd, materialid, textureid carry over to the pieces' outside; the cut faces take the materialid and textureid of their piece's outside (a broken glass is glass inside too). Every other attribute (static, glueid, your own; up to 4 components, 32 floats a point in all) comes through per piece under its own name and type. |
| 2 | Optional: your own seed points (P); with a meshid they only cut that mesh. |
Output attributes
| Attribute | Meaning |
|---|---|
P, N, Tex, Color |
as input; cut faces get Inside Color and a flat Tex projected on their plane (× Inside UV Scale per unit) so a material can tell the broken inside from the outside |
meshid |
the mesh each piece came from (or the pieceid, with meshid Output = Pieceid) |
pieceid |
1, 2, 3 ... across the whole output; 0 = not a piece (what a Merge POP gives a mesh merged in beside them) |
inside |
1 on cut faces |
cutid |
on cut faces, one integer per cut between two pieces, the same on both sides; -1 on the outside |
fractureid |
one integer per Fracture POP (below) |
v, glueid, gluestrength |
as input, where it has them; cut faces take their piece's (so pieces start at the input's velocity) |
The output keeps the input's attribute names, sizes and types (Cd or Color with 3 or 4 components; uv or Tex with 2 or 3; meshid, materialid and TextureId as int or float) so a Merge POP of pieces with the original geometry doesn't end up with duplicate colour attributes.
Parameters#
| Parameter (default) | What it does |
|---|---|
| Pieces per Mesh (20) | 1 to 5000 |
| Seed (0) | |
| Spread (Uniform) | Uniform through the volume, or Around Point: gathered round Point (within about Radius 0.25), which gives small pieces there and large ones further out, as round a hit |
| Point, Radius | Greyed out unless Spread is Around Point. |
| Separate Disconnected Parts (on) | |
| Inside Color (0.8 grey), Inside UV Scale (1) | |
| meshid Output (Input) | Input: pieces keep their mesh id (Bodies holds them glued). Pieceid: every piece is loose from the start. |
| Output to TouchDesigner (on) | Off: an HRLW Bodies POP wired straight in still gets the pieces (from memory), but TouchDesigner gets an empty POP, so nothing is copied out for it. Anything in between (Null, Transform) breaks the link; HRLW Bodies warns when it sees no pieces while a Fracture POP exists. |
Glued objects (with HRLW Bodies)#
With Glue Prefractured Pieces on, the pieces of each meshid start glued into one object. The cut faces between glued pieces are hidden (their points sit at the face centre, so the face has no area) and the pieces don't collide with each other, so a glass looks like one smooth piece. It breaks two ways, at Break Strength (50 g; 0 = never):
- a hit that would decelerate a piece past it (its share of the closing speed over about 10 ms) knocks that piece loose;
- a glued face tears when it carries more than that many times its share of the object's own weight (a blast from the Volume Solver, a liquid's push, a joint pulling).
Once a piece's glue goes, its cut faces show and it collides with the rest. A mesh merged in next to the pieces without a pieceid of its own stays a whole body of its own.
glueid (point attribute, 1 or more) glues across objects: every piece or whole mesh with the same glueid is one glued object, whichever Fracture POP (or none) it came from. Pieces of one object still weld at their cuts; different objects weld where their outside faces lie flat against each other (on one plane, facing each other, overlapping), so stacked bricks or a fractured wall on a fractured floor hold together. Faces that only touch at an edge or a point don't weld. 0 or no glueid: objects glue by meshid as before.
gluestrength (point attribute, read at each piece's first point) overrides Break Strength for that piece, in the same g's; between two pieces with different values the weaker one decides.
Several Fracture POPs#
Each Fracture POP numbers its pieces and cuts from 1 on its own and takes a fractureid no other live Fracture POP has (1, 2, 3 ..., the lowest free, kept while it exists). Merge their outputs into one HRLW Bodies POP and it tells objects apart by fractureid, pieceid and meshid.
Limits#
- Open meshes (a single sheet) are cut too, but a cut that doesn't close into an outline can't be filled; Info CHOP
open_cutscounts them and a warning says so. - Attributes other than
N,Tex, colour,materialid,textureid,v,glueidandgluestrengtharen't carried over. - Info CHOP:
pieces,meshes,open_cuts,cut_ms.