# Compression/Extension¶

The compression and extension coefficients are used in three different ways: Stretch Compression/Extension/Equilibrium, Surface Compression/Extension, and Volume Compression/Extension.

## Stretch Compression/Extension/Equilibrium¶

Stretch Compression/Extension/Equilibrium describes the minimum and maximum length each edge of the mesh can achieve as well as the resting length an edge will try to maintain during a simulation.

The compression and extension coefficients describe the upper and lower hard stretch limits as fractions of the reference length (compression has to be smaller or equal to extension).

If the two terms are equal the stretch will be set to preserve length through an equality constraint. In this case, since there will be no space available for elastic deformation, both the stiffness and viscosity will be irrelevant.

The equilibrium describes the length targeted by the stretch through elastic forces and is also expressed as a fraction of the reference length. The equilibrium can match a position situated out of the elastic deformation range, producing stronger forces towards one of the hard limits. The hard limits (Lagrangian constraints) will always dominate over the elastic forces.

Note

In practice and when using a random triangle mesh, it is best to keep the extension close to the reference length and tune the compression to allow some motion that would otherwise be locked due to the discrete distribution of the bending edges in the geometry of the cloth.

## Surface Compression/Extension¶

The surface compression and extension describes the range of variation allowed for each triangle surface area as a fraction of the resting area.

Setting the compression and the extension to 1 will enforce surface preservation.

The surface compression and extension constrains the area of a surface, but does not constrain the surface to keep its initial triangular shape. The structural shape constraint is achieved through a stretch on every edge.

Note

Setting compression and extension to 1 could make cloth deformation very difficult due to the discrete representation of the cloth by a mesh. In most cases the cloth can compress but barely extend.

## Volume Compression/Extension¶

The volume compression and extension describes the range of variation allowed for the volume of each single tetrahedron contained in a Carbon Tetra object as a fraction of their resting volume.

The volume compression and extension constrains the volume of a tetrahedron, but does not constrain the tetrahedron to keep its initial shape. The structural shape constraint is achieved through a stretch on every edge.

Setting the compression and the extension to 1 will enforce volume preservation.

Note

Setting the compression lower than 1 and extension to exactly 1 simulates porous materials like sponges, which can be compressed easily, but do not grow in volume.