A browser-based 3D CAD editor and CSG engine. Write OpenSCAD-style code and see your models render instantly in the viewport.
| 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. |
| chamfered_cylinder | h, r, d, r1, r2, d1, d2, chamfer, chamfer_top, chamfer_bot, center, $fn | Cylinder with chamfered edges. Same radius params as cylinder. |
| 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. |
| text | text, size, halign, valign, spacing, $fn | Text as 2D outline. halign: "left"/"center"/"right". valign: "baseline"/"bottom"/"center"/"top". Use with linear_extrude() for 3D text. |
| 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. |
| mirror | [x, y, z] | Mirror children over plane with given normal vector. |
| resize | [x, y, z], auto | Resize to target dimensions. auto fills unspecified dims proportionally. |
| offset | r, delta, chamfer | 2D offset. r = round, delta + chamfer = square, delta alone = miter. |
| 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. |
| import | file | Import a mesh file. Load via Import Mesh menu first, then import("file.stl"). |
| include | include <https://...> | Include remote SCAD file by URL. Fetched and inlined before evaluation. |
| children | Inside a user-defined module, renders the caller's child shapes. |
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. |
| standoff | h, r, d, hole, hole_d, hole_depth, screw_size, center, anchor, $fn | Mounting pillar with optional hole. screw_size (e.g. "M3") auto-derives dimensions. hole: "pilot" (default), "through", or "none". |
| 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 |
The AI assistant helps you create, modify, and debug SCAD code through natural language conversation. It understands your current code and errors.
Open the hamburger menu and select AI Settings to configure a provider. Or click the dimmed AI button in the toolbar.
| Provider | Notes |
|---|---|
| Claude (Anthropic) | Recommended. Best SCAD understanding. |
| OpenAI | GPT-4o and other OpenAI models. |
| DeepSeek | Cost-effective alternative. |
| Groq | Fast inference, open-source models. |
| OpenRouter | Access 100+ models with one key. |
| Ollama (Local) | Run locally, no API key needed. |
| Custom | Any OpenAI-compatible endpoint. |
| Feature | Description |
|---|---|
| Apply | Replace your entire code with the AI's suggestion. |
| Insert | Append the AI's code after your current code. |
| Images | Paste or upload reference images for the AI to see. |
| New Chat | Start a fresh conversation. Previous chat is saved to History. |
| History | Switch to the History tab to browse and reload past conversations. |
| Tip | Example |
|---|---|
| Be specific about dimensions | "Make a box 40mm wide, 20mm deep, 15mm tall" |
| Reference your code | "Add mounting holes to the enclosure" |
| Ask to fix errors | "Fix the error in my code" (errors are sent automatically) |
| Iterate on designs | "Make the walls thicker and add fillets" |
Your API key is stored in your browser's localStorage and never sent to our servers. Code context is sent directly to your chosen AI provider.