*bump* I am hoping this email doesn't get buried in the list... anybody got ideas?<br><br><div class="gmail_quote">On Jan 25, 2008 8:39 PM, Alessandro Bellina <<a href="mailto:bellina@uiuc.edu">bellina@uiuc.edu</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello again,<br>I am trying now to display some data that is not structured in cells and points as a mesh would. This is a vector cloud in 3-D. Reading some of the other threads I have found this could be done with Programmable Sources, or vtp files. My only problem is that I am having trouble creating the actual vectors... so I can assign points but am having issues assigning those points, end points, to create vectors.<br>
<br>Here is some code, posted in this list before, that I have been using. I think I need to add the end points as vtkPoints, is that right? Then populate them in the loop. If anybody could point to how to do this in .vtp xml file format that would help me even more. Like what structure should the file have?<br>
<br>Thank you in advance,<br><br>Alessandro<br><br>---------------------------------------------------------------<br><br><br>#!/usr/bin/env python<br><br>from paraview import vtk<br>import csv<br><br>output = self.GetOutput()<br>
<br>points = vtk.vtkPoints()<br>data = vtk.vtkPoints() #? Is this what I need to be using?<br>cells = vtk.vtkCellArray()<br>vectors = vtk.vtkCellArray()<br><br>file = open("/home/bellina/workspace/Data/CSphere/test.vtp")<br>
<br>header = csv.reader(file).next() #get the header line<br>csvReader = csv.DictReader(file, header) #make a dict reader with the header<br>counter = 0 #need to keep track of the amount of cells<br>for line in csvReader:<br>
points.InsertNextPoint(float(line['x']), float(line['y']), float(line['z'])) #add a point change the 'x' etc to what you have in your header<br> cells.InsertNextCell(1) #each point has its own cell<br>
cells.InsertCellPoint(counter)<br> counter += 1<br><br>output.SetPoints(points) #need to set points<br>output.SetVerts(cells) #need to set cells as verts<br><br><br>----------------------------------<br>
</blockquote></div><br>