Hi Matt, The output of the tube filter is not triangulated: it is represented in a different mesh structure (don't ask me which, I'd have to dig up my VTK documentation and loose a couple of hours looking in it).
The quick workaround is to apply a triangle filter to triangulate the mesh: poly_data = mlab.pipeline.triangle_filter(ply_data).outputs[0] then the 'polys' attribute of the poly_data is well-behaved. A as side remark, it would be useful to apply a stripper module to your source before running the tube filter: it will connect the segment into continuous lines, and the resulting tubes will be more continuous: tube = mlab.pipeline.tube(mlab.pipeline.stripper(pts)) Finally, the warning about computing normals is fairly harmless. However, a bit of CleanPolyData can remove the coincident geometry that VTK dislikes: lines = mlab.pipeline.user_defined(pts, filter='CleanPolyData') Hope this helps, Gaël On Fri, Feb 24, 2012 at 05:50:36PM -0800, Matt Goodman wrote: > Much thanks. That was the first place that I looked, but I was a bit > confused by the following output, so I figured I was poking about in the > wrong place. > >From there, I do: > ply_data = tube.outputs[0] > print ply_data.points, ply_data.points.to_array() > print ply_data.polys, ply_data.polys.to_array() > When I print the poly-data's points attribute I get what I expect, but the > polys attribute seems devoid of the connectivity data that I am used to > seeing there: > (output follows) > vtkPoints (000000000E89F190) > Debug: Off > Modified Time: 813051 > Reference Count: 4 > Registered Events: > Registered Observers: > vtkObserver (000000000E7DBB00) > Event: 33 > EventName: ModifiedEvent > Command: 000000000E7DB0B0 > Priority: 0 > Tag: 1 > Data: 00000000108208D0 > Data Array Name: Points > Number Of Points: 85404 > Bounds: > Xmin,Xmax: (-219.164, 618.399) > Ymin,Ymax: (-116.33, 665.014) > Zmin,Zmax: (-234.603, 904.209) > [[ 478.18218994 249.84048462 236.28182983] > [ 478.12219238 250.10919189 236.24630737] > [ 478.32241821 250.28787231 236.17526245] > ..., > [ 252.15283203 62.9306488 252.89715576] > [ 247.82270813 60.4306488 252.89715576] > [ 247.82270813 55.4306488 252.89715576]] > vtkCellArray (000000000E8A0700) > Debug: Off > Modified Time: 804722 > Reference Count: 52 > Registered Events: > Registered Observers: > vtkObserver (000000000E7DBB00) > Event: 33 > EventName: ModifiedEvent > Command: 000000000E7DB350 > Priority: 0 > Tag: 3 > Number Of Cells: 0 > Insert Location: 0 > Traversal Location: 0 > [] > (note empty polys object . . .) > I get a few warnings about being able to compute surface normals (there may > be a few coincident points kicking around in there), but the figure draws > just fine (attached), so I know the data has to be somewhere in that > object. . . > The warnings look like this: > Generic Warning: In > C:\pisi\tmp\VTK-5.6.0-1\work\VTK\Filtering\vtkPolyLine.cxx, line 104 > Coincident points in polyline...can't compute normals > Warning: In C:\pisi\tmp\VTK-5.6.0-1\work\VTK\Graphics\vtkTubeFilter.cxx, > line 225 > vtkTubeFilter (000000000EE0C330): Could not generate normals for line. > Skipping to next. > Are these possibly related? > Code and data attached, thanks for reading. . . > --Matthew Goodman > ===================== > Check Out My Website: http://craneium.net > Find me on LinkedIn: http://tinyurl.com/d6wlch > On Fri, Feb 24, 2012 at 3:15 PM, Gael Varoquaux < > gael.varoqu...@normalesup.org> wrote: > > Hi Matt, > > On Fri, Feb 24, 2012 at 02:24:55PM -0800, Matt Goodman wrote: > >> I am trying to extract the mesh data from the generated tube object, > >> but I am having trouble finding the generated polygon data. > > The tube filter, as any filter, shoudl have an 'outputs' attribute, > > giving the list of VTK datasets that it outputs. The first on of them > > should be a polydata: > > http://github.enthought.com/mayavi/mayavi/data.html#polydata > > Hope this helps, > > Gaėl -- Gael Varoquaux Researcher, INRIA Parietal Laboratoire de Neuro-Imagerie Assistee par Ordinateur NeuroSpin/CEA Saclay , Bat 145, 91191 Gif-sur-Yvette France Phone: ++ 33-1-69-08-79-68 http://gael-varoquaux.info ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ MayaVi-users mailing list MayaVi-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mayavi-users