# 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 `