MCPcopy
hub / github.com/CadQuery/cadquery / siblings

Method siblings

cadquery/cq.py:1013–1029  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers 2

test_siblingsFunction · 0.45
test_iteratorsMethod · 0.45

Calls 3

findSolidMethod · 0.95
_getTaggedMethod · 0.95
newObjectMethod · 0.95

Tested by 2

test_siblingsFunction · 0.36
test_iteratorsMethod · 0.36