[vtkusers] Getting the mesh information from a vtkPolyData
Wendel Silva
wendelbsilva at gmail.com
Mon Sep 27 15:49:14 EDT 2010
Hello everyone,
I have a vtkPolyData and I wanna to get its mesh. From the instance I have,
Im able to get the normals, texture coordinates and the index of the
triangles but, Im not able to get the vertices.
The TCoord and Normals I found inside the PointData. The vectors in the
PointData is None. Inside the GetPolygons I was only able to get the index
of the triangles.
My code is currently simple (python):
cylinder = vtk.vtkCylinderSource()
> ...
> triangulate = vtk.vtkTriangleFilter()
> triangulate.SetInputConnection(cylinder.GetOutputPort(0))
> triangulate.Update()
> polydata = triangulate.GetOutput(0)
>
Im also calling the methods Render() and Initialize() of the
vtkRenderWindowInteractor before getting the information from the polydata.
The window with my visualization shows me my code isnt wrong. How can I get
the vertices of the Cylinder(PolyData)?
Thanks
Wendel B Silva
ps.: When I print the PolyData I get the following information:
>
> vtkPolyData (0x2d46000)
> Debug: Off
> Modified Time: 1509
> Reference Count: 2
> Registered Events: (none)
> Source: (none)
> Information: 0x2d433f0
> Data Released: False
> Global Release Data: Off
> UpdateTime: 1510
> Release Data: Off
> UpdateExtent: Not Initialized
> Update Number Of Pieces: 1
> Update Piece: 0
> Update Ghost Level: 0
> MaximumNumberOfPieces: 1
> RequestExactExtent: Off
> Field Data:
> Debug: Off
> Modified Time: 1374
> Reference Count: 1
> Registered Events: (none)
> Number Of Arrays: 0
> Number Of Components: 0
> Number Of Tuples: 0
> Number Of Points: 20
> Number Of Cells: 16
> Cell Data:
> Debug: Off
> Modified Time: 1382
> Reference Count: 1
> Registered Events: (none)
> Number Of Arrays: 0
> Number Of Components: 0
> Number Of Tuples: 0
> Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )
> Interpolate Flags: ( 1 1 1 1 1 0 0 1 )
> Pass Through Flags: ( 1 1 1 1 1 1 1 1 )
> Scalars: (none)
> Vectors: (none)
> Normals: (none)
> TCoords: (none)
> Tensors: (none)
> GlobalIds: (none)
> PedigreeIds: (none)
> EdgeFlag: (none)
> Point Data:
> Debug: Off
> Modified Time: 1509
> Reference Count: 2
> Registered Events: (none)
> Number Of Arrays: 2
> Array 0 name = Normals
> Array 1 name = TCoords
> Number Of Components: 5
> Number Of Tuples: 20
> Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )
> Interpolate Flags: ( 1 1 1 1 1 0 0 1 )
> Pass Through Flags: ( 1 1 1 1 1 1 1 1 )
> Scalars: (none)
> Vectors: (none)
> Normals:
> Debug: Off
> Modified Time: 1346
> Reference Count: 2
> Registered Events: (none)
> Name: Normals
> Data type: float
> Size: 60
> MaxId: 59
> NumberOfComponents: 3
> Information: 0
> Name: Normals
> Number Of Components: 3
> Number Of Tuples: 20
> Size: 60
> MaxId: 59
> LookupTable: (none)
> Array: 0x2d47fe0
> Bounds:
> Xmin,Xmax: (-0.161803, 0.2)
> Ymin,Ymax: (-0.2, 0.2)
> Zmin,Zmax: (-0.190211, 0.190211)
> Compute Time: 1540
> Number Of Points: 20
> Point Coordinates: 0x2d47720
> Locator: 0
> Number Of Vertices: 0
> Number Of Lines: 0
> Number Of Polygons: 16
> Number Of Triangle Strips: 0
> Number Of Pieces: 1
> Piece: 0
> Ghost Level: 0
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100927/5fc5362b/attachment.htm>
More information about the vtkusers
mailing list