Digitized stitch geometry discarded — workspace/editor model and export use region outlines (~5 pts), not real stitches #96

Closed
opened 2026-09-16 01:38:28 +00:00 by Mark · 0 comments
Owner

Summary

The workspace model is built from region polygon outlines; the service's real stitch geometry (response.stitchObjects, thousands of stitches) is used only to compute thread stops and then discarded. Export therefore sends region outlines (~5 points each) instead of the digitized stitches.

Verified live 2026-09-15 against the running stack (vite :3000 -> easystitch-service :8080 -> engine):

  • Solid red SVG: service digitizes to 3,813 stitches (stats.totalStitches), returns full stitchObjects.
  • UI Object List shows "Region r0 — 0 stitches" (fromServiceRegion hardcodes stitchCount: 0 at src/lib/digitize-adapters.ts:100).
  • Export via dialog: "PES exported (5 stitches, 1 colors)" — the 5-point region polygon, not 3,813 stitches.
  • Same outline-only snapshot reaches the Editor via sessionStorage (tc_workspace_snapshot), so the Editor works on outlines too.

Where

  • src/components/workspace/useWorkspace.ts:580-589 — maps response.stitchObjects only into computeThreadStops, then calls commitDigitizedResult(colorRegions).
  • src/components/workspace/useWorkspace.ts:489-514 — builds workspace StitchObjects from colorRegions (outline points).
  • src/lib/digitize-adapters.ts:88-105 — fromServiceRegion sets stitchCount: 0, points = region.polygon.
  • Export path: ExportDialog -> toServiceStitchObjects(state.stitchObjects) -> POST /v1/export (outlines).

Expected

The committed workspace/editor model carries the real response.stitchObjects geometry (converted via fromServiceStitchObject), with regions kept as metadata/selection boundaries. Exported PES contains the actual digitized stitches; Object List / totals reflect real stitch counts.

Actual

Exported PES = region outline polygons. Everything downstream (Editor, export, per-object stitch counts) operates on outlines.

Severity

P1 — the core promise (image -> stitches -> PES) produces outline-only output for auto-digitized designs.

## Summary The workspace model is built from **region polygon outlines**; the service's real stitch geometry (`response.stitchObjects`, thousands of stitches) is used only to compute thread stops and then discarded. Export therefore sends region outlines (~5 points each) instead of the digitized stitches. Verified live 2026-09-15 against the running stack (vite :3000 -> easystitch-service :8080 -> engine): - Solid red SVG: service digitizes to **3,813 stitches** (`stats.totalStitches`), returns full `stitchObjects`. - UI Object List shows "Region r0 — **0 stitches**" (`fromServiceRegion` hardcodes `stitchCount: 0` at `src/lib/digitize-adapters.ts:100`). - Export via dialog: "PES exported (**5 stitches**, 1 colors)" — the 5-point region polygon, not 3,813 stitches. - Same outline-only snapshot reaches the Editor via `sessionStorage` (`tc_workspace_snapshot`), so the Editor works on outlines too. ## Where - `src/components/workspace/useWorkspace.ts:580-589` — maps `response.stitchObjects` only into `computeThreadStops`, then calls `commitDigitizedResult(colorRegions)`. - `src/components/workspace/useWorkspace.ts:489-514` — builds workspace `StitchObject`s from `colorRegions` (outline `points`). - `src/lib/digitize-adapters.ts:88-105` — `fromServiceRegion` sets `stitchCount: 0`, `points = region.polygon`. - Export path: `ExportDialog` -> `toServiceStitchObjects(state.stitchObjects)` -> `POST /v1/export` (outlines). ## Expected The committed workspace/editor model carries the real `response.stitchObjects` geometry (converted via `fromServiceStitchObject`), with regions kept as metadata/selection boundaries. Exported PES contains the actual digitized stitches; Object List / totals reflect real stitch counts. ## Actual Exported PES = region outline polygons. Everything downstream (Editor, export, per-object stitch counts) operates on outlines. ## Severity P1 — the core promise (image -> stitches -> PES) produces outline-only output for auto-digitized designs.
Mark 2026-09-16 01:38:28 +00:00
  • closed this issue
  • added the
    bug
    label
Sign in to join this conversation.
No description provided.