main
John Lauer
Preserve board29, component assets and scaffold-fit correction candidate with reviewed footage
c54169e
"""Native offline filled-ground geometry; never edits the live board."""
import pcbnew as k,json
from pathlib import Path
p=Path(__file__).parent
b=k.LoadBoard(str(p/'board-routed.kicad_pcb'))
k.ZONE_FILLER(b).Fill(b.Zones())
k.SaveBoard(str(p/'ground-filled.kicad_pcb'),b)
print(json.dumps({'zones':[{'name':z.GetZoneName(),'layer':b.GetLayerName(z.GetLayer()),'outlines':z.GetFilledPolysList(z.GetLayer()).OutlineCount()} for z in b.Zones()]}))