啊鹿Dizzyi
啊鹿Dizzyi

Reputation: 1048

CadQuery Stack Nagivation: how to unparent "XY" plane from `transformed`-made workplane

Beginner at CadQuery,

Trying to do basic modeling.

I want to drill multiple holes from different direction in an object,

so I:

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:

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

Expected Result

expected result

Upvotes: 0

Views: 19

Answers (0)

Related Questions