Skip to content
Shapemetry

@huukhanhnguyen/model / schema/modelRuntime

schema/modelRuntime

EvaluateDiagnostic

EvaluateDiagnostic = { message: string; nodeId?: string; phase: "load" | "render" | "texture"; }

message

message: string

nodeId?

optional nodeId?: string

Runtime id of the node the failure is attributed to, when known.

phase

phase: "load" | "render" | "texture"

The pass that produced it: "load" (expression syntax), "render" (data tessellation), "texture" (texture-chain resolve).


EvaluateResult

EvaluateResult = { diagnostics: EvaluateDiagnostic[]; fonts: AssetFile[]; geometry: GeometryNode[]; layers: Layer[]; materials: MaterialData[]; model: ModelHost; name: string; nodes: NodeCollectionHost<ChildNode>; params: ParamInfo[]; }

diagnostics

diagnostics: EvaluateDiagnostic[]

Fail-soft failures from this evaluation (render/texture/load). Empty when nothing went wrong. NOTE: .geometry is lazy — render diagnostics land here when it is first read, not when evaluate() returns.

fonts

fonts: AssetFile[]

The document's font ASSET records ({ name, url }), not the kernel's registry handles — collectFonts reads ModelScope.fonts. Was declared FontData ({ ids, name }), which the runtime never produced.

geometry

geometry: GeometryNode[]

layers

layers: Layer[]

materials

materials: MaterialData[]

model

model: ModelHost

The evaluated Model itself — the ONLY object that can emit the FULL document (toJSON() carries every lane: materials/fonts/textures/ views/components/sheets + unit). A host that persists a doc must build it from here, never by hand-partitioning nodes (that drops the lanes — the exact bug this field exists to prevent).

name

name: string

nodes

nodes: NodeCollectionHost<ChildNode>

params

params: ParamInfo[]


GeometryItem

GeometryItem = Record<string, unknown>


GeometryNode

GeometryNode = { children: GeometryNode[]; instances?: GeometryPlacement[]; items: GeometryItem[]; key: string; material?: string; packs?: { instances: GeometryPlacement[]; items: GeometryItem[]; }[]; source?: ContainerNodeHost | DataNodeHost; }

children

children: GeometryNode[]

instances?

optional instances?: GeometryPlacement[]

≥2 placements of the shared items (single-definition instance path). Absent = baked or multi-pack.

items

items: GeometryItem[]

key

key: string

material?

optional material?: string

packs?

optional packs?: { instances: GeometryPlacement[]; items: GeometryItem[]; }[]

Multi-member instance path: each pack is one nest rendered once (items) with its own placements. Used when array* copies several different source shapes step-aligned (each source keeps its own def).

instances

instances: GeometryPlacement[]

items

items: GeometryItem[]

source?

optional source?: ContainerNodeHost | DataNodeHost


ParamInfo

ParamInfo = { key: string; type: string; value: unknown; }

key

key: string

type

type: string

value

value: unknown


PartMeta

PartMeta = { collisionTolerance?: number; foldPolicy?: "rigid" | "layered"; grain?: "length" | "width"; kerfWidth?: number; kFactor?: number; label: string; material?: string; minFlange?: number; remainingThickness?: number; section?: string; thickness?: number; }

A part component's fold metadata, read off its own parameters lane — see the PART METADATA CONVENTION block above _partMetaOf.

collisionTolerance?

optional collisionTolerance?: number

foldPolicy?

optional foldPolicy?: "rigid" | "layered"

grain?

optional grain?: "length" | "width"

kerfWidth?

optional kerfWidth?: number

kFactor?

optional kFactor?: number

label

label: string

material?

optional material?: string

minFlange?

optional minFlange?: number

remainingThickness?

optional remainingThickness?: number

section?

optional section?: string

thickness?

optional thickness?: number

Last updated: 📖 3 min readEdit on GitHub