Arc Sweep #1885
Unanswered
RickyIlBoss
asked this question in
Q&A
Arc Sweep
#1885
Replies: 1 comment
-
Here is an example where the base shape is defined by the angle from cadquery import Sketch
from cadquery.func import *
a = 60 # angle of arc / trimmed circle for base shape
x1 = 15 # base circle offset in x
r1 = 10 # radius for base shape
r2 = 3.5 # radius for "handle" part
h = 10 # base height
# create the left arc with Sketch
e1 = Sketch().arc((-x1, 0), r1, a, 360 - 2 * a).val()
# an alternative is to use trim to create the arc from a circle
# mirror to create the right arc
e2 = e1.mirror("YZ")
# the start, end vertices for the middle arc
v1 = e1.vertices("<Y")
v2 = e2.vertices("<Y")
# the lower middle arc, tangentAt(1) to get the tangent of the arc endpoint
e3 = Edge.makeTangentArc(v1.Center(), e1.tangentAt(1), v2.Center())
# mirror to create the top middle arc
e4 = e3.mirror("XZ")
# build a face from edges
f1 = face(wire(e1, e2, e3, e4))
# create the solid base
base = extrude(f1, (0, 0, h))
# sweep to create the "handle"
f1 = face(circle(r2).move(x=-x1, z=h))
path1 = Sketch().arc((0, 0), x1, 0, 180).val().move(rx=90, z=h)
sweep1 = sweep(f1, path1)
# final shape
res = fuse(base, sweep1) |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Good morning, I need to understand how to make this part of the pattern... I've posted the photo here... I'll also post the YouTube link with the video if needed. Thanks in advance and have a good day.🙏
https://youtu.be/dus_2cFHaiY?si=tKzmSfOMAsEaLTZe
Beta Was this translation helpful? Give feedback.
All reactions