Skip to content
Shapemetry

Model - Block

API reference for src/nodeMethods/block on @huukhanhnguyen/model, reachable from ./compute.

See the Guide for the ModelJSON / evaluate pipeline.

API reference

Signatures are generated from the live package .d.ts - not hand-written.

bakeBlock

function

Bake a (possibly nested) entity into a flat list of renderable leaf entities by exploding every blockEntity (resolving its definition from definitions). A non-block entity passes through (wrapped in a one-element array). EVERY baked leaf gets a FRESH id — a definition placed in more than one spot (e.g. a node + a clone of it) must not emit colliding ids into the scene.

deep (default true) recurses through every nesting level → flat leaves. deep false dissolves ONLY this block by one level: its children are transformed by the placement but a child that is itself a block STAYS a block (used by blockExplode with nested:false).

bakeBlock(entity: Entity, definitions?: DefinitionMap, inherited?: Inherited, deep?: boolean): Entity[]

makeBlock

function

Wrap the ENTIRE entity array into ONE blockEntity, unconditionally — no connectivity clustering, no kind filtering (points / faces / curves / already-nested blocks all go in together; see looseToBlocks for the per-cluster variant). Empty input stays empty; nothing to wrap.

makeBlock(entities: Entity[], definitions: DefinitionMap): Entity[]
Last updated: 📖 1 min readEdit on GitHub