Source-linked AI summary

DiffCloth: Differentiable Cloth Simulation with Dry Frictional Contact

Yifei Li, Tao Du, Kui Wu, Jie Xu, Wojciech Matusik

arXiv:2106.05306v3cs.GRcs.LG

TL;DR

Cloth simulation needs useful gradients despite frequent, non-smooth contact and self-collisions. DiffCloth extends Projective Dynamics with dry frictional contact and a fast gradient solver, then evaluates gradients across contact-rich settings and downstream applications. The paper reports substantial solver speedups and improved sample efficiency in many applications, while identifying material-model and gradient-smoothness limitations.

  • Problem

    Frequent contact and self-collisions make gradients difficult to derive and use reliably in cloth simulation, whose differentiable solutions remain limited.

  • Method

    DiffCloth extends a Projective Dynamics cloth simulator with Signorini-Coulomb dry frictional contact, an iterative gradient solver, and evaluations of gradient behavior in contact-rich simulation.

  • Results

    The simulator achieves substantial gradient-computation speedups and supports system identification, assisted-dressing trajectory optimization, control, inverse design, and real-to-sim transfer with higher sample efficiency than gradient-free methods.

  • Takeaways & Limitations

    Gradient information makes several cloth-related optimization applications more sample-efficient, including friction identification, garment design, and robot-assisted dressing.

  • Takeaways & Limitations

    The Projective Dynamics foundation limits supported material models, and the effects of gradient discontinuities on optimization require further investigation.

Abstract

from arXiv · show

Cloth simulation has wide applications in computer animation, garment design, and robot-assisted dressing. This work presents a differentiable cloth simulator whose additional gradient information facilitates cloth-related applications. Our differentiable simulator extends a state-of-the-art cloth simulator based on Projective Dynamics (PD) and with dry frictional contact. We draw inspiration from previous work to propose a fast and novel method for deriving gradients in PD-based cloth simulation with dry frictional contact. Furthermore, we conduct a comprehensive analysis and evaluation of the usefulness of gradients in contact-rich cloth simulation. Finally, we demonstrate the efficacy of our simulator in a number of downstream applications, including system identification, trajectory optimization for assisted dressing, closed-loop control, inverse design, and real-to-sim transfer. We observe a substantial speedup obtained from using our gradient information in solving most of these applications.

1 INTRODUCTION

DiffCloth addresses the unresolved challenge of differentiating cloth simulation with frequent contact and self-collisions. It introduces a dry-friction-aware differentiable simulator, analyzes gradient usefulness, and demonstrates applications where gradient-based optimization improves sample efficiency.

  • Cloth simulation supports applications including virtual try-on, garment design, fold design, garment grading, sagging-free inversion, and robot-assisted dressing.
  • Frequent contact and self-collisions make gradient computation in cloth simulation difficult and remain incompletely resolved by existing differentiable cloth simulators.
  • DiffCloth extends Projective Dynamics with Signorini-Coulomb dry frictional contact and an iterative gradient solver modified for this contact model.
  • The work evaluates gradient behavior under varying numbers of contact events and analyzes discontinuities in contact-rich cloth simulation.
  • The simulator is demonstrated in system identification, inverse garment design, and robot-assisted dressing, among other downstream applications.
  • Additional gradient information enables gradient-based optimizers with higher sample efficiency than traditional gradient-free methods.

2 RELATED WORK

Prior work established cloth simulation, Projective Dynamics, contact handling, and differentiable simulation, but differentiable cloth remains limited by frequent, non-smooth contact events. DiffCloth builds on these lines while targeting physically accurate and practically useful gradients for cloth.

  • Cloth simulation: Cloth simulation research spans implicit, explicit, and variational integration methods, with Projective Dynamics providing a local-global solver for suitable quadratic material energies.
  • Cloth simulation: Projective Dynamics has been accelerated through Chebyshev, parallel randomized Gauss-Seidel, and multigrid techniques.
  • Cloth applications: Cloth material fitting and real-fabric matching can benefit from the additional gradient information provided by differentiable simulation.
  • Cloth contact and friction: Cloth contact methods include impact zones, repulsion impulses, friction, dissipative optimization, and constraint-based collision formulations.
  • Differentiable simulation: Differentiable simulation extends beyond rigid-body systems to soft bodies and fluids, but differentiable cloth still lacks a good solution, while neural approximations make physical accuracy difficult to guarantee.
  • Differentiable simulation: Non-smooth contact events arise from discontinuous contact shapes, impulsive forces, and branches in contact laws, challenging the usability of gradients in cloth simulation.

3 BACKGROUND

The simulator uses implicit Projective Dynamics with dry frictional contact, combining a local-global energy solver with contact constraints expressed through nodal velocities and forces. Contact-aware iterative updates enforce the Signorini-Coulomb law while preserving efficient PD structure.

  • Implicit time integration: Implicit time integration advances cloth positions and velocities using a mass matrix, internal forces, external forces, and a time step size.
  • Optimization view: The implicit step can be written as an energy minimization problem whose stationary condition reproduces the time-stepping equations.
  • Local and global solvers in PD: Projective Dynamics assumes the internal energy is a sum of quadratic forms and alternates local projections with a global minimization step.
  • Local and global solvers in PD: Prefactorizing the constant global matrix makes the Projective Dynamics global step efficient by reducing it to back-substitution.
  • Dry frictional contact: The Signorini-Coulomb law constrains each contact node’s local force and velocity, with friction represented in a local tangential-normal contact frame.
  • Dry frictional contact: Contact-aware integration augments the position and velocity updates with contact forces, local velocities, and membership in valid contact-pair sets.
  • Dry frictional contact: The contact solver rewrites the global step in velocities and alternates it with the original local step, while contact impulses enter the global equation.
  • Dry frictional contact: An iterative solver seeks velocities and contact forces satisfying contact conditions, then updates contact variables through successive iterations.

4 DIFFERENTIABLE CLOTH SIMULATION

The paper extends Projective Dynamics to differentiate cloth simulation with rich, frictional contact, including self-collisions. It derives efficient contact-aware gradients and analyzes their differentiability, solver efficiency, and practical limitations.

  • 4 DIFFERENTIABLE CLOTH SIMULATION: The simulator extends Projective Dynamics with gradients for rich contact events governed by Coulomb friction, including self-collisions.It addresses limitations of methods handling only non-penetration, small-scale contact, sparse contact, or frictionless cloth.
  • 4.1 Gradients without Contact: Gradients are obtained by differentiating implicit time integration and solving adjoint systems rather than explicitly inverting large sparse matrices.The method computes Jacobians through implicit integration and uses linear solves for adjoint vectors and velocity gradients.
  • 4.1 Gradients without Contact: Projective Dynamics accelerates gradient computation through local-global iterations that reuse a prefactorized matrix and parallelize local derivative updates.The contact-aware solver replaces ΔP with ΔP+ΔR, while ΔR can be computed in parallel across contact nodes.
  • 4.2 Gradients with Contact: Contact gradients are derived by expressing active contact conditions as a stacked nonlinear function over contact nodes and differentiating the resulting system.The formulation uses velocity as the variable and includes derivatives of the contact constraint through ΔR.
  • 4.2 Gradients with Contact: Inactive inequality constraints can be omitted during backpropagation, whereas active corner cases make gradients undefined because contact types can change.These cases introduce non-smoothness but not discontinuities, analogous to a ReLU turning point.
  • 4.2 Gradients with Contact: The iterative adjoint solver is theoretically guaranteed under ρ[P^-1(ΔP + ΔR)] < 1 and falls back to a direct sparse solver if it fails to converge.Empirically, divergence is uncommon when high-precision backpropagation is not required.
  • 4.2 Gradients with Contact: The inherited node-based contact model does not handle edge-edge or vertex-face self-collisions, whose gradient derivation is left for future work.The limitation follows from inheriting the contact model of Ly et al. [2020].

5 EVALUATIONS

The evaluations analyze gradient smoothness in contact-rich cloth simulation, compare dry frictional contact with prior handling, and test optimization and backpropagation performance. Results show that contact-set changes create local bumpiness, while gradient-based optimization and the iterative solver often provide substantial efficiency benefits.

  • Evaluation scope: The evaluation examines gradient sources, high-dimensional optimization, dry frictional contact, and the numerical performance of iterative backpropagation.The study analyzes non-smoothness, compares contact models, and evaluates gradient usefulness and solver speed.
  • Continuity and Smoothness: Changing contact sets makes the local loss landscape bumpier as contact events become more frequent.The experiment identifies frictional coefficient μ and cloth stiffness k as the loss-landscape parameters.
  • Continuity and Smoothness: Contact branches preserve continuity, surface discretization introduces discontinuities from normal jumps, and contact-set changes produce the most frequent discontinuities.The authors order these sources by their damage to gradients.
  • High-Dimensional Optimization: L-BFGS-B achieves significant speedups over CMA-ES, with the largest speedup at the highest number of degrees of freedom.The speedup is measured as the ratio of CMA-ES to L-BFGS-B time steps when losses reach 0.01.
  • Benefits of Dry Frictional Contact: The dry frictional model produces more physically realistic napkin motion than a prior contact model, which exhibits popping artifacts after bowl contact.The prior method modifies penetrated node positions without verifying the need for sticky contact forces, injecting extra elastic energy in the concave bowl.
  • Iterative Solver: The iterative backpropagation solver is faster than the direct solver, especially at higher mesh resolutions and lower precision thresholds.Lower-precision gradients may be less accurate but can still support successful gradient-based optimization; uncommon solver failures also occur.

6 APPLICATIONS

The applications show that differentiable cloth simulation supports system identification, robot-assisted dressing, inverse design, closed-loop control, and real-to-sim matching. Across these tasks, gradient-based optimization often reaches better solutions or comparable performance with substantially fewer simulation steps.

  • 6.1 System Identification: System identification estimates cloth and wind parameters from motion data despite frequent self-collisions and frictional contacts.The T-shirt task optimizes one material parameter and five wind-model parameters, while the Sphere task identifies a frictional coefficient.
  • 6.2 Robot-Assisted Dressing: L-BFGS-B converges substantially faster than gradient-free baselines to better solutions in the Hat and Sock dressing tasks.The robot trajectories optimize B-spline parameters for kinematic manipulators pulling cloth vertices toward target configurations.
  • 6.3 Inverse Design: L-BFGS-B achieves better optimized dress motion using fewer time steps than the evolutionary-strategy baselines.The inverse-design objective targets a 100-degree apex angle for a twirl dress by optimizing material parameters.
  • 6.4 A Real-to-Sim Example: L-BFGS-B substantially reduces real-to-sim trajectory discrepancy, although the final match remains imperfect under the synthetic wind model.The task optimizes an eight-dimensional material-and-wind parameter space against motion-captured trajectories.
  • 6.5 Hat Controller: The gradient-based hat controller reaches a similar final loss to PPO with an 85x speedup and succeeds from all 20 test positions.Adam uses 23,200 time steps versus PPO’s 1,978,000 time steps, and both methods move the hat onto the head from every tested start.

7 CONCLUSIONS, LIMITATION, AND FUTURE WORK

The paper concludes that its PD-based differentiable simulator with Signorini-Coulomb contact enables efficient gradient-based cloth applications, while identifying limits in material modeling, collision handling, gradient behavior, solver convergence, and real-world validation.

  • Conclusions: The simulator combines Projective Dynamics with Signorini-Coulomb contact and enables gradient-based optimization across diverse cloth applications.The paper reports comparable performance and generalizability to PPO for a closed-loop controller while using much less time.
  • Limitations and Future Work: Because the framework is built on Projective Dynamics, its supported material models are limited; more physically accurate models remain future work.The authors specifically cite piecewise linear elastic models as a possible extension.
  • Limitations and Future Work: The inherited contact model handles vertex-vertex self-collisions but omits vertex-face and edge-edge collisions, limiting physical realism.The authors observed plausible results at medium mesh resolution despite this omission.
  • Limitations and Future Work: The effects of contact-induced gradient discontinuities on optimization remain insufficiently understood, motivating investigation of smoothed gradients.The paper describes a locally bumpy but globally smooth energy landscape and leaves inexact smoothed gradients for future work.
  • Limitations and Future Work: The iterative backpropagation solver lacks a theoretical convergence guarantee and may require switching to a slower direct solver.Non-convergence is uncommon empirically, but the fallback introduces additional cost.
  • Limitations and Future Work: Many applications remain simulation-only, so reproducing the results in real-world settings and closing the sim-to-real gap remain open challenges.Future directions include real-world dressing, fabric parameter identification, and computational design for sports suits.

A EXPERIMENT RUN TIME

The experiments use a gradient-based optimization setup evaluated on an 80-core, 80G-memory workstation. Reported optimization wall-clock times range from less than 30 minutes to 2 hours, with Table 4 detailing runtime components.

  • Optimization runs used a workstation with 80 CPU cores and 80G memory.
  • Optimization wall-clock time ranged from less than 30 minutes to 2 hours, depending on problem complexity.
  • Table 4 reports average runtime for the gradient-based examples, including forward-simulation and back-propagation times.

B EXPERIMENT DETAILS

The paper provides detailed specifications for the Sec. 6 examples, covering their setups, loss functions, and optimization decision variables.

  • Example descriptions specify each setup, its exact loss function, and the decision variables optimized.

B.1 System Identification

The system-identification examples optimize cloth or contact parameters against simulated targets. They include T-shirt material and wind parameters, plus a sphere friction coefficient.

  • T-shirt: The T-shirt loss compares optimized mesh positions with ground-truth positions over N = 240 time steps.
  • T-shirt: The T-shirt example optimizes stretching stiffness and parameterized external-wind parameters.The wind force at each node is 0.5[sin(ωt + ϕ) + 1.0]d.
  • Sphere: The sphere example uses the same loss structure as the T-shirt example over N = 300 time steps and optimizes its 1-DoF frictional coefficient.

B.2 Robot-Assisted Dressing

The robot-assisted-dressing examples optimize end-effector trajectories or fabric parameters for placing garments on target body models. They cover hat, sock, and dress tasks with task-specific losses and variables.

  • Hat: The hat task optimizes two end-effector cubic-Hermite-spline trajectories over 400 time steps.The spline parameters comprise two tangents and an endpoint, totaling 9 DoFs per spline.
  • Sock: The sock task optimizes four end-effector trajectories to hook the sock opening onto the foot and slide it upward onto the leg.Its loss sums position differences over manually selected sock-foot keypoint correspondences.
  • Dress: The dress task optimizes fabric density and bending stiffness using the bottom-edge height error relative to a target height.The optimized variables are d and k_bend, with the target determined when the desired apex angle is reached.

B.4 Real-to-Sim Example

The real-to-sim examples optimize cloth and wind-model parameters to match captured flag motion, while the hat task optimizes controller parameters for dressing from varied starting positions.

  • Flag: The flag task optimizes eight parameters spanning fabric stiffness, density, and wind-model variables to match real-world motion trajectories.The wind model includes a 3D vector d and coefficient vector k.
  • Hat: The hat task optimizes neural-network controller parameters so two end effectors place a hat on a head from any sampled starting position on a fixed-radius hemisphere.Training samples 20 starting positions per epoch and averages the loss across simulation sequences.
  • Hat: The hat objective combines end-effector deformation, target-pose distance over the final frames, and orientation difference from the target pose.The deformation term penalizes changes in distance between the two end effectors.

C OPTIMIZATION RESULTS FOR ALL RANDOM SEEDS

Across random seeds, L-BFGS-B generally reaches lower or comparable optimized losses than gradient-free methods using substantially fewer time steps, although some runs become trapped in local minima.

  • Overall results: L-BFGS-B achieves lower or comparable optimized loss than gradient-free methods for most experiments.The comparison covers optimization results across the reported random seeds and examples.
  • Overall results: L-BFGS-B often uses a fraction, sometimes an order of magnitude fewer, of the time steps required by gradient-free methods.The reported efficiency advantage is attributed to gradient information from the differentiable simulator.
  • Overall results: Some random seeds produce relatively large final loss percentages when L-BFGS-B becomes stuck in a local minimum.This indicates that the gradient-based optimizer does not consistently avoid unfavorable local minima.
Loading 2106.05306v3…