[Paraview] Table of points to colored tube.

Jan Deca jandeca at gmail.com
Sat May 7 20:17:45 EDT 2016


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!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160507/ca63efa0/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TubeFilterOutput.png
Type: image/png
Size: 288031 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160507/ca63efa0/attachment-0001.png>
-------------- next part --------------
x y z u
0.48 0.53208718441 0.465358168082 0.015827736896
0.480015868191 0.532075753183 0.465349509398 0.0159084404236
0.480031814754 0.532064157098 0.465341182625 0.0159844839492
0.480047835018 0.532052399243 0.465333190341 0.0160558396844
0.480063924283 0.532040482745 0.465325535038 0.0161224810919
0.48008007782 0.53202841076 0.465318219113 0.0161843829012
0.48009629088 0.532016186479 0.465311244872 0.0162415211177
0.480112558687 0.532003813122 0.465304614527 0.0162938730288
0.480128876444 0.53199129394 0.465298330194 0.0163414172109
0.480145239333 0.531978632215 0.465292393899 0.0163841335347
0.480161642516 0.531965831256 0.465286807568 0.0164220031712
0.480178081138 0.531952894399 0.465281573034 0.0164550085962
0.480194550328 0.531939825009 0.465276692033 0.0164831335954
0.480211045196 0.531926626474 0.465272166204 0.0165063632688
0.48022756084 0.531913302208 0.46526799709 0.0165246840346
0.480244092346 0.531899855652 0.465264186136 0.0165380836327
0.480260634787 0.531886290264 0.465260734689 0.0165465511283
0.480277183225 0.531872609531 0.465257643998 0.0165500769148
0.480293732715 0.531858816955 0.465254915212 0.016548652716
0.480310278303 0.531844916062 0.465252549382 0.0165422715889
0.48032681503 0.531830910396 0.465250547462 0.0165309279252
0.48034333793 0.531816803521 0.465248910303 0.0165146174529
0.480359842035 0.531802599016 0.465247638658 0.0164933372376
0.480376322375 0.531788300477 0.46524673318 0.0164670856829
0.480392773978 0.531773911517 0.465246194422 0.0164358625312
0.480409191873 0.531759435762 0.465246022838 0.0163996688638
0.48042557109 0.531744876851 0.465246218779 0.0163585071002
0.480441906663 0.531730238439 0.465246782497 0.016312380998
0.48045819363 0.531715524188 0.465247714144 0.0162612956516
0.480474427036 0.531700737773 0.46524901377 0.0162052574906
0.480490600244 0.531685875934 0.465250697152 0.016140758755
0.480506706066 0.531670935921 0.46525278002 0.0160704846006
0.480522738732 0.531655922208 0.465255262211 0.0159944474713
0.480538692485 0.531640839279 0.465258143429 0.0159126616449
0.480554561585 0.531625691626 0.465261423254 0.0158251432281
0.480570340308 0.531610483751 0.465265101132 0.0157319101516
0.48058602295 0.531595220161 0.465269176384 0.0156329821644
0.480601603825 0.531579905367 0.4652736482 0.0155283808274
0.480617077273 0.531564543884 0.465278515645 0.0154181295066
0.480632437656 0.531549140231 0.465283777651 0.0153022533659
0.480647679361 0.531533698925 0.465289433027 0.0151807793585
0.480662796807 0.531518224484 0.465295480453 0.0150537362191
0.480677784437 0.531502721421 0.465301918482 0.014921154454
0.480692636731 0.531487194247 0.465308745541 0.014783066332
0.480707348198 0.531471647469 0.465315959931 0.0146395058738
0.480721913385 0.531456085586 0.465323559827 0.0144905088412
0.480736326872 0.531440513089 0.46533154328 0.014336112726
0.48075058328 0.531424934458 0.465339908218 0.0141763567378
0.48076467727 0.531409354166 0.465348652443 0.0140112817913
0.480778603545 0.53139377667 0.465357773637 0.013840930494
0.480792356849 0.531378206415 0.465367269357 0.0136653471321
0.480805931973 0.53136264783 0.465377137041 0.0134845776564
0.480819323755 0.531347105328 0.465387374006 0.0132986696679
0.480832527082 0.531331583304 0.465397977449 0.0131076724027
0.480845536888 0.531316086134 0.465408944449 0.0129116367162
0.480858348162 0.531300618172 0.465420271967 0.0127106150668
0.480870955945 0.53128518375 0.465431956846 0.0125046614995
0.480883355332 0.531269787178 0.465443995816 0.0122938316285
0.480895541476 0.53125443274 0.465456385489 0.0120781826198
0.480907509586 0.531239124694 0.465469122365 0.0118577731725
0.480919255046 0.53122386278 0.465482200276 0.0116328775881
0.480930773159 0.531208646455 0.465495612911 0.0114030875477
0.480942059062 0.531193479443 0.465509356383 0.0111684687265
0.480953107961 0.531178365438 0.465523426695 0.0109290883528
0.480963915129 0.531163308105 0.465537819746 0.0106850151865
0.480974475906 0.531148311078 0.465552531326 0.0104363194967
0.480984785707 0.531133377959 0.465567557122 0.0101830730395
0.480994840018 0.531118512317 0.46558289272 0.00992534903462
0.481004634398 0.531103717687 0.465598533602 0.00966322214205
0.481014164481 0.531088997568 0.465614475151 0.00939676843808
0.481023425981 0.531074355422 0.465630712652 0.0091260653908
0.481032414686 0.531059794675 0.465647241293 0.00885119183524
0.481041126466 0.531045318713 0.465664056166 0.00857222794808
0.481049557272 0.531030930882 0.46568115227 0.00828925522188
0.481057703136 0.531016634489 0.46569852451 0.00800235643894
0.481065560173 0.531002432797 0.465716167703 0.00771161564473
0.481073124585 0.530988329026 0.465734076575 0.00741711812095
0.481080392664 0.530974326348 0.465752245774 0.00711895021122
0.481087360783 0.530960427893 0.465770669858 0.00681719955684
0.481094025404 0.530946636748 0.465789343296 0.00651195497169
0.481100383077 0.530932955951 0.465808260478 0.00620330639328
0.481106430445 0.530919388491 0.465827415712 0.00589134485385
0.481112164239 0.530905937311 0.465846803229 0.00557616245108
0.481117581286 0.530892605302 0.465866417184 0.00525785231849
0.481122678504 0.530879395304 0.465886251655 0.00493650859547
0.481127452906 0.530866310105 0.46590630065 0.00461222639701
0.481131901604 0.530853352443 0.465926558104 0.00428510178312
0.481136021802 0.530840524999 0.465947017886 0.00395523172793
0.481139810803 0.5308278304 0.465967673794 0.00362271408851
0.481143266009 0.530815271221 0.465988519566 0.00328764757336
0.481146384922 0.530802849976 0.466009548874 0.00295013171075
0.481149165141 0.530790569126 0.466030755331 0.00261026681662
0.481151604368 0.530778431073 0.466052132488 0.00226815396238
0.481153700405 0.530766438159 0.466073673844 0.00192389494238
0.481155451159 0.53075459267 0.46609537284 0.00157759224116
0.481156854636 0.530742896828 0.466117222867 0.00122934900054
0.481157908947 0.530731352798 0.466139217262 0.000879268986407
0.481158612309 0.530719962681 0.466161349319 0.000527456555343
0.48115896304 0.530708728518 0.466183612281 0.000174016621092
0.481158959567 0.530697652285 0.466205999351 -0.0001809453792


More information about the ParaView mailing list