Replies: 1 comment
-
Try import cadquery as cq
box1 = cq.Workplane().box(40, 40, 30)
# drill mounting holes
box1 = (
box1.faces(">Z")
.workplane()
.pushPoints(
[
(-10, 0),
(10, 0),
]
)
.cboreHole(3.2, 6.2, 4.2)
)
# drill bearing hole
box1 = box1.faces(">Y").workplane(centerOption="CenterOfMass").hole(10)
box1 = box1.faces(">Z").edges("|X").fillet(3) Here is an example that locates the hole relative to the corner vertex: import cadquery as cq
box1 = cq.Workplane().box(40, 40, 30)
# drill mounting holes
box1 = (
box1.faces(">Z")
.workplane()
.pushPoints(
[
(-10, 0),
(10, 0),
]
)
.cboreHole(3.2, 6.2, 4.2)
)
# drill bearing hole
sk1 = cq.Sketch().push([(20, 15)]).circle(5)
# hole is referenced from selected vertex
box1 = (
box1.faces("<Y")
.vertices("<XZ")
.workplane(centerOption="CenterOfMass")
.placeSketch(sk1)
# .placeSketch(sk1.moved(x=20, y=15)) # or with latest branch can use moved with x, y instead of push
.cutThruAll()
)
box1 = box1.faces(">Z").edges("|X").fillet(3) See also: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I tag the previous state, and then I set the plane with:
It works, but I have a feeling that there must be a more elegant way. How would one normally do this?
Complete code sample below:
Beta Was this translation helpful? Give feedback.
All reactions