In this section, we will introduce different constraints to simulate different materials such as articulated rigid bodies, soft bodies, cloth or even fluids with PBD.
For readability, we define xi,j=xi−xj
🌟 Stretching
Figure 3: Projection of the constraint C(x1,x2)=∣x1,2∣−d. The corrections ∆xi are weighted according to the inverse masses wi=1/mi.
→ simulate articulated rigid body systems with joint and contact constraints
For a rigid body, parameterize the rotation by a vector ϑ which represents a rotation of ∣ϑ∣ about the axis ϑ/∣ϑ∣ in order to define constraint function C(x,ϑ) for positions and orientations.
C(x+Δx,ϑ+Δϑ)≈C(x,ϑ)+J(x,ϑ)(ΔxT,ΔϑT)T
Connector
Example: Ball Joint : C(P1,P2)=P1−P2=0, where P1 and P2 are connector points in the first and second body, respectively.
The world space position of a connector point Pi of a body j with position xj and orientation ϑj is defined by:
Pi(xj,ϑj)=xj+R(ϑj)riri denotes the position of the connector in the local coordinate system of the body.
The Jacobian of a constraint function C(P) which depends on a set of connector points P:
J=constraintspecificpart∂P∂C(P)⋅connecotrspecificpart(∂x∂P∂ϑ∂P)T
fluid incompressibility is enforced using density constraints
a density constraint for each particle i in the systems
Ci(x1,...,xn)=ρ0ρi−1ρ0: the fluid rest density; ρi: the density at a particle, defines as the sum of smooth kernels centered at the particle’s neighbor positions
ρi=j∑mjW(xi−xj,h)
the derivative of the constraint:
∇xkCi=ρ11{∑j∇xkW(xi−xj,h),−∇xkW(xi−xj,h),if k = iif k = j
the corrective change in position due to the particle’s own density constraint and the density constraints of its neighbors is given by:
Δxi=ρ01j∑(λi+λj)∇W(xi−xj,h)
5.11 Shape Matching
Shape matching is a mesh-less approach which is able to simulate visually plausible elastic and plastic deformations.
5.11.1 Goal Positions
5.11.2 Region-Based Shape Matching
5.11.6. Cloth Simulation
6. Implementation
7. Applications
8. Conclusion
Math Equations
Particle i: mass mi, position xi, velocity vi
the equation of motion of a particle:
vi˙=mi1fifi : the sum of all forces acting on a particle i
the velocity kinematic relationship:
xi˙=vi
Rigid Body: inertia tensor Ii∈R3×3, orientation (a unit quaternion) qi∈H, angular velocity ωi∈R3.
the equation of motion for the rotational part of a rigid body:
ωi˙=Ii−1(τi−(ωi×(Iiωi)))
τi is the sum of all moments. pure moment or byproduct of a force τ=(p−x)×f
the velocity kinematic relationship for the rotational part: