[vtkusers] vtkPoints, vtkUnstructuredGrid data overwritten or not updated?

George george.gerber at gmail.com
Sat Nov 8 10:22:31 EST 2014


Good day,
I am trying to display 4 polyhedrons that are aligned along the x-axis, 4
along the y-axis and 4 along the z-axis. Below the section of code that does
this. Basically I do a for-loop where the first loop is for the x-axis, the
second y and the last z. When I view my .vtu file in paraview I only see 4
polyhedrons all aligned in one direction. When I view the properties of the
data set I see that there are correctly 12 cells. I am a bit stumped. Why
are the other 8 polyhedrons not showing? Could it be that the point data
stored in MODEL['vtkpoints'] is overwritten at the start of each loop?

Best regards,
George

        for gamma in [gammax, gammay, gammaz]:
            for pt_local in pt1list:
                pt_global = dot(gamma.T,pt_local)        
                MODEL['vtkpoints'].InsertNextPoint(self.x-10+pt_global[0],
self.y+pt_global[1], self.z+pt_global[2])
            face1Id = vtk.vtkIdList()
            face1Id.InsertNextId(len(face1list)) # Number faces that make up
the cell.
            for face in face1list: # Loop over all the faces
                face1Id.InsertNextId(len(face)) # Number of points in face
                [face1Id.InsertNextId(i) for i in face] # Insert the
pointIds for the face
            MODEL['vtkugrid'].InsertNextCell(vtk.VTK_POLYHEDRON, face1Id)



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkPoints-vtkUnstructuredGrid-data-overwritten-or-not-updated-tp5729414.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list