Chris Collins

Tools · fabrication

OpenSCAD in the browser

Write OpenSCAD code and render it right in the page — the real OpenSCAD engine compiled to WebAssembly — with a 3D preview, a Customizer built from your parameter comments, BOSL2 and MCAD libraries on demand, and STL, 3MF, OBJ, OFF, AMF, SVG and DXF downloads.

Added

How to use it

This is OpenSCAD itself (version 2025.01.19 with the Manifold geometry engine), compiled to WebAssembly and running in a background thread in your browser. Nothing is uploaded: your code, the render and the files you download never leave the page.

How to use it

  • Render (F6, or Cmd/Ctrl + Enter) runs the code. The engine — about 3.7 MB — downloads the first time; after that a render of a typical part takes tens of milliseconds. Tick Auto to re-render as you type or move a slider. Stop abandons a render that is taking too long.

  • Examples loads seven designs written for this page: a box with a lift-off lid, an involute spur gear built from first principles, a knob that grips a hex-head bolt, a honeycomb panel (3D or a 2D outline for a laser), a wall hook, a nameplate with raised text, and a tray and gear made with BOSL2.

  • The console shows echo() output, warnings and errors. Click a line number to jump to it; lines with errors are marked in the editor’s gutter.

  • Manifold is the new geometry engine — often many times faster than CGAL, the classic one, which is there for comparison.

⛶ Full screen (or F) gives the editor and the 3-D view the whole screen — the browser’s full screen where it is allowed, otherwise a full-window layer (iPhone); ◫ Panels hides the editor column so the model goes edge to edge. Escape leaves.

The Customizer

Top-level assignments before the first module or function become controls, the same way OpenSCAD’s own Customizer reads them:

/* [Box] */                       // starts a group
// Inside width (mm)              // the line above becomes the description
inner_width = 70; // [10:1:250]   // slider: min:step:max  ([10:250] steps by 1)
part = "both"; // [both:Box and lid, box:Box only]   // dropdown with labels
pressure_angle = 20; // [14.5, 20, 25]               // dropdown of numbers
flat = false;                     // checkbox
size = [30, 20, 10]; // [1:100]   // a vector: one box per element
label = "HELLO"; // 12            // text, at most 12 characters
/* [Hidden] */                    // anything below is not shown

Changed values are passed to OpenSCAD with -D name=value; the code itself is untouched. Reset returns to the values in the file. Save set and Load set use OpenSCAD’s parameter-set JSON, so a set made here opens in the desktop program and vice versa.

Libraries and fonts

  • include <BOSL2/std.scad> — the Belfry OpenSCAD Library v2 (BSD-2-Clause, pinned to 2.0.767): rounding, attachments, gears, threads, screws and much more. The tool fetches the files a design needs from jsDelivr the first time (about 3 MB for std.scad) and keeps them for the session.

  • use <MCAD/…> — the classic MCAD library (LGPL-2.1, the 2019.05 release).

  • text() uses the DejaVu fonts (DejaVu Sans, Sans Mono and Serif; Bitstream Vera licence), loaded the first time a design calls text(). Name them as font = "DejaVu Sans:style=Bold".

  • Other includes and import() of your own files are not available — paste the code into one file.

Downloads

  • 3D: STL (binary), 3MF and OBJ are written from the rendered mesh in the page; OFF and AMF are produced by OpenSCAD. PNG saves the current view.

  • 2D designs (a top-level square, circle, polygon, text or projection() without an extrude) are shown flat and download as SVG or DXF for laser cutters and CNC routers.

The size, volume, surface area and PLA weight (at 1.24 g/cm³, solid) are measured from the mesh, so they are only meaningful for a closed (watertight) model.

Sharing

Share link (top right) copies a URL that carries your code and any Customizer values you changed, compressed into the link itself — nothing is stored on a server — and the design renders as soon as the link is opened. An unedited example travels by name, and you can write those links by hand: ?example= takes box, gear, knob, honeycomb, hook, nameplate or bosl2 — for example /tools/openscad/?example=gear. Links made before this button (with #s= in the address) still open.

Limits

  • The engine runs single-threaded and in memory; very heavy minkowski() or high-$fn designs can take a long time — use Stop — or run out of memory.

  • PNG export from OpenSCAD itself, PDF and 3MF colour output are not available in this build (3MF here is geometry only).

  • The engine is the openscad-wasm-prebuilt package (GPL-2.0-or-later), loaded from jsDelivr; its source is at https://github.com/openscad/openscad and https://github.com/lorenzowritescode/openscad-wasm.

Runs entirely in your browser — network requests go only to the services named on this page.