REFERENCE / 06
Params and Controls
Declare editable inputs inside params. The key is the name used by geometry expressions; :label is the text shown in the control. A saved project can override a source default with its current parameter value.
params
(params
decl
decl
:relations ((<= wall shell) (>= shell 1.6)))- container for parameter declarations
- optional
:relationslist attaches cross-parameter constraints
Supported relation operators:
<<=>>=
number
(number wall 2.4
:label "Wall"
:min 0.8
:max 8
:step 0.1
:unit length
:frozen #f)- positional 1: parameter key symbol
- positional 2: default number
- keywords:
:labeltext:minnumber:maxnumber:stepnumber:unitone oflength | angle | ratio | count | text:frozenboolean
Units and suffixed literals
Bare lengths are millimetres; bare rotation angles are degrees. Suffixes make conversions explicit:
| Literal | Base-unit value |
|---|---|
12mm | 12 mm |
2.54cm | 25.4 mm |
0.25in | 6.35 mm |
45deg | 45 degrees |
1.5708rad | Approximately 90 degrees |
Use bare numbers for counts, ratios, and segment counts. Suffix conversion does not by itself provide dimensional type checking.
toggle
(toggle useFillet #t
:label "Use fillet"
:frozen #f)- positional 1: parameter key symbol
- positional 2: default boolean
- keywords:
:label:frozen
select
(select material "PLA"
:label "Material"
:unit text
:options
((option "PLA" "PLA")
(option "PETG" "PETG")
(option "ABS" "ABS"))
:frozen #f)- positional 1: parameter key symbol
- positional 2: default choice value
- required keyword for practical use:
:options - optional keywords:
:label:unit:frozen
image
(image decal "assets/logo.svg"
:label "Decal"
:frozen #f)- positional 1: parameter key symbol
- positional 2: default image path text
- optional keywords:
:label:frozen
option
(option "Large" 42)
(option "PLA" "PLA")- positional 1: display label
- positional 2: value
- valid value kinds:
- number
- string / text symbol