<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
So, I'm almost there with this script:<br>
<br>
"<br>
pdi = self.GetPolyDataInput()<br>
pdo = self.GetPolyDataOutput()<br>
numPoints = pdi.GetNumberOfPoints()<br>
pdo.Allocate()<br>
for i in range(0, numPoints-1):<br>
points = [i, i+1]<br>
pdo.InsertNextCell(3, 2, points)<br>
<br>
ivals = pdi.GetPointData().GetScalars("u")<br>
ca = vtk.vtkFloatArray()<br>
ca.SetName(ivals.GetName())<br>
ca.SetNumberOfComponents(1)<br>
ca.SetNumberOfTuples(numPoints-1)<br>
pdo.GetCellData().AddArray(ca)<br>
for i in range(0, numPoints-1):<br>
ca.SetValue(i, ivals.GetValue(i))<br>
"<br>
<br>
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.<br>
<br>
"<br>
<meta name="qrichtext" content="1">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:13pt; color:#000000;">Generic Warning: In /Users/kitware/Dashboards/MyTests/NightlyMaster/ParaViewSuperbuild-Release-Python27/paraview/src/paraview/VTK/Common/DataModel/vtkPolyLine.cxx, line 106</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:13pt; color:#000000;">Coincident points in polyline...can't compute normals</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Courier'; font-size:13pt; color:#000000;">
</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Courier'; font-size:13pt; color:#000000;">
</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:13pt; color:#000000;">Warning: In /Users/kitware/Dashboards/MyTests/NightlyMaster/ParaViewSuperbuild-Release-Python27/paraview/src/paraview/VTK/Filters/Core/vtkTubeFilter.cxx, line 243</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:13pt; color:#000000;">vtkTubeFilter (0x7f840214ca40): Could not generate normals for line. Skipping to next.</span><!--EndFragment--></p>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>"<br>
<br>
Anybody any suggestions?<br>
<br>
Thank you! <br>
</body>
</html>