From 09c49f85290f1cdc51971b333bc451a135d6a7e5 Mon Sep 17 00:00:00 2001 From: Michele Bigi Date: Sun, 20 Sep 2026 16:06:54 +0200 Subject: [PATCH] Resolve board via nets by net code, not pad-net token. _via_from_node used _pad_net first, so (net 1) stayed as '1' instead of GND. --- periscope/src/backend/periscopex/parsers_kicad_pcb.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/periscope/src/backend/periscopex/parsers_kicad_pcb.py b/periscope/src/backend/periscopex/parsers_kicad_pcb.py index 533b0da..c9ead7f 100644 --- a/periscope/src/backend/periscopex/parsers_kicad_pcb.py +++ b/periscope/src/backend/periscopex/parsers_kicad_pcb.py @@ -274,7 +274,7 @@ def _via_from_node( if local: rx, ry = _rotate(vx, vy, frot) vx, vy = fx + rx, fy + ry - net = _pad_net(node) or _net_name(node, nets) + net = _net_name(node, nets) return LayoutVia(x=vx, y=vy, net=net, drill=drill) @@ -361,7 +361,9 @@ def parse_kicad_pcb(path: str | Path) -> LayoutGraph: if _is_footprint_via(pad): drill_el = _kid(pad, "drill") drill = _fnum(drill_el[1]) if drill_el and len(drill_el) > 1 else None - vias.append(LayoutVia(x=ax, y=ay, net=_pad_net(pad), drill=drill)) + vias.append(LayoutVia( + x=ax, y=ay, net=_net_name(pad, nets) or _pad_net(pad), drill=drill, + )) continue if _is_npth_pad(pad): continue