MCPcopy Index your code
hub / github.com/CadQuery/cadquery / _compound_or_shape

Function _compound_or_shape

cadquery/occ_impl/shapes.py:5351–5363  ·  view source on GitHub ↗

Convert a list of TopoDS_Shape to a Shape or a Compound.

(s: TopoDS_Shape | Sequence[TopoDS_Shape])

Source from the content-addressed store, hash-verified

5349
5350
5351def _compound_or_shape(s: TopoDS_Shape | Sequence[TopoDS_Shape]) -> Shape:
5352 """
5353 Convert a list of TopoDS_Shape to a Shape or a Compound.
5354 """
5355
5356 if isinstance(s, TopoDS_Shape):
5357 rv = _normalize(Shape.cast(s))
5358 elif len(s) == 1:
5359 rv = _normalize(Shape.cast(list(s)[0]))
5360 else:
5361 rv = Compound.makeCompound([_normalize(Shape.cast(el)) for el in s])
5362
5363 return rv
5364
5365
5366def _shape(s: TopoDS_Shape, _: type[T]) -> T:

Callers 15

movedMethod · 0.85
_update_historyFunction · 0.85
_update_imagesFunction · 0.85
edgeOnFunction · 0.85
faceFunction · 0.85
shellFunction · 0.85
solidFunction · 0.85
textFunction · 0.85
fuseFunction · 0.85
cutFunction · 0.85
intersectFunction · 0.85
splitFunction · 0.85

Calls 3

_normalizeFunction · 0.85
castMethod · 0.80
makeCompoundMethod · 0.80

Tested by

no test coverage detected