| 649 | return list(tmp.values()) |
| 650 | |
| 651 | def _select( |
| 652 | self: T, |
| 653 | s: Optional[Union[str, Selector]], |
| 654 | kind: Literal["Faces", "Wires", "Edges", "Vertices"], |
| 655 | tag: Optional[str] = None, |
| 656 | ) -> T: |
| 657 | |
| 658 | rv = [] |
| 659 | |
| 660 | if tag: |
| 661 | for el in self._tags[tag]: |
| 662 | rv.extend(getattr(el, kind)()) |
| 663 | elif self._selection: |
| 664 | for el in self._selection: |
| 665 | if not isinstance(el, Location): |
| 666 | rv.extend(getattr(el, kind)()) |
| 667 | else: |
| 668 | rv.extend(getattr(self._faces, kind)()) |
| 669 | for el in self._edges: |
| 670 | rv.extend(getattr(el, kind)()) |
| 671 | |
| 672 | if s and isinstance(s, Selector): |
| 673 | filtered = s.filter(rv) |
| 674 | elif s and isinstance(s, str): |
| 675 | filtered = StringSyntaxSelector(s).filter(rv) |
| 676 | else: |
| 677 | filtered = rv |
| 678 | |
| 679 | self._selection = self._unique(filtered) |
| 680 | |
| 681 | return self |
| 682 | |
| 683 | def tag(self: T, tag: str) -> T: |
| 684 | """ |