board
RITHESH LED Display
Public Unreviewedby Rithesh03
A 300 x 70 mm PCB that spells RITHESH with 107 WS2812B RGB LEDs, controlled over Wi-Fi.
main
Rithesh03
Update 3: PCB design completed - routed board, manufacturing package (prototype, do not order yet), WLED guide, final checklist, Hydrogen feedback
1ed072d
13d ago
"""Run KiCad's DRC on the board and print the summary (KiCad 7 has no kicad-cli DRC command).
Usage: python3 run_drc.py [board.kicad_pcb] -> writes drc-report.rpt next to the board
"""
import os
import re
import sys
os.environ.setdefault("KICAD7_FOOTPRINT_DIR", "/usr/share/kicad/footprints")
import pcbnew # noqa: E402
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import make_board as mb # noqa: E402
pcb = sys.argv[1] if len(sys.argv) > 1 else mb.PCB
out = os.path.join(os.path.dirname(pcb), "drc-report.rpt")
board = pcbnew.LoadBoard(pcb)
pcbnew.WriteDRCReport(board, out, pcbnew.EDA_UNITS_MILLIMETRES, True)
txt = open(out).read().replace(os.path.dirname(os.path.abspath(pcb)) + "/", "") # no local paths in the report
open(out, "w").write(txt)
for line in txt.splitlines():
if line.startswith("** Found"):
print(line)
kinds = re.findall(r"^\[(\w+)\]", txt, re.M)
counts = {}
for k in kinds:
counts[k] = counts.get(k, 0) + 1
print("by type:", counts)