Realistic Deformable Cloth

Discussion in 'Support requests' started by Sridhar Thiagarajan, Jul 8, 2019.

  1. Hello,

    I am trying to get a near realistic deformable cloth for doing some sim-to-real stuff.

    Currently, my cloth XML is as follows

    <option timestep="0.002" solver="CG" tolerance="1e-6"/>

    <size nconmax="300" njmax="1000" nstack="1000000"/>

    <composite type="cloth" count="7 7 1" spacing="0.05" flatinertia="0.01">
    <joint kind="main" damping="0.001"/>
    <joint kind="twist" damping="0.0001"/>
    <geom type="capsule" size="0.015 0.01" rgba=".8 .2 .1 1" friction="0.1 0.005 0.0001"/>

    1) When I add a shear tendon, the cloth behavior changes a lot and the diagonal connections make the cloth move together as a unit in the same direction. Is this the intended behavior? I read that joints are preferred over tendons due to implicit Euler integration, is there something I am losing by using joints? Joints don't seem to have a shear attribute.

    2) flatinertia : "The idea is to set it to a small value, say 0.01, in which case the inertias of the body elements will correspond to flat boxes aligned with the cloth (which can then be used for lift forces). This will not change the geom shapes, but instead will set the body inertias directly and disable the automatic computation of inertia from geom shape for the composite body only. "

    Could you explain how changing this ratio to a positive value corresponds to a more realistic modeling scenario? I am unable to understand from this quote in the documentation.

    3) If I wanted to define friction between all the bodies in the composite with a plane, is there an easy way to define pairs? (rather than define a lot of pairs and their properties)

    4) Am I missing any other major additions (joints/tendons/properties) which could be changed compared to the default values for the cloth?

    Last edited: Jul 8, 2019
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    1) Joints and tendons are different elements. Sheer is not an attribute of tendons; it creates tendons. You can set all the joint and tendon properties allowed by MJCF. Sheer tendons make the material more rigid because the introduce equality constraints on the diagonal distances. But you can make these constraints soft by adjusting the solimp and solref parameters.

    2) The cloth is modeled as a grid of geoms and not as an actual continuous surface. This means that all the mass is clustered at the grid points. Flatinertia allows the mass to be spread out. Press I in the simulator to render the equivalent inertia boxes and the effect will become obvious. This is especially useful if you want to simulate lift/drag forces -- which requires very flat inertia boxes to have any effect.

    3) You don't need to define pairs. The gem contype/conaffinity mechanism can be used to do this. All geoms of the composite object have the same properties -- so colliding all of them with the plane involves the same settings as colliding a single geom with the plane.

    4) Again, almost all the standard geom/joint/tendon properties can be adjusted within composite bodies, as listed in the documentation.