Chain constraints

A chain constraint takes a list of particles (a "chain") and makes sure its total length does not change. Chain constraints internally make use of a direct, linear solver, instead of the usual iterative, non-linear solver asued by everything else in Obi. These constraints are used by rods to limit stretching to a minimum.

Chain constraints lay out a system of linear equations involving all particles in the chain at once. Then, Obi attempts to solve this system. If there's a solution to it, the chain will reach its rest lenght in a single iteration, since adjustments are applied to all particles at once towards a common solution. However if the configuration of the particles at the beginning of the step is too far from the solution, or if there's no solution at all, the simulation may exhibit jittering. Since chain constraints always converge to a solution -if there's any-, increasing the amount of chain constraint iterations improves their stability, instead of their convergence speed.



Left column: chain constraints. Right column: Stretch/shear constraints.
Top row: at rest. Bottom row: overstretched. When both ends of the rod are fixed at a distance greater than its length (even if slightly), there's no way to simultaneously maintain maintain rest lenght and keep both ends at their designed positions. This results in unstable simulation (jittering) when using chain constraints. Stretch/shear constraints have a much harder time keeping the rod from stretching, but can withstand conflictive situations while remaining stable.