Skip to content

Is there some convenient way to create hollow tube with certain thickness wall? #800

Answered by marcomusy
ZiguoAtGitHub asked this question in Q&A
Discussion options

You must be logged in to vote

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, c…

Replies: 1 comment 3 replies

Comment options

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

@marcomusy
Comment options

@marcomusy
Comment options

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