main
John Lauer Preserve board29, component assets and scaffold-fit correction candidate with reviewed footage c54169e
"""Disposable native candidate; no live-editor mutation."""
import pcbnew as k, json, shutil
from pathlib import Path
p=Path(__file__).parent;b=k.LoadBoard(str(p/'source.kicad_pcb'))
changes=json.loads((p/'widths.json').read_text());seen=set()
for item in b.GetTracks():
 uid=item.m_Uuid.AsString()
 if uid in changes:
  item.SetWidth(k.FromMM(changes[uid]));seen.add(uid)
assert seen==set(changes),(seen,set(changes))
k.ZONE_FILLER(b).Fill(b.Zones());k.SaveBoard(str(p/'candidate.kicad_pcb'),b)
for ext in ['kicad_pro','kicad_dru']:shutil.copy2(p/('source.'+ext),p/('candidate.'+ext))
print('Changed',len(seen),'widths; isolated candidate saved. Exit before DRC.')