MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / _split_through_wires

Method _split_through_wires

SLiCAP/schematic/canvas.py:1023–1035  ·  view source on GitHub ↗

Split any wire that is crossed by a wire endpoint or component pin.

(self)

Source from the content-addressed store, hash-verified

1021 # ── wire splitting ────────────────────────────────────────────────────────
1022
1023 def _split_through_wires(self) -> None:
1024 """Split any wire that is crossed by a wire endpoint or component pin."""
1025 changed = True
1026 while changed:
1027 changed = False
1028 wires = [i for i in self.items() if isinstance(i, WireItem)]
1029 comps = [i for i in self.items() if isinstance(i, ComponentItem)]
1030 for wire in wires:
1031 pt = self._interior_tap(wire, wires, comps)
1032 if pt is not None:
1033 self._split_wire_at(wire, pt)
1034 changed = True
1035 break # restart after topology change
1036
1037 def _interior_tap(self, wire, wires, comps):
1038 """Return the first interior tap position on wire, or None."""

Callers 1

_sync_junctionsMethod · 0.95

Calls 2

_interior_tapMethod · 0.95
_split_wire_atMethod · 0.95

Tested by

no test coverage detected