Get wires or wires from edges.
(s: Shape)
| 5135 | |
| 5136 | |
| 5137 | def _get_wires(s: Shape) -> Iterable[Shape]: |
| 5138 | """ |
| 5139 | Get wires or wires from edges. |
| 5140 | """ |
| 5141 | |
| 5142 | t = s.ShapeType() |
| 5143 | |
| 5144 | if t == "Wire": |
| 5145 | yield s |
| 5146 | elif t == "Edge": |
| 5147 | yield Wire.assembleEdges((tcast(Edge, s),)) |
| 5148 | elif t == "Compound": |
| 5149 | for el in s: |
| 5150 | yield from _get_wires(el) |
| 5151 | else: |
| 5152 | raise ValueError(f"Required type(s): Edge, Wire; encountered {t}") |
| 5153 | |
| 5154 | |
| 5155 | def _get_edges(*shapes: Shape) -> Iterable[Shape]: |