| Function | Parameters | Description |
|---|---|---|
| cube | size, center, anchor, fillet, chamfer, edges, $fn | Box. size: number or [x,y,z]. Fillet > 0 convex, < 0 concave. |
| sphere | r, d, anchor, $fn | Icosphere. r = radius, d = diameter. |
| cylinder | h, r, d, r1, r2, d1, d2, center, anchor, fillet, fillet_top, fillet_bot, chamfer, chamfer_top, chamfer_bot, $fn | Cylinder or cone. r1/r2 for conical. |
| torus | r1, r2, angle, $fn | Torus. r1 = major, r2 = minor. angle for partial sweep. |
| ellipsoid | r, rx, ry, rz, $fn | Ellipsoid. r: scalar or [rx,ry,rz]. |
| pipe | h, r, t, r_inner, center, anchor, fillet, chamfer, $fn | Hollow cylinder. t = wall thickness. |
| wedge | size, center, anchor | Triangular prism. size: scalar or [w,d,h]. |
| capsule | h, r, center, anchor, $fn | Pill shape. Sphere if h ≤ 2r. |
| rounded_cube | size, r, center, anchor, $fn | Rounded box via hull of 8 spheres. |
| polyhedron | points, faces | Raw mesh from vertices and face indices. |
| thread | d, pitch, length, starts, profile_angle, center, anchor, $fn | Helical screw thread. |
| spring | r, r_wire, pitch, turns, center, anchor, $fn | Helical coil wire. |
Use inside linear_extrude() or rotate_extrude(), or as thin top-level 3D shapes.
| Function | Parameters | Description |
|---|---|---|
| circle | r, d, $fn | Circle. r = radius, d = diameter. |
| square | size, center, $fn | Rectangle. size: scalar or [w,h]. |
| polygon | points, paths, $fn | 2D polygon from point array. paths for holes. |
| regular_polygon | r, n, $fn | Regular n-gon. n = sides (default 6). |
| hexagon | r | Alias for regular_polygon(r, n=6). |
| slot | w, h, center, $fn | Stadium / obround shape. |
| star | points, r_outer, r_inner | Star polygon. points = number of points. |
| Function | Parameters | Description |
|---|---|---|
| linear_extrude | height, twist, slices, scale, center | Extrude 2D shape along Z. scale: scalar or [sx,sy]. |
| rotate_extrude | angle, $fn | Revolve 2D profile around Z-axis. |
| Function | Parameters | Description |
|---|---|---|
| translate | [x, y, z] | Move children by offset vector. |
| rotate | [x, y, z] | Rotate children (degrees). |
| scale | [sx, sy, sz] | Scale children. Scalar for uniform. |
| color | c, alpha | Apply color (hex or CSS name) and opacity. |
| Function | Parameters | Description |
|---|---|---|
| union | children | Combine all shapes. |
| difference | children | First child minus the rest. |
| intersection | children | Keep only overlapping volume. |
| hull | children | Convex hull of children. |
| minkowski | children | Minkowski sum of children. |
| Syntax | Example | Description |
|---|---|---|
| for | for (i = [0:5]) { ... } | Loop. Supports [start:end], [start:step:end], arrays. |
| if / else | if (x > 0) { ... } else { ... } | Conditional geometry. |
| module | module name(p=1) { ... } | Define reusable module. |
| $fn | $fn = 64; | Global resolution (circle segments). |
| # | #cube(10); | Debug: highlight in translucent pink. |
Place inside a shape's { } block to position children relative to the parent shape.
| Function | Parameters | Description |
|---|---|---|
| position | anchor, pad, extend, axis, mode | Place child center at parent's anchor point. No rotation. |
| align | face, alignment, inset, pad, extend, axis, mode | Flush child face to parent face with auto-anchoring. Standalone mode moves anchor to origin. |
| attach | parent_anchor, child_anchor, overlap, spin, align, pad, extend, axis, mode | Rotate child UP to parent face normal, position child_anchor at parent_anchor. BOSL2-style. |
| frame | size | Invisible phantom bounding box for layout. Shown as dashed wireframe. |
| group | children | Explicit union. Layout children use combined bounding box. |
| Mode | Description |
|---|---|
| "add" | Default. Union child with parent. |
| "cut" | Subtract child from parent. |
| "intersect" | Keep only overlap of child and parent. |
| Function | Parameters | Description |
|---|---|---|
| bolt | size, length, d, head_h, head_d, pitch, thread_length, chamfer, standard, center, $fn | ISO metric hex bolt. size: "M1".."M30". standard: "din" or "iso". Origin at head bottom. |
| nut | size, h, d, s, thread, pitch, chamfer, standard, center, $fn | ISO metric hex nut. thread: boolean for threaded bore. |
| enclosure | size, wall, r, fillet_top, fillet_bottom, chamfer_top, chamfer_bottom, lid_h, lip_h, lip_gap, mount, screw_size, screw_d, screw_inset, boss_r, hole_depth, nut_pocket, part, center, $fn | Parametric box with lid. size: [w,d,h]. mount: "none"/"screw"/"bolt". part: "assembly"/"body"/"lid". |
| shell | thickness, open | Hollows out child shapes. thickness: wall thickness (pos 0, default 2). open: anchor face to remove (e.g. TOP). Uses scale-from-center. |
| Function | Parameters | Description |
|---|---|---|
| spur_gear | teeth, mod, pressure_angle, width, bore, backlash, center, $fn | Involute spur gear. |
| helical_gear | teeth, mod, pressure_angle, width, helix_angle, bore, backlash, center, $fn | Spur gear with helical twist. |
| herringbone_gear | teeth, mod, pressure_angle, width, helix_angle, bore, backlash, center, $fn | V-pattern double helical gear. |
| rack | teeth, mod, pressure_angle, width, height, backlash, center, $fn | Linear gear rack. |
| bevel_gear | teeth, mod, pressure_angle, width, cone_angle, bore, backlash, center, $fn | Bevel gear for angled shafts. |
| worm | starts, mod, pressure_angle, length, d, r, bore, center, $fn | Helical worm for worm-gear drives. |
Thin-walled extrusions. All share: w (width), h (height), t (thickness), l (length), fillet, chamfer, center, $fn.
| Function | Extra Parameters | Description |
|---|---|---|
| l_profile | fillet_outside, chamfer_outside | L-shaped cross-section. |
| u_profile | fillet_outside, chamfer_outside | U-shaped (channel). |
| o_profile | fillet_outside, chamfer_outside | Rectangular tube. |
| t_profile | tw | T-shaped. tw = web thickness. |
| i_profile | tw | I-beam. tw = web thickness. |
Combinable with + for edges and corners (e.g. TOP + RIGHT + FRONT).
| Constant | Value | Description |
|---|---|---|
| CENTER | [0, 0, 0] | Bounding box center |
| TOP | [0, 0, 1] | Z+ face |
| BOTTOM | [0, 0, -1] | Z- face |
| RIGHT | [1, 0, 0] | X+ face |
| LEFT | [-1, 0, 0] | X- face |
| BACK | [0, 1, 0] | Y+ face |
| FRONT | [0, -1, 0] | Y- face |
| Constant | Value | Usage |
|---|---|---|
| X | [1, 0, 0] | X axis only |
| Y | [0, 1, 0] | Y axis only |
| Z | [0, 0, 1] | Z axis only |
| XY | [1, 1, 0] | X and Y axes |
| XZ | [1, 0, 1] | X and Z axes |
| YZ | [0, 1, 1] | Y and Z axes |
| Category | Functions |
|---|---|
| Trigonometry (degrees) | sin(x), cos(x), tan(x) |
| Rounding | abs(x), ceil(x), floor(x), round(x) |
| Exponents | sqrt(x), pow(x, y) |
| Logarithms | ln(x), log(x) |
| Comparison | min(a, b, ...), max(a, b, ...) |
| Constants | PI |
| Key | Action |
|---|---|
| Num 1 | Front view |
| Ctrl + Num 1 | Back view |
| Num 3 | Right view |
| Ctrl + Num 3 | Left view |
| Num 7 | Top view |
| Ctrl + Num 7 | Bottom view |
| Num 5 | Toggle Ortho / Perspective |
| Key | Action |
|---|---|
| T | Translate mode |
| R | Rotate mode (Shift = 45° snap) |
| S | Scale mode |
| Key | Action |
|---|---|
| F | Fit view to selection |
| N | Fit view with normal |
| Esc | Deselect all |
| Delete | Delete selected object |
| Key | Action |
|---|---|
| X | Constrain to X-axis |
| Y | Constrain to Y-axis |
| Z | Constrain to Z-axis |