Reconstruct parametric box/cylinder/sphere shapes as exact OpenCascade
B-Rep solids and write a named, colored multi-body STEP assembly, cutting
holes via boolean subtraction (only against bodies they overlap). brepjs
and the 22 MB occt-wasm kernel load lazily on first export, so the initial
bundle is unchanged.
Unsupported shape kinds are skipped with an in-app notice. Cones are exact
in the kernel but skipped pending an upstream occt-wasm multi-solid STEP
writer fix that drops conical surfaces.
occt-wasm runtime is staged into public/occt by scripts/copy-occt-wasm.mjs
(gitignored) and loaded outside the bundler; the optional brepkit /
opencascade kernel backends are aliased away in next.config.
Additive fork feature letting an MCP server (driven by Claude) push parametric
WorkplaneShape[] scenes into the running SketchForge editor. The Node side never
writes browser storage; it stages a command file that an in-page poller applies
through the editor's existing updateProjectShapes() save path.
- Phase 1: apps/web/src/app/api/scene/route.ts — stages/serves commands behind the
existing same-origin guard, with its own monotonic stagingRevision (separate from
the app's project revision).
- Phase 2: apps/web/src/lib/sceneBridge.ts (SceneTransport seam + polling transport)
and a useSceneBridge poller hook in page.tsx (gated on ?bridge=1), which creates
unknown projects and hydrates via updateProjectShapes; defers while dragging.
- Phase 3: apps/mcp/ MCP server — set_scene/get_scene/add_shapes/list_kinds. zod
validates the ShapeKind union enum + base numerics, then reuses the app's own
sceneShape/canonicalizeShape for defaults/canonicalisation (no hand-authored ranges).
- Phase 4: docs/scene-bridge/README.md plus vitest cases for the route handler and
the schema validator.
Staged scenes live under .codex/pending-scenes/ (gitignored). MCP registered via
.mcp.json. npm run test: 29 passing.
Co-Authored-By: Claude Opus 4.8 <[email protected]>