Skip to content

Add plot-time estimate, path clean-up, masks, G-code/HPGL, undo and new patterns - #9

Merged
Murphy23x merged 1 commit into
mainfrom
Dev
Oct 11, 2026
Merged

Murphy23x merged 1 commit into
mainfrom
Dev

Conversation

@Murphy23x

Copy link
Copy Markdown
Owner

Summary

Adds ten features to the sketch (GenerativeLineArt/GenerativeLineArt.pde) and updates the README and CONTRIBUTING. The side panel now has two tabs: Design (paper, layers, pattern parameters) and Output (plotter, clean-up, mask and export settings). The panel also scrolls when its contents don't fit.

  • Plot time estimate: pen-down distance, pen-up travel and pen lifts per layer, converted to a time using configurable pen-down speed, travel speed and lift time. The total also shows in the status bar.
  • Path clean-up: simplification (Ramer-Douglas-Peucker), joining paths whose ends nearly touch, dropping tiny pieces and duplicate paths, and a faster nearest-neighbour travel ordering that scales to tens of thousands of paths. It runs before the preview, so the preview, stats and export all use the same paths.
  • Registration marks and pen test swatches: corner crosshairs drawn by every pen, plus a small test patch per pen in the bottom margin, plotted first.
  • Undo / redo: buttons, Ctrl+Z, and Ctrl+Y or Ctrl+Shift+Z. A whole slider drag counts as one step; up to 200 steps.
  • Batch export: writes N seed variations into exports/batch_<timestamp>/.
  • Parameter locks: right-click a pattern parameter or the seed to lock it. Randomize, New seed and batch export leave locked values alone.
  • G-code and HPGL export alongside SVG:
    • G-code is GRBL-style, with a Z-axis or servo (M3 S) pen lift, a dwell after each lift, and an M0 pause between pens.
    • HPGL uses pen n (SP1–SP4) for layer n.
  • Masks: per layer, Off / Inside / Outside, using either typed text or a PNG/JPG/GIF/SVG image, with threshold and invert.
  • Image pattern: turns a photo into a TSP line, stipple dots, hatching, a spiral or squiggle lines. Without a photo it uses a built-in demo picture.
  • New patterns: Hex Truchet, Penrose (rhombs and/or arcs) and Hex maze.

Presets now also save the new settings, the mask and the locks. Older presets still load and get default values for anything new.

Behaviour change: clean-up is on by default (simplify 0.05 mm, merge gap 0.1 mm, minimum length 0.2 mm). Existing designs will export slightly fewer points and strokes. Set the sliders to 0 to switch it off.

Testing

  • The sketch builds with the Processing 4.5.7 CLI, the same version CI uses.
  • I ran the sketch headless (Xvfb) with a test script, then reviewed the screenshots:
    • every pattern and every Image style produces lines
    • masks, registration marks and pen tests render as expected
    • SVG, G-code and HPGL exports were checked by hand
    • batch export keeps locked seeds
    • undo/redo, locks with Randomize, and saving/loading presets all behave correctly
  • Not tested:
    • real mouse and keyboard input: the file dialogs, right-click and Ctrl+Z on actual hardware
    • G-code or HPGL on a physical plotter

🤖 Generated with Claude Code

https://claude.ai/code/session_01CspRSgko45MN3D4Esk5wXs


Generated by Claude Code

…ew patterns

- Output tab with a plot-time estimate per layer (pen-down, travel, lifts)
  from configurable plotter speeds, shown in the status bar too
- Path clean-up applied to preview, stats and export: RDP simplify,
  joining nearly touching paths, dropping tiny bits and duplicates, and a
  grid-based nearest-neighbour ordering that scales to large path counts
- Optional registration marks and per-pen test swatches
- Undo / redo (buttons, Ctrl+Z / Ctrl+Y) with slider drags grouped
- Batch export of seed variations into exports/batch_<timestamp>/
- Right-click to lock pattern parameters or the seed; Randomize, New seed
  and batch export respect locks
- G-code (GRBL, Z axis or servo lift) and HPGL export next to SVG
- Per-layer text or image mask (inside / outside, threshold, invert)
- New patterns: Image (TSP line, stipple, hatch, spiral, squiggle; built-in
  demo picture), Hex Truchet, Penrose (rhombs / arcs) and Hex maze
- Scrollable side panel; presets store the new settings, mask and locks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CspRSgko45MN3D4Esk5wXs
@Murphy23x
Murphy23x merged commit 26e4c25 into main Oct 11, 2026
5 checks passed
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.

2 participants