Support SVG gradient and pattern fills in digitize pipeline #96

Closed
opened 2026-07-25 17:09:16 +00:00 by Mark · 1 comment
Owner

Feature — Support SVG gradient and pattern fills in digitize pipeline

Expected behavior: Gradients and patterns should produce stitched output, or at minimum a clear 422 error (never a 500 crash).

Current: Engine crashes with HTTP 500 on url(#...) fill references. The gradient test case produced 500 with {"error":"internal"}.

Acceptance:

  1. 2+ stop gradients produce a reasonable stitch approximation (sampled color bands)
  2. Pattern fills tile as individual filled regions
  3. No 500 crash for any valid SVG (this is a hard requirement — crash is never acceptable)
  4. If unsupported, return 422 with clear message explaining why

Approach: Browser-side gradient flattening (sample gradient at N stops, replace with banded solid-fill paths) or engine-level gradient resolution.

Moved from: Kimi_Agent_Brother_10_Digitizing_App#39

## Feature — Support SVG gradient and pattern fills in digitize pipeline **Expected behavior**: Gradients and patterns should produce stitched output, or at minimum a clear 422 error (never a 500 crash). **Current**: Engine crashes with HTTP 500 on `url(#...)` fill references. The gradient test case produced `500` with `{"error":"internal"}`. **Acceptance**: 1. 2+ stop gradients produce a reasonable stitch approximation (sampled color bands) 2. Pattern fills tile as individual filled regions 3. No 500 crash for any valid SVG (this is a hard requirement — crash is never acceptable) 4. If unsupported, return 422 with clear message explaining why **Approach**: Browser-side gradient flattening (sample gradient at N stops, replace with banded solid-fill paths) or engine-level gradient resolution. **Moved from**: Kimi_Agent_Brother_10_Digitizing_App#39
Author
Owner

Wired into parse_svg in 123fddf. Tested with 3-stop linearGradient (red→yellow→blue): 200 OK, 8 stitch objects, 10,400 stitches across 8 sampled color bands. No more 500 crash. 209/209 tests pass.

Wired into parse_svg in 123fddf. Tested with 3-stop linearGradient (red→yellow→blue): 200 OK, 8 stitch objects, 10,400 stitches across 8 sampled color bands. No more 500 crash. 209/209 tests pass.
Mark closed this issue 2026-07-26 14:50:19 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/easystitch#96
No description provided.