Split wire at an interior position, creating two sub-segments.
(self, wire, pt_key: tuple)
| 1051 | return None |
| 1052 | |
| 1053 | def _split_wire_at(self, wire, pt_key: tuple) -> None: |
| 1054 | """Split wire at an interior position, creating two sub-segments.""" |
| 1055 | pt = QPointF(pt_key[0], pt_key[1]) |
| 1056 | pts = wire.points |
| 1057 | # Check intermediate elbow vertices first |
| 1058 | for idx in range(1, len(pts) - 1): |
| 1059 | if _pt_key(pts[idx]) == pt_key: |
| 1060 | self._do_wire_split(wire, list(pts[:idx + 1]), list(pts[idx:])) |
| 1061 | return |
| 1062 | # Split a segment interior |
| 1063 | for i in range(len(pts) - 1): |
| 1064 | if _pt_on_segment(pt_key[0], pt_key[1], pts[i], pts[i + 1]): |
| 1065 | self._do_wire_split(wire, |
| 1066 | list(pts[:i + 1]) + [pt], |
| 1067 | [pt] + list(pts[i + 1:])) |
| 1068 | return |
| 1069 | |
| 1070 | def _do_wire_split(self, wire, pts1: list, pts2: list) -> None: |
| 1071 | net_name = wire.net_name |
no test coverage detected