Skip to content
Sign in

Documentation

PPSCAD and OpenSCAD

What is the same, what differs, and how to move a model over.

PPSCAD takes most of its shape from OpenSCAD. If you know one, you can read the other.

  • Solids are built by union, difference and intersection.
  • The same primitives: cube, cylinder, sphere, and the 2D circle, square and polygon.
  • The same transforms: translate, rotate, scale, mirror.
  • Extrude and revolve take a 2D shape into 3D; hull wraps a set of shapes.
  • For loops and if and else.

OpenSCAD and PPSCAD side by side
OpenSCADPPSCAD
ParametersCustomizer annotations in commentsA param line with a type, a range and a label
Modulesmodule name() { … }mod name() { … }
Functionsfunction name() = …fn name() = …
Variablesname = value;let name = value
SemicolonsRequiredNot needed
Vectorscube([x, y, z])cube(x, y, z) or cube(size: [x, y, z])
Resolution$fn, $fa, $fssegments: on a primitive ($fn: works too)
RunningA desktop program, F5 and F6The browser, as you type
SharingAn exported STLA link with the sliders in it
KernelCGAL, nativeManifold, WebAssembly in the browser

OpenSCAD
// OpenSCAD
$fn = 60;
width = 40; // [10:100]
height = 20; // [5:50]
wall = 2; // [1:5]

difference() {
    cube([width, height, 20]);
    translate([wall, wall, wall])
        cube([width-wall*2, height-wall*2, 21]);
}
PPSCAD
// PPSCAD
param width: float = 40 [10:100] "Width (mm)"
param height: float = 20 [5:50] "Height (mm)"
param wall: float = 2 [1:5:0.5] "Wall (mm)"

difference {
  cube(width, height, 20)
  translate(wall, wall, wall)
    cube(width - wall * 2, height - wall * 2, 21)
}

  • module becomes mod, function becomes fn, an assignment becomes a let.
  • Drop the semicolons and the parentheses after union, difference and intersection.
  • A customizer comment becomes a param line with its range and a label.
  • cube([x, y, z]) becomes cube(x, y, z); a vector argument is still accepted as size:.
  • $fn becomes segments: on the primitive that needs it.
  • Trigonometry is in degrees in both, so angles need no change.
  • A polygon's points run counter-clockwise and the points of a hole clockwise; a list is walked with for and has no index.

PPSCAD is open source. The specification says exactly what a program means, and its documentation has a longer page for people who come from OpenSCAD.