Is there some convenient way to create hollow tube with certain thickness wall? #800
Answered
by
marcomusy
ZiguoAtGitHub
asked this question in
Q&A
-
Hi Marco, |
Beta Was this translation helpful? Give feedback.
Answered by
marcomusy
Feb 2, 2023
Replies: 1 comment 3 replies
-
this would be one way of doing it maybe there are better ways - it still doesn't work for some reason cap2 is not right while cap1 is perfectly fine... need to debug..: from vedo import *
pts = [[sin(x), cos(x), x/3] for x in np.arange(0.1, 3, 0.3)]
vline = Line(pts, lw=3)
t1 = Tube(pts, r=0.2, cap=False)
t2 = Tube(pts, r=0.3, cap=False)
tc1a, tc1b = t1.boundaries().split()
tc2a, tc2b = t2.boundaries().split()
cap1 = Ribbon(tc1a, tc2a, closed=True, res=(tc1a.npoints,1))
cap2 = Ribbon(tc1b, tc2b, closed=True, res=(tc1b.npoints,1))
show(vline, t1, t2, tc1a, tc1b, tc2a, tc2b, cap1, cap2, axes=1).close()
# show(vline, t1, t2, tc1b, tc2b, axes=1).close()
thick_tube = merge(t1, t2, cap1, cap2)
show("thick_tube", vline, thick_tube, axes=1).close() |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
marcomusy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this would be one way of doing it maybe there are better ways - it still doesn't work for some reason cap2 is not right while cap1 is perfectly fine... need to debug..: