Documentation
How to write printable parts as code, make them adjustable, and get them onto a printer. Start with the first guide; keep the reference open while you write.
Guides
- From an empty editor to a printable, parametric part in five minutes.
- Tolerances, clearances, wall thickness and the dimensions a printer can hold.
- Names, units, defaults, ranges and steps that make a model usable by someone else.
- Copy-paste recipes: rounded boxes, screw holes, arrays, shells, chamfers, text.
- The whole workflow: sketch, build, parameterize, test the extremes, export, slice.
- What is the same, what differs, and how to move a model over.
Reference
- Every statement, primitive, transform, operation, function and operator of the language.
- What runs where, the time budget, what the browser cannot promise, and what PPSCAD is not.
An open language
PPSCAD, the language of these docs, is open source. Its specification defines every statement, and the repository on GitHub holds the grammar, more documentation, examples, a conformance test suite and the interpreter this site runs. Read the announcement.
A model in ten lines
// A box with a cylindrical hole through it
param width: float = 30 [10:100] "Width (mm)"
param height: float = 20 [5:50] "Height (mm)"
param depth: float = 10 [2:30] "Depth (mm)"
param hole_radius: float = 4 [1:15] "Hole radius (mm)"
difference {
cube(width, height, depth)
translate(width / 2, height / 2, -1)
cylinder(h: depth + 2, r: hole_radius)
}The four param lines become sliders beside the viewer; the model follows a slider as it moves. Every length is in millimetres, and the STL you download is too.
Parameters
A parameter is declared in the code, so the controls come from the code and a shared link can carry the values:
param name: type = default [min:max:step] "Label" "Description"// A whole number with a slider
param teeth: int = 20 [6:200] "Number of teeth"
// A decimal with its own step
param module: float = 2.0 [0.5:10:0.01] "Module (mm)"
// A switch
param chamfer: bool = true "Add a chamfer"
// A choice from a list
param style: choice = round ["round", "square", "hex"] "Head style"Sharing
Save a design and it gets a short address. Anyone with the link opens the model, moves the sliders and downloads an STL, without an account. The values travel in the query of the link, as in ?width=50&height=30.