Editor's Path Properties section has no 'min radius' / 'min curve radius' warning — user with a curve of 0.5mm radius knows it's too tight for embroidery, but no validation #344

Closed
opened 2026-10-04 03:55:04 +00:00 by Mark · 0 comments
Owner

Finding

grep -rn 'minRadius\|tightCurve' src/components/editor/ returns 0. The editor doesn't warn about very tight curves.

A user with a curve of 0.5mm radius:

  • Doesn't realize that's too tight for embroidery
  • Exports and the machine can't make that turn

The fix is a warning for tight curves.

Where

  • Path Properties: src/components/editor/EditorRightPanel.tsx
  • No min radius: grep -rn 'minRadius' src/components/editor/ returns 0
  • Geometry: src/components/editor/geometry.ts (where the algorithm would live)

Suggested fix shape

  1. Algorithm: for each curve segment, compute the radius of curvature:
function curveRadius(p1: Point, p2: Point, p3: Point): number {
  // Three points, compute the radius of the circle through them
  const ax = p1.x - p2.x;
  const ay = p1.y - p2.y;
  const bx = p3.x - p2.x;
  const by = p3.y - p2.y;
  const d = 2 * (ax * by - ay * bx);
  if (d === 0) return Infinity;  // straight line
  const ux = ((p1.x * p1.x - p2.x * p2.x) + (p1.y * p1.y - p2.y * p2.y)) / d;
  const uy = ((p3.x * p3.x - p2.x * p2.x) + (p3.y * p3.y - p2.y * p2.y)) / d;
  const cx = ux + p2.x;
  const cy = uy + p2.y;
  return Math.sqrt((p2.x - cx) ** 2 + (p2.y - cy) ** 2);
}
  1. Threshold: 1mm is the typical minimum radius for embroidery.

  2. UI: a small warning in the Path Properties section:

{p.tightCurves > 0 && (
  <p className="text-[10px]" style={{ color: '#DC2626' }}>
    ⚠ {p.tightCurves} curves are tighter than 1 mm — below the minimum.
  </p>
)}
  1. Visual: tight curves are drawn with a red highlight on the canvas.

  2. Use cases:

  • The user is drawing small details
  • The auto-digitize output has small features

Severity

Low. The user can spot tight curves visually. Power users with production embroidery 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.
  • #337 (open) — Overlap. Same family.
  • #343 (open) — Min path length. Same family.
## Finding `grep -rn 'minRadius\|tightCurve' src/components/editor/` returns 0. The editor doesn't warn about very tight curves. A user with a curve of 0.5mm radius: - Doesn't realize that's too tight for embroidery - Exports and the machine can't make that turn The fix is a warning for tight curves. ## Where - Path Properties: `src/components/editor/EditorRightPanel.tsx` - No min radius: `grep -rn 'minRadius' src/components/editor/` returns 0 - Geometry: `src/components/editor/geometry.ts` (where the algorithm would live) ## Suggested fix shape 1. **Algorithm**: for each curve segment, compute the radius of curvature: ```ts function curveRadius(p1: Point, p2: Point, p3: Point): number { // Three points, compute the radius of the circle through them const ax = p1.x - p2.x; const ay = p1.y - p2.y; const bx = p3.x - p2.x; const by = p3.y - p2.y; const d = 2 * (ax * by - ay * bx); if (d === 0) return Infinity; // straight line const ux = ((p1.x * p1.x - p2.x * p2.x) + (p1.y * p1.y - p2.y * p2.y)) / d; const uy = ((p3.x * p3.x - p2.x * p2.x) + (p3.y * p3.y - p2.y * p2.y)) / d; const cx = ux + p2.x; const cy = uy + p2.y; return Math.sqrt((p2.x - cx) ** 2 + (p2.y - cy) ** 2); } ``` 2. **Threshold**: 1mm is the typical minimum radius for embroidery. 3. **UI**: a small warning in the Path Properties section: ```tsx {p.tightCurves > 0 && ( <p className="text-[10px]" style={{ color: '#DC2626' }}> ⚠ {p.tightCurves} curves are tighter than 1 mm — below the minimum. </p> )} ``` 4. **Visual**: tight curves are drawn with a red highlight on the canvas. 5. **Use cases**: - The user is drawing small details - The auto-digitize output has small features ## Severity Low. The user can spot tight curves visually. Power users with production embroidery 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. - #337 (open) — Overlap. Same family. - #343 (open) — Min path length. Same family.
Mark 2026-10-05 10:09:04 +00:00
Sign in to join this conversation.
No description provided.