Skip to content

Printability guardrails + v0.4.0 - #12

Merged
kurenn merged 1 commit into
mainfrom
feat/printability
Jun 5, 2026
Merged

kurenn merged 1 commit into
mainfrom
feat/printability

Conversation

@kurenn

@kurenn kurenn commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Detects color regions with features thinner than the nozzle line width at the chosen size — strands the slicer would skip or print fragile — and flags colors so thin they'd vanish entirely. Warns + suggests a fix; never blocks.

How it works

  • colorplate/printability.py (shared, numpy + scipy.ndimage + cv2): morphological opening at nozzle & 2×nozzle finds sub-nozzle features (boundary-noise-free); a distance transform gives the thinnest real strand width; suggests the size that brings it to a safe width.
  • Web: service.printability() + POST /api/printability return a per-color report plus an at-risk overlay PNG aligned with the 2D preview. The GUI adds a nozzle control, a warnings panel (✓ / ⚠ fragile / ✗ won't print, with the thinnest width), the highlight overlay (magenta = won't print, amber = fragile), and a one-click "bump size to ~X mm".
  • CLI/pipeline: --nozzle (default 0.4), PlateConfig.nozzle_mm, the report on PlateResult/StackResult + in the manifest, and per-color warnings to stderr.
  • Warn, don't block — Generate/Export stays enabled.

Tests / verification

tests/test_printability.py — synthetic thin/thick masks, the service + endpoint, and the pipeline report. Full suite: 64 passing (3.10 + 3.12 in CI). Verified live in a headless browser: small size → warnings panel + magenta/amber overlay on the preview; click bump size → size updates and warnings clear; works across MMU / single-extruder / 3D / dark mode; no console errors. CLI prints warnings at small --height, clean at large.

Ships as v0.4.0 (also rolls up the previously-merged guided tour). Auto-deploys to colorplate.spoolr.io on merge.

🤖 Generated with Claude Code

Detect color regions with features thinner than the nozzle line width at the
chosen print size — strands the slicer would skip or print fragile — and flag
colors so thin they'd vanish (the mesh builder drops sub-min-area islands).

- colorplate/printability.py: shared, dependency-light detector (morphological
  opening at nozzle & 2x-nozzle to find sub-nozzle features, distance transform
  for the thinnest real strand width, a "bump size to clear it" suggestion).
- Web: service.printability() + POST /api/printability return a per-color report
  plus an at-risk overlay PNG aligned with the 2D preview; app.jsx adds a nozzle
  control, a warnings panel, the highlight overlay, and a one-click bump-size.
- CLI/pipeline: --nozzle flag, PlateConfig.nozzle_mm, the report on
  PlateResult/StackResult + manifest, and per-color warnings to stderr.
- Warns only — Generate/Export is never blocked.
- tests/test_printability.py (64 tests total).

Release prep: bump to 0.4.0 and finalize the CHANGELOG (printability + the
guided tour ship in this release).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kurenn
kurenn merged commit 0f3fbda into main Jun 5, 2026
2 checks passed
@kurenn
kurenn deleted the feat/printability branch June 5, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant