Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct formatting of cboreHole(), cskHole(), and hole() example code #1062

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 28 additions & 9 deletions cadquery/cq.py
Original file line number Diff line number Diff line change
Expand Up @@ -2784,6 +2784,7 @@ def cutEach(

return self.newObject([s])

# TODO: almost all code duplicated!
# but parameter list is different so a simple function pointer won't work
def cboreHole(
self: T,
Expand Down Expand Up @@ -2811,9 +2812,15 @@ def cboreHole(
One hole is created for each item on the stack. A very common use case is to use a
construction rectangle to define the centers of a set of holes, like so::

s = Workplane(Plane.XY()).box(2,4,0.5).faces(">Z").workplane()\
.rect(1.5,3.5,forConstruction=True)\
.vertices().cboreHole(0.125, 0.25,0.125,depth=None)
s = (
Workplane()
.box(2, 4, 0.5)
.faces(">Z")
.workplane()
.rect(1.5, 3.5, forConstruction=True)
.vertices()
.cboreHole(0.125, 0.25, 0.125, depth=None)
)

This sample creates a plate with a set of holes at the corners.

Expand Down Expand Up @@ -2866,9 +2873,15 @@ def cskHole(
One hole is created for each item on the stack. A very common use case is to use a
construction rectangle to define the centers of a set of holes, like so::

s = Workplane(Plane.XY()).box(2,4,0.5).faces(">Z").workplane()\
.rect(1.5,3.5,forConstruction=True)\
.vertices().cskHole(0.125, 0.25,82,depth=None)
s = (
Workplane()
.box(2, 4, 0.5)
.faces(">Z")
.workplane()
.rect(1.5, 3.5, forConstruction=True)
.vertices()
.cskHole(0.125, 0.25, 82, depth=None)
)

This sample creates a plate with a set of holes at the corners.

Expand Down Expand Up @@ -2914,9 +2927,15 @@ def hole(
One hole is created for each item on the stack. A very common use case is to use a
construction rectangle to define the centers of a set of holes, like so::

s = Workplane(Plane.XY()).box(2,4,0.5).faces(">Z").workplane()\
.rect(1.5,3.5,forConstruction=True)\
.vertices().hole(0.125, 0.25,82,depth=None)
s = (
Workplane()
.box(2, 4, 0.5)
.faces(">Z")
.workplane()
.rect(1.5, 3.5, forConstruction=True)
.vertices()
.hole(0.125, 0.25, 82, depth=None)
)

This sample creates a plate with a set of holes at the corners.

Expand Down