I am using python 3.5 and mayavi 4.5.0 + vtk 7.1 (mayavi‑4.5.0+vtk71‑cp35‑cp35m‑win_amd64.whl downloaded from http://www.lfd.uci.edu/~gohlke/pythonlibs/#mayavi), and I ran into a problem.
I tried to run the draw-many-lines example given by the official documentation, but gets a lot of warnings in the vtkOutputWindow. The lines will be drawn eventually, but it is very slow because you have to wait until all warnings are printed.
How to fix this? Thanks.
The code is here:
http://docs.enthought.com/mayavi/mayavi/auto/example_plotting_many_lines.html
And the warnings looks like this:
....
Warning: In D:\Build\VTK\VTK-7.1.1\Common\DataModel\vtkPolyData.cxx, line 1023
vtkPolyData (00000150D4F16FE0): Building VTK_TRIANGLE 482 with less than three points, but VTK_TRIANGLE needs at least three points. Check the input.
Warning: In D:\Build\VTK\VTK-7.1.1\Common\DataModel\vtkPolyData.cxx, line 1023
vtkPolyData (00000150D4F16FE0): Building VTK_TRIANGLE 483 with less than three points, but VTK_TRIANGLE needs at least three points. Check the input.
Warning: In D:\Build\VTK\VTK-7.1.1\Common\DataModel\vtkPolyData.cxx, line 1023
vtkPolyData (00000150D4F16FE0): Building VTK_TRIANGLE 484 with less than three points, but VTK_TRIANGLE needs at least three points. Check the input.
Warning: In D:\Build\VTK\VTK-7.1.1\Common\DataModel\vtkPolyData.cxx, line 1023
vtkPolyData (00000150D4F16FE0): Building VTK_TRIANGLE 485 with less than three points, but VTK_TRIANGLE needs at least three points. Check the input.
Warning: In D:\Build\VTK\VTK-7.1.1\Common\DataModel\vtkPolyData.cxx, line 1023
vtkPolyData (00000150D4F16FE0): Building VTK_TRIANGLE 486 with less than three points, but VTK_TRIANGLE needs at least three points. Check the input.
....
I installed py3-mayavi on Mac with MacPort, and had the same problem: "vtkPolyData (0x7fac677c5290): Building VTK_TRIANGLE 99 with less than three points, but VTK_TRIANGLE needs at least three points. Check the input."
Thanks for the issue, I can reproduce it and it looks like something changed in VTK 7.1 that breaks this and I'll try to work on a fix next week.
There is no warning when I create lines
as tube
: lines= mlab.pipeline.tube(src, tube_radius=0.005, tube_sides=6)
.
@ying17zi It works! You saved the day, thanks !!
Any update on this one? The tube doesn't really work for me.
I looked into this. Apparently the issue is the stripper filter which is only needed if you want to use tubes. For lines you don't need it. So you can drop the offensive part if you plot only lines. Thus
# The stripper filter cleans up connected lines
#lines = mlab.pipeline.stripper(src)
# Finally, display the set of lines
mlab.pipeline.surface(src, colormap='Accent', line_width=1, opacity=.4)
and it works without warnings.
Cheers.
Most helpful comment
There is no warning when I create
lines
astube
:lines= mlab.pipeline.tube(src, tube_radius=0.005, tube_sides=6)
.