AI CAD — say it, shape it. chisel.theradicalparty.com
Single source of truth: build123d drives BOTH the STL preview and the STEP export from the same script + params, so what you see is what you download. Verified live: generate → build123d → /api/build STL + /api/step STEP. - prompts: SYSTEM_PROMPT teaches build123d (Python) with # @param sliders - claude.ts: parse python fences - step.ts → generic geometry-service client (/tessellate + /step), GeometryError carries the Python traceback for the repair loop - worker: /api/generate returns code; /api/build tessellates; /api/step runs the same code+params (no separate Claude re-gen) - client engine: runJscad → buildModel (server STL); parseParams handles # @param - App: debounced param rebuilds + rebuilding indicator; STEP sends script+params - Viewer: Z-up→Y-up rotation; retire client-side JSCAD worker - VM service.py/runner.py: /tessellate + /step with params Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| migrations | ||
| src | ||
| step-service | ||
| .gitignore | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| vite.config.ts | ||
| wrangler.jsonc | ||
◢ Chisel — AI CAD
Say it. Shape it. Message what you want built; Claude writes a parametric CAD script, it runs in a sandbox, and it appears in a live 3D viewport — exportable to real CAD.
The core idea: the design is a parametric script. Chat edits patch the script; sliders tune its parameters; export emits the geometry. Everything — editing, versioning, parametrics — falls out of that one choice.
Live: https://chisel.theradicalparty.com · pushes to main auto-deploy via
the Forgejo post-receive hook.
Architecture (v0 — MVP)
React + react-three-fiber (chat + 3D viewport)
│ POST /api/generate | /api/repair
▼
Hono Worker ── Claude (claude-sonnet-4-6, prompt-cached system prompt)
│
▼ returns a JSCAD script
Sandboxed Web Worker (src/client/engine) ── runs script → binary STL
▼
three.js viewport + Download STL
- Kernel: JSCAD (
@jscad/modeling), pure JS — runs client-side in a Web Worker isolated from the DOM. Exports STL now. - Agent loop: generate → execute → on error,
/api/repair(up to 3×) before the user sees anything. - Parameters:
// @param name default // labelcomments in the script become live sliders that re-run locally with no API call.
Develop
npm install
wrangler secret put ANTHROPIC_API_KEY # or add to .dev.vars for local dev
# terminal 1 — Worker API on :8787
npm run dev
# terminal 2 — Vite client on :5173 (proxies /api → :8787)
npm run dev:client
Open http://localhost:5173.
Deploy
npm run deploy # builds client → ./public, then wrangler deploy
Serves at chisel.theradicalparty.com.
Roadmap
- v1 — conversational edits as source-of-truth, vision verification (render → "does this match?"), auth + saved projects (D1/R2), 3MF/OBJ export.
- v2 — STEP B-rep engine via build123d/OpenCascade in a Cloudflare Container/Sandbox, so exports reopen cleanly in Fusion/SolidWorks/FreeCAD. Version history & branching.
- v3 — assemblies & mates, dimension queries ("how tall is it?"), manufacturing hints (3D print / CNC).
Layout
src/worker/ Hono API — Claude orchestration, prompts, repair
src/client/ React app, 3D viewer, JSCAD Web Worker engine