logo


Resources:

Part 3: Specific Constraints

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=xixj\bold x_{i,j} = \bold x_i - \bold x_j

🌟 Stretching

Figure 3: Projection of the constraint C(\bold x_1, \bold x_2) = |\bold x_{1,2}| − d. The corrections ∆\bold x_i are weighted according to the inverse masses w_i = 1/m_i.

Figure 3: Projection of the constraint C(x1,x2)=x1,2dC(\bold x_1, \bold x_2) = |\bold x_{1,2}| − d. The corrections xi∆\bold x_i are weighted according to the inverse masses wi=1/miw_i = 1/m_i.

  1. The final corrections

    Δx1=w1w1+w2(x1,2d)nΔx2=+w2w1+w2(x1,2d)n\Delta \bold x_1 = - \frac{w_1}{w_1 + w_2}(|\bold x_{1, 2}| - d) \bold n \\ \Delta \bold x_2 = + \frac{w_2}{w_1 + w_2}(|\bold x_{1, 2}| - d) \bold n
  2. The distance constraint function:

    C(x1,x2)=x1,2dC(\bold x_1, \bold x_2) = |\bold x_{1, 2}| - d
  3. The derivatives with respect to the points:

    x1C(x1,x2)=nx2C(x1,x2)=nn=x1,2x1,2\nabla_{\bold x_1}C(\bold x_1, \bold x_2) = \bold n \\ \nabla_{\bold x_2}C(\bold x_1, \bold x_2) = -\bold n \\ \bold n = \frac{\bold x_{1,2}}{|\bold x_{1,2}|}
  4. The scaling factor λ\lambda is

    λ=x1,2d1+1\lambda = \frac{|\bold x_{1,2}| - d}{1 + 1}

🌟 Bending

Untitled

Isometric Bending

Untitled

5.4 Collisions

Triangle Collisions

Untitled

5.5 Volume Conservation

Tetrahedral Meshes

Cloth Balloons

Surface Meshes

Robust Collision Handling with Air Meshes

5.6 Long Range Attachments

5.7 Strands

5.8 Continuous Materials

5.9 Rigid Body Dynamics

→ simulate articulated rigid body systems with joint and contact constraints

  • For a rigid body, parameterize the rotation by a vector ϑ\vartheta which represents a rotation of ϑ|\vartheta| about the axis ϑ/ϑ\vartheta/|\vartheta| in order to define constraint function C(x,ϑ)\bold C(\bold x, \vartheta) for positions and orientations. C(x+Δx,ϑ+Δϑ)C(x,ϑ)+J(x,ϑ)(ΔxT,ΔϑT)TC(\bold x + \Delta \bold x, \vartheta + \Delta \vartheta) \approx C(\bold x, \vartheta) + \bold J(\bold x, \vartheta) (\Delta \bold x^T, \Delta \vartheta^T)^T
  • Connector
  • Example: Ball Joint : C(P1,P2)=P1P2=0\bold C(\bold P_1, \bold P_2) = \bold P_1 - \bold P_2 = \bold 0, where P1\bold P_1 and P2\bold P_2 are connector points in the first and second body, respectively.
  • The world space position of a connector point Pi\bold P_i of a body jj with position xj\bold x_j and orientation ϑj\vartheta_j is defined by: Pi(xj,ϑj)=xj+R(ϑj)ri\begin{align} \bold P_i(\bold x_j, \vartheta_j) =\bold x_j + \bold R(\vartheta_j)\bold r_i \end{align} ri\bold r_i denotes the position of the connector in the local coordinate system of the body.
  • The Jacobian of a constraint function C(P)\bold C(\bold P) which depends on a set of connector points P\bold P: J=C(P)Pconstraint specific part(PxPϑ)Tconnecotr specific part\bold J = \underbrace{\frac{\partial \bold C(\bold P)}{\partial \bold P}}_{constraint\text{ } specific \text{ }part} \cdot \underbrace{\left(\frac{\partial \bold P}{\partial \bold x}\frac{\partial \bold P}{\partial \vartheta}\right)^T}_{connecotr \text{ } specific \text{ } part}
  • Example: Ball Joint: C(P)/P1=C(P)/P2=I\partial \bold C(\bold P)/\partial \bold P_1 = - \partial \bold C(\bold P)/\partial \bold P_2 = \bold I. P/x=I\partial \bold P / \partial \bold x = \bold I, p/ϑ\partial \bold p / \partial \varthetaR(ϑ)/ϑ\partial \bold R(\vartheta)/\partial \vartheta.
  • Lagrange multiplier λ\lambda: JM1JTλ=C(x,ϑ)\begin{align} \bold J\bold M^{-1}\bold J^T\lambda = -\bold C(\bold x, \vartheta) \end{align} [ΔxT,ΔϑT]=M1JTλ\begin{align} \left[\Delta \bold x^T, \Delta \vartheta ^T\right] = \bold M^{-1}\bold J^T\lambda \end{align}

5.10 Fluids

  • fluid incompressibility is enforced using density constraints
  • a density constraint for each particle ii in the systems Ci(x1,...,xn)=ρiρ01\begin{align} C_i(\bold x_1, ..., \bold x_n) = \frac{\rho_i}{\rho_0} - 1 \end{align} ρ0\rho_0: the fluid rest density; ρi\rho_i: the density at a particle, defines as the sum of smooth kernels centered at the particle’s neighbor positions ρi=jmjW(xixj,h)\begin{align} \rho_i = \sum_jm_jW(\bold x_i - \bold x_j, h) \end{align} the derivative of the constraint: xkCi=1ρ1{jxkW(xixj,h),if k = ixkW(xixj,h),if k = j\nabla_{\bold x_k} C_i = \frac{1}{\rho_1} \begin{cases} \sum_j \nabla _{\bold x_k} W(\bold x_i - \bold x_j, h), & \text{if }k\text{ = } i\\ -\nabla_{\bold x_k} W(\bold x_i - \bold x_j, h), & \text{if }k\text{ = }j \end{cases} the corrective change in position due to the particle’s own density constraint and the density constraints of its neighbors is given by: Δxi=1ρ0j(λi+λj)W(xixj,h)\Delta \bold x_i = \frac{1}{\rho_0}\sum_j(\lambda_i + \lambda_j)\nabla W(\bold x_i - \bold x_j, 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 ii: mass mim_i, position xi\bold x_i, velocity vi\bold v_i
  • the equation of motion of a particle: vi˙=1mifi\begin{align}\dot {\bold v_i} = \frac{1}{m_i}\bold f_i\end{align} fi\bold f_i : the sum of all forces acting on a particle ii
  • the velocity kinematic relationship:
xi˙=vi\begin{align}\dot {\bold x_i} = \bold v_i\end{align}
  • Rigid Body: inertia tensor IiR3×3\bold I_i \in \mathbb R^{3\times 3}, orientation (a unit quaternion) qiH\bold q_i \in \mathbb H, angular velocity ωiR3\omega_i \in \mathbb R^3.

  • the equation of motion for the rotational part of a rigid body:

    ωi˙=Ii1(τi(ωi×(Iiωi)))\begin{align}\dot {\bold \omega_i} = \bold I_i^{-1}(\tau_i - (\omega_i \times(\bold I_i \omega_i)))\end{align}

    τi\tau_i is the sum of all moments. pure moment or byproduct of a force τ=(px)×f\tau = (\bold p - \bold x) \times \bold f

  • the velocity kinematic relationship for the rotational part:

    qi˙=12ω~iqi\begin{align}\dot {\bold q_i} = \frac{1}{2}\tilde \omega_i \bold q_i\end{align}

    ω~\tilde \omega the quaternion [0,ωix,ωiy,ωiz][0, \omega_i^x, \omega_i^y, \omega_i^z].

PreBack to BlogNext