|
37 | 37 | from typing_extensions import Literal
|
38 | 38 | from inspect import Parameter, Signature
|
39 | 39 |
|
| 40 | + |
40 | 41 | from .occ_impl.geom import Vector, Plane, Location
|
41 | 42 | from .occ_impl.shapes import (
|
42 | 43 | Shape,
|
|
45 | 46 | Face,
|
46 | 47 | Solid,
|
47 | 48 | Compound,
|
48 |
| - sortWiresByBuildOrder, |
49 | 49 | wiresToFaces,
|
50 | 50 | )
|
51 | 51 |
|
|
55 | 55 |
|
56 | 56 | from .selectors import (
|
57 | 57 | Selector,
|
58 |
| - PerpendicularDirSelector, |
59 |
| - NearestToPointSelector, |
60 | 58 | StringSyntaxSelector,
|
61 | 59 | )
|
62 | 60 |
|
@@ -3042,36 +3040,39 @@ def extrude(
|
3042 | 3040 | * if combine is true, the value is combined with the context solid if it exists,
|
3043 | 3041 | and the resulting solid becomes the new context solid.
|
3044 | 3042 | """
|
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 |
3051 | 3052 |
|
3052 |
| - r = self._extrude(None, both=both, taper=taper, upToFace=faceIndex) |
| 3053 | + r = self._extrude(None, both=both, taper=taper, upToFace=faceIndex) |
3053 | 3054 |
|
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) |
3056 | 3057 |
|
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) |
3059 | 3060 |
|
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 | + ) |
3064 | 3065 |
|
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 | + ) |
3069 | 3070 |
|
3070 |
| - newS = self._combineWithBase(r, combine) |
| 3071 | + newS = self._combineWithBase(r, combine) |
3071 | 3072 |
|
3072 |
| - if clean: |
3073 |
| - newS = newS.clean() |
3074 |
| - return newS |
| 3073 | + if clean: |
| 3074 | + newS = newS.clean() |
| 3075 | + return newS |
3075 | 3076 |
|
3076 | 3077 | def revolve(
|
3077 | 3078 | self: T,
|
|
0 commit comments