Skip to content
Shapemetry

@huukhanhnguyen/model / core/scene

core/scene

applyOverrides()

applyOverrides(model, params): () => void

Apply params as parameter-input overrides and return a restore function that puts the original inputs back (evaluate() calls it in a finally — overrides never outlive the pass they were applied for).

Parameters

model

Model

params

Record<string, unknown>

Returns

() => void


invalidateLaneNodes()

invalidateLaneNodes(model): void

Blanket-invalidate every already-constructed lane node — the response to a "change" notification on the root collection (see constructor): a lane JSON edit (tables/textures/components/views/sheets) has no ArgumentNode of its own to dirty, so this is what makes a lane node's NEXT resolve() pick it up. Each node's own hasChanged() (nodes/LaneNode.ts — a content diff of that ONE record/chain's own small JSON against a snapshot taken at its last resolve) keeps this PRECISE: editing one texture/component/table must not force every OTHER already-resolved one to recompute too — cheap, since it's bounded by ONE record/chain's own JSON, unlike the whole-lane JSON.stringify hash the old _texturesSignature paid on every resolve of every chain. Root-graph edits (an ArgumentNode's setInput) do NOT need any of this — they already cascade precisely through the ordinary _dependents/markDirty chain (see _sceneNode's wiring above), same as ever. (_sceneNode itself is deliberately NOT included here — a lane-JSON edit never changes the 3D scene directly; the one path where it'd matter, a tableEntity/viewport/imageData/ placeComponent/displace operation consuming the edited lane, already cascades to it precisely through that operation's OWN dependency edge

  • the fold-adjacency _dependents.add(_sceneNode) wiring above.)

Parameters

model

Model

Returns

void


onAssetLoaded()

onAssetLoaded(model, url): void

Store finished loading url — readiness becomes a graph edge: dirty every url-method parameter pointing at that url (ordinary markDirty cascade reaches textCurve/imageData/pattern image consumers) and re-resolve material textureData. Texture chains AND component chains that embed the url as a literal (2026-07-22: a component may hold its OWN url-method parameter — share.ts's law — invisible to the root this.nodes scan above, and its ChainNode's resolveWith() memo has no other invalidation edge to late-arriving pixels) are dirtied wholesale (small N).

Parameters

model

Model

url

string

Returns

void


sceneDrawingData()

sceneDrawingData(model, reader?): ObjectData[]

The same scene, FLAT: every BlockData placement expanded into tessellated leaves (nodeMethods/block.ts's expandAndTessellate). The drawing path — resolveView/resolveSheet project world triangles, so a placement has to become geometry before it can be drawn.

Parameters

model

Model

reader?

string

Returns

ObjectData[]


scenePull()

scenePull(model, reader?): ScenePull

Full ScenePull (fold slices + frame) — internal single-path source for tessellate / collectGeometry.

Parameters

model

Model

reader?

string

Returns

ScenePull


sceneTessellation()

sceneTessellation(model, reader?): ObjectData[]

Tessellated ObjectData[] from the SceneNode cache — NO nested evaluate() (views/sheets use this so they don't re-enter Model.evaluate mid-resolve). BlockData placements are KEPT (not expanded); leaves are tessellated.

Parameters

model

Model

reader?

string

Returns

ObjectData[]

Last updated: 📖 3 min readEdit on GitHub