cutBlind(distance: float, clean: bool=True) -> CadQuery
The cutBlind()
function is used to cut a solid from a Workplane by one or more blind distances. A blind cut is a cut that does not start from the surface of the solid, but rather from a distance inside of it.
Parameters:
distance
(float): The distance to cut into the solid.clean
(bool, optional): If True
, the resulting solid will be cleaned by removing any slivers, holes, or unnecessary edges. Default is True
.Returns:
CadQuery
: A new solid resulting from the cut.Example:
import cadquery as cq
# create a box and a cylinder
box = cq.Workplane("XY").box(10, 10, 10)
cylinder = cq.Workplane("XY").circle(2).extrude(10)
# cut the box by a blind depth of 5
result = box.cutBlind(5)
# cut the cylinder into the box by two different depths
result = result.cutBlind([3, 7], clean=True)
# show the resulting solid
show_object(result)
In this example, we start by creating a box and a cylinder with a circular base. We then cut the box by 5 units using the cutBlind()
function, resulting in a box with a hole. Finally, we cut the cylinder into the box at two different depths, resulting in a complex solid with multiple holes.
Notes:
distance
can be either a single float or a list of floats. When a list is used, multiple blind cuts are made at different depths.clean
is set to True
, the resulting solid will have all unnecessary edges, slivers, and holes removed. This can be useful when dealing with complex solids with multiple cuts.