Skip to content

Commit 2c3a2fd

Browse files
committed
Update cq.py
1 parent 42e144b commit 2c3a2fd

File tree

1 file changed

+27
-26
lines changed

1 file changed

+27
-26
lines changed

cadquery/cq.py

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
from typing_extensions import Literal
3838
from inspect import Parameter, Signature
3939

40+
4041
from .occ_impl.geom import Vector, Plane, Location
4142
from .occ_impl.shapes import (
4243
Shape,
@@ -45,7 +46,6 @@
4546
Face,
4647
Solid,
4748
Compound,
48-
sortWiresByBuildOrder,
4949
wiresToFaces,
5050
)
5151

@@ -55,8 +55,6 @@
5555

5656
from .selectors import (
5757
Selector,
58-
PerpendicularDirSelector,
59-
NearestToPointSelector,
6058
StringSyntaxSelector,
6159
)
6260

@@ -3042,36 +3040,39 @@ def extrude(
30423040
* if combine is true, the value is combined with the context solid if it exists,
30433041
and the resulting solid becomes the new context solid.
30443042
"""
3045-
# Handle `until` multiple values
3046-
if isinstance(until, str) and until in ("next", "last") and combine:
3047-
if until == "next":
3048-
faceIndex = 0
3049-
elif until == "last":
3050-
faceIndex = -1
3043+
if combine == "cut":
3044+
self.cutBlind(until,clean,taper)
3045+
else:
3046+
# Handle `until` multiple values
3047+
if isinstance(until, str) and until in ("next", "last") and combine:
3048+
if until == "next":
3049+
faceIndex = 0
3050+
elif until == "last":
3051+
faceIndex = -1
30513052

3052-
r = self._extrude(None, both=both, taper=taper, upToFace=faceIndex)
3053+
r = self._extrude(None, both=both, taper=taper, upToFace=faceIndex)
30533054

3054-
elif isinstance(until, Face) and combine:
3055-
r = self._extrude(None, both=both, taper=taper, upToFace=until)
3055+
elif isinstance(until, Face) and combine:
3056+
r = self._extrude(None, both=both, taper=taper, upToFace=until)
30563057

3057-
elif isinstance(until, (int, float)):
3058-
r = self._extrude(until, both=both, taper=taper, upToFace=None)
3058+
elif isinstance(until, (int, float)):
3059+
r = self._extrude(until, both=both, taper=taper, upToFace=None)
30593060

3060-
elif isinstance(until, (str, Face)) and combine is False:
3061-
raise ValueError(
3062-
"`combine` can't be set to False when extruding until a face"
3063-
)
3061+
elif isinstance(until, (str, Face)) and combine is False:
3062+
raise ValueError(
3063+
"`combine` can't be set to False when extruding until a face"
3064+
)
30643065

3065-
else:
3066-
raise ValueError(
3067-
f"Do not know how to handle until argument of type {type(until)}"
3068-
)
3066+
else:
3067+
raise ValueError(
3068+
f"Do not know how to handle until argument of type {type(until)}"
3069+
)
30693070

3070-
newS = self._combineWithBase(r, combine)
3071+
newS = self._combineWithBase(r, combine)
30713072

3072-
if clean:
3073-
newS = newS.clean()
3074-
return newS
3073+
if clean:
3074+
newS = newS.clean()
3075+
return newS
30753076

30763077
def revolve(
30773078
self: T,

0 commit comments

Comments
 (0)