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

Method _siblings

cadquery/occ_impl/shapes.py:1771–1787  ·  view source on GitHub ↗
(shapes: Iterable[Shape], level: int)

Source from the content-addressed store, hash-verified

1769 exclude = TopTools_MapOfShape()
1770
1771 def _siblings(shapes: Iterable[Shape], level: int) -> set[Shape]:
1772
1773 rv: set[Shape] = set()
1774
1775 for s in shapes:
1776 exclude.Add(s.wrapped)
1777
1778 for s in shapes:
1779
1780 rv.update(
1781 Shape.cast(el)
1782 for child in s._entities(kind)
1783 for el in shape_map.FindFromKey(child)
1784 if not exclude.Contains(el)
1785 )
1786
1787 return rv if level == 1 else _siblings(rv, level - 1)
1788
1789 # simple query
1790 if isinstance(level, int):

Callers

nothing calls this directly

Calls 2

castMethod · 0.80
_entitiesMethod · 0.80

Tested by

no test coverage detected