Skip to content
Shapemetry

@huukhanhnguyen/model / schema/vocabulary/builtinParams

schema/vocabulary/builtinParams

BuiltinParamDef

BuiltinParamDef = { default: number | string; tooltip: string; type: string; }

One lane-builtin parameter's seeding record. NOT an ArgDef (schema/registry.ts): an ArgDef describes an arg EXPRESSION on a method (default is optional expression text), while this is a lane's reserved parameter key whose default is a required literal VALUE (number|string) and whose identity is the record key, not a key field.

default

default: number | string

Value used when the lane entry declares no parameter with this key.

tooltip

tooltip: string

type

type: string

A TYPE_REGISTRY name — the value method a declaration should use.


BuiltinParamLane

BuiltinParamLane = keyof typeof LANE_BUILTIN_PARAMS


Builtins

Builtins<T> = { -readonly [K in keyof T]: T[K] extends { default: infer D } ? D extends string ? string : D extends number ? number : D : never }

Same keys after resolution, widened to what a declaration may carry — the defaults are literals, a resolved value is any number/string. NOT a duplicate of BuiltinValues — this is the POST-resolution shape (widened).

Type Parameters

T

T


BuiltinValues

BuiltinValues<T> = { -readonly [K in keyof T]: T[K] extends { default: infer D } ? D : never }

The default VALUES of one lane's table, each key keeping the LITERAL type it was declared with (wrap: "repeat", paperWidth: 420). NOT a duplicate of Builtins — this is the PRE-resolution shape (literal defaults).

Type Parameters

T

T


LANE_BUILTIN_PARAMS

const LANE_BUILTIN_PARAMS: { textures: { filter: { default: "linear"; tooltip: "Sampling filter: 'linear' | 'nearest'."; type: "string"; }; imageHeight: { default: 0; tooltip: "Output height in pixels. 0 = derive from the physical aspect (imageWidth × lengthY/lengthX — square physical pixels)."; type: "number"; }; imageWidth: { default: 512; tooltip: "Output width in pixels — source ops default their own `width` to it; declaring it resamples the finished chain to exactly this size."; type: "number"; }; lengthX: { default: 1000; tooltip: "Physical width in mm of ONE tile. Declaring it attaches the size to the output stream (TextureData.tileWidth)."; type: "length"; }; lengthY: { default: 1000; tooltip: "Physical height in mm of ONE tile (TextureData.tileHeight)."; type: "length"; }; uvSet: { default: 0; tooltip: "UV channel the texture samples: 0 = TEXCOORD_0, 1 = TEXCOORD_1."; type: "number"; }; wrap: { default: "repeat"; tooltip: "Sampling wrap out of bounds: 'repeat' | 'clamp' | 'mirror'."; type: "string"; }; }; }

textures

readonly textures: { filter: { default: "linear"; tooltip: "Sampling filter: 'linear' | 'nearest'."; type: "string"; }; imageHeight: { default: 0; tooltip: "Output height in pixels. 0 = derive from the physical aspect (imageWidth × lengthY/lengthX — square physical pixels)."; type: "number"; }; imageWidth: { default: 512; tooltip: "Output width in pixels — source ops default their own `width` to it; declaring it resamples the finished chain to exactly this size."; type: "number"; }; lengthX: { default: 1000; tooltip: "Physical width in mm of ONE tile. Declaring it attaches the size to the output stream (TextureData.tileWidth)."; type: "length"; }; lengthY: { default: 1000; tooltip: "Physical height in mm of ONE tile (TextureData.tileHeight)."; type: "length"; }; uvSet: { default: 0; tooltip: "UV channel the texture samples: 0 = TEXCOORD_0, 1 = TEXCOORD_1."; type: "number"; }; wrap: { default: "repeat"; tooltip: "Sampling wrap out of bounds: 'repeat' | 'clamp' | 'mirror'."; type: "string"; }; }

A texture chain's external contract: tile size in mm, output pixels, and the sampling triple. DECLARING a key is what activates it — an undeclared wrap/filter/uvSet keeps the default REPEAT + LINEAR + TEXCOORD_0, and undeclared tile mm leave the material record's own fallback in charge.

textures.filter

readonly filter: { default: "linear"; tooltip: "Sampling filter: 'linear' | 'nearest'."; type: "string"; }

textures.filter.default

readonly default: "linear" = "linear"

textures.filter.tooltip

readonly tooltip: "Sampling filter: 'linear' | 'nearest'." = "Sampling filter: 'linear' | 'nearest'."

textures.filter.type

readonly type: "string" = "string"

textures.imageHeight

readonly imageHeight: { default: 0; tooltip: "Output height in pixels. 0 = derive from the physical aspect (imageWidth × lengthY/lengthX — square physical pixels)."; type: "number"; }

textures.imageHeight.default

readonly default: 0 = 0

textures.imageHeight.tooltip

readonly tooltip: "Output height in pixels. 0 = derive from the physical aspect (imageWidth × lengthY/lengthX — square physical pixels)." = "Output height in pixels. 0 = derive from the physical aspect (imageWidth × lengthY/lengthX — square physical pixels)."

textures.imageHeight.type

readonly type: "number" = "number"

textures.imageWidth

readonly imageWidth: { default: 512; tooltip: "Output width in pixels — source ops default their own `width` to it; declaring it resamples the finished chain to exactly this size."; type: "number"; }

textures.imageWidth.default

readonly default: 512 = 512

textures.imageWidth.tooltip

readonly tooltip: "Output width in pixels — source ops default their own `width` to it; declaring it resamples the finished chain to exactly this size." = "Output width in pixels — source ops default their own `width` to it; declaring it resamples the finished chain to exactly this size."

textures.imageWidth.type

readonly type: "number" = "number"

textures.lengthX

readonly lengthX: { default: 1000; tooltip: "Physical width in mm of ONE tile. Declaring it attaches the size to the output stream (TextureData.tileWidth)."; type: "length"; }

textures.lengthX.default

readonly default: 1000 = 1000

textures.lengthX.tooltip

readonly tooltip: "Physical width in mm of ONE tile. Declaring it attaches the size to the output stream (TextureData.tileWidth)." = "Physical width in mm of ONE tile. Declaring it attaches the size to the output stream (TextureData.tileWidth)."

textures.lengthX.type

readonly type: "length" = "length"

textures.lengthY

readonly lengthY: { default: 1000; tooltip: "Physical height in mm of ONE tile (TextureData.tileHeight)."; type: "length"; }

textures.lengthY.default

readonly default: 1000 = 1000

textures.lengthY.tooltip

readonly tooltip: "Physical height in mm of ONE tile (TextureData.tileHeight)." = "Physical height in mm of ONE tile (TextureData.tileHeight)."

textures.lengthY.type

readonly type: "length" = "length"

textures.uvSet

readonly uvSet: { default: 0; tooltip: "UV channel the texture samples: 0 = TEXCOORD_0, 1 = TEXCOORD_1."; type: "number"; }

textures.uvSet.default

readonly default: 0 = 0

textures.uvSet.tooltip

readonly tooltip: "UV channel the texture samples: 0 = TEXCOORD_0, 1 = TEXCOORD_1." = "UV channel the texture samples: 0 = TEXCOORD_0, 1 = TEXCOORD_1."

textures.uvSet.type

readonly type: "number" = "number"

textures.wrap

readonly wrap: { default: "repeat"; tooltip: "Sampling wrap out of bounds: 'repeat' | 'clamp' | 'mirror'."; type: "string"; }

textures.wrap.default

readonly default: "repeat" = "repeat"

textures.wrap.tooltip

readonly tooltip: "Sampling wrap out of bounds: 'repeat' | 'clamp' | 'mirror'." = "Sampling wrap out of bounds: 'repeat' | 'clamp' | 'mirror'."

textures.wrap.type

readonly type: "string" = "string"


builtinParamExpression()

builtinParamExpression(def): string

The authored EXPRESSION a seeder writes for a builtin's default — a string builtin is quoted (wrap seeds as "'repeat'"), a number stringifies.

Parameters

def

BuiltinParamDef

Returns

string


builtinParamValues()

builtinParamValues<T>(table): BuiltinValues<T>

{ paperWidth: 420, … } — the defaults alone, for the lane that wants a plain value record (and for resolveLaneBuiltins to layer overrides on).

Type Parameters

T

T extends Record<string, BuiltinParamDef>

Parameters

table

T

Returns

BuiltinValues<T>


laneParamLiterals()

laneParamLiterals(parameters): Record<string, unknown>

Primary-arg LITERAL values from a parameters[] lane (a number, or an unquoted/quoted string literal). Expressions that are not plain literals are skipped: the three builtin resolvers are registry-free by design, so full parametric paper size goes through a host that can evaluate.

Parameters

parameters

(Operation | Group)[] | undefined

Returns

Record<string, unknown>


resolveLaneBuiltins()

resolveLaneBuiltins<T>(table, parameters): Builtins<T>

THE resolution law, implemented once: a builtin keeps its default unless the entry's own parameters[] declares that key with a finite literal of the same JS type. A lane that needs a range guard on top (paper must be positive; a 0 mm margin is legal) does that at its own call site — the shared law stays one rule.

Type Parameters

T

T extends Record<string, BuiltinParamDef>

Parameters

table

T

parameters

(Operation | Group)[] | undefined

Returns

Builtins<T>

Last updated: 📖 8 min readEdit on GitHub