Volume Conservation Constraints
The simulation of incompressible or nearly incompressible materials is critical for many applications in computer graphics. In a force-based framework, incompressibility typically requires solving a complex Poisson equation for pressure. PBD offers a more direct and often simpler approach by enforcing volume or density conservation through geometric constraints. This section will explore several such constraints, beginning with those defined on discrete mesh elements like tetrahedra and extending to global volume constraints for closed surfaces.
Tetrahedral Volume and Triangle Area Constraints
For volumetric objects discretized into a tetrahedral mesh, incompressibility can be approximated by constraining the volume of each individual tetrahedron to remain at its rest volume.
Definition 33.3.1 (Tetrahedral Volume Constraint). Given a tetrahedron defined by four vertices with positions and a rest volume , the volume constraint function is defined as: The constraint is satisfied when . The gradients of this function with respect to the four vertex positions are: These gradients—vectors proportional to the areas of the opposing faces—are used to calculate position corrections for the four vertices. An analogous constraint can be defined for the area of a triangle in 2D or 3D simulations.
Global Volume for Closed Meshes
For objects represented by a closed, watertight triangle mesh (such as an inflatable character), it is often desirable to control the total enclosed volume. This can be achieved with a single global constraint that acts on all vertices of the mesh. The total volume of a closed mesh can be calculated using the Divergence Theorem, which discretizes to a sum over all triangles. The volume contributed by each triangle with vertices is the signed volume of the tetrahedron formed by the triangle and the origin:
The global volume constraint is then formulated to maintain this volume at a target value, which is typically the rest volume scaled by a pressure factor : The gradient of this constraint with respect to a vertex position is the sum of the gradients from all triangles adjacent to that vertex. This results in a correction that redistributes the volume error across the entire surface.