Jan, I think you want to copy the field data as point data, not cell data. Since the points of your input are the same as your output, you can just call “PassData” to copy them over. Try this version of the script for the programmable filter:
pdi = self.GetPolyDataInput() pdo = self.GetPolyDataOutput() numPoints = pdi.GetNumberOfPoints() pdo.Allocate() for i in range(0, numPoints-1): points = [i, i+1] pdo.InsertNextCell(3, 2, points) pdo.GetPointData().PassData(pdi.GetPointData()) -Ken From: ParaView <[email protected]> on behalf of Jan Deca <[email protected]> Date: Saturday, May 7, 2016 at 6:17 PM To: "[email protected]" <[email protected]> Subject: [EXTERNAL] Re: [Paraview] Table of points to colored tube. So, I'm almost there with this script: " pdi = self.GetPolyDataInput() pdo = self.GetPolyDataOutput() numPoints = pdi.GetNumberOfPoints() pdo.Allocate() for i in range(0, numPoints-1): points = [i, i+1] pdo.InsertNextCell(3, 2, points) ivals = pdi.GetPointData().GetScalars("u") ca = vtk.vtkFloatArray() ca.SetName(ivals.GetName()) ca.SetNumberOfComponents(1) ca.SetNumberOfTuples(numPoints-1) pdo.GetCellData().AddArray(ca) for i in range(0, numPoints-1): ca.SetValue(i, ivals.GetValue(i)) " The only issue now is that the Tube filter is unhappy as it is unable to compute the normals making its output segmented looking like a collection of separate disks. I've attached a test-file and screenshot of the output. " Generic Warning: In /Users/kitware/Dashboards/MyTests/NightlyMaster/ParaViewSuperbuild-Release-Python27/paraview/src/paraview/VTK/Common/DataModel/vtkPolyLine.cxx, line 106 Coincident points in polyline...can't compute normals Warning: In /Users/kitware/Dashboards/MyTests/NightlyMaster/ParaViewSuperbuild-Release-Python27/paraview/src/paraview/VTK/Filters/Core/vtkTubeFilter.cxx, line 243 vtkTubeFilter (0x7f840214ca40): Could not generate normals for line. Skipping to next. " Anybody any suggestions? Thank you!
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
