Cloth drape and flutter

2D twin of the 3D page: the same XPBD solver, shown from the side and from above on Blender-rendered props.

Switch to 3D

Presets

Playback

Fabric

Heavier, stiffer or softer cloth changes the folds; the size slider rebuilds the cloth.

Air and contact

Scene

Model checks

The science

What is modelled

A square sheet of fabric made of a grid of point masses joined by springs: stretch springs along the threads, shear springs on the diagonals and bending springs across two cells. It falls under gravity, feels air drag and wind, and collides with a table, a ball, the floor, a flag pole or a curtain rod. You can switch between four fabrics, change the density and stiffness, and grab the cloth with the pointer.

Equations

  • Each point has mass m = ρA h2 (areal density times cell area) and obeys Newton's law with gravity g = 9.81 m/s2.
  • Springs are solved with XPBD (extended position-based dynamics): a distance constraint with compliance α = 1/k gives a true Hooke spring F = k (L - L0) that stays stable at any stiffness. Stretch springs use k = Y (N/m), shear Y/2, bending b Y. Ten sub-steps per frame, two constraint passes each.
  • Air drag on every triangle: F = -½ ρair Cd A (vrel · n) |vrel · n| n, where vrel is the cloth velocity minus the wind and n the triangle normal; ρair = 1.2 kg/m3. Gusts modulate the wind speed with two sine waves.
  • Collisions: points are pushed out of a cylinder, a sphere or the floor along the surface normal (plus a 12 mm cloth thickness), and friction removes tangential motion up to μ × the push-out distance (Coulomb-like).
  • Energies: KE = Σ ½ m v2, PE = Σ m g y, elastic Σ ½ k (ΔL)2. The largest strain of the stretch springs is shown so you can see where the model stops behaving like cloth (real fabric barely stretches).

Checks run in the page

  • Free fall in vacuum against ½ g t2.
  • An 8-point chain hanging from one end settles to the static stretch Σ (weight below / k).
  • The drag force on a flat sheet in a steady 10 m/s updraft, read from the momentum it gains, against ½ ρair Cd A (U - v)2.
  • Live: no cloth point is inside an object or below the floor.

Honest simplifications

  • No self-collision: a cloth that folds over itself can pass through its own layers, and thin folds look thicker than real fabric. Collision shapes are simple analytic cylinders and spheres, not the full rendered meshes.
  • Fabric parameters (density, stiffness, drag) are typical orders of magnitude, not measurements of a specific textile. Real cloth is orthotropic and hysteretic (different along warp, weft and bias, with friction between threads); this model is isotropic and elastic with a simple damping term. Bending uses second-neighbour springs, which is crude compared with a hinge-energy model.
  • Air drag uses a constant coefficient on each triangle with no shielding, lift or turbulence, so a flag flaps from the drag and the gust pattern only, not from a wake instability.
  • Grid resolution is 36 x 36 in High and 24 x 24 in Low, so wrinkles finer than a few centimetres cannot appear.
What to try
  • Pick Drape over a table and compare Silk with Denim: the lighter, softer fabric hangs in tight folds, the stiff one stays in broad ones (bending stiffness).
  • Choose Flag in the wind, raise the wind speed and watch the gusts make the free edge flutter; the drag on each triangle follows 1/2 rho Cd A (v_rel . n)|v_rel . n|.
  • Tick Show the spring mesh, then Drag the cloth with the pointer and pull a corner: the largest spring strain graph shows where the fabric is stretched most.
Height of the cloth centre
Kinetic and elastic energy
Largest spring strain
Mechanical energy change
Made with 🟠 Blender