gokul/macro-six-usbc
USB-powered ATmega32U4 controller board with protected/switched 5 V power, six tactile keys, rotary encoder, reset/boot/ISP interfaces, power LED, and six daisy-chained SK6812 RGB LEDs driven through MOSFETs.
- Version
- 0.1.6
- License
- MIT
- Stars
- 0
manufacturing/check-pour-connectivity.py
import sys,json
sys.argv=['check',sys.argv[1] if len(sys.argv)>1 else 'outputs/release/board.circuit.json']
exec(open('manufacturing/check-copper.py').read().split('errors=[];min_gap=10')[0])
report=[]
for f in features:
if f['kind']!='pour':continue
anchors=[a['geometry'] for a in features if a['layer']==f['layer'] and a['net']==f['net'] and a['kind']!='pour']
ds=[f['geometry'].distance(a) for a in anchors]
report.append(dict(id=f['id'],layer=f['layer'],area_mm2=round(f['geometry'].area,4),grounded=min(ds)<.003,minimum_anchor_gap_mm=min(ds),valid=f['geometry'].is_valid))
print(json.dumps(report,indent=2));json.dump(report,open('outputs/release/pour-connectivity.json','w'),indent=2)
if any(not p['grounded'] or not p['valid'] for p in report):raise RuntimeError('Ungrounded or invalid pour')