Replies: 1 comment 5 replies
-
Please share minimal reproducible/working examples without extensions and other imports. I tried to make changes and reduce the code to the following: import cadquery as cq
sk: cq.Sketch = (
cq.Sketch()
.arc((0, 0), 1.0, 0.0, 360.0)
.arc((1, 1.5), 0.5, 0.0, 360.0)
.segment((0.0, 2), (-1, 3.0))
.hull()
)
box: cq.Workplane = cq.Workplane("XY").box(20, 30, 10).shell(2).split(keepBottom=True)
wire = box.faces(">Z").wires(cq.selectors.LengthNthSelector(-1))
wire2 = wire.toPending().offset2D(-0.25)
# I don't know which orientation was expected; you can also try "<XY"
vert = wire2.vertices(">XY")
plineSweep = cq.Workplane("XZ", origin=vert.val().toTuple()).placeSketch(sk)
plineSweep = plineSweep.sweep(wire2)
plineSweep = plineSweep.translate((0, 0, 5)) # move up for visualization
The original code calls
This is due to moving in the XZ plane:
The origin was moved in the Z direction by
Yes, the edges may be returned in any order. It looks like it was offset differently based on the vert.Y value of the first vertex. This case doesn't require a specific edge/vertex ordering AFAICT. Instead select a single point for the start of the sweep. I don't know if this is the exact result you expect. You may need to make changes to the orientation of the sketch profile. |
Beta Was this translation helpful? Give feedback.
-
I have a code example that is trying to do the following:
So what I am doing is:
I end up with the following:
So questions:
plineSweep
?). Is it because there are multiple edges in the wire?Now I am sure that this is due to my not really understanding what the sweep API is doing. Could someone save me from my ignorance? =)
Beta Was this translation helpful? Give feedback.
All reactions