Select topological siblings. :param kind: kind of linking element, e.g. "Vertex" or "Edge" :param level: level of relation - how many elements of kind are in the link :param tag: if set, search the tagged object instead of self :return: a Workplane object wh
(self: T, kind: Shapes, level: int = 1, tag: Optional[str] = None)
| 1011 | return self.newObject(set(el for res in results for el in res)) |
| 1012 | |
| 1013 | def siblings(self: T, kind: Shapes, level: int = 1, tag: Optional[str] = None) -> T: |
| 1014 | """ |
| 1015 | Select topological siblings. |
| 1016 | |
| 1017 | :param kind: kind of linking element, e.g. "Vertex" or "Edge" |
| 1018 | :param level: level of relation - how many elements of kind are in the link |
| 1019 | :param tag: if set, search the tagged object instead of self |
| 1020 | :return: a Workplane object whose stack contains selected siblings. |
| 1021 | |
| 1022 | """ |
| 1023 | ctx_solid = self.findSolid() |
| 1024 | objects = self._getTagged(tag).objects if tag else self.objects |
| 1025 | shapes = [el for el in objects if isinstance(el, Shape)] |
| 1026 | |
| 1027 | results = [el.siblings(ctx_solid, kind, level) for el in shapes] |
| 1028 | |
| 1029 | return self.newObject(set(el for res in results for el in res) - set(shapes)) |
| 1030 | |
| 1031 | def toSvg(self, opts: Any = None) -> str: |
| 1032 | """ |