Convert a list of TopoDS_Shape to a Shape or a Compound.
(s: TopoDS_Shape | Sequence[TopoDS_Shape])
| 5349 | |
| 5350 | |
| 5351 | def _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 | |
| 5366 | def _shape(s: TopoDS_Shape, _: type[T]) -> T: |
no test coverage detected