From 08767cf8218eeca4d51c6c79e4b387744e24a9ba Mon Sep 17 00:00:00 2001 From: sjat Date: Mon, 8 Jun 2026 21:55:06 +0200 Subject: [PATCH] Add G-code overlay design spec Co-Authored-By: Claude Opus 4.8 (1M context) --- .../specs/2026-06-08-gcode-overlay-design.md | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 docs/superpowers/specs/2026-06-08-gcode-overlay-design.md diff --git a/docs/superpowers/specs/2026-06-08-gcode-overlay-design.md b/docs/superpowers/specs/2026-06-08-gcode-overlay-design.md new file mode 100644 index 0000000..faac26d --- /dev/null +++ b/docs/superpowers/specs/2026-06-08-gcode-overlay-design.md @@ -0,0 +1,124 @@ +# G-Code Overlay — Design + +**Date:** 2026-06-08 +**Status:** Approved (pending spec review) + +## Purpose + +At the makerspace, a fixed camera mounted on the wall films the CNC router table top-down, and the feed is restreamed to monitors around the space. This project is a web app that overlays a G-code toolpath on top of that camera stream, so an operator can: + +- **Reality-check a job** — see where the machine will actually cut before/while it runs. +- **Plan fixturing** — see where the tool *won't* go, to decide where screws/clamps can safely be placed. + +A user opens a local G-code file in the browser, the toolpath is drawn over the live video, and they align it to the real material. + +## Scope + +**In scope (v1):** +- Load a local G-code file (no upload; parsed in-browser). +- Draw cutting paths (G1/G2/G3) and rapid/travel moves (G0, styled distinctly) over the video. +- One-time camera→machine calibration (perspective transform), shared via a served config file. +- Per-job alignment of the toolpath to the material (drag+rotate, click-to-set-origin, numeric offset). + +**Out of scope (v1), designed to add later:** +- Plunge/screw-placement highlighting. +- Depth cues (color/weight by Z or cut order). +- Broadcasting the overlay to all makerspace monitors (requires shared session state / backend). +- Lens-distortion correction. +- Multi-camera support. + +**Audience:** local viewer only. The overlay appears on the screen of whoever loaded the G-code; the makerspace-wide monitors keep showing the existing raw stream. No shared session state. + +## Architecture + +A pure client-side static single-page app — **TypeScript + Vite + Canvas 2D**, no backend. The page stacks three layers: + +1. **Video layer** — the camera stream, shown in an `` (MJPEG) or `