Editor's Path Properties section has no 'min spacing' / 'overlap' detection — user with 2 paths that overlap or are too close gets no warning, embroidery on overlapping paths is undefined #337

Open
opened 2026-10-04 03:54:13 +00:00 by Mark · 0 comments
Owner

Finding

grep -rn 'minSpacing\|pathOverlap' src/components/editor/ returns 0. The editor has no overlap detection.

A user with 2 paths:

  • One circle, one square
  • They overlap by 2mm
  • Doesn't realize this is problematic for embroidery (overlapping stitches pile up)

The fix is overlap / min-spacing detection.

Where

  • canvasRenderer: src/components/editor/canvasRenderer.ts
  • Geometry: src/components/editor/geometry.ts (where the algorithm lives)
  • No detection: grep -rn 'pathOverlap' src/components/editor/ returns 0

Suggested fix shape

  1. Algorithm: detect pairs of paths whose edges are within 1mm:
function findOverlappingPaths(paths: StitchPath[]): Array<{ pathId1: string; pathId2: string; distance: number }> {
  const overlaps = [];
  for (let i = 0; i < paths.length; i++) {
    for (let j = i + 1; j < paths.length; j++) {
      const distance = minEdgeDistance(paths[i].nodes, paths[j].nodes);
      if (distance < 1.0) {
        overlaps.push({ pathId1: paths[i].id, pathId2: paths[j].id, distance });
      }
    }
  }
  return overlaps;
}
  1. Visual highlight: overlapping paths are drawn with a faint red outline.

  2. Warning: in the right panel, "X path pairs overlap or are too close."

  3. Auto-fix: not easy (the user must move paths manually).

Severity

Low. The user can spot overlaps visually. Power users with complex designs notice.

Discovered by

Gap analysis (2026-10-02) of editor validation.

  • #260 (open) — Hoop size mismatch. Same validation family.
  • #335 (open) — Sharp corner. Same family.
  • #336 (open) — Self-intersection. Same family.
  • The auto-digitize output may produce overlapping regions; this catches them.
## Finding `grep -rn 'minSpacing\|pathOverlap' src/components/editor/` returns 0. The editor has no overlap detection. A user with 2 paths: - One circle, one square - They overlap by 2mm - Doesn't realize this is problematic for embroidery (overlapping stitches pile up) The fix is overlap / min-spacing detection. ## Where - canvasRenderer: `src/components/editor/canvasRenderer.ts` - Geometry: `src/components/editor/geometry.ts` (where the algorithm lives) - No detection: `grep -rn 'pathOverlap' src/components/editor/` returns 0 ## Suggested fix shape 1. **Algorithm**: detect pairs of paths whose edges are within 1mm: ```ts function findOverlappingPaths(paths: StitchPath[]): Array<{ pathId1: string; pathId2: string; distance: number }> { const overlaps = []; for (let i = 0; i < paths.length; i++) { for (let j = i + 1; j < paths.length; j++) { const distance = minEdgeDistance(paths[i].nodes, paths[j].nodes); if (distance < 1.0) { overlaps.push({ pathId1: paths[i].id, pathId2: paths[j].id, distance }); } } } return overlaps; } ``` 2. **Visual highlight**: overlapping paths are drawn with a faint red outline. 3. **Warning**: in the right panel, "X path pairs overlap or are too close." 4. **Auto-fix**: not easy (the user must move paths manually). ## Severity Low. The user can spot overlaps visually. Power users with complex designs notice. ## Discovered by Gap analysis (2026-10-02) of editor validation. ## Related - #260 (open) — Hoop size mismatch. Same validation family. - #335 (open) — Sharp corner. Same family. - #336 (open) — Self-intersection. Same family. - The auto-digitize output may produce overlapping regions; this catches them.
Sign in to join this conversation.
No description provided.