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

Method combine

cadquery/cq.py:3280–3304  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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,

Callers 6

_consolidateWiresMethod · 0.45
testCubePluginMethod · 0.45
testCombineMethod · 0.45
testMakeShellSolidMethod · 0.45
test_iteratorsMethod · 0.45

Calls 4

newObjectMethod · 0.95
popMethod · 0.45
fuseMethod · 0.45
cleanMethod · 0.45

Tested by 5

testCubePluginMethod · 0.36
testCombineMethod · 0.36
testMakeShellSolidMethod · 0.36
test_iteratorsMethod · 0.36