Skip to content
Discussion options

You must be logged in to vote

I think sweep with an aux spine is the canonical solution.

from cadquery import Sketch
from cadquery.func import *

# base parts creation
th = 4
sk1 = Sketch().rect(10, 20).moved(x=5).circle(10).clean().circle(5, "s")
fsk1 = sk1.faces().val().moved(z=-th / 2)
part1 = extrude(fsk1, (0, 0, th))
part2 = part1.mirror("YZ").moved(x=45, rx=-90)

# select faces to be connected
f1 = part1.faces(">X")
f2 = part2.faces("<X")
eps = 1e-3

# paths
tgts = [(1,0,0), (1,0,0)]
path = spline((f1.Center(), f2.Center()), tgts=tgts)
aux = spline((f1.Center() - Vector(0,eps,0), f2.Center() - Vector(0,0,eps)), tgts=tgts)

# twisted sweep
twist = sweep(f1, path, aux)

# combine everything
result = fuse(part1, twist

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@RickyIlBoss
Comment options

@RickyIlBoss
Comment options

@RickyIlBoss
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@lorenzncode
Comment options

Answer selected by lorenzncode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants