MCPcopy
hub / github.com/CadQuery/cadquery / cutBlind

Method cutBlind

cadquery/cq.py:3511–3587  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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

Callers 13

extrudeMethod · 0.95
testWorkplaneFromFaceMethod · 0.80
testFrontReferenceMethod · 0.80
testSimpleWorkplaneMethod · 0.80
testTwoWorkplanesMethod · 0.80
testCleanMethod · 0.80
testCutBlindUntilFaceMethod · 0.80
testSlot2DMethod · 0.80
testCutBlindMethod · 0.80
testPopPendingMethod · 0.80

Calls 5

_extrudeMethod · 0.95
findSolidMethod · 0.95
newObjectMethod · 0.95
cutMethod · 0.45
cleanMethod · 0.45

Tested by 11

testWorkplaneFromFaceMethod · 0.64
testFrontReferenceMethod · 0.64
testSimpleWorkplaneMethod · 0.64
testTwoWorkplanesMethod · 0.64
testCleanMethod · 0.64
testCutBlindUntilFaceMethod · 0.64
testSlot2DMethod · 0.64
testCutBlindMethod · 0.64
testPopPendingMethod · 0.64