Skip to content
Shapemetry

@huukhanhnguyen/model / schema/domains/mesh

schema/domains/mesh

BakedTriangleMesh

BakedTriangleMesh = TriangleMesh & { groups: MeshGroup[]; normals: number[]; uvs: number[]; }

The display-tessellation payload: faces → the display triangle mesh, tessellated from the BREP boundary in the wasm kernel, one whole outer shell per document and the results concatenated.

It IS the canonical TriangleMesh (@huukhanhnguyen/types) — no channel of its own — narrowed so the three channels the display path always fills stop being optional: every consumer reads normals.length / uvs without a guard, and ?? [] there would be a lie about a producer that never omits them. The per-point attr channels (uvs2/skin/morphs) a Shell once carried are gone for good: a brep face has no loop-point index space to hang them on, so anything needing them is a meshData, whose own MeshVertex entries declare them.

UV follows law 11c: the kernel's own surface UV is the DERIVED frame used whenever uvMatrix is absent (for a planar face it is already plane-frame millimetres, so the tiling law repeat = 1/tile holds); an AUTHORED uvMatrix WINS and is re-projected onto the emitted vertices, or a deliberately placed texture would silently lose its origin and rotation.


MeshEdgeRecord

MeshEdgeRecord = { faceCount: number; sharp: boolean; v1: number; v2: number; }

faceCount

faceCount: number

How many faces use this undirected edge.

sharp

sharp: boolean

Hard edge — split normal at render, Blender sharp_edge.

v1

v1: number

v2

v2: number

Last updated: 📖 1 min readEdit on GitHub