vedo
vedo copied to clipboard
Overlap on inside of Tube
When constructing a Tube from a set of points, an overlapping section can appear in the Tube on tight corners:
Ideally the Tube should just consist of the surface.
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)