Differentiable Cloth Modeling
2022/07 - now
Updated on 2022/12/09
I have implemented three types of cloth simulation methods, including
- Mass-Spring-System
- Finite Element Method
- Material Point Method
I use forward or symplectic Euler integration at this stage. Implicit integration may be implemented in the future. I found it is helpful to keep things simple at the beginning.
Mass-Spring-System
The Mass-Spring-System method is popular for real-time applications in robotics due to its simplicity. It models the deformable objects as a collection of particles connected by springs and dampers. However, the conciseness comes with the price of the lost of physical interpretability. It is not suitable for scenarios that involve large deformation, severe self-occulusion, and multiple material coupling. Here is an implementation in Taichi.
Finite Element Method
The finite element method (FEM) is a numerical method for solving differential equations arising in engineering and mathematical modeling. Usually, the continuum material is discretized into triangular or tetrahedron elements. Then the deformation gradient and the internal stress are computed for each element. I tried to follow the classic 1998 SIGGRAPH paper "Large Steps in Cloth Simulation". A preliminary result is attached below. However, the self-collision was not handled properly and only the streching component of the energy density function was implemented. I didn't complete the full implementation since I found the result of the material point method (MPM), the state of the art method for deformbale object and granular particle simulation in the computer graphics community, is more promising.
Material Point Method
A simple toy example of my MPM framework. Easy to debug.
Let’s push a deformable sheet.
Let’s add the mesh indices and twist a deformable sheet. Green color represents det(F) > 1 and red represents det(F) < 1. Note that this is hard to achieve utilizing the traditional methods.
Change of the Young’s modulus affect the twisting process.
I also did some experiments using a real peice of garment.
Let’s also shear a deformable sheet.
Change of the Young’s modulus affect the shearing result.
I also did some experiments using a real peice of garment.
Through the conducted experiments, I found that the twisting simulation was not so realistic. Espetially, the middle part of the garmment is much more bulky than the real one. After some analysis, I found the isotropic constitutive model caused the problem. Thus, I modified the deformation energy density function accroding to 2017 SIGGRAPH paper “Anisotropic Elastoplasticity for Cloth, Knit and Hair Frictional Contact”. The following shows the difference between the original and the improved simulation. Note that physical parameters are set the same and only the energy density function is different. The updated version on the right is closer the the real garment.
I also started to develop my simulation playground in a more organized way. The cylinder shape static boundary is added with softened signed distance function (for a smoother gradient). Here are some preliminary results.
With some further updates, I have reproduced ~80% of the cloth modeling methods proposed in “Anisotropic Elastoplasticity for Cloth, Knit and Hair Frictional Contact”. I am satisfied with the following results. For the next step, I will explore how to train a NN controller using this differentiable simulator. To my understanding, some layers in the NN approximate and store the the state-dependent jacobian matrix of the deformable object somehow efficiently, so we don’t need to update J(x) in real time as in servoing-based methods. As many examples have been demonstrated in “DiffTaichi”, hopefully, this goal can be achieved soon.
I recently found a promising related pioneer work “PlasticineLab: A Soft-Body Manipulation Benchmark with Differentiable Physics”. I decided to learn from it!
Miscellaneous
I aslo attached two wrong implementations of the return mapping. It is hilarious how the material behaves. No one likes explosion except Deidara.
I might join EPFL in 2023 as a PhD student. 亦可赛艇!
Reference Materials
- Taichi Lang
- Taichi Graphics Course
- Modeling, learning, perception, and control methods for deformable object manipulation
- Learning garment manipulation policies toward robot-assisted dressing
- A Grasping-Centered Analysis for Cloth Manipulation
- The Material Point Method for Simulating Continuum Materials