Raster inputs use placeholder stitch generator (silently produces degenerate output) #77
Labels
No labels
blocked:children
blocked:depends-101
blocked:depends-103
blocked:depends-104
blocked:needs-attention
blocked:needs-decision
blocked:no-changes
blocked:preflight
bug
chore
feature-request
in-progress
lint-cleanup
needs-decompose
performance
quality
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/easystitch#77
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
EmbroideryPipeline._emit_machine_file()(insrc/main_pipeline.py) has this branch:The
from_raster=Truebranch callsconvert_to_stitches()fromsrc/embroidery_converter/stitch_generator.py, which is a stub:It returns every SVG coordinate as a
"normal"stitch. No satin, no fill differentiation, no pull compensation, no underlay. Output looks correct superficially (a PES file is produced) but the stitches are wrong: not what a real embroidery machine expects, and not what the SAAS service contract claims to deliver.Impact
This is the primary path for the SAAS service — uploads are rasters (PNG/JPG), not SVG. Every digitize from the service would silently produce degenerate output if this branch ran.
The branch is in
_emit_machine_file()which is called byprocess_bytes(). It's also the natural target of the newdigitize_to_stitches()method (separate issue), so the bug propagates.Fix
Remove the
from_rasterbranch entirely. Type-aware generation (_generate_stitches_from_paths) should run for both raster-derived SVG and direct SVG input. Raster conversion produces SVG that should be classified like any other SVG.If there's a reason
from_rasterwas treated differently (e.g. performance, file-size blowup), capture that in the comment but keep type-aware generation as the default.Also fix
convert_to_stitches()— either:_generate_stitches_from_paths.Acceptance
type in {satin, fill, running}(not allnormal).tests/test_main.pycovers raster->digitize end-to-end and asserts non-trivial stitch-type distribution._emit_machine_filefunction no longer referencesfrom_rasterfor stitch generation decisions.Blocks
Mark/easystitch-service#1— service contract requiresstitchObjects[].type in {satin, fill, running}. Without this fix, every raster input to the service would produce wrong output.Notes
from_rasterflag may still be useful for other decisions (e.g. SVG cleanup heuristics) but not for stitch generation.