Attempts to combine all of the items on the stack into a single item. WARNING: all of the items must be of the same type! :param clean: call :meth:`clean` afterwards to have a clean shape :param glue: use a faster gluing mode for non-overlapping shapes (default Fal
(
self: T, clean: bool = True, glue: bool = False, tol: Optional[float] = None,
)
| 3278 | return self.newObject([r]) |
| 3279 | |
| 3280 | def combine( |
| 3281 | self: T, clean: bool = True, glue: bool = False, tol: Optional[float] = None, |
| 3282 | ) -> T: |
| 3283 | """ |
| 3284 | Attempts to combine all of the items on the stack into a single item. |
| 3285 | |
| 3286 | WARNING: all of the items must be of the same type! |
| 3287 | |
| 3288 | :param clean: call :meth:`clean` afterwards to have a clean shape |
| 3289 | :param glue: use a faster gluing mode for non-overlapping shapes (default False) |
| 3290 | :param tol: tolerance value for fuzzy bool operation mode (default None) |
| 3291 | :raises: ValueError if there are no items on the stack, or if they cannot be combined |
| 3292 | :return: a CQ object with the resulting object selected |
| 3293 | """ |
| 3294 | |
| 3295 | items: List[Shape] = [o for o in self.objects if isinstance(o, Shape)] |
| 3296 | s = items.pop(0) |
| 3297 | |
| 3298 | if items: |
| 3299 | s = s.fuse(*items, glue=glue, tol=tol) |
| 3300 | |
| 3301 | if clean: |
| 3302 | s = s.clean() |
| 3303 | |
| 3304 | return self.newObject([s]) |
| 3305 | |
| 3306 | def union( |
| 3307 | self: T, |