Units and expressions
Every value field in Moket accepts an expression: a number, a parameter, or a formula.
Units
| Unit | Kind |
|---|---|
mm | Length |
cm | Length |
m | Length |
in | Length |
ft | Length |
deg | Angle |
rad | Angle |
A number without a unit uses the part's units (see Units, materials and properties). Units can be mixed: 1 in + 5 mm works.
Operators and functions
| Item | Example |
|---|---|
+, -, *, / | width / 2 - 5 mm |
^ (power) | side ^ 2 |
| Parentheses | (width - 2 * margin) / 3 |
pi | 2 * pi * r |
sqrt, abs, floor, ceil, round | round(width / 30) |
min, max (two or more values) | max(5 mm, thick / 2) |
sin, cos, tan | cos(30 deg) * length |
asin, acos, atan, atan2 | atan2(h, w) |
Names
An expression uses the part's parameters by name (width / 2) and the project's parameters as project. and the name (project.axisZ - 10 mm). See Share sizes across a project.
Checking
The field checks the expression as you type and shows its value. Units must fit: a length cannot go where an angle is needed, and mm + deg is refused. An unknown name or an expression that refers to itself is refused too; nothing changes until the expression is valid.