About OpenSCAD in the Browser
What this is
A page where you type OpenSCAD code and watch the 3D model appear next to it. It is the real OpenSCAD, running inside your browser, so a script that works on your own computer works here too, and the other way around. When you like the model, File, Download STL gives you a file a 3D printer’s software can read.
Everything stays on your computer. Your code is not sent anywhere, and there is nothing to install and no account to make.
What you can do here
- Write and run code. Colors for the parts of the language, automatic
indenting, and suggestions as you type (try typing
cyl). Press Ctrl or Cmd and Enter to render. - Open and save
.scadfiles from your computer. In Chrome you can install this page as an app (the menu, Cast, save and share, Install page as app). Then Finder’s Open With lists it for.scadfiles, and File, Save to the file (Ctrl or Cmd and S) writes your changes back to that file. - Keep many drawings. Give a drawing a name and it is saved in this browser as you type. File, My drawings lists all of them, and you can back them up to a file and restore them later.
- Share through GitHub. File, Open from GitHub opens a
.scadfile from a repository (public, or private with a token) when you paste its link, or lists all the.scadfiles in a repository when you paste the repository’s link. File, Save to GitHub puts your drawing in a repository with a note about the change. If you changed a file that someone else also changed, it stops and tells you instead of erasing their work. - Open a GitHub file by its address. Go to
/openscad/owner/repo/branch/folder/part.scadto open that file (leave out the branch and it ismain). Go to/openscad/owner/repo(or add a branch and folder) to get a list of the repository’s.scadfiles to pick from. If the repository is private you are asked for a token once. - See the history. File, History on GitHub lists the commits that changed the drawing’s GitHub file, newest first, with the date, who made it and the note. Open this version loads an old one as a separate new drawing, and On GitHub shows what changed.
- Share a link. File, Copy share link makes a link with your exact code. If the drawing came from a GitHub file, the link remembers that file, so the person you send it to can change the code and save it back with their own token. Copy link to the GitHub file makes a link that opens the file as it is on GitHub right now.
- Move a drawing to Python. File, Open in Python 3D Studio turns the drawing into
Python code and opens it in Python in 3D Studio in a new tab. Python 3D
has fewer features than OpenSCAD, so it converts what it can (shapes, moving, turning,
colors, combining and cutting, extruding, variables, loops, modules) and leaves a
# NOTE:comment where it could not, for examplemirror,hullandminkowski. Read the result over; it is a starting point. - Look at the model. Turn it, zoom, fit it to the window, look from below, show scale numbers on the axes, and show its size and center.
- Check it for printing. Print, Show overhangs paints in red the faces that tilt too far out and would need support, and tells you how many square millimeters that is. Auto-orient tries the faces of the model as its bottom and keeps the way up that needs the least support.
Why OpenSCAD matters
Most 3D design programs are about dragging shapes with a mouse. OpenSCAD is about describing a shape with numbers and words, and that changes what you can do.
- It is exact. A hole that is 10.8 mm is 10.8 mm, not “about that size on the screen.” Parts that must fit together, such as a cap that slides into a tube and squeezes an O-ring, depend on numbers like that.
- Change one number, change the whole part. Put the tube size at the top as a variable and every other measurement follows. This is called a parametric design, and it is how one design becomes ten sizes.
- Your design is a text file. You can copy it, share it, compare two versions, and keep it for years. Nothing is hidden inside a mouse movement.
- It teaches real programming. Variables, loops, if statements, functions and your own modules are all in it, and the result is something you can hold after it prints.
- It is free and open. Anyone can use it, read how it works, and add to it. Many people who share 3D printable designs write them in OpenSCAD.
It also pairs with the rest of this site. Python in 3D uses the same ideas (shapes, translate, rotate, difference) written in Python. If you can write one, the other will feel familiar.
What is under the hood
| Part | What it does | License |
|---|---|---|
| OpenSCAD (a snapshot dated 2025-01-19, built for the web) | Reads your code and builds the model. It uses the Manifold geometry library for fast cutting and joining of shapes. | GPL-2.0-or-later (Manifold: Apache-2.0) |
| DejaVu fonts | The letters used by text(). |
Free (Bitstream Vera license) |
| WebAssembly and a Web Worker | WebAssembly lets the program written for desktops run in a browser. The worker runs it off the main page, so the page stays responsive and Stop works if a script never finishes. | Part of the browser |
| CodeMirror 6 | The editor: colors, indenting, suggestions, undo. | MIT |
| three.js | Draws the 3D model, the grid, the axes and the arrows. | MIT |
| lz-string | Squeezes your code into a share link. | MIT |
| Your browser’s local storage | Keeps your named drawings on this computer. | Part of the browser |
The OpenSCAD engine is copied, unchanged, from the open source package openscad-wasm-prebuilt, which compiles OpenSCAD for the web. The overhang check and auto-orient are this page’s own code: they look at the triangles of the finished model, they are not part of OpenSCAD.
Licensing
- OpenSCAD is free software under the GNU General Public License, version 2 or later. The engine file on this site is that program, so it comes with its license text and the sources are linked above. This is why the tool lives in its own folder, separate from the lessons.
- What you make is yours. The code you write and the STL files you download belong to you, to use and share as you like.
- This page’s own wrapper (the page, the editor setup and the viewer code) is the work of the course teacher and is part of this site.
Privacy
- Your code and drawings are never sent to a server. They live in this browser’s local storage, on this computer, and are gone if the site’s data is cleared. Use File, My drawings, Back up all for anything you care about.
-
GitHub is only contacted when you use Open from GitHub, Save to GitHub, or an address like
/openscad/owner/repo/branch/part.scad. Saving needs a personal access token, and so does opening a file from a private repository (a public one needs no token). The token is sent only to GitHub. Once GitHub accepts it, this browser’s local storage remembers it for that oneowner/repoon this site, so you are not asked again. Forget saved token in the Open and Save dialogs removes it, and so does clearing the site’s data. Anyone who can use this browser profile can use the token, so do not save one on a shared computer. Make the token for one repository only, with permission to write contents, and let it expire soon. - The page does load two small code libraries (three.js and lz-string) from a public library host, the same way the Python in 3D pages do. That host can see that a page asked for them, as any host would, but it never receives your code.
What is not here yet
- Fonts:
text()works with three fonts: DejaVu Sans, DejaVu Sans Bold and DejaVu Sans Mono. Use them by name, for exampletext("Hi", font="DejaVu Sans:style=Bold"). Other fonts are not included, and the fonts are downloaded only when your script usestext(). - Libraries:
use <...>andinclude <...>of outside libraries (such as MCAD or BOSL) do not work, and neither doesimport()of a file. Everything has to be in your one script. - GitHub: each file is opened or saved on its own, and nothing else in the
repository is fetched yet, so
use <other.scad>still does not work. - Size: the first time you open the page it downloads the engine, which is about 11 MB. After that your browser keeps it.
- Overhangs: the red faces are a guide. A real 3D printer’s software has the final say about what needs support, and a face exactly at the limit is treated as printable.
Where to learn OpenSCAD
- The OpenSCAD cheatsheet is one page with every command. It is also in the Help menu.
- The OpenSCAD documentation has a full manual and tutorials.
- In the tool, File, Example: overhang test is a small script that shows what the overhang check does.