Skip to content
Shapemetry

@huukhanhnguyen/model / core/evaluationSnapshot

core/evaluationSnapshot

captureEvaluationSnapshot()

captureEvaluationSnapshot(model, result?): EvaluationSnapshot

Capture a just-evaluated model into a worker-safe snapshot. Call after model.evaluate() (or with a completed EvaluateResult).

Parameters

model

Model

result?

EvaluateResult

Returns

EvaluationSnapshot


evaluateResultFromSnapshot()

evaluateResultFromSnapshot(model, snapshot): EvaluateResult

Build an EvaluateResult after install — same host-facing shape as model.evaluate(), without running the fold on this thread. Viewport uses .nodes + collectRenderFrame (SceneNode cache). The lazy .geometry mesh export path is empty until a full tessellate is requested on a thread that can afford it (export still may call model.tessellateScene).

Parameters

model

Model

snapshot

EvaluationSnapshot

Returns

EvaluateResult


installEvaluationSnapshot()

installEvaluationSnapshot(model, snapshot): void

Install a worker snapshot onto a Model that was just fromJSON'd and has NOT been evaluated on this thread. Seeds SceneNode + root body values so collectRenderFrame / sceneFrame serve geometry without a main-thread fold.

Parameters

model

Model

snapshot

EvaluationSnapshot

Returns

void

Last updated: 📖 1 min readEdit on GitHub