You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cadquery/cq.py
+24-19Lines changed: 24 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@
51
51
52
52
from .occ_impl.exporters.svgimportgetSVG, exportSVG
53
53
54
-
from .utilsimportdeprecate_kwarg, deprecate
54
+
from .utilsimportdeprecate_kwarg, deprecate, deprecate_kwarg_name
55
55
56
56
from .selectorsimport (
57
57
Selector,
@@ -2394,6 +2394,8 @@ def each(
2394
2394
self: T,
2395
2395
callback: Callable[[CQObject], Shape],
2396
2396
useLocalCoordinates: bool=False,
2397
+
combine: Union[bool, str] =True,
2398
+
clean: bool=True,
2397
2399
) ->T:
2398
2400
"""
2399
2401
Runs the provided function on each value in the stack, and collects the return values into
@@ -2404,6 +2406,9 @@ def each(
2404
2406
:param callBackFunction: the function to call for each item on the current stack.
2405
2407
:param useLocalCoordinates: should values be converted from local coordinates first?
2406
2408
:type useLocalCoordinates: boolean
2409
+
:param boolean or string combine: True to combine the resulting solid with parent solids if found, "cut" to remove the resulting solid from the parent solids if found.
2410
+
:param boolean clean: call :py:meth:`clean` afterwards to have a clean shape
2411
+
2407
2412
2408
2413
The callback function must accept one argument, which is the item on the stack, and return
2409
2414
one object, which is collected. If the function returns None, nothing is added to the stack.
@@ -2439,7 +2444,6 @@ def each(
2439
2444
ifisinstance(r, Wire):
2440
2445
ifnotr.forConstruction:
2441
2446
self._addPendingWire(r)
2442
-
2443
2447
results.append(r)
2444
2448
2445
2449
returnself.newObject(results)
@@ -2448,6 +2452,7 @@ def eachpoint(
2448
2452
self: T,
2449
2453
callback: Callable[[Location], Shape],
2450
2454
useLocalCoordinates: bool=False,
2455
+
combine: Union[bool, str] =False,
2451
2456
) ->T:
2452
2457
"""
2453
2458
Same as each(), except each item on the stack is converted into a point before it
@@ -2457,6 +2462,8 @@ def eachpoint(
2457
2462
2458
2463
:param useLocalCoordinates: should points be in local or global coordinates
2459
2464
:type useLocalCoordinates: boolean
2465
+
:param boolean or string combine: True to combine the resulting solid with parent solids if found, "cut" to remove the resulting solid from the parent solids if found.
2466
+
2460
2467
2461
2468
The resulting object has a point on the stack for each object on the original stack.
2462
2469
Vertices and points remain a point. Faces, Wires, Solids, Edges, and Shells are converted
to the normal of the plane. The string "next" extrudes until the next face orthogonal to
3016
3027
the wire normal. "last" extrudes to the last face. If a object of type Face is passed then
3017
3028
the extrusion will extend until this face.
3018
-
:param boolean combine: True to combine the resulting solid with parent solids if found. (Cannot be set to False when `until` is not set as a float)
3029
+
:param boolean or string combine: True to combine the resulting solid with parent solids if found, "cut" to remove the resulting solid from the parent solids if found.
3019
3030
:param boolean clean: call :py:meth:`clean` afterwards to have a clean shape
3020
3031
:param boolean both: extrude in both directions symmetrically
3021
3032
:param float taper: angle for optional tapered extrusion
:param distance: the distance to extrude or cut, normal to the workplane plane
4142
4152
:type distance: float, negative means opposite the normal direction
4143
4153
:param cut: True to cut the resulting solid from the parent solids if found
4144
-
:param combine: True to combine the resulting solid with parent solids if found
4154
+
:param boolean or string combine: True to combine the resulting solid with parent solids if found, "cut" to remove the resulting solid from the parent solids if found.
4145
4155
:param clean: call :py:meth:`clean` afterwards to have a clean shape
0 commit comments