@huukhanhnguyen/model / registry/helpers
registry/helpers
applyGeometry()
applyGeometry(
state,op):ChainState
Run a geometry op over the *Data document. Nested BlockData passes through untouched, unless the stream is array/mirror leaf packs.
Parameters
state
op
(data) => unknown
Returns
dataOp()
dataOp(
fn,argValues,argTypes): (data) =>unknown
Parameters
fn
(...a) => unknown
argValues
unknown[]
argTypes
string[]
Returns
(data) => unknown
declaresCallback()
declaresCallback(
type):boolean
Does this arg's declared type ACCEPT a callback? A union counts: an arg typed binary | function takes one, and testing for the exact string "function" silently CALLED every such callback instead of passing it through — which is how applyVisible((e, i) => …) became true.
Parameters
type
string | undefined
Returns
boolean
explodeGroups()
explodeGroups(
state,_nested):ChainState
Dissolve nested blocks into the inner *Data (SketchUp Explode).
Through bakeBlock, so each PLACEMENT contributes its own leaf with its own matrix applied. Reading object.data directly instead dropped the placement: every array/mirror copy landed back on the original, and the weld then fused the duplicates into one body — a wrong answer that still looked like a valid solid.
Parameters
state
_nested
boolean
Returns
looseToBlocks()
looseToBlocks(
state):ChainState
Cluster loose curves/faces into connected BlockData nests.
Parameters
state
Returns
makeBlock()
makeBlock(
state):ChainState
Wrap the stream as one BlockData nest. Already a block passes through.