Replies: 4 comments
-
Are you looking for |
Beta Was this translation helpful? Give feedback.
-
You are right, I've put an example together. import cadquery as cq
# first I create a beam
beam = (cq.Workplane("XZ")
.rect(50, 100)
.extrude(1000)
)
# now I want to cut a slot in the beam but without doing `faces(">X").workplane()`
# I want the local YZ workplane instead
result = (beam.copyWorkplane(cq.Workplane("YZ", origin=(0, -500, 0)))
.rect(200, 50)
.extrude(50, combine='cut')
)
show_object(result) Hopefully this clears things up a bit. The question is if this is the right thing to do or is there a better approach. It's basically the same when doing this in a GUI. Maybe The reason for not using faces is because the shape of the profile can be rounded and dynamically changed. Selecting the right face becomes quite difficult hence using the workplane instead. |
Beta Was this translation helpful? Give feedback.
-
I do not understand what is the problem with Maybe you want to use the free function API? Maybe you want to define a custom selector? |
Beta Was this translation helpful? Give feedback.
-
The example is just an example with a rectangle, but maybe a circle was better. In the function I create, the beam profile is created by an imported DXF and can have any form and size.
When using faces I'm at the mercy of CadQuery to select the right face. Also like I said the faces are maybe planer. And if they are planar they can be rotated around an axis which ruins the cutout.
Sorry, your are right, the example is wrong, I used
I want to make a cut in a beam or cut the beam at an angle. The profile of the beam is created by importing a DXF file, so the profile of the beam is kind of unknown beforehand. So I want to have a geometry independent sketch to be used to make an angular cut at the end of the beam. Also a cutout at a certain place will be added. Another thing is that the origin (0, 0, 0) should not change because I'm creating an assembly based on the origins. Using the |
Beta Was this translation helpful? Give feedback.
-
Maybe a very confusing title 😓 but what I mean is that I have extruded a profile. This profile is imported from a DXF file and placed on the "XZ" workplane. Now I want to cut a piece from it but I don't want to use a face of the profile because the profile can change shape. Instead of using a face I want to use the "YZ" workplane which should be the local one and not the global one.
According to the documentation I can use
copyWorkplane
to get a new workplane which is working properly, but I was wondering it that's the correct way to do this. Maybe there are other ways as well?Beta Was this translation helpful? Give feedback.
All reactions