Skip to content

Shapemetry API


Shapemetry API / MeshJSON

Type Alias: MeshJSON

MeshJSON = object

Defined in: types.ts:182

Plain-data serialization of Mesh (half-edge, n-gon, single outer loop per face — no holes). positions is a flat XYZ pool; each entry in faces is an array of vertex indices (CCW). faceUvs, when present, mirrors faces: each inner array is [u, v, u, v, ...] paired with that face's corners — per-corner so a shared vertex can carry different UV in each face. materials, when present, has one entry per face (null = no material), each an id keyed into materialPalette. Texture assets referenced by materials live in texturePalette — shared across materials to avoid duplicate blobs.

Properties

positions

positions: number[]

Defined in: types.ts:183


faces

faces: number[][]

Defined in: types.ts:184


faceUvs?

optional faceUvs?: number[][]

Defined in: types.ts:185


materials?

optional materials?: (string | null)[]

Defined in: types.ts:186


materialPalette?

optional materialPalette?: MaterialJSON[]

Defined in: types.ts:187


texturePalette?

optional texturePalette?: TextureAssetJSON[]

Defined in: types.ts:188