Commit Graph
1 Commits
Author SHA1 Message Date
Zhonx 48ebdb0003 fix(ViaStitching): fix Outline/Concentric modes on multi-layer boards
The original ConcentricFillVias() used BooleanIntersection across all
copper layers. On multi-layer boards where the target net (e.g. GND)
only exists on a subset of layers (e.g. inner GNDPWR plane), the
intersection with empty layers produced an empty polygon set, causing
'No areas to fill'.

Additionally, CORNER_STRATEGY_CHAMFER_ALL_CORNERS applied to complex
zone outlines (boards with irregular shapes / many vertices) could
produce empty or degenerate polygons after the negative Inflate.

Fixes:
- Process each GND zone independently instead of merging across layers
- Use CORNER_STRATEGY_ALLOW_ACUTE_CORNERS to preserve complex polygon
  topology during the shrink step
- Manually copy zone.Outline() point-by-point (KiCad >= 7) to avoid
  SWIG aliasing issues with the returned SHAPE_POLY_SET pointer
- Per-zone via list: vias placed on one zone no longer block placement
  on other zones' perimeters
- Add debug wxPrint messages to help diagnose future issues

Tested on a 4-layer board (F_Cu / GNDPWR / BATT / B_Cu).
2026-03-16 15:46:16 +01:00