Springs, ropes, cloth, soft bodies
Skill ferret-physics-stretch · download all skills · SKILL.md
When to use#
A rope bridge, a bungee, a curtain, a flag, a jelly.
The model#
Springs and ropes are links with E, area, damping, rest length, yieldStrain (permanent set) and breakStrain (snap); strength held still is breakStrain × E × area. Cloth and soft bodies are not kernel bodies: particles advanced by their own solver with a fixed step and a fixed number of passes, so replays are identical. They meet the world through colliders you give them and read gravity and wind from the host.
Steps#
- Enable
stretch; build withcap.rope({...}),Cloth,SoftBody. - Pin the top row for a curtain (
pinned: 'top'); add colliders (sphere,plane,box, rigid bodies) tocloth.colliders. - Name links you care about; events
stretch:yield,stretch:break. - Keep cloth to a handful on screen; check
cap.particles()against the budget.
Check afterwards#
A rope hangs F L / E A longer than rest; a curtain hangs about its length with the strain limit held; a load over the rating parts the rope.
What usually goes wrong#
- Cloth does not move: over the particle budget, capability off, or hand-stepped without calling
step. - Rubber cloth: raise
stiffness, lowerstrainLimit(1.05). - Passes through a body: not in
cloth.colliders, orthicknesssmaller than a step's travel: raisesubsteps. - A rope does not sag:
rope: false, or too stiff for the load. - Results differ between runs: variable
dt.
Files#
reference/stretch.md— Springs, ropes that sag and snap, cloth and flags, soft jelly bodies: everything that gives way instead of staying rigid.reference/api-physics-stretch.md— every export of@ferret/physics-stretchwith signature and doc commentreference/commands.md— 2 commands of these packages with their argumentsrecipes/structures-and-ropes.md— Six recipes: a rope that holds a load or snaps, a shear pin that protects the rest, a crate that breaks only at speed, a bungee that springs back, a wall that breaks under a blast, a curtain that hangs.