Cadgpt does not generate CAD. You write OpenSCAD code yourself (using your own AI — Codex, Claude, Copilot, whatever), and Cadgpt just renders it as an interactive 3D preview inside VS Code.
Features
Open a .scad file and run Cadgpt: Preview Cad to get a live Three.js 3D preview beside your editor.
Converts OpenSCAD → STL via the OpenSCAD CLI, then renders the mesh with orbit controls, grid, and lighting.
Auto-refreshes the preview when you save the .scad file.
Export STL button to save a binary STL from your model.
Toggle auto-orbit to spin the model.
Requirements
OpenSCAD installed and on your system PATH (the openscad command must work in a terminal).
A .scad file open in the editor.
If you prefer, set the OpenSCAD binary path in VS Code settings: cadgpt.openscadPath.
Usage
Write (or have your AI write) OpenSCAD code in a .scad file, e.g.:
$fn = 64;
difference() {
cube([40, 40, 40], center = true);
sphere(d = 30, center = true);
}
Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) → Cadgpt: Preview Cad.
Or click the Cadgpt: Preview Cad button in the editor title bar when a .scad file is active.
A Three.js viewer opens beside the editor. Edit your .scad, save, and the preview updates automatically.
Use Export STL to save a binary .stl for 3D printing / downstream tools.
Extension Settings
cadgpt.openscadPath: Absolute path to the OpenSCAD CLI binary (default: resolves openscad from PATH).
How it works
Cadgpt reads your .scad source, shells out to openscad -o model.stl model.scad, then streams the resulting STL into a VS Code webview where Three.js renders it interactively. Your AI generates the geometry; Cadgpt just renders it.