shibosoftwaredev/f1c100s-linux-nema17-stepper-controller
A four-layer NEMA 17 motor-controller PCB combining an Allwinner F1C100S Linux computer, USB‑PD/buck power system, W5500 Ethernet, STM32 real-time motion control, DRV8825 stepper driver, protection/temperature/current telemetry, USB interfaces, and local LED/buzzer diagnostics.
- Version
- 0.4.56
- License
- unset
- Stars
- 0
scripts/check-bulk-ground-corridor.py
from route_geometry import *
from shapely.strtree import STRtree
c=load_circuit('routing/review-placement.circuit.json');root=connectivity(c)
m=json.loads(Path('routing/net-map.json').read_text())['roots']
pp={e['pcb_port_id']:e for e in c if e['type']=='pcb_port'}
parts={e['source_component_id']:e['name'] for e in c if e['type']=='source_component'}
pc={e['pcb_component_id']:parts[e['source_component_id']] for e in c if e['type']=='pcb_component'}
physical=json.loads(Path('routing/bulk-top-seed-physical.json').read_text())
objects=[]
for e in c:
if e['type'] not in ['pcb_smtpad','pcb_plated_hole']:continue
p=pp.get(e.get('pcb_port_id'));n=m[root(p['source_port_id'])] if p else None
objects.append((n,e.get('layers',[e.get('layer')]),geometry(e,'outer_' if e['type']=='pcb_plated_hole' else ''),'pad '+pc[e['pcb_component_id']]))
for i,w in enumerate(physical['wires']):objects.append((w['net'],[w['layer']],LineString(w['points']).buffer(w['width']/2),f'wire {i} '+str(w['points'])))
for v in physical['vias']:objects.append((v['net'],LAYERS,Point(v['x'],v['y']).buffer(.225),'via '+str((v['x'],v['y']))))
native=json.loads(Path('routing/native-features.json').read_text())
print('native ground',json.dumps(native['thermal_vias']))
paths={'top':[(14.95,-9.3),(14.95,-10.7),(13.7,-11.1),(5.2,-11.1),(3.15,-11.1),(1.2,-11.500127)]}
findings=[]
for l,points in paths.items():
shape=LineString(points).buffer(.4)
for n,ls,g,name in objects:
if n!='N62' and l in ls and shape.distance(g)<.1001:
findings.append(dict(layer=l,net=n,object=name,clearance=round(shape.distance(g),5)))
print(json.dumps(findings,indent=2))