OpenSCAD Transformations Reference — PrintPal Docs

OpenSCAD Transformations Reference — PrintPal Docs

Transformations are modifiers — they apply to the next module or block that follows them. Chain them, nest them inside for loops, wrap them in user modules. The handful below covers ~99% of real-world CAD positioning.

translate([10,0,0]) cube(5); is a single statement — the ; terminates the cube . Putting one after translate(...) would discard whatever comes next.

Shift children by a 3-vector [x, y, z] (or 2-vector for 2D).

The 3-vector form rotates around X, then Y, then Z. The angle+axis form rotates around an arbitrary axis.

scale multiplies dimensions; resize sets them absolutely (great for fitting a model into a known envelope). Pass 0 for "leave this axis alone" in resize , with auto=true scaling the unset axes proportionally.

Mirror across the plane normal to v . Most common usage:

Build one side of a symmetric bracket, then union() { half(); mirror([1,0,0]) half(); } .

Apply an arbitrary 4×4 transform matrix — the foundation for skews, shears, and custom projections.

Color affects preview only — exported meshes carry no color (use 3MF if you need per-part colors at print time).

2D-only operation: grow or shrink a 2D shape outward/inward. Round corners with r , chamfer with delta + chamfer=true .

Convex hull of all children. The single most useful trick for building organic, sweeping shapes from a few keypoints.

Hull two spheres to get a capsule; hull a circle and a square to get a teardrop; hull a bunch of points to wrap them in a "shrink-wrap" mesh.

Minkowski sum — sweeps the second child along every point on the first. The classic recipe for rounded boxes and fillets.

For rounded boxes, prefer the 2D offset() + linear_extrude() pattern shown above — orders of magnitude faster. Reserve true 3D Minkowski for cases where you actually need to sweep a sphere/torus along a complex 3D path.

"Mount with four M3 holes on a 30 mm bolt pattern, rounded corners" — the agent picks the right transformation pattern and writes it parametrically.

Recommended articles