Reputation: 1048
Beginner at CadQuery,
Trying to do basic modeling.
I want to drill multiple holes from different direction in an object,
so I:
.faces("XY")
to get the top plane and then.transforms(...)
to rotate the plane to a specific direction then.hole(...)
to drill holes.however, workspace got from faces()
seem to be parented to the previous one, and make the rotation aggregated.
I have very few understandings of the cadquery stack in general, so I try:
.first()
before or after the drilling holes.last()
before or after the drilling holes.end()
before or after the drilling holesSo, how can I achieve desired task, and what is the best practice(s) for that?
import cadquery as cq
thickness = 2
rad = 5
leng = 10
# Making the Soild
result = (
cq
.Workplane("XY")
.tag("top")
.sphere(rad + thickness)
.faces("XY")
.split(keepTop=True)
.faces("<Z")
.workplane()
.circle(rad + thickness)
.extrude(leng)
.faces("<Z")
.shell(thickness)
)
# Drilling Holes
for i in range(3):
result = (
result
# .first()
# .last()
.faces("XY")
.transformed(rotate=(0,30,0))
.transformed(rotate=(0,0,i*120))
.hole(1)
# .transformed(rotate=(0,0,-i*120))
# .transformed(rotate=(0,-30,0))
)
show_object(result)
Upvotes: 0
Views: 19