Welcome to SCADLite, a completely offline, browser-based OpenSCAD environment. Below you'll find quick keyboard shortcuts, compatibility notes, and the OpenSCAD Cheat Sheet, which contains a helpful OpenSCAD modeling syntax references.
[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] : Download Editor Cache as .scad Text File[Ctrl] + [O] : Open .scad FileLink 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 keystoke basis. However, opening a URL containing an encoded model will overwrite the Link Workspace. When Link Sharing is enabled in settings, use the Share Link button to encode your current model into a URL and copy it to your clipboard for sharing. 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.
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 tab 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.
Scroll down for syntax. Click to highlight, then copy and paste directly into the editor.
var = value;module name(...) { ... }name();function name(...) = ...;include <filename.scad>use <filename.scad>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);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);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()union()difference()intersection()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)* Disable (ignores the subtree)! Show only (ignores everything else)# Highlight (draws in transparent pink)% Transparent (draws in transparent gray)for (i = [start:end]) { ... }for (i = [start:step:end]) { ... }for (i = [...]) { ... }intersection_for(i = [start:end]) { ... }if (...) { ... } else { ... }[ for (i = range|list) i ][ for (i = ...) if (condition(i)) i ][ for (i = ...) let (a = ...) a ]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()echo(...)render(convexity)import("....ext")$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* OpenSCAD Cheat Sheet content adapted from the OpenSCAD CheatSheet by Peter Uithoven @ Fablab Amersfoort, licensed under CC-BY.