@@ -3085,7 +3085,7 @@ def revolve(
3085
3085
:param axisEnd: the end point of the axis of rotation
3086
3086
:type axisEnd: tuple, a two tuple
3087
3087
:param combine: True to combine the resulting solid with parent solids if found.
3088
- :type combine: boolean, combine with parent solid
3088
+ :type combine: boolean or string, defines how the result of the operation is combined with the base solid
3089
3089
:param boolean clean: call :py:meth:`clean` afterwards to have a clean shape
3090
3090
:return: a CQ object with the resulting solid selected.
3091
3091
@@ -3129,7 +3129,9 @@ def revolve(
3129
3129
3130
3130
# returns a Solid (or a compound if there were multiple)
3131
3131
r = self ._revolve (angleDegrees , axisStart , axisEnd )
3132
- if combine :
3132
+ if isinstance (combine , str ) and combine == "cut" :
3133
+ newS = self ._cutFromBase (r )
3134
+ elif isinstance (combine , bool ) and combine :
3133
3135
newS = self ._combineWithBase (r )
3134
3136
else :
3135
3137
newS = self .newObject ([r ])
@@ -3492,12 +3494,10 @@ def cutThruAll(self: T, clean: bool = True, taper: float = 0) -> T:
3492
3494
3493
3495
return self .newObject ([s ])
3494
3496
3495
- def loft (
3496
- self : T , filled : bool = True , ruled : bool = False , combine : bool = True
3497
- ) -> T :
3497
+ def loft (self : T , ruled : bool = False , combine : Union [bool , str ] = True ) -> T :
3498
3498
"""
3499
3499
Make a lofted solid, through the set of wires.
3500
- :return: a CQ object containing the created loft
3500
+ :return: a Workplane object containing the created loft
3501
3501
"""
3502
3502
3503
3503
if self .ctx .pendingWires :
@@ -3510,14 +3510,13 @@ def loft(
3510
3510
3511
3511
r : Shape = Solid .makeLoft (wiresToLoft , ruled )
3512
3512
3513
- if combine :
3514
- parentSolid = self ._findType (
3515
- (Solid , Compound ), searchStack = False , searchParents = True
3516
- )
3517
- if parentSolid is not None :
3518
- r = parentSolid .fuse (r )
3513
+ if isinstance (combine , str ) and combine == "cut" :
3514
+ r = self ._cutFromBase (r )
3519
3515
3520
- return self .newObject ([r ])
3516
+ elif isinstance (combine , bool ) and combine :
3517
+ r = self ._combineWithBase (r )
3518
+
3519
+ return r
3521
3520
3522
3521
def _getFaces (self ) -> List [Face ]:
3523
3522
"""
0 commit comments