Ki-hoon Kim 2013-12-27 Computer Graphics @ Korea University G.Irving et al. SIGGRAPH 2007
Ki-hoon Kim
2013-12-27
Computer Graphics @ Korea University
G.Irving et al.SIGGRAPH 2007
Ki-hoon Kim | 2013-12-27 | # 2Computer Graphics @ Korea University
• Treating both object contact and self-contact as linear constraints during the incompressible solve.
• Conserves the volume locally near each node in a finite element mesh.
Abstract
Ki-hoon Kim | 2013-12-27 | # 3Computer Graphics @ Korea University
• “The most important rule to squash and stretch is that, no matter how squashed or stretched out a particular object gets, its volume remains constant.”
Principles of Traditional Animation Applied to 3D Computer Animation
• John LasseterSIGGRAPH 1987
IntroductionVolume Conserving
Ki-hoon Kim | 2013-12-27 | # 4Computer Graphics @ Korea University
• Sweep-based Freeform Deformations
Yoon and KimEUROGRAPHICS 2006
• Swirling-sweepers: Constant-volume modeling
A. Angelidis et al.Graphical Models 2006
• Vector field based shape deformations.
W.Funck et al.SIGGRAPH 2006
IntroductionVolume Conserving: Shape Modeling
Ki-hoon Kim | 2013-12-27 | # 5Computer Graphics @ Korea University
• Fast Volume Preservation for a Mass-Spring System
Hong et al.IEEE Computer Graphics and Applications 2006
• Localized volume preservation for simulation and animation
Punak and PetersPoster, SIGGRAPH 2006
IntroductionVolume Conserving: Only Total Volume
Ki-hoon Kim | 2013-12-27 | # 6Computer Graphics @ Korea University
• A versatile and robust model for geometrically complex deformable solids.
M. Teschner et al.CGI 2004
• Limitation
Volume is not preserved in the presence of competing forces
IntroductionVolume Conserving: Approximate Local Volume(with simple spring-like forces)
Ki-hoon Kim | 2013-12-27 | # 7Computer Graphics @ Korea University
• Modified Semi-implicit Newmark scheme.
Simulation of clothing with folds and wrinkles.
• R. Bridson et al.SCA 2003
Time Discretization
Ki-hoon Kim | 2013-12-27 | # 8Computer Graphics @ Korea University
Time DiscretizationOverview
Ki-hoon Kim | 2013-12-27 | # 9Computer Graphics @ Korea University
• Step 2 and 4 combine to form(w/o collision)
𝑥𝑛+1 = 𝑥𝑛 + Δ𝑡𝑣∗𝑛+
12 + Δ𝑡𝛾𝑥
• The final volumes should equal the initial volumes𝑉 𝑥𝑛+1 = 𝑉 𝑥0
𝑉 𝑥𝑛 + Δ𝑡𝐝𝐢𝐯𝑣∗𝑛+
12 + Δ𝑡𝐝𝐢𝐯𝛾𝑥 = 𝑉 𝑥0
where, 𝐝𝐢𝐯 is volume-weighted divergence.
• Similar to the typical pressure correction in fluids,
𝑣𝑛+1/2 = 𝑣∗𝑛+1/2
−𝛻 𝑝
𝜌
𝛾𝑥 = −𝛻 𝑝
𝜌
Time Discretizationstep 2. Pressure: Volume Conserving
Ki-hoon Kim | 2013-12-27 | # 10Computer Graphics @ Korea University
• Contd.
𝑉 𝑥𝑛 + Δ𝑡𝐝𝐢𝐯𝑣∗𝑛+
12 + Δ𝑡𝐝𝐢𝐯𝑀−1𝐠𝐫𝐚𝐝 𝑝 = 𝑉 𝑥0
𝐠𝐫𝐚𝐝 is the volume-weighted gradient and 𝑀 is the mass matrix.
• Rearranging into standard Poisson equation form,
−𝐝𝐢𝐯𝑀−1𝐠𝐫𝐚𝐝 𝑝 = 𝐝𝐢𝐯𝑣∗𝑛+
12 −
𝑉 𝑥𝑛 − 𝑉 𝑥0
Δ𝑡⋯ (1)
which can be solved for 𝑝, and then 𝛾𝑥 = −𝑀−1𝐠𝐫𝐚𝐝 𝑝.
Time Discretizationstep 2. Pressure: Volume Conserving(Contd.)
Ki-hoon Kim | 2013-12-27 | # 11Computer Graphics @ Korea University
• We correct the velocity to be divergence free in step 6, although this can be executed at any point in the algorithm since it is a static projection.
• Taking the divergence of step 6 and setting 𝛻 ∙ 𝑣𝑛 = 𝛻 ∙ 𝑣∗
𝑛 + 𝛻 ∙ 𝛾𝑣 = 0
𝛾𝑣 = −𝛻 𝑝
𝜌
• Similar to (1) we obtain
−𝐝𝐢𝐯𝑀−1𝐠𝐫𝐚𝐝 𝑝 = 𝐝𝐢𝐯𝑣∗𝑛+
12⋯ (2)
which can be solved for 𝑝, and then 𝛾𝑣 = −𝑀−1𝐠𝐫𝐚𝐝 𝑝.
Time Discretizationstep 6. Pressure: Divergence free velocity field
Ki-hoon Kim | 2013-12-27 | # 12Computer Graphics @ Korea University
• Mesh with 𝑛 nodes has more than 4𝑛 tetrahedrons.
Over-constrained system makes locking.
• We avoid locking by enforcing incompressibility on one-rings.
Spatial DiscretizationOverview
Ki-hoon Kim | 2013-12-27 | # 13Computer Graphics @ Korea University
• Standard finite volume discretization with all information coloacted on the nodes of the mesh.
Finite Volume Methods for the Simulation of Skeletal Muscle
• J. Teran et al.SCA 2003
• Define
𝐃 = 𝐱𝟏 − 𝐱𝟎, 𝐱𝟐 − 𝐱𝟎, 𝐱𝟑 − 𝐱𝟎
𝐃 = 𝐯𝟏 − 𝐯𝟎, 𝐯𝟐 − 𝐯𝟎 , 𝐯𝟑 − 𝐯𝟎
𝐁 = 𝑉𝐃−𝐓 = −(𝐚𝐧𝟏, 𝐚𝐧𝟐, 𝐚𝐧𝟑)/3
• 𝑉 is volume of the tetrahedron.
• 𝐚𝐧𝒌 is area-weighted normal opposite vertex 𝑘.
Spatial DiscretizationFinite volume method
Ki-hoon Kim | 2013-12-27 | # 14Computer Graphics @ Korea University
• Linearly interpolated velocity field𝐯 𝐱 = 𝐃𝐃−1 𝐱 − 𝐱0 𝐯0
and
𝛻 ∙ 𝐯 𝐱 = 𝐭𝐫 𝐃𝐃−1 = 𝐃−T: 𝐃
volume-weighted divergence at node 𝑘 is
• is the set of tetrahedra incident on 𝑘.
Spatial DiscretizationVolume-weighted Divergence
Ki-hoon Kim | 2013-12-27 | # 15Computer Graphics @ Korea University
• Gradient operator: negative transpose of the divergence operator.
(1) and (2) result in symmetric positive definite system.
• We want 𝛁𝑝, 𝐯 = 𝑝,−𝛁 ∙ 𝐯 , that is ( 𝐚, 𝐛 = 𝐚𝑻𝐛 and 𝑎, 𝑏 = 𝑎𝑏)
Ω
𝛻𝑝 ∙ 𝐯 𝑑𝐱 + Ω
𝑝𝛻 ∙ 𝐯 𝑑𝐱 = Ω
𝛻 ∙ (𝑝𝐯) 𝑑𝐱 = 𝜕Ω
𝑝𝐯 ∙ 𝑑𝐒 = 𝟎
Dirichlet boundary condition. (𝑝 = 0 on the boundary)
Spatial DiscretizationVolume-weighted Gradient and Pressure: Define
Ki-hoon Kim | 2013-12-27 | # 16Computer Graphics @ Korea University
• We partition the pressure field into
𝑝 =
𝑡∈𝑹(𝑘)
𝑝𝑡
𝑝𝑡 is a pressure field that agrees with 𝑝 in 𝑡.
• The linearity of the gradient operator gives
𝐠𝐫𝐚𝐝 𝑝 𝑘 =
𝑡∈𝑹(𝑘)
𝐠𝐫𝐚𝐝 𝑝𝑡 𝑘
Spatial DiscretizationVolume-weighted Gradient and Pressure: Pressure
Ki-hoon Kim | 2013-12-27 | # 17Computer Graphics @ Korea University
• From divergence operator on a single tetrahedron
𝐝𝐢𝐯 𝐯 𝑘 =1
4𝐁: 𝐃 = −
1
12
𝑗=1
3
𝐯𝑗 − 𝐯0 ∙ 𝐚𝐧𝑗 = −1
12
𝑗=0
3
𝐯𝑗 ∙ 𝐚𝐧𝑗
−𝐝𝐢𝐯 =1
12𝐍 𝐍 𝐍 𝐍 T where 𝐍 = 𝐚𝐧0
T 𝐚𝐧1T 𝐚𝐧2
T 𝐚𝐧3T T
.
• So, gradient operator on a single tetrahedron is
𝐠𝐫𝐚𝐝 =1
12𝐍 𝐍 𝐍 𝐍
,and gradient pressure at a node 𝑘 is
𝐠𝐫𝐚𝐝 𝑝 𝑘 =1
12𝐍𝑘
𝑗=0
3
𝑝𝑗 =1
3𝐚𝐧𝑘 𝑝
Spatial DiscretizationVolume-weighted Gradient and Pressure: On a single tetrahedron
Ki-hoon Kim | 2013-12-27 | # 18Computer Graphics @ Korea University
• Summing over 𝑹(𝑘) gives
𝐠𝐫𝐚𝐝 𝑝 𝑘 =1
3
𝑡∈𝑹(𝑘)
𝐚𝐧𝑡,𝑘 𝑝𝑘
This equation is exactly standard FVM force for stress of 𝑝.
Spatial DiscretizationVolume-weighted Gradient and Pressure: On multi tetrahedrons
Ki-hoon Kim | 2013-12-27 | # 19Computer Graphics @ Korea University
Collision and ContactRemind Time Discretization
Ki-hoon Kim | 2013-12-27 | # 20Computer Graphics @ Korea University
• Problem
Over-constraints can cause serious artifacts
• Competing constraints
• Resulting in unusably tangled surface
• Solution Propose
Incorporate collision constraints into our Poisson equation.
Collision and ContactRemind Time Discretization: Conclusion
Ki-hoon Kim | 2013-12-27 | # 21Computer Graphics @ Korea University
• Step 5.
Set the position and velocity of particles to respect collision.
𝐜𝑇𝐱 ≥ 0
• 𝐧𝑇 𝐱𝑝 − 𝑤1𝐱1 − 𝑤2𝐱2 − 𝑤3𝐱3 ≥ 0
Point-Triangle pair collision
𝑤𝑖 are barycentric weights.
𝐧 is triangle’s normal
• 𝒔𝑇 1 − 𝛼1 𝐱1 + 𝛼1𝐱2 − (1 − 𝛼2)𝐱3 − 𝛼2𝐱3 ≥ 0
Edge-Edge pair collision
𝛼𝑖 are position of the interacting points
𝒔 is shortest vector between the interacting segments
• Step 6.
Solve volume conserving problem
Solver change the velocity
• Δ𝐯 is the change in velocity.
Collision and ContactProblem Analysis
Ki-hoon Kim | 2013-12-27 | # 22Computer Graphics @ Korea University
• Step 7.
Maintain the correct normal velocity for colliding particles.
i.e. 𝐜TΔ𝐯 = 0
• 𝐧𝑇 𝚫𝐯𝑝 − 𝑤1𝚫𝐯1 − 𝑤2𝚫𝐯2 −𝑤3𝚫𝐯3 = 0
• 𝒔𝑇 1 − 𝛼1 𝚫𝐯1 + 𝛼1𝚫𝐯2 − (1 − 𝛼2)𝚫𝐯3 − 𝛼2𝚫𝐯3 = 0
• How to?
Project out any constraint by redefinding𝛾 = −ℙ𝑀−1 𝐠𝐫𝐚𝐝 𝑝
Collision and ContactProblem Solution
Ki-hoon Kim | 2013-12-27 | # 23Computer Graphics @ Korea University
• ℙ projects a change in velocity using an impulse 𝐣ℙΔ𝐯 = Δ𝐯 +𝑀−1𝐣
• Find impulse 𝐣 by
Minimize : 1
2𝐣𝑇𝑀−1𝐣
Subject to: 𝐜𝑇ℙΔ𝐯 = 0
Objective function:1
2𝐣𝑇𝑀−1𝐣 + 𝜆(𝐜𝑇Δ𝐯 + 𝐜𝑇𝑀−1𝐣)
𝐣 = −𝐜𝜆 and 𝜆 = 𝐜𝑇𝑀−1𝐜 −1𝐜𝑇Δ𝐯
• ℙ = 𝕀 −𝑀−1𝐜 𝐜𝑇𝑀−1𝐜 −1𝐜𝑇
ℙ𝑀−1 is symmetric positive semidefinite.
Collision and ContactProject out any constraint
Ki-hoon Kim | 2013-12-27 | # 24Computer Graphics @ Korea University
• In the case of many constraints𝐂𝑇Δ𝐯 = 𝐜1⋯𝐜𝑛 Δ𝐯 = 0
• 1. This can apply the projection in simple Gaussian-Seidel order.ℙ𝑀−1 = ℙ𝑛⋯ℙ1𝑀
−1
This is only symmetric if none of the constraints overlap.
• 2. Apply all constraints at once.ℙ = 𝕀 −𝑀−1𝐂 𝐂𝑇𝑀−1𝐂 −1𝐂𝑇
Require inversion of 𝑛 × 𝑛 matrix 𝐂𝑇𝑀−1𝐂 −1
This is prohibitively expensive for complex scenarios.
Collision and ContactProject out many constraints : Attempt
Ki-hoon Kim | 2013-12-27 | # 25Computer Graphics @ Korea University
• Apply the projection in alternating forward and backward sweeps.ℙ𝑀−1 = ℙ1⋯ℙ𝑛⋯ℙ1
𝑞𝑀−1
This is positive semidefinite matrix.
𝑞 is small integer, we use 𝑞 = 4.
ℙ𝑖 strictly reduces energy, so this iteration is stable.
Collision and ContactProject out many constraints : Last Solution
Ki-hoon Kim | 2013-12-27 | # 26Computer Graphics @ Korea University
• Using our method
(Top) maintains correct volume within 1%.
• Using standard finite element forces
(Middle) with a Poisson’s ratio of 0.45 results in a maximum volume loss of over 15%.
(Bottom) with a Poisson’s ratio to 0.499 reduces the maximum volume loss to 2%
ExamplesVolume Conserving
Ki-hoon Kim | 2013-12-27 | # 27Computer Graphics @ Korea University
ExamplesSelf-Collision
Ki-hoon Kim | 2013-12-27 | # 28Computer Graphics @ Korea University
ExamplesMany Objects Collision
Ki-hoon Kim | 2013-12-27 | # 29Computer Graphics @ Korea University
• Proposed a novel technique from fluid dynamics.
• Simplicity and flexibility of tetrahedra.
• Avoiding the locking by one-rings volume preservation
• Incorporate collision constraints into the incompressible solver.
• The method is trivially adapted for triangles and thin shells.
Conclusion