AI CAD — say it, shape it. chisel.theradicalparty.com
- Fix param sliders: Viewer now fits camera once per design (fitKey), not on every param change — size changes are visible again. Better slider ranges. - Progress UX: full-stage overlay with spinning cube + pipeline stepper, animated thinking dots in chat, send-button spinner, staged status. - B (vision verify): capture canvas → /api/verify (Claude vision) → auto-refine one pass on mismatch. Fail-open so a flaky judge never blocks. - C (persistence): D1 designs table + anonymous cookie identity, save/load/list, designs drawer, autosave, shareable ids. no-store on all /api responses. - D (STEP scaffold): /api/step + build123d prompt + service client (step.ts), Download STEP button. Needs STEP_SERVICE_URL to go live. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| migrations | ||
| src | ||
| .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.
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