# Export vertices connections (triangles) and vertex colors

**URL:** https://discourse.paraview.org/t/export-vertices-connections-triangles-and-vertex-colors/3928
**Category:** ParaView Support
**Created:** [March 31, 2020, 5:30pm UTC](https://discourse.paraview.org/t/export-vertices-connections-triangles-and-vertex-colors/3928 "2020-03-31T17:30:01Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Scott\_G](https://discourse.paraview.org/user_avatar/discourse.paraview.org/scott_g/32/3298_2.png) [@Scott\_G](https://discourse.paraview.org/u/Scott_G)
#### Post date: [March 31, 2020, 5:30pm UTC](https://discourse.paraview.org/t/export-vertices-connections-triangles-and-vertex-colors/3928/1 "2020-03-31T17:30:01Z")

</div>

> <https://stackoverflow.com/questions/60954087/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](https://stackoverflow.com/questions/58617015/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.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [April 1, 2020, 1:54am UTC](https://discourse.paraview.org/t/export-vertices-connections-triangles-and-vertex-colors/3928/2 "2020-04-01T01:54:39Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Scott\_G](https://discourse.paraview.org/user_avatar/discourse.paraview.org/scott_g/32/3298_2.png) [@Scott\_G](https://discourse.paraview.org/u/Scott_G)
#### Post date: [April 1, 2020, 12:35pm UTC](https://discourse.paraview.org/t/export-vertices-connections-triangles-and-vertex-colors/3928/3 "2020-04-01T12:35:30Z")

</div>

Your wish is my command. OP has been updated. 🙂

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [April 2, 2020, 2:32am UTC](https://discourse.paraview.org/t/export-vertices-connections-triangles-and-vertex-colors/3928/4 "2020-04-02T02:32:07Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Scott\_G](https://discourse.paraview.org/user_avatar/discourse.paraview.org/scott_g/32/3298_2.png) [@Scott\_G](https://discourse.paraview.org/u/Scott_G)
#### Post date: [April 2, 2020, 5:54pm UTC](https://discourse.paraview.org/t/export-vertices-connections-triangles-and-vertex-colors/3928/5 "2020-04-02T17:54:40Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [April 6, 2020, 7:53am UTC](https://discourse.paraview.org/t/export-vertices-connections-triangles-and-vertex-colors/3928/6 "2020-04-06T07:53:07Z")

</div>

Alright.

gltf support has only been added in 5.8.
