Decompose: Implement real auto-digitize engine — Phase 5: Thread Palette Mapping & Engine Integration #10

Closed
opened 2026-06-22 15:28:18 +00:00 by Mark · 2 comments
Owner

⚠️ Re-scoped — blocked on #11

This work was originally framed as "implement from scratch." After auditing the
existing ~/Projects/easystitch/ project (a complete Python embroidery CAM with
5-stage pipeline, satin/fill/running generation, ΔE color matching, and PES/DST/
EXP/JEF output), the right shape is call the EasyStitch service rather than
re-implement the algorithms.

Blocked on #11 ("Stand up EasyStitch as an HTTP service for ThreadCraft").
Until that service exists, this work has no backend to call.

Donor code in EasyStitch (do not port — call it):

  • ~/Projects/easystitch/src/embroidery_converter/thread_manager.py
    (ΔE-2000 thread matching, Brother PR-10 catalog)

New scope (post #11)

Thread palette mapping and the integration glue are the only
TypeScript-side concerns. The actual catalog + ΔE distance math
lives in the service.

  1. Use the paletteIndex returned by /v1/digitize (one per stitch
    object) to drive the Workspace's thread color picker. The picker
    should display the Brother catalog entry's name + swatch, not the
    raw RGB.
  2. The catalog itself can be cached client-side from a one-time
    GET /v1/threads/catalog call (or served as a static JSON bundle
    alongside the frontend build — coordinate with #11).
  3. For live color previews during manual edits (user drags a color
    picker), call POST /v1/threads/resolve to find the nearest
    catalog entry on the fly. Debounce to avoid spamming the service.
  4. Wire the auto-digitize button to call /v1/digitize (per #6) and
    show progress in RightPanel.tsx during the round-trip.
  5. Do not port the ΔE-2000 distance math, and do not embed the
    Brother catalog as TS data.

Acceptance: the Workspace's color picker shows Brother catalog
names (e.g. "Polyneon Pale Plum 907") instead of raw hex, and
the auto-digitize button produces a full stitch-object set in
the right panel within 2 seconds.

## ⚠️ Re-scoped — blocked on #11 > This work was originally framed as "implement from scratch." After auditing the > existing `~/Projects/easystitch/` project (a complete Python embroidery CAM with > 5-stage pipeline, satin/fill/running generation, ΔE color matching, and PES/DST/ > EXP/JEF output), the right shape is **call the EasyStitch service** rather than > re-implement the algorithms. > > **Blocked on #11** ("Stand up EasyStitch as an HTTP service for ThreadCraft"). > Until that service exists, this work has no backend to call. > > Donor code in EasyStitch (do not port — call it): - `~/Projects/easystitch/src/embroidery_converter/thread_manager.py` (ΔE-2000 thread matching, Brother PR-10 catalog) ## New scope (post #11) Thread palette mapping and the integration glue are the only TypeScript-side concerns. The actual catalog + ΔE distance math lives in the service. 1. Use the `paletteIndex` returned by `/v1/digitize` (one per stitch object) to drive the Workspace's thread color picker. The picker should display the Brother catalog entry's name + swatch, not the raw RGB. 2. The catalog itself can be cached client-side from a one-time `GET /v1/threads/catalog` call (or served as a static JSON bundle alongside the frontend build — coordinate with #11). 3. For live color previews during manual edits (user drags a color picker), call `POST /v1/threads/resolve` to find the nearest catalog entry on the fly. Debounce to avoid spamming the service. 4. Wire the auto-digitize button to call `/v1/digitize` (per #6) and show progress in `RightPanel.tsx` during the round-trip. 5. Do not port the ΔE-2000 distance math, and do not embed the Brother catalog as TS data. Acceptance: the Workspace's color picker shows Brother catalog names (e.g. "Polyneon Pale Plum 907") instead of raw hex, and the auto-digitize button produces a full stitch-object set in the right panel within 2 seconds.
Author
Owner

Blocked on #11 (Stand up EasyStitch as an HTTP service for ThreadCraft).

This work has been re-scoped — see the updated body. The reframe replaces
"implement from scratch" with "call the EasyStitch service and render the
result." #11 must complete first; once the service exposes /v1/digitize and
/v1/export, this work becomes a thin client + canvas rendering job.

cc: #11

**Blocked on #11** (Stand up EasyStitch as an HTTP service for ThreadCraft). This work has been re-scoped — see the updated body. The reframe replaces "implement from scratch" with "call the EasyStitch service and render the result." #11 must complete first; once the service exposes `/v1/digitize` and `/v1/export`, this work becomes a thin client + canvas rendering job. cc: #11
Author
Owner

Blocked-on update

This issue is blocked on easystitch-service#1 ("FastAPI wrapper exposing easystitch pipeline as HTTP service").

Why: the paletteIndex comes from /v1/digitize (and /v1/threads/resolve for live preview).

The parent ticket [Kimi_Agent_Brother_10_Digitizing_App#11] is the integration contract. The actual implementation lives in Mark/easystitch-service. When easystitch-service#1 closes, this issue can move forward.

There is also a frontend-side wiring issue: [Mark/easystitch-service#3] ("TypeScript client wrapper + vite dev proxy") — that one will be mirrored into the ThreadCraft repo as a frontend sub-issue when it's ready to dispatch.

## Blocked-on update This issue is blocked on **easystitch-service#1** ("FastAPI wrapper exposing easystitch pipeline as HTTP service"). **Why:** the paletteIndex comes from /v1/digitize (and /v1/threads/resolve for live preview). The parent ticket [Kimi_Agent_Brother_10_Digitizing_App#11] is the integration contract. The actual implementation lives in [Mark/easystitch-service](https://forgejo.tail018ac4.ts.net/Mark/easystitch-service). When easystitch-service#1 closes, this issue can move forward. There is also a frontend-side wiring issue: [Mark/easystitch-service#3] ("TypeScript client wrapper + vite dev proxy") — that one will be mirrored into the ThreadCraft repo as a frontend sub-issue when it's ready to dispatch.
Mark 2026-06-27 09:18:59 +00:00
Sign in to join this conversation.
No description provided.