[Paraview] xyzc file to vtk

Paulo Herrera pauloa.herrera at gmail.com
Wed Jan 12 05:17:32 EST 2011


Hi Luca,

There are many ways to do this. However, if you are familar with
python I would suggest you take a look at PyEVTK:
https://bitbucket.org/pauloh/pyevtk/overview.

If you want to use PyEVTK, you'll have to:

1) Read your data and store it in 4 numpy arrays: x, y, z and C.
2) Write the following two lines to export them as a VTK file:
       from evtk.hl import pointsToVTK
       pointsToVTK("./points", x, y, z, data = {"C" : C })

This will create a point.vtu file in the current directory which
contains an unstructured VTK grid.
If the coordinates x, y, z are the vertices of a rectilinear or
structured grid, you could also export the data as a structured or
rectilinear grid (see the VTK file format document for details). There
are examples in PyEVTK of how to do this.

Good luck,

Paulo

On Wed, Jan 12, 2011 at 10:20 AM, Luca Cinquepalmi
<cinquepalmi at planetek.it> wrote:
> Hi, I have an ascii file with 4 fileds:
>
> X Y Z C
>
> where X, Y, Z represent the coordinates of the point, and C represent the
> component/value of the point (e.g. temperature, umidity, ecc.) I want to
> convert this file in a vtk file. Is it possible? How can I do it? Thanks
>
> Luca
>
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>


More information about the ParaView mailing list