Hello everyone,

I found the solution. For people who are interesting, you have just to turn on 
the checkbox for « Copy Arrays » in the Programmable filter.

Sincerely.

> Le 16 août 2016 à 15:50, Lancelot Boulet <[email protected]> a écrit :
> 
> Dear all,
> 
> I am trying to visualise the path of one particle with the line colored by a 
> scalar. But I don’t really know how to do that.
> For example, I want to visualize the evolution of the temperature along the 
> path of my particle.
> I have a data file with point coordinates (each line represents its evolution 
> in time) and some scalars (like temperature, diameter) as input.
> "x", "y", "z", "scalar1", "scalar2"
> 0, 0, 0, 300, 12.5
> 0, 12, 7, 302, 35.4
> ...
> 
> What I had already done is to convert my data into Table Of Points. Then, I 
> used this Programmable Filter to connect the points :
> 
> pdi = self.GetPolyDataInput()
> pdo =  self.GetPolyDataOutput()
> numPoints = pdi.GetNumberOfPoints()
> pdo.Allocate()
> for i in range(0, numPoints-1):
>     points = [i, i+1]
>     # VTK_LINE is 3
>     pdo.InsertNextCell(3, 2, points)
> 
> 
> I have found, on the Paraview Wiki, a way to give a unique color for the line 
> that link all the coordinates :
> 
> pdi = self.GetPolyDataInput()
> pdo =  self.GetPolyDataOutput()
> numPoints = pdi.GetNumberOfPoints()
> pdo.Allocate()
> 
> colors = vtk.vtkUnsignedCharArray()
> colors.SetNumberOfComponents(3)
> colors.SetName("Colors")
>  
> for i in range(0, numPoints-1):
>     points = [i, i+1]
>     # VTK_LINE is 3
>     pdo.InsertNextCell(3, 2, points)
>     colors.InsertNextTuple3(255,0,0)
>  
> pdo.GetPointData().AddArray(colors)
> del colors
> 
> 
> Do you have any idea how I can do that (with a Programmable Filter or not) ?
> 
> Thank you in advance.

_______________________________________________
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

Reply via email to