[vtkusers] diapearing polydata

HannahK hannahkaufmann at aol.com
Fri Sep 13 02:11:45 EDT 2013


no there are no warnings or errors. I didn't try ParaView.
It's strange if I render polydata with the same structure but less cells it
works fine.

Here is my code:
polygons = vtk.vtkCellArray()

for row in range(0,columns-1):
    for col in range(0,rows-1):            
         polygon = vtk.vtkPolygon()
         polygon.GetPointIds().SetNumberOfIds(4) 
         polygon.GetPointIds().SetId(0, row + col * rows)
         polygon.GetPointIds().SetId(1, row + (col+1) * rows)
         polygon.GetPointIds().SetId(2, row+1 + (col+1) * rows)
         polygon.GetPointIds().SetId(3, row+1 + col * rows)
         # Add the polygon to a list of polygons
         polygons.InsertNextCell(polygon)

# Create a PolyData
polygonPolyData = vtk.vtkPolyData()
polygonPolyData.SetPoints(Tdata.GetPoints())
polygonPolyData.SetPolys(polygons)
    
# Create a mapper and actor
mapper = vtk.vtkPolyDataMapper()
if vtk.VTK_MAJOR_VERSION <= 5:
    mapper.SetInput(polygonPolyData)
else:
    mapper.SetInputData(polygonPolyData)
     
actor = vtk.vtkActor()
actor.SetMapper(mapper)
actor.GetProperty().SetColor(color)

I also tried to allocate memory first, but still the same problem occurs.
Is there any better method to mesh and render a big point cloud with vtk?

Thanks,
Hannah



--
View this message in context: http://vtk.1045678.n5.nabble.com/diapearing-polydata-tp1247421p5723452.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list