

Since I am quite lazy to explain as well as I do not know what you had in hand and want to perform, any discussion in details is sure. Now openning the vtk file by paraview, you will get something like this Simple surface on a triangle mesh with vertices (xj,yj,zj) for j=0,8. Lastly, make a file, say triangle_surf.vtk, with the following contents: # vtk DataFile Version 2.0 Secondly, adding values of $z_j=z(x_j,y_j)$, for instance, $z_0 = 1$ and $z_j = 0$ for $j \not = 0$, we now had the set of 9 points in 3D, where $z(x,y)$ is the scalar that we want to plot, and the mesh now is with 8 trianlges surrounding $(0,0)$. For example, we firstly generate vertices like this: $(x_0, y_0) = (0,0)$ and Suppose that you had a set of vertices of the triangle mesh and a scalar field valued at the vertices.

Here I'm going to provide you a very simple example.

We can use the UNSTRUCTURED_GRID dataset attribute format in VTK. I Edited my message with an example of my vtk file. How can I obtain plots like the first one? Something like an "elevation", but in paraview I just had obtained plane plots like

X3dExport(os.path.I have a usual vtk file with a mesh of triangles and a scalar velocity. # then loop over all and save it into different formatsįileNameVtk = '.x3d'.format(oldFileName, time) # group VTK files by gruop (fields in openfoam "vtkFilesGroups") X3dExporter = exporters.X3DExporter(FileName=output) VtkFiles.append(os.path.join(root, filename))Įxporters = servermanager.createModule("exporters") However, when I try to do the same operation using the following script from paraview.simple import *įor root, dirnames, filenames in os.walk('.'):įor filename in fnmatch.filter(filenames, '*.vtk'): When I do it via paraview graphical interface it works and results can be visualized in Blender, see the following picture I am trying to export in x3d format OpenFOAM results using paraview-python script.
