Export vertices connections (triangles) and vertex colors

The post metioned above is reproduced below:

I have a .vtk file which I have uploaded into paraview and generated isosurfaces. I was able to export the value, normals, and points of the isosurfaces. However, I need the triangles (integer representation of how the vertices connect to eachother) so I can reconstruct the image in another software. A bonus would also be to get the colors (rgba) or the vertices as well.

So far I have figured out how to load the data, get the view I would like, use the python trace tool to generate an automated python script that reproduces my work, and how to export the data mentioned above. However, I can’t figure out how to get triangle information.

I found the question below which was similar, but I am so unfamiliar with paraview the solution remains a mystery. I think though that a python call to export data is in the right direction…

Extract Triangles IDs from VTU file

Your help is greatly appreciated!

Update

1

I think I have found the color and triangle data by saving data as a .ply file. I am writing a script that brings the .csv data and .ply data together. This seems wonky to need to saved data as two file types to get the necessary information… but perhaps there is a good reason for it.

Please type out the question so it can be searchable by user and robots alike.

Your wish is my command. OP has been updated. :slight_smile:

It is a litle bit unclear what you are trying to achieve here, but I think that if you use File -> ExportScene, and save as a gltf file, you will get what youa re looking for.

To recreate a paraview contour, you need Points or vertices (X,Y,Z), and triangles (integer data in multiplies of 3 which specify how the points are connected to eachother. For smoothing, you can also optionally include normals for each set of data points as well. Colors used in the contours are sets of 3 (rgb) which are of the same length as your points array. File -> Save data requires the user to save two separate file types (i.e., .csv and .ply) to get all the data you need for points and normals (csv) and colors and triangles (ply) - points are in the .ply file too. So, I was able to get what I needed, it just required looking into each file save option.

I tried the ExportScene option but there is no gltf option. In any case, I can automate the exporting of two files and the parsing of them was really easy. Appreciate taking a look at this question.

Alright.

gltf support has only been added in 5.8.