SCAD+
Verts: 0 · Faces: 0 · Time: 0ms Rendering…
Rendering…

About SCAD+

SCAD+
Version 1.0.0

A browser-based 3D CAD editor and CSG engine. Write OpenSCAD-style code and see your models render instantly in the viewport.

OpenSCAD Compatibility: SCAD+ aims to be compatible with OpenSCAD, but not all functions and features are currently supported. Some standard OpenSCAD modules, functions, and language features may be missing or behave differently.
Built With
  • Manifold-3D — WASM-based CSG engine
  • Three.js — WebGL 3D rendering
  • CodeMirror 6 — Code editor
  • TypeScript + Vite — Build toolchain
Press ? to open the language reference.

SCAD Language Reference

3D Primitives

FunctionParametersDescription
cubesize, center, anchor, fillet, chamfer, edges, $fnBox. size: number or [x,y,z]. Fillet > 0 convex, < 0 concave.
spherer, d, anchor, $fnIcosphere. r = radius, d = diameter.
cylinderh, r, d, r1, r2, d1, d2, center, anchor, fillet, fillet_top, fillet_bot, chamfer, chamfer_top, chamfer_bot, $fnCylinder or cone. r1/r2 for conical.
torusr1, r2, angle, $fnTorus. r1 = major, r2 = minor. angle for partial sweep.
ellipsoidr, rx, ry, rz, $fnEllipsoid. r: scalar or [rx,ry,rz].
pipeh, r, t, r_inner, center, anchor, fillet, chamfer, $fnHollow cylinder. t = wall thickness.
wedgesize, center, anchorTriangular prism. size: scalar or [w,d,h].
capsuleh, r, center, anchor, $fnPill shape. Sphere if h ≤ 2r.
rounded_cubesize, r, center, anchor, $fnRounded box via hull of 8 spheres.
polyhedronpoints, facesRaw mesh from vertices and face indices.
chamfered_cylinderh, r, d, r1, r2, d1, d2, chamfer, chamfer_top, chamfer_bot, center, $fnCylinder with chamfered edges. Same radius params as cylinder.
threadd, pitch, length, starts, profile_angle, center, anchor, $fnHelical screw thread.
springr, r_wire, pitch, turns, center, anchor, $fnHelical coil wire.

2D Primitives

Use inside linear_extrude() or rotate_extrude(), or as thin top-level 3D shapes.

FunctionParametersDescription
circler, d, $fnCircle. r = radius, d = diameter.
squaresize, center, $fnRectangle. size: scalar or [w,h].
polygonpoints, paths, $fn2D polygon from point array. paths for holes.
regular_polygonr, n, $fnRegular n-gon. n = sides (default 6).
hexagonrAlias for regular_polygon(r, n=6).
slotw, h, center, $fnStadium / obround shape.
starpoints, r_outer, r_innerStar polygon. points = number of points.
texttext, size, halign, valign, spacing, $fnText as 2D outline. halign: "left"/"center"/"right". valign: "baseline"/"bottom"/"center"/"top". Use with linear_extrude() for 3D text.

Extrusions

FunctionParametersDescription
linear_extrudeheight, twist, slices, scale, centerExtrude 2D shape along Z. scale: scalar or [sx,sy].
rotate_extrudeangle, $fnRevolve 2D profile around Z-axis.

Transforms

FunctionParametersDescription
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], autoResize to target dimensions. auto fills unspecified dims proportionally.
offsetr, delta, chamfer2D offset. r = round, delta + chamfer = square, delta alone = miter.
colorc, alphaApply color (hex or CSS name) and opacity.

Boolean Operations

FunctionParametersDescription
unionchildrenCombine all shapes.
differencechildrenFirst child minus the rest.
intersectionchildrenKeep only overlapping volume.
hullchildrenConvex hull of children.
minkowskichildrenMinkowski sum of children.

Control Flow

SyntaxExampleDescription
forfor (i = [0:5]) { ... }Loop. Supports [start:end], [start:step:end], arrays.
if / elseif (x > 0) { ... } else { ... }Conditional geometry.
modulemodule name(p=1) { ... }Define reusable module.
$fn$fn = 64;Global resolution (circle segments).
##cube(10);Debug: highlight in translucent pink.
importfileImport a mesh file. Load via Import Mesh menu first, then import("file.stl").
includeinclude <https://...>Include remote SCAD file by URL. Fetched and inlined before evaluation.
childrenInside a user-defined module, renders the caller's child shapes.

Layout Modules

Place inside a shape's { } block to position children relative to the parent shape.

FunctionParametersDescription
positionanchor, pad, extend, axis, modePlace child center at parent's anchor point. No rotation.
alignface, alignment, inset, pad, extend, axis, modeFlush child face to parent face with auto-anchoring. Standalone mode moves anchor to origin.
attachparent_anchor, child_anchor, overlap, spin, align, pad, extend, axis, modeRotate child UP to parent face normal, position child_anchor at parent_anchor. BOSL2-style.
framesizeInvisible phantom bounding box for layout. Shown as dashed wireframe.
groupchildrenExplicit union. Layout children use combined bounding box.

Layout Modes

ModeDescription
"add"Default. Union child with parent.
"cut"Subtract child from parent.
"intersect"Keep only overlap of child and parent.

Hardware Components

FunctionParametersDescription
boltsize, length, d, head_h, head_d, pitch, thread_length, chamfer, standard, center, $fnISO metric hex bolt. size: "M1".."M30". standard: "din" or "iso". Origin at head bottom.
nutsize, h, d, s, thread, pitch, chamfer, standard, center, $fnISO metric hex nut. thread: boolean for threaded bore.
enclosuresize, 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, $fnParametric box with lid. size: [w,d,h]. mount: "none"/"screw"/"bolt". part: "assembly"/"body"/"lid".
shellthickness, openHollows out child shapes. thickness: wall thickness (pos 0, default 2). open: anchor face to remove (e.g. TOP). Uses scale-from-center.
standoffh, r, d, hole, hole_d, hole_depth, screw_size, center, anchor, $fnMounting pillar with optional hole. screw_size (e.g. "M3") auto-derives dimensions. hole: "pilot" (default), "through", or "none".

Gears & Mechanical

FunctionParametersDescription
spur_gearteeth, mod, pressure_angle, width, bore, backlash, center, $fnInvolute spur gear.
helical_gearteeth, mod, pressure_angle, width, helix_angle, bore, backlash, center, $fnSpur gear with helical twist.
herringbone_gearteeth, mod, pressure_angle, width, helix_angle, bore, backlash, center, $fnV-pattern double helical gear.
rackteeth, mod, pressure_angle, width, height, backlash, center, $fnLinear gear rack.
bevel_gearteeth, mod, pressure_angle, width, cone_angle, bore, backlash, center, $fnBevel gear for angled shafts.
wormstarts, mod, pressure_angle, length, d, r, bore, center, $fnHelical worm for worm-gear drives.

Structural Profiles

Thin-walled extrusions. All share: w (width), h (height), t (thickness), l (length), fillet, chamfer, center, $fn.

FunctionExtra ParametersDescription
l_profilefillet_outside, chamfer_outsideL-shaped cross-section.
u_profilefillet_outside, chamfer_outsideU-shaped (channel).
o_profilefillet_outside, chamfer_outsideRectangular tube.
t_profiletwT-shaped. tw = web thickness.
i_profiletwI-beam. tw = web thickness.

Anchor Constants

Combinable with + for edges and corners (e.g. TOP + RIGHT + FRONT).

ConstantValueDescription
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

Axis Constants

ConstantValueUsage
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

Math Functions

CategoryFunctions
Trigonometry (degrees)sin(x), cos(x), tan(x)
Roundingabs(x), ceil(x), floor(x), round(x)
Exponentssqrt(x), pow(x, y)
Logarithmsln(x), log(x)
Comparisonmin(a, b, ...), max(a, b, ...)
ConstantsPI

View Navigation

KeyAction
Num 1Front view
Ctrl + Num 1Back view
Num 3Right view
Ctrl + Num 3Left view
Num 7Top view
Ctrl + Num 7Bottom view
Num 5Toggle Ortho / Perspective

Transform

KeyAction
TTranslate mode
RRotate mode (Shift = 45° snap)
SScale mode

Selection & View

KeyAction
FFit view to selection
NFit view with normal
EscDeselect all
DeleteDelete selected object

Dimension Dragging

KeyAction
XConstrain to X-axis
YConstrain to Y-axis
ZConstrain to Z-axis

AI Assistant

The AI assistant helps you create, modify, and debug SCAD code through natural language conversation. It understands your current code and errors.

Setup

Open the hamburger menu and select AI Settings to configure a provider. Or click the dimmed AI button in the toolbar.

ProviderNotes
Claude (Anthropic)Recommended. Best SCAD understanding.
OpenAIGPT-4o and other OpenAI models.
DeepSeekCost-effective alternative.
GroqFast inference, open-source models.
OpenRouterAccess 100+ models with one key.
Ollama (Local)Run locally, no API key needed.
CustomAny OpenAI-compatible endpoint.

Usage

FeatureDescription
ApplyReplace your entire code with the AI's suggestion.
InsertAppend the AI's code after your current code.
ImagesPaste or upload reference images for the AI to see.
New ChatStart a fresh conversation. Previous chat is saved to History.
HistorySwitch to the History tab to browse and reload past conversations.

Tips

TipExample
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.