main
John Lauer
Publish board-19 copper repair candidate and require unresolved assembly reviews
8e53907
import pcbnew,pathlib,shutil,subprocess
p=pathlib.Path('C:/Users/arav/Downloads/electronic-load-issue-1');src=p/'source-pad-spread.kicad_pcb';dst=p/'source-receiver-spread.kicad_pcb'
for ext in ['.kicad_pro','.kicad_dru']:shutil.copyfile(src.with_suffix(ext),dst.with_suffix(ext))
m=pcbnew.GetSettingsManager();m.LoadProject(str(dst.with_suffix('.kicad_pro')));b=pcbnew.LoadBoard(str(src));b.SetProject(m.GetProject(str(dst.with_suffix('.kicad_pro'))));net=b.FindNet('SHUNT_P').GetNetCode()
for x,y in [(135.4317,86.566983)]:
t=pcbnew.PCB_TRACK(b);t.SetStart(pcbnew.VECTOR2I(round(x*1e6),round(y*1e6)));t.SetEnd(pcbnew.VECTOR2I(136625000,85700000));t.SetWidth(1200000);t.SetLayer(pcbnew.F_Cu);t.SetNetCode(net);b.Add(t)
pcbnew.ZONE_FILLER(b).Fill(b.Zones());pcbnew.SaveBoard(str(dst),b)
r=subprocess.run(['C:/Users/arav/AppData/Local/Programs/KiCad/10.0/bin/kicad-cli.exe','pcb','drc','--format','json','--output',str(p/'source-receiver-spread-drc.json'),str(dst)],capture_output=True,text=True);print(r.stdout,r.stderr)