Guide
What it is: the RUNTIME parametric kernel - load ModelJSON, build a node graph, evaluate(), emit scene vocabulary for hosts.
Headless and deterministic. Depends on geometry.
Pipeline
ModelJSON → Model.fromJSON({ registry }) → model.evaluate(params?)
→ EvaluateResult { geometry, materials, params, … }
→ scene ObjectData / Material (host-consumed)Document shapes
type ModelJSON = {
title: string
parameters?: (Operation | Group)[] // header value bindings
objects?: SceneNode[] // ObjectNode | BlockNode; key required
materials?: Operation[]
layers?: Operation[]
styles?: …; textStyles?: …; annotationStyles?: …;
cameras?: LaneNode[] // look-at args → CameraObject[]
animations?: …; components?: …;
textures?: …; tables?: …; views?: …; sheets?: …;
}
// No nodeType field - discriminate by method vs operations[]
// Data chains (object bodies, component bodies/openings, sheets) use DataStep;
// config lanes use Operation (animation? only). Group is display grouping.
type DataStep = { method: string; args?: { key: string; input: string }[]; key?: string; … }
type Operation = { method: string; args?: …; key?: string; animation?: … }
type Group = { operations: (DataStep | Group)[]; key?: string; instances?: … }
type ObjectNodeBase = { key: string; label?: string; enabled?: string; instances?: NodeInstance[] }
type ObjectNode = ObjectNodeBase & { operations: (Operation | Group)[] }
type BlockNode = ObjectNodeBase & { objects: SceneNode[] }
type SceneNode = ObjectNode | BlockNode
// Evaluated camera: projection on `data` (CameraData + optional gizmoSize).
// Placement is CameraObject.instances[i].transformation — there is no `camera` field.
type CameraData = { fov: number; near?: number; far?: number } | { height: number; near?: number; far?: number }
type CameraObject = BaseObject & { type: "camera"; data: CameraData & { gizmoSize?: number } }
// Evaluated sheet. No PageObject type — paper content is SceneObject[].
type Page = { title: string; objects: SceneObject[]; width: number; height: number }Args are expression strings evaluated at runtime. Producers concat into the stream; transforms map/reduce; groups nest folds.
Entry points
| Specifier | Role |
|---|---|
@huukhanhnguyen/model | Full runtime |
@huukhanhnguyen/model/compute | Compute-only import graph |
@huukhanhnguyen/model/nodes | Default method registry |
@huukhanhnguyen/model/src/* | Live src/ (parashape check-/gen- import the source registries) |
import { Model } from '@huukhanhnguyen/model'
import { nodeRegistry } from '@huukhanhnguyen/model/nodes'
const model = Model.fromJSON(json, { registry: nodeRegistry })
const result = model.evaluate()Method tables (AUTOGEN): REFERENCE.md, DATA.md.
Modules
- commandRegistry/laneEdit
- compute
- conventions
- conventions/drawing
- conventions/drawing/standard
- conventions/lighting
- conventions/lighting/standard
- conventions/material
- conventions/material/standard
- conventions/registry
- conventions/texture
- conventions/types
- core/analyze
- core/applyDocument
- core/BaseCollection
- core/BaseObject
- core/behaviors
- core/drafting
- core/editHistory
- core/evaluate
- core/evaluationSnapshot
- core/evaluationStack
- core/graphSnapshot
- core/identity
- core/inspect
- core/isolated
- core/laneFields
- core/laneNodes
- core/maybeAsync
- core/ModelScope
- core/modelSerialize
- core/modelUpdate
- core/Notifier
- core/preview
- core/ref
- core/renderDiff
- core/rootFold
- core/sanitizer
- core/scene
- core/seed
- core/share
- core/typeRegistry
- core/unit
- core/UnitSymbols
- document/assets
- document/dataKind
- document/environment
- document/light
- document/objectData
- document/styles
- document/views
- expression
- functionRegistry
- functionRegistry/catalog
- functionRegistry/catalog/analysis
- functionRegistry/catalog/display
- functionRegistry/catalog/geometry
- functionRegistry/catalog/runtime
- functionRegistry/catalog/transform
- functionRegistry/wiring
- graph
- graph/spaces
- import/obj
- inspect-cli
- lanes/animations/animation
- lanes/animations/nodes
- lanes/annotationStyles/annotationStyles
- lanes/annotationStyles/nodes
- lanes/cameras/camera
- lanes/cameras/cameras
- lanes/cameras/nodes
- lanes/components/components
- lanes/components/nodes
- lanes/layers/layers
- lanes/layers/nodes
- lanes/materials/materials
- lanes/materials/nodes
- lanes/objects/diff
- lanes/objects/drawingData
- lanes/objects/instanceProperties
- lanes/objects/nodes
- lanes/objects/sceneObjectFromData
- lanes/objects/viewObject
- lanes/patterns/nodes
- lanes/patterns/patterns
- lanes/sheets/crop
- lanes/sheets/defaultTemplate
- lanes/sheets/nodes
- lanes/sheets/sheets
- lanes/styles/nodes
- lanes/styles/styles
- lanes/tables/csv
- lanes/tables/nodes
- lanes/tables/tables
- lanes/textStyles/nodes
- lanes/textStyles/textStyles
- lanes/textures/evaluate
- lanes/textures/formula
- lanes/textures/nodes
- lanes/textures/noise
- lanes/textures/ops
- lanes/textures/params
- lanes/textures/raster
- lanes/textures/textureResolve
- lanes/textures/textures
- lanes/views/nodes
- lanes/views/renderViews
- lanes/views/viewChain
- lanes/views/views
- Model
- nesting
- nodeMethods/annotation
- nodeMethods/axis
- nodeMethods/barcode
- nodeMethods/block
- nodeMethods/boundsValue
- nodeMethods/brepFace
- nodeMethods/colorValue
- nodeMethods/curve
- nodeMethods/data
- nodeMethods/dataCollection
- nodeMethods/deform
- nodeMethods/displace
- nodeMethods/face
- nodeMethods/faceSplit
- nodeMethods/faceValue
- nodeMethods/filterSynthesis
- nodeMethods/font
- nodeMethods/formatValue
- nodeMethods/hatch
- nodeMethods/importFaces
- nodeMethods/light
- nodeMethods/linearPart
- nodeMethods/mesh
- nodeMethods/meshEdges
- nodeMethods/nesting
- nodeMethods/noiseValue
- nodeMethods/parameter
- nodeMethods/placePart
- nodeMethods/planarize
- nodeMethods/plane
- nodeMethods/point
- nodeMethods/pointCloudValue
- nodeMethods/projection
- nodeMethods/quaternionValue
- nodeMethods/randomValue
- nodeMethods/render
- nodeMethods/section
- nodeMethods/skeleton
- nodeMethods/slice
- nodeMethods/solid
- nodeMethods/solid/generate
- nodeMethods/solid/helpers
- nodeMethods/solid/mesh
- nodeMethods/solid/modify
- nodeMethods/solidify
- nodeMethods/solidValue
- nodeMethods/statValue
- nodeMethods/straightSkeleton
- nodeMethods/subdivide
- nodeMethods/sun
- nodeMethods/surface
- nodeMethods/surfaceDivide
- nodeMethods/surfaceValue
- nodeMethods/tableNamespace
- nodeMethods/toCurve
- nodeMethods/toShell
- nodeMethods/transformValue
- nodeMethods/tree
- nodeMethods/triangulate
- nodeMethods/unfold
- nodeMethods/utils
- nodeMethods/vector
- nodeMethods/voronoi
- nodeMethods/wholeArray
- nodes/ArgumentNode
- nodes/BaseNode
- nodes/CollectionNode
- nodes/ContainerNode
- nodes/DataNode
- nodes/ExpressionNode
- nodes/hooks
- nodes/KeyedNode
- nodes/LaneNode
- nodes/lockedFold
- nodes/NodeCollection
- nodes/ObjectNode
- nodes/OptionNode
- nodes/ParameterNode
- nodesRegistry
- nodesRegistry/catalog
- nodesRegistry/catalog/assetLanes
- nodesRegistry/catalog/curves
- nodesRegistry/catalog/drawing
- nodesRegistry/catalog/faceModifiers
- nodesRegistry/catalog/faceProducers
- nodesRegistry/catalog/instanceModifiers
- nodesRegistry/catalog/instanceProducers
- nodesRegistry/catalog/laneDisplay
- nodesRegistry/catalog/mesh
- nodesRegistry/catalog/modifiers
- nodesRegistry/catalog/parameters
- nodesRegistry/wiring
- registry
- registry/builtins
- registry/contract
- registry/helpers
- registry/Registry
- schema
- schema
- schema/_locals/domains__face
- schema/_locals/domains__mesh
- schema/_locals/domains__nesting_nested
- schema/_locals/domains__placePart_nested
- schema/_locals/domains__triangulate_nested
- schema/_locals/inspect_nested
- schema/_locals/model__isolated
- schema/_locals/validate_nested
- schema/analyze
- schema/animation
- schema/commandRegistry
- schema/components
- schema/core
- schema/dataKind
- schema/domains
- schema/domains/data
- schema/domains/deform
- schema/domains/face
- schema/domains/filter
- schema/domains/fold
- schema/domains/font
- schema/domains/hatch
- schema/domains/import
- schema/domains/kernel
- schema/domains/mesh
- schema/domains/nesting
- schema/domains/tree
- schema/domains/voronoi
- schema/editHistory
- schema/evaluationSnapshot
- schema/expression
- schema/functionRegistry
- schema/graphSnapshot
- schema/hostTypes
- schema/lanes
- schema/layers
- schema/lockedFold
- schema/looseNode
- schema/model
- schema/modelRuntime
- schema/modelUpdate
- schema/nesting
- schema/nodeArgs
- schema/nodes
- schema/nodesRegistry
- schema/preview
- schema/publicSurface
- schema/ref
- schema/references
- schema/registry
- schema/renderDiff
- schema/renderViews
- schema/share
- schema/sheets
- schema/spaces
- schema/store
- schema/tables
- schema/textureResolve
- schema/textures
- schema/utils
- schema/validate
- schema/viewChain
- schema/views
- schema/vocabulary/builtinParams
- schema/vocabulary/cameras
- schema/vocabulary/constants
- schema/vocabulary/instanceProperties
- schema/vocabulary/laneMethods
- schema/vocabulary/types
- Store
- utils/convertExpression
- utils/unitConvert
- validate
- validate/animations
- validate/assets
- validate/cameras
- validate/components
- validate/diagnose
- validate/expressions
- validate/objects
- validate/parse
- validate/registry
- validate/rewrite
- validate/shared
- validate/skin
- validate/tables
- validate/textures
- validate/views