vedo icon indicating copy to clipboard operation
vedo copied to clipboard

Overlap on inside of Tube

Open Linus-Foley opened this issue 1 year ago • 1 comments

When constructing a Tube from a set of points, an overlapping section can appear in the Tube on tight corners:

image image

Ideally the Tube should just consist of the surface.

Linus-Foley avatar Jun 19 '24 02:06 Linus-Foley

Hi, unfortunately VTK doesn't seem to be able to avoid self intersections in many cases.. ( I also tried a different class called vtkTubeBender which also does not work well). Another option which is much slower and less precise is https://vedo.embl.es/autodocs/content/vedo/vedo/pointcloud.html#Points.generate_surface_halo Eg:

from vedo import *
np.random.seed(1)
s = Spline(np.random.randn(10,3), res=200)
# tube = Tube(s, r=0.1)
tube = s.generate_surface_halo(res=(100,100,100))
tube.smooth()
tube.alpha(0.5).lw(1)
show(s, tube, axes=1)
Screenshot 2024-06-20 at 00 45 26

marcomusy avatar Jun 19 '24 22:06 marcomusy