Skip to content

feat: implement Excellon M25/M01/M02 pattern repeat#304

Open
rampageservices wants to merge 1 commit intogerbv:developfrom
SourceParts:feat/excellon-m25-m01-m02-pattern-repeat
Open

feat: implement Excellon M25/M01/M02 pattern repeat#304
rampageservices wants to merge 1 commit intogerbv:developfrom
SourceParts:feat/excellon-m25-m01-m02-pattern-repeat

Conversation

@rampageservices
Copy link
Copy Markdown
Contributor

Summary

  • Implement M25 (begin pattern), M01 (end pattern), and M02 (repeat pattern offset) Excellon commands for panelized PCB drill files
  • Drills between M25 and M01 render normally and get buffered; M02 replays all buffered operations (drill holes and route segments) shifted by a given X/Y offset
  • Multiple M02 commands can follow a single M25/M01 block to repeat at different offsets

Changes

  • src/drill.c: Pattern entry struct, state fields, M25/M01/M02 dispatch handlers, pattern recording at drill/route/R-code sites, buffer cleanup
  • src/gerbv.h: M02 stats counter
  • src/drill_stats.c: M02 stats accumulation
  • src/callbacks.c: M02 row in drill statistics UI
  • test/inputs/test-drill-pattern-repeat.exc: Test file with 3-hole pattern repeated at two offsets (9 holes total)
  • test/golden/test-drill-pattern-repeat.png: Golden reference image
  • test/tests.list: Registered new test

Test plan

  • Clean build with zero warnings
  • test-drill-pattern-repeat passes (9 holes in 3 clusters)
  • All existing tests unaffected (same 10 pre-existing rendering mismatches on develop)
  • Visual check: ./build/src/gerbv test/inputs/test-drill-pattern-repeat.exc shows 3 clusters of 3 holes

M25 begins recording drill operations into a pattern buffer, M01 stops
recording, and M02 replays all buffered operations shifted by a given
X/Y offset. This supports panelized PCB drill files where the same hole
pattern repeats across multiple board instances.

Drills between M25 and M01 render normally and get buffered. Multiple
M02 commands can follow a single M25/M01 block to repeat at different
offsets. Both drill holes and routed segments are recorded and replayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants