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-top-seed.py

from route_geometry import *
c=load_circuit("routing/review-placement.circuit.json");root=connectivity(c)
m=json.loads(Path("routing/net-map.json").read_text())["roots"]
s={e["source_trace_id"]:e for e in c if e["type"]=="source_trace"}
wires=[];vias={}
for t in json.loads(Path("routing/bulk-top-retained.json").read_text()):
    source=s[t["source_trace_id"]];ids=source.get("connected_source_port_ids",[])+source.get("connected_source_net_ids",[]);n=m[root(ids[0])]
    for p in t["route"]:
        if p["route_type"]=="via":vias[n,p["x"],p["y"]]=dict(net=n,x=p["x"],y=p["y"])
    for a,b in zip(t["route"],t["route"][1:]):
        if a["route_type"]==b["route_type"]=="wire" and a["layer"]==b["layer"] and math.dist((a["x"],a["y"]),(b["x"],b["y"]))>1e-8:
            wires.append(dict(net=n,layer=a["layer"],width=max(a["width"],b["width"]),points=[(a["x"],a["y"]),(b["x"],b["y"])]))
native=json.loads(Path("routing/native-features.json").read_text())
for v in native["thermal_vias"]+native.get("auxiliary_vias",[]):vias[v["net"],v["x"],v["y"]]=dict(net=v["net"],x=v["x"],y=v["y"])
Path("routing/bulk-top-seed-physical.json").write_text(json.dumps(dict(wires=wires,vias=list(vias.values())),indent=2)+"\n")