Cloth: Stretching and Bending
In the context of Position-Based Dynamics (PBD), the complex mechanical behaviors of cloth, such as its resistance to stretching and bending, are modeled through a system of geometric constraints. Instead of accumulating forces, the PBD framework directly manipulates the positions of the mesh vertices to satisfy these constraints in an iterative manner. This section will detail the formulation of fundamental constraints for cloth simulation.
Stretching Resistance via Distance Constraints
The primary characteristic of most textiles is their high resistance to stretching. In PBD, this property is enforced by constraining the distance between connected particles to remain close to its initial, or rest, distance. This is one of the simplest yet most crucial constraints in the PBD ecosystem (we have already seen this constraint in Example 32.4.1)
Example 33.1.1 (Stretching Constraint). Consider two particles, , with positions and , masses and , and a rest distance between them. The stretching constraint function is defined as the difference between the current distance and the rest distance: The goal is to find corrections and such that . The gradients of the constraint function with respect to the particle positions are: where is the unit vector along the axis connecting the two particles. Following the general PBD projection formula (32.4.4), the scalar Lagrange multiplier is computed as: where is the inverse mass of particle . The position corrections are then found by moving the particles along their respective gradient directions, scaled by their inverse mass and : These corrections, when applied, will move the particles to exactly satisfy the rest length. Note that the total correction is distributed between the particles based on their inverse mass, ensuring that lighter particles move more than heavier ones and that linear momentum is conserved ().
To achieve different levels of elasticity, a stiffness parameter can be introduced by scaling the corrections by . This allows for materials with varying elasticity, from perfectly rigid () to completely unstiff ().
Dihedral Angle Bending Constraints
While stretching constraints maintain the structural integrity of the cloth mesh, they do not prevent it from folding unnaturally. Bending resistance, which dictates how the cloth wrinkles and drapes, is modeled by constraining the angle between adjacent triangles.
The constraint is defined for a pair of triangles and sharing a common edge . The bending resistance is a function of the dihedral angle between the two triangles, which is the initial angle between their respective normal vectors and . The constraint aims to restore this angle to its rest value, .

The constraint function is formulated as: where the normals are computed as: The gradients of this function with respect to the four vertex positions are then computed, and the standard PBD projection mechanism is used to derive the position corrections. The stiffness of bending is determined using parameter.
A significant advantage of this formulation is its independence from stretching. Because the angle is defined by normalized vectors, the constraint is invariant to the lengths of the triangle edges.
Isometric Bending
For surfaces that are nearly inextensible, the isometric bending model [Bergou et al. 2006] can be used. This model provides a robust formulation based on the local Hessian of the bending energy.
This model considers a stencil for each interior edge of the mesh, consisting of the four vertices of the two triangles adjacent to that edge, labeled . The local bending energy for this stencil is defined as a quadratic form: where is the vector of stencil positions and is a constant matrix representing the local Hessian of the bending energy. This matrix depends only on the rest geometry of the stencil and can be precomputed. Its entries are derived from the cotangents of the angles within the two triangles.
The bending constraint is defined directly from this energy: . Since the energy is quadratic in the positions, its gradient is linear and straightforward to compute: This model is particularly effective for garment simulation where fabric is expected to deform isometrically (i.e., without stretching).