Value types
What each valueType word on Nodes and each parameter method on Parameters means: the value an expression must evaluate to, and how to write it. Read live from engine_catalog's Catalog.types (crates/model/src/document/vocabulary.rs TYPE_REGISTRY).
35 type words. An arg's valueType and a node's returns are built from them: T[] is a list of T, A | B accepts either.
value
| type | what it is | min / max | options | catalog uses |
|---|---|---|---|---|
number | A number. | yes | yes | 39 |
integer | A whole number; a fraction fails loud. | yes | yes | 29 |
length | A number of millimetres. | yes | yes | 41 |
angle | A number of degrees. | yes | yes | 13 |
boolean | On or off: 0 / 1 or false / true, read by truthiness. | — | — | 17 |
string | Text, quoted: 'abc'. | — | yes | 28 |
color | A CSS colour, quoted: '#ffffff'. | — | yes | 12 |
url | An address, quoted: 'https:…' or 'data:…'. | — | yes | 11 |
vector | A direction [x, y, z]; [x, y] reads z as 0. | — | — | 22 |
point | A position [x, y, z] in millimetres; [x, y] reads z as 0. | — | — | 62 |
plane | { point, normal } — a point on the plane and its normal vector. | — | — | 1 |
line | { origin, direction } — an infinite line through origin. | — | — | 4 |
curve | Point rows [[x, y, z], …], an analytic curve value (Arc.*, Ellipse.*, Bezier.*, Nurbs.*, Spline.*) or a Curve. | — | — | 0 |
surface | A NURBS control net, the value of a surface parameter; nurbsSurface bakes it to a Mesh. | — | — | 3 |
transform | 16 numbers, a column-major 4x4 matrix, translation at indices 12/13/14. | — | — | 0 |
function | An arrow function, e.g. (p, i) => true. | — | — | 31 |
object | Any JSON-shaped value — an object { … } or an array [ … ]. | — | — | 16 |
font | The address of a font file, quoted; '' = the host's default font. | — | — | 2 |
data
| type | what it is | min / max | options | catalog uses |
|---|---|---|---|---|
curveData | A Curve — the evaluated curve shape. An arg of this type also accepts point rows [[x,y,z],...] (a polyline chain, closed when the last row repeats the first) or a list of such row lists (several chains). | — | — | 28 |
pointCloudData | A Curve with no edges — a point cloud. | — | — | 1 |
meshData | A Mesh — the evaluated face shape. | — | — | 17 |
blockData | A Block — evaluated objects kept together as one unit. | — | — | 2 |
linearDimensionData | A LinearDimensionRecord. | — | — | 1 |
radialDimensionData | A RadialDimensionRecord. | — | — | 1 |
angularDimensionData | An AngularDimensionRecord. | — | — | 1 |
leaderData | A LeaderRecord. | — | — | 1 |
imageData | An ImageRecord. | — | — | 1 |
sectionData | A SectionRecord. | — | — | 1 |
hatchData | A HatchRecord. | — | — | 1 |
objectData | Any evaluated stream piece — a Curve, a Mesh or a Block; an expression naming a sibling object reads that object's evaluated content. | — | — | 49 |
record
| type | what it is | min / max | options | catalog uses |
|---|---|---|---|---|
material | A materials[] key, quoted: 'oak'. | — | — | 3 |
layer | A layers[] key, quoted: 'walls'. | — | — | 3 |
pattern | A patterns[] key, quoted: 'brick'. | — | — | 4 |
view | A views[] key, quoted: 'plan'. A visible / active value that is an arrow (camera) => boolean runs against the camera, which it receives as { projection: 'orthographic' | 'perspective', viewType: 'plan' | 'ceiling' | 'elevation' | '3d', position, target, up, direction, fov | height } — the active view's pose, else the free camera the host reported (no pose yet: false) — viewType is 'plan' for an orthographic camera looking straight down, 'ceiling' straight up, 'elevation' level, and '3d' for every other pose, direction is the unit vector from position to target, fov (degrees) is set on a perspective camera and height (mm) on an orthographic one; the function reads only camera and the builtins, names no view, and a throw or a non-boolean result is an error. | — | — | 1 |
component | A components[] key, quoted: 'door'; the named record evaluates to a whole ModelJson document. | — | — | 3 |
📖 4 min read