Use all un-extruded wires in the parent chain to create a prismatic cut from existing solid. Specify either a distance value, or one of "next", "last" to indicate a face to cut to. Similar to extrude, except that a solid in the parent chain is required to remove material
(
self: T,
until: Union[float, Literal["next", "last"], Face],
clean: bool = True,
both: bool = False,
taper: Optional[float] = None,
)
| 3509 | return self.split(other) |
| 3510 | |
| 3511 | def cutBlind( |
| 3512 | self: T, |
| 3513 | until: Union[float, Literal["next", "last"], Face], |
| 3514 | clean: bool = True, |
| 3515 | both: bool = False, |
| 3516 | taper: Optional[float] = None, |
| 3517 | ) -> T: |
| 3518 | """ |
| 3519 | Use all un-extruded wires in the parent chain to create a prismatic cut from existing solid. |
| 3520 | |
| 3521 | Specify either a distance value, or one of "next", "last" to indicate a face to cut to. |
| 3522 | |
| 3523 | Similar to extrude, except that a solid in the parent chain is required to remove material |
| 3524 | from. cutBlind always removes material from a part. |
| 3525 | |
| 3526 | :param until: The distance to cut to, normal to the workplane plane. When a negative float |
| 3527 | is passed the cut extends this far in the opposite direction to the normal of the plane |
| 3528 | (i.e in the solid). The string "next" cuts until the next face orthogonal to the wire |
| 3529 | normal. "last" cuts to the last face. If an object of type Face is passed, then the cut |
| 3530 | will extend until this face. |
| 3531 | :param clean: call :meth:`clean` afterwards to have a clean shape |
| 3532 | :param both: cut in both directions symmetrically |
| 3533 | :param taper: angle for optional tapered extrusion |
| 3534 | :raises ValueError: if there is no solid to subtract from in the chain |
| 3535 | :return: a CQ object with the resulting object selected |
| 3536 | |
| 3537 | see :meth:`cutThruAll` to cut material from the entire part |
| 3538 | """ |
| 3539 | # Handling of `until` passed values |
| 3540 | s: Union[Compound, Solid, Shape] |
| 3541 | if isinstance(both, float) and taper == None: |
| 3542 | # Because inserting a new parameter "both" in front of "taper", |
| 3543 | # existing code calling this function with position arguments will |
| 3544 | # pass the taper argument (float) to the "both" argument. This |
| 3545 | # warning is to catch that. |
| 3546 | from warnings import warn |
| 3547 | |
| 3548 | warn( |
| 3549 | "cutBlind added a new keyword argument `both=True`. " |
| 3550 | "The signature is changed from " |
| 3551 | "(until, clean, taper) -> (until, clean, both, taper)", |
| 3552 | DeprecationWarning, |
| 3553 | ) |
| 3554 | |
| 3555 | # assign 3rd argument value to taper |
| 3556 | taper = both |
| 3557 | both = False |
| 3558 | |
| 3559 | if isinstance(until, str) and until in ("next", "last"): |
| 3560 | if until == "next": |
| 3561 | faceIndex = 0 |
| 3562 | elif until == "last": |
| 3563 | faceIndex = -1 |
| 3564 | |
| 3565 | s = self._extrude( |
| 3566 | None, both=both, taper=taper, upToFace=faceIndex, additive=False |
| 3567 | ) |
| 3568 |