Skip to content
Sign in

Documentation

Parameter design guidelines

Names, units, defaults, ranges and steps that make a model usable by someone else.

A name says what the number is in the real part. Abbreviate only what everyone abbreviates.

PPSCAD
// 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"

Every length is a millimetre and every angle a degree; say so where the slider is.

PPSCAD
param width: float = 80 [20:200] "Width (mm)"
param angle: float = 45 [0:90] "Angle (degrees)"

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.

The range keeps a slider away from values no printer or no geometry can take:

PPSCAD
// 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)"

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.

PPSCAD
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
}

When a feature comes in a few named kinds, a choice names them:

PPSCAD
param mount_type: choice = "screws" ["screws", "magnets", "adhesive"] "Mount type"
param screw_size: choice = "M3" ["M2", "M3", "M4", "M5"] "Screw size"

A dimension that follows from another is computed, not asked twice; two sliders for one fact drift apart.

PPSCAD
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