A simple tool to trace the edge of a piece of scrap wood for lasercutting
  • TypeScript 81.7%
  • Svelte 17.7%
  • HTML 0.4%
  • JavaScript 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Bas Dado c1183ce85c chore: deploy to Cloudflare Pages with wrangler
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 16:28:34 +02:00
docs/superpowers Add Scrap Tracer implementation plan 2026-10-15 14:35:10 +02:00
src feat: style the UI with Oat and make the empty canvas a click-to-load drop zone 2026-10-15 15:43:06 +02:00
tests perf: cache the detected piece so margin changes only re-trace it 2026-10-15 15:30:12 +02:00
.gitignore chore: deploy to Cloudflare Pages with wrangler 2026-10-15 16:28:34 +02:00
index.html feat: scaffold Svelte app with shared types and scale calculation 2026-10-15 14:38:22 +02:00
package-lock.json chore: deploy to Cloudflare Pages with wrangler 2026-10-15 16:28:34 +02:00
package.json chore: deploy to Cloudflare Pages with wrangler 2026-10-15 16:28:34 +02:00
README.md feat: correct uneven lighting and pick polarity automatically 2026-10-15 15:12:16 +02:00
svelte.config.js feat: scaffold Svelte app with shared types and scale calculation 2026-10-15 14:38:22 +02:00
tsconfig.json feat: scaffold Svelte app with shared types and scale calculation 2026-10-15 14:38:22 +02:00
vite.config.ts feat: add OpenCV loader, Otsu threshold and margin-aware mask tracing 2026-10-15 14:43:41 +02:00

Scrap Tracer

Turn a phone photo of a laser-cut scrap piece into a 1:1 DXF/SVG outline, so you can check in RDWorks (or LightBurn/Inkscape) whether your design fits on it. Built for Makerspace Delft.

Use

  1. Photograph the piece from straight above, on a contrasting surface, with something of known length visible.
  2. Load the photo, click Measure, click both ends of the known length, and enter it in mm.
  3. Check the green outline. If needed, click the piece (this also tells the app whether it is darker or lighter than the background), adjust the threshold, or draw the outline by hand.
  4. Set the safety margin (default −2 mm shrinks the usable area a little).
  5. Download DXF and import it in your laser software at 1:1, in mm.

Develop

npm install
npm run dev      # local dev server
npm test         # unit tests (Vitest, OpenCV runs headless in Node)
npm run check    # type check
npm run build    # static build in dist/

Deploy (Cloudflare Pages)

Build command npm run build, output directory dist. No server or environment variables needed.