← Ecky CAD / Ecky Language Reference

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 :relations list 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:
  • :label text
  • :min number
  • :max number
  • :step number
  • :unit one of length | angle | ratio | count | text
  • :frozen boolean

Units and suffixed literals

Bare lengths are millimetres; bare rotation angles are degrees. Suffixes make conversions explicit:

LiteralBase-unit value
12mm12 mm
2.54cm25.4 mm
0.25in6.35 mm
45deg45 degrees
1.5708radApproximately 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