01 / THE SHEET IN 3D
Pull it. Cut it.
Drag cloth to pull · drag space to orbit · scroll to zoom
SHAPE FROM TINY CONSTRAINTS
A sheet of 165 particles joined by 584 links. Gravity and wind push the particles. A solver keeps nudging every link back to its length. Pin it, pull it, cut it, drop it on a ball.
01 / THE SHEET IN 3D
Drag cloth to pull · drag space to orbit · scroll to zoom
02 / CONSTRAINT MAP
Drawn to scale in model units. Each line is one link, coloured by how far it is from its rest length. Hover a link to read it; drag a dot to pull it.
WHAT’S HAPPENING
TRY THIS
The sheet is 165 particles on a 15 × 11 grid, 0.2 units apart. Each neighbouring pair is joined by a link (a distance constraint) with a rest length: across, down, and both diagonals of every square, 584 links in all. The diagonals stop the squares folding flat into diamonds (shear).
Every 1/120 s of model time the model does two things. 1. Predict. Each free particle keeps moving the way it was moving, minus a little damping, and gravity and wind are added: xnew = x + (x − xprev)·0.994 + a·Δt². This is Verlet integration: velocity is never stored, it is the gap between the last two positions. 2. Correct. The solver then visits every link 8 times. For a link that is too long or too short it moves both ends along the link by (length − rest) × stiffness, shared out by inverse mass. A pinned particle has inverse mass zero, so its neighbour takes the whole correction. After each pass, particles inside the ball are pushed out to its surface and nothing may go below the floor.
This is position-based dynamics. Links are not springs: there is no spring constant. Stretch is whatever error is left after 8 passes. More load, a lower stiffness or a longer chain of links all leave more of it.
Wind is an acceleration toward +z of wind × (0.6 + 0.4·sin(2t + x)), so it gusts across the sheet. Sag on the readout is the distance from the straight line between the two corner pins down to the lowest particle on the top edge. Volume (soft block) splits each of the 64 small cubes into six tetrahedra and adds up their volumes. Motion is the average of |x − xprev| ÷ Δt.
Grab pins the particle you hold to your pointer for as long as you hold it, then lets it go. Dragging a pin moves its anchor. Cut removes every link your stroke crosses on screen, then every face that has lost an edge, which is what the model’s own seam cut does.
The model notes are in RESEARCH.md. Related labs: Chain Reaction Builder and Motion Design Playground.