Docs / Fabric simulation

Glossary: FabricCutMesh

The members of FabricCutMesh, in alphabetical order.

Color legend plain property

A cut sheet’s triangles with clean lips: the triangles a cut damaged, clipped along the strokes that cut them at whatever angle those ran, so a straight cut draws as a straight line rather than a staircase.

A sealed class with no public constructor: Fabric.CreateCutMesh makes one, once per change of damage, and hands back the same instance until the next cut, tear, mend or rebuild. Fabric.CaptureSurface picks against that instance too, so treat its arrays as read-only. Indices below ParticleCount are particles; the rest name lip vertices, SeamVertices, which a vertex shader evaluates with FabricEvaluateVertex. Drawing only: the simulation underneath still tears whole threads, within about a cell of the drawn lip. The cuts page shows it in context, with code.

Names are colored by what they are: a property; values and fields keep the plain color.

Properties

Indices →

int[] · Read-only. Three indices per triangle, wound as CreateTriangleIndices winds them. An index below the particle count is a particle of the buffer; an index i at or above it is the seam vertex SeamVertices[i - ParticleCount]. Upload it to a 32-bit index buffer. On a sheet with no cut strokes, whole or damaged only through Tear, it is the very list CreateTriangleIndices returns. A piece whose particles no longer hang together through the surviving weave, or that holds fewer than two particles, is left out rather than stretched across separated cloth.

SeamVertices →

FabricSeamVertex[] · Read-only. The lip vertices, each a flat-sheet point blended from particles on its own side of the cut, so the lips part as the rip opens. Upload them to a structured buffer bound to FabricSeamVertices. Empty on an uncut sheet; keep the buffer at least one element long all the same, since the shader declares it and a real resource has to sit behind the binding. The placeholder vertex buffer has to cover every id the indices name, ParticleCount + SeamVertices.Length.

TriangleCount →

int · Read-only. The triangles in Indices, a third of its length: the count to draw. It can exceed Fabric.TriangleCount, and even the whole sheet’s two per square, since a clipped square yields more, smaller triangles: size the index buffer from this mesh, not from the sheet.