Help & OpenSCAD Cheat Sheet
Welcome to SCADLite, a completely offline, browser-based OpenSCAD environment. Below you'll find quick keyboard shortcuts, additional use instructions, compatibility notes, and the OpenSCAD Cheat Sheet, which contains helpful OpenSCAD modeling syntax references.
Keyboard Shortcuts
[F1] : Toggle Help and OpenSCAD Cheat Sheet Menu
[Ctrl] + [,] : Toggle Workspace Settings
[F5] or [Ctrl] + [Enter] : Preview Model
[F6] : Render Model
[F7] : Export to STL/3MF
[Ctrl] + [S] : Save to App Files (Save As when untitled)
[Ctrl] + [O] : Open from App Files
App Files, and Loading vs. Opening [Show]
App Files is SCADLite's built-in storage for your .scad files, kept inside the app rather than on disk. Save the editor's contents there with the Save button or [Ctrl] + [S] (Save As when untitled), and bring files back with the App Files button or [Ctrl] + [O]. Every file stored in App Files is also visible to the compiler, so files can reference each other with include <myutils.scad> or use <parts.scad> exactly as they would on desktop OpenSCAD with files sitting side by side. That makes modular projects possible: keep shared modules in App Files and include them from whatever you're working on. App Files also offers Download All to save everything to a single zip file.
The naming convention throughout the app: Open means retrieving a file from App Files, while Load means bringing code in from an external source, either a .scad file on your computer or a shared link. Loading from disk places the file's code in the editor and names the project after the file, but nothing is stored in App Files until you Save it there. Normally the Load button goes straight to a file picker; when Link Sharing is enabled it instead opens a small Load menu offering both paths, loading from disk or pasting a shared link. Download, by contrast, writes the editor's current code out to a .scad file on your computer.
Workspace Settings [Show]
The Project Name at the top names your current work: it becomes the filename for saves, downloads, and exports, and is displayed at the top-left of the 3D view. When Link Sharing is enabled, each workspace keeps its own project name, and the name travels along with shared links. Project names and editor contents persist across sessions while Recover Last Workspaces is enabled; disabling it starts every session fresh with a blank editor.
The left column collects editor and readout preferences: editor font size, line numbers, brace matching, line highlighting, console visibility and debug verbosity, and the grid and axes with their step, range, and style controls. The right column controls the 3D view: Reset View re-frames the camera, Zoom Settings tune zoom feel, and Model View pairs the projection toggle (Perspective or Orthogonal) with the rendering toggle (Solid or Wireframe); both are remembered across sessions. The Model Color button doubles as a swatch, always showing the current model color. Export Format switches exports between STL and 3MF.
The manager buttons (Custom Fonts, STL Imports, SVG Imports, Libraries) let you upload external resources, fonts for text(), STL and SVG files for import(), and OpenSCAD libraries, all stored inside the app and available to your code by filename. See the Compatibility Notes below for format details.
Backup All Data downloads a single zip containing everything the app stores: App Files, libraries, fonts, STL and SVG imports, every setting, and the current editor contents. Restore Backup does the reverse, and is a full mirror operation: it erases all current data and replaces it with the backup's contents, after a confirmation prompt, then reloads the app. Together they make SCADLite portable across machines, browser profiles, and reinstalls, which is especially useful in environments where browser storage gets wiped.
Link Sharing, Workspaces, and Multiple Instances [Show]
Link sharing can be enabled in Workspace Settings. Enabling it gives you a second workspace, the Link Workspace, in addition to the Main Workspace. Workspaces can be toggled between freely. Code written in either workspace persists in local storage, written on a per keystroke basis. However, opening a URL containing an encoded model will overwrite the Link Workspace. When Link Sharing is enabled in settings, use the Update Link button to encode your current model into a URL and copy it to your clipboard for sharing. If the project has a name, the name is carried along in the link as well. Note that complex models may run into problems, since URL parameters are limited in length. Link sharing is best suited for smaller models or demo purposes, not as a primary save method. Also, sharing a link while the Main Workspace is selected will overwrite the Link Workspace with the Main Workspace's code.
To open a shared link you've received without leaving the app, which is especially useful in the installed PWA where there is no address bar, use the Load Shared Link button next to the Link Sharing toggle, or the Load button's menu once Link Sharing is enabled, and paste the link there. Pasting a full URL or just the #scad= portion both work. Loading a link this way enables Link Sharing automatically if it wasn't already on.
Multiple instances of the page/PWA can be open at once, but the Main and Link workspaces are shared, global storage, not separate per instance. Each new instance loads whichever version of the workspaces most recently saved. If you work with multiple instances open simultaneously, only the last modified code editor caches will be written to storage. Thus, an earlier instance's unsaved changes can be silently lost, even if that instance is still open. The moment a page refreshes, reloads, or a new instance is opened, it will pull the shared storage's current contents from the last instance that had code edited. If you need to work on more than one model at a time, save each to a .scad file as needed rather than relying on the workspace storage caches to hold multiple versions. Code is retained independently in each instance's code editor while that instance stays open, so multiple instances can be used simultaneously. Though when using multiple instances, avoid refreshing the instance you're relying on until you've saved your work as a .scad file. Note that [F5] keypresses are intercepted to perform a Preview operation, as opposed to refreshing. Though refreshing is still possible via right-click context menu or with [Ctrl] + [R] when using Firefox, so care is needed to not refresh the page unintentionally.
Compatibility Notes [Show]
Imported STL files must be in ASCII format. Binary-formatted STL files are not supported. OpenSCAD can be configured to export STLs in ASCII format in Preferences › Advanced › Export Features. Note that ASCII STLs are much larger in size.
External libraries are now supported. You can upload libraries contained in zip files in Workspace Settings › Manage Libraries. The zip file should be named after the library's canonical folder name for compatibility. For example, if using the MCAD library your uploaded zip file should be named MCAD.zip, and contain MCAD library .scad files, or a folder containing the files. Either way is supported. Then, in the example of MCAD, your include line(s) would be:
include <MCAD/filename.scad>
OpenSCAD Cheat Sheet
Scroll down for syntax. Click to highlight, then copy and paste directly into the editor.
Syntax & Includes
var = value;
module name(...) { ... }
name();
function name(...) = ...;
include <filename.scad>
use <filename.scad>
2D Shapes
circle(radius | d=diameter);
square(size, center);
square([width, height], center);
polygon([points]);
polygon([points], [paths]);
text(text, size, font, halign, valign, spacing, direction, language, script);
3D Shapes
sphere(radius | d=diameter);
cube(size, center);
cube([width, depth, height], center);
cylinder(h, r|d, center);
cylinder(h, r1|d1, r2|d2, center);
polyhedron(points, faces, convexity);
Transformations
translate([x, y, z])
rotate([x, y, z])
rotate(a, [x, y, z])
scale([x, y, z])
resize([x, y, z], auto)
mirror([x, y, z])
multmatrix(m)
color("colorname", alpha)
color([r, g, b, a])
offset(r|delta, chamfer)
hull()
minkowski()
Boolean Operations
union()
difference()
intersection()
Extrusion & Projection
linear_extrude(height, center, convexity, twist, slices, scale, $fn, $fa, $fs)
rotate_extrude(angle, convexity, $fn, $fa, $fs)
projection(cut)
surface(file, center, invert, convexity)
Modifiers
* Disable (ignores the subtree)
! Show only (ignores everything else)
# Highlight (draws in transparent pink)
% Transparent (draws in transparent gray)
Loops & Conditionals
for (i = [start:end]) { ... }
for (i = [start:step:end]) { ... }
for (i = [...]) { ... }
intersection_for(i = [start:end]) { ... }
if (...) { ... } else { ... }
List Comprehensions
[ for (i = range|list) i ]
[ for (i = ...) if (condition(i)) i ]
[ for (i = ...) let (a = ...) a ]
Math & String Functions
abs(), sign(), sin(), cos(), tan(), acos(), asin(), atan(), atan2()
floor(), round(), ceil(), ln(), len(), let(), log(), pow(), sqrt(), exp()
rands(), min(), max(), norm(), cross(), concat(), lookup()
str(), chr(), ord(), search(), version(), version_num(), parent_module()
Other
echo(...)
render(convexity)
import("....ext")
Special Variables
$fa Minimum angle
$fs Minimum size
$fn Number of fragments
$t Animation step
$vpr Viewport rotation
$vpt Viewport translation
$vpd Viewport camera distance
$children Number of module children
The OpenSCAD Cheat Sheet content was adapted from the
OpenSCAD CheatSheet
written by Peter Uithoven
at Fablab Amersfoort,
and is licensed under
CC-BY.