I have a 3D triangulated surface. The geometry is stored in F
which is the array that contains the faces and V
is the one holding vertices coordinates. In addition, at each vertex, a scalar quantity, S
, and a vector with three components, A
, are stored. I want to import this geometry and data into Paraview. I was thinking about saving the data as a VTK format. To do this, what would be the best format for the geometry, vtkPolyData or vtkUnstructured? Also, how can I add field data (the scalar quantity, S
, and vector A
, at each vertex) to the geometry? Do I need a separate file for this?
As a side question, is there any way to also store some data in the centroid of each triangle including scalar or vector data along the data that are stored at each vertex?
vtkPolyData
are for surface "2D" cells. vtkUnstructuredGrid
are for volumic "3D" cells.
So you need to use a vtkPolyData
. To add the data you should use a vtkPointData
, so each point (vertex) have data associated with it. Considering your side question, there is a vtkCellData
, which store data for each cell, which are triangle in your case.
Have a look at the following examples: http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadPlainTextTriangles http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/MiscPointData
In any case, if your format is not standard, in order to read it into paraview, you will need to write a python script or a C++ plugin.