Skip to content

Cloth

type: "cloth" · Deformer: moves the points of the drawing. · Editor menu: Experimental.

The drawing becomes a sheet of cloth for the next simulation: a following Gravity, or the Physics of an enclosing group. A mesh of about Resolution cells along its longer side fills each sheet; it resists stretching (Stiffness) and bending (Bending) and folds in depth, towards and away from the viewer, so it hangs, sways and flaps instead of keeping its shape like Soft Body. Everything drawn on it (fills, strokes, text, several shapes) is carried by the mesh. The shapes it receives that touch each other are one sheet (put it on a group of stripes for a striped flag); Clone copies apart are separate sheets. Depth makes the folds that come towards the viewer grow a little (perspective). Shade (off by default) darkens the folds that turn away from a light at the top left and lightens those that face it, in translucent black and white over the sheet. Pin holds it (its Points and Regions catch the mesh, inside too); Wind blows it across its surface and, with Turbulence, in depth, which is what makes a flag flap. Drag & throw grabs it and Click push pushes it. It collides with floors and the other bodies of its world, which collide with it too (in the plane; it doesn’t collide with itself), and drapes over Solids as volumes (a circle is a sphere): it rides up their front and slides off under its own weight; Weight is how heavy it is against them: light cloth gives way to what hits it. Changes no geometry by itself. On a shape with Soft Body too, Cloth wins.

Param Type Default Range Notes
cells number 16 min 4, max 48, step 1 not animatable; label: Resolution
stiffness number 0.9 min 0, max 1, step 0.01 shown as a percentage in the editor (0.5 is 50 %)
bending number 0.02 min 0, max 1, step 0.01 shown as a percentage in the editor (0.5 is 50 %)
damping number 0.02 min 0, max 1, step 0.01 shown as a percentage in the editor (0.5 is 50 %)
depth number 0.4 min 0, max 1, step 0.01 shown as a percentage in the editor (0.5 is 50 %)
shade number 0 min 0, max 1, step 0.01 shown as a percentage in the editor (0.5 is 50 %)
weight number 0.25 min 0.05, max 1, step 0.01

Missing parameters take their default. Numbers and angles (and points and colours) can be animated with a track { on: "modifier", modifier: "<id>", param: "<name>" } unless noted.

Inside a node’s stack (effects run top to bottom):

{
"id": "cloth-1",
"type": "cloth",
"params": {
"cells": 16,
"stiffness": 0.9,
"bending": 0.02,
"damping": 0.02,
"depth": 0.4,
"shade": 0,
"weight": 0.25
}
}

Generated from the schema of @svertik/engine. See the index.