Parameters turn one design document into a family of evaluated variants.
InvariantCAD stores formulas as immutable expression trees instead of executing
arbitrary JavaScript during evaluation.
Supported dimensions
Defaults and bounds may themselves reference parameters that belong to the same
design. Evaluation resolves the complete dependency graph and reports cycles,
missing values, non-finite results, and bound violations as diagnostics.
Arithmetic
Every expression exposes immutable arithmetic methods:
add and sub require the same dimension.
mul and div accept a scalar expression or finite number.
neg and abs preserve the dimension.
expr.min, expr.max, and trigonometric helpers construct additional
serializable operations.
TypeScript prevents many dimension mistakes, while runtime validation protects
documents received from untyped or hostile sources.
Vectors
Use vector helpers to preserve component dimensions:
vec2 and vec3 contain lengths. scalarVec3 is used for scale and directions;
angleVec3 is used for Euler rotations.
Evaluation overrides
Override values by parameter ID:
Override numbers use base units, not the constructor originally used by the
author. width: 125 means 125 mm, even if the default was written as
inch(4.5).
Do not pass deg(5) or mm(20) as evaluation override values. Overrides are
plain finite numbers because evaluation options are data, while expression
objects belong to authoring.
Configuration overrides
A named configuration can bind parameters inside the document:
At evaluation, select it by reference during authoring or by stable ID after
serialization. Explicit evaluation overrides apply within the selected
configuration context. See configurations and BOMs.
Parameter ownership
Parameters are bound to the DesignBuilder that created them. Cross-design use
throws immediately:
This restriction guarantees that every expression reference can be represented
inside one closed document.