The ball's outline is a ring of point masses connected by edge springs. Each spring obeys Hooke's law, F = -k·(L − L₀), pulling a stretched edge back toward its rest length and pushing a compressed one back out. Squeezing at one point stretches the edges next to it and compresses the ones opposite.
A ring of springs alone would just cave in — real squeezable material also resists losing volume. Every frame the simulation measures the polygon's enclosed area and compares it to the ball's rest area; the shortfall becomes an outward pressure force along each edge's normal, exactly the gradient that grows the polygon back toward its original area. That's what makes the far side of the ball visibly bulge when you squeeze one spot.
Both the springs and the pressure term carry viscoelastic damping — a velocity-dependent drag proportional to how fast the shape is changing — so energy bleeds out of the oscillation and the ball settles back to round instead of ringing forever.
- Stiffness scales the spring constant k — stiffer material snaps back faster and resists denting more.
- Damping scales how quickly oscillation energy is absorbed — low damping lets the ball jiggle after release, high damping makes it settle almost immediately.