[vtkusers] Write Vector Field to VTK File

Cory Quammen cory.quammen at kitware.com
Fri Feb 26 12:51:25 EST 2016


Hi Ruben,

You will need to create an array that holds the vector field, likely either
a vtkFloatArray or vtkDoubleArray, to store your vector field. Set the
number of tuples in the array to the number of elements in your vector.
Then you will need to add this array to either the point or cell data in
your data set as appropriate. Finally, just write out your data set with
the writer.

HTH,
Cory

On Tue, Feb 23, 2016 at 4:21 PM, Ruben van Staden <rubenvanstaden at gmail.com>
wrote:

> Hey all
>
> I'm pritty new to VTK. How do I add a vector field
> to a .vts or .vtk file using the VTK library?
> I did this example and simple want to add
> a vector field to this file:
>
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/XMLStructuredGridWriter
>
> Thanx 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>


-- 
Cory Quammen
R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160226/4afe23e8/attachment.html>


More information about the vtkusers mailing list