Documentation
Parameter design guidelines
Names, units, defaults, ranges and steps that make a model usable by someone else.
Name parameters as the maker sees them
A name says what the number is in the real part. Abbreviate only what everyone abbreviates.
// Clear
param wall_thickness: float = 2 [1:5:0.5] "Wall thickness (mm)"
param screw_diameter: float = 3 [2:8] "Screw diameter (mm)"
// Unclear
param wt: float = 2 [1:5:0.5] "wt"
param sd: float = 3 [2:8] "sd"Put the unit in the label
Every length is a millimetre and every angle a degree; say so where the slider is.
param width: float = 80 [20:200] "Width (mm)"
param angle: float = 45 [0:90] "Angle (degrees)"Choose a default that prints
Someone who opens the design and touches nothing should get a part worth printing.
- A wall of 2 mm prints on any filament printer.
- A corner radius of 2 to 3 mm prints well and looks finished.
- Hole sizes follow the common screws, M3 and M4.
Give a range that keeps the part possible
The range keeps a slider away from values no printer or no geometry can take:
// A wall no thinner than one extrusion width
param wall: float = 2.0 [1.2:6:0.2] "Wall thickness (mm)"
// A corner radius that stays under half the smallest side
param corner_r: float = 3 [0:10] "Corner radius (mm)"
// Without a range the wall can be set to zero
param wall: float = 2.0 "Wall thickness (mm)"Match the step to what matters
The step is how fine the slider moves; match it to the precision the part needs.
- Counts (how many of something): an
int, which steps by one. - Coarse lengths (width, height): 1 or 0.5.
- Fine lengths (walls, clearances): 0.1 or 0.2.
- Angles: 5 or 1, depending on how sensitive the shape is.
A switch for an optional feature
param vents: bool = true "Add ventilation slots"
param lid: bool = true "Make a lid"
param rounded: bool = true "Round the corners"
if (vents) {
// the slot geometry
}A choice for a variant
When a feature comes in a few named kinds, a choice names them:
param mount_type: choice = "screws" ["screws", "magnets", "adhesive"] "Mount type"
param screw_size: choice = "M3" ["M2", "M3", "M4", "M5"] "Screw size"Derive what follows from something else
A dimension that follows from another is computed, not asked twice; two sliders for one fact drift apart.
param width: float = 80 [40:200] "Width (mm)"
param wall: float = 2.0 [1.2:4:0.2] "Wall (mm)"
// Derived, not a parameter
let inner_width = width - wall * 2