Cloth#
Cloth is the material model for simulating curves. Cloth objects in Blender must be triangulated mesh objects.
Related Objects#
Solver-
The Solver object for the simulation.
Rest Shape-
The Rest Shape is the object for defining the shape at rest. The simulation object will returns to the Rest Shape when there is no external force. When no Rest Shape is specified, the start frame of the simulation object is used as the Rest Shape. Rest Shape needs to have the same number of vertices as the simulation object.
Target Shape-
During simulation, the Target Shape creates a force to pull the simulation object towards the Target Shape. It designed for achieving art directed shape during motion. The strength of the pulling force is controlled Target Stiffness and Target Damping parameter. Target Shape needs to have the same number of vertices as the simulation object.
Driven Shape-
As noted in overview, in Blender, the simulation cache directly deforms the point attribute before any modifier is applied. While during export, all modifiers of the simulation object is applied. This means that having any modifiers on the simulation object that changes point position or vertex count on the simulation object will leads to a discrepancy between the simulation mesh and the simulation cache. Driven Shape is designed to bypass this limitation. If user wish to apply modifiers after the simulation result, user can apply the modifiers to the Driven Shape instead of the simulation object. When Driven Shape is set, the simulation will export from the simulation object, but deforms the Driven Shape (instead of the simulation object).
Cloth Material Models#
Cloth objects can be one of two different type of materials, uv panel Baraff et. al. or elastic membrane Macklin et. al.
UV panel#
UV panel material follows the tailor style workflow. User can create cloth 2D patches, and use constraints to stitch the cloth patches together. In such case, the cloth rest shape is defined in 2D using UV parameters stored in hi_phy_cloth_uv attribute.
In Blender, we provided a Convert UV button on the cloth object panel to convert the blender UV attribute to hi_phy_cloth_uv attribute. However, the cloth uv attribute is not 0 - 1 as the UV texture coordinate, but rather should be the physical coordinate of the cloth panel when lay flat on the UV plane. User can use addons such Magic UV to create a UV coordinate that matches the UV scale of cloth panels.
Scaling the cloth panel
Because the transformation of the 3D model can skew the surface of a mesh. We do not automatically adjust the cloth uv coordinate if the 3D model is scaled. To ensure the simulation works as intended, user need to manually adjust the cloth uv attribute to match the scaling of the cloth model.
| Property Name | Description | Unit | Is Mappable | Is Animatable |
|---|---|---|---|---|
| Stretch Stiffness U | How much the panel resists stretching along the U direction | \(g/s^2\) | YES | YES |
| Stretch Stiffness V | How much the panel resists stretching along the V direction | \(g/s^2\) | YES | YES |
| Stretch Damping | Damping for the stretch motion | \(1/s\) | YES | YES |
| Sheer Stiffness | How much the panel resists sheering | \(g/s^2\) | YES | YES |
| Sheer Damping | Damping for the sheering motion | \(1/s\) | YES | YES |
| Bend Stiffness U | How much the panel resists bend along the U direction | \(g*cm/s^2\) | YES | YES |
| Bend Stiffness V | How much the panel resists bend along the V direction | \(g*cm/s^2\) | YES | YES |
| Bend Damping | Damping for the bend motion | \(1/s\) | YES | YES |
Elastic Membrane#
Elastic Membrane are material models that are rubber like. It can be used to simulate 2D surfaces that does not have a clear panel structure, such as gloves. UV parameters are not need for simulate elastic membranes
| Property Name | Description | Unit | Is Mappable | Is Animatable |
|---|---|---|---|---|
| Lambda \(\lambda\) | The first Lamé parameter, \(\lambda\). It roughly corresponding to volume preservation | \(g/s^2\) | YES | YES |
| Mu \(\mu\) | The second Lamé parameter, shear modulus, \(\mu\). It roughly corresponding to resistance to the shearing motion | \(g/s^2\) | YES | YES |
| Mu Damping | Damping for the shear motion | \(1/s\) | YES | YES |
| Lambda Damping | Damping for the area changing (stretch) motions | \(1/s\) | YES | YES |
| Bend Stiffness V | How much the panel resists bend along the V direction | \(g*cm/s^2\) | YES | YES |
| Bend Damping | Damping for the bend motion | \(1/s\) | YES | YES |
Animating the material model
The cloth material model is animatable. User can key the property and pick the material that fit the situation the best for each frame. However, each material has a seperate paramter set that user will need to tune. The two material models do share the same rest shape.
Other Properties#
| Property Name | Description | Unit | Is Mappable | Is Animatable |
|---|---|---|---|---|
| Target Stiffness | The strength of the target shape pull | \(10\mu N/cm = g/s^2\) | YES | YES |
| Target Damping | Damping factor for target shape pull to prevent oscillation. \(1\) is critical damping | Unitless | YES | YES |
| Can Collide With Other Simulation Object | Can this simulation object collide with other simulation objects | YES | YES | |
| Can Collide With Colliders | Can this simulation object collide with kinematic colliders | YES | YES | |
| Gravity | The gravitaional acceleration | \(cm/s^2\) | YES | YES |
| External Force | Additional external force | \(10\mu N = g*cm/s^2\) | YES | YES |
| Inner Thickness | The thickness along the negative normal direction | Model | YES | YES |
| Outer Thickness | The thickness along the positive normal direction | Model | YES | YES |
| Inner Friction Coefficient | The friction coefficient for the inside | Unitless | YES | YES |
| Outer Friction Coefficient | The friction coefficient for the outside | Unitless | YES | YES |
| Barrier Stiffness | The stiffness of the collision barrier for contact | \(10\mu N = g*cm/s^2\) | YES | YES |
| Density | Surface density of the cloth object | \(g/cm^2\) | YES | YES |
| Relative Motion Damping | Damping factor for relative motion between two adjacent vertices. | \(1/s\) | YES | YES |
Example#
You can find the an example file for cloth simulation with UV panel materials here.
You can find the an example file for cloth simulation with elastic membrane materials with resolution test here.
Biased Triangulation
Because HiPhyEngine requires all meshes to be triangulated, the regularity of the triangulation will creates a preferred bending direction on the material. Increasing resolution of the mesh, and randomize the triangulation can mitigate such artifacts.
You can find a more complex example of an animated hand taking off a glove here. This example shows how user can use soft collider for the hands and cloth object for the glove, and even though the animation contains self intersection, HiPhyEngine is able to resolve the collision and create an intersection free result for both hands and the glove.
The last example showcases a twisted cloth, and how HiPhyEngine handles layered contact. Note that for complex layered collisions, low frictional value can cause jitters. User might need to increase friction to stabilize the simulation. In this example, the simulation is stable for friction of value \(1\).