ScadForge — browser-based OpenSCAD parametric CAD IDE
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| .gsd/gates | ||
| docs | ||
| public | ||
| src | ||
| .gitignore | ||
| AGENTS.md | ||
| components.json | ||
| CONTRIBUTING.md | ||
| eslint.config.js | ||
| index.html | ||
| lefthook.yml | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.js | ||
| README.md | ||
| tailwind.config.js | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||
| vitest.config.ts | ||
ScadForge
A browser-based IDE for OpenSCAD parametric CAD.
Projects are directories. Parts are modules. Click-to-select code sync. Real
.scadexport.
What it does
ScadForge wraps OpenSCAD in a graphical workbench with a virtual filesystem, a CAD-aware parser, a constraint solver, and a 3D viewport — all in the browser, with project state stored in IndexedDB.
- Module-first editing. Each
.scadpart is a top-level module you can select in the 3D viewport and jump to in the source editor. - Constraint solver. Declare dimensional relationships (equalities, inequalities, references) and let the solver adjust parameters to keep them satisfied.
- Project filesystem. Nested directories, drag-to-move, rename, duplicate — autosaved, survives refresh.
- Library manager. Built-in catalogs for BOSL2, MCAD, NopSCADlib, and DotSCAD, plus the ability to drop in custom libraries.
- Real
.scadexport. Projects zip out as actual OpenSCAD files (preserving the directory tree) ready to feed intoopenscad -o model.stl.
Tech Stack
- React 19 + TypeScript 5
- Vite 7
- Tailwind CSS 3 + Radix UI primitives
- CodeMirror 6 (editor)
- React Three Fiber + Three.js (viewport)
- GSAP + Lenis (landing animations)
- IndexedDB (project storage, via the custom VFS in
src/lib/vfs.ts)
Getting Started
git clone https://github.com/Mark/kimi_agent_openscad_parametric_gui.git
cd kimi_agent_openscad_parametric_gui
npm install
npm run dev # http://localhost:5173
Scripts
| Command | Description |
|---|---|
npm run dev |
Vite dev server with HMR |
npm run build |
Type-check + production build |
npm run lint |
ESLint over src/ |
npm run preview |
Serve the production build locally |
Project Structure
src/
lib/
vfs.ts # Virtual filesystem — SHARED CONTRACT
scad/ # OpenSCAD parser, solver, codegen
parser.ts # Tokenizer + module-tree builder
constraints.ts # Constraint AST
solver.ts # Gauss-Seidel constraint solver
constraintCodegen.ts # Solve → parameter substitution
geometry.ts # Bounding-box + shape inference
syncStore.ts # useSyncExternalStore-backed VFS hook
libraries.ts # BOSL2 / MCAD / NopSCADlib / DotSCAD catalogs
components/
workbench/ # CodeEditor, Viewport3D, FileTree, etc.
ui/ # shadcn/ui primitives
pages/
Home.tsx # Marketing landing
Workspace.tsx # Main IDE view
Libraries.tsx # Library catalog browser
Shortcuts.tsx # Keyboard cheat-sheet
About.tsx # Project info
VFS Contract
src/lib/vfs.ts is the merge seam between agents. If you fork or extend
this codebase, do not change those exported signatures — add new helpers
in your own files instead.
License
Private — Mark/Cyguin.