# Adding Scalar Data To Triangle Mesh

**URL:** https://discourse.paraview.org/t/adding-scalar-data-to-triangle-mesh/3478
**Category:** ParaView Support
**Created:** [February 1, 2020, 1:45am UTC](https://discourse.paraview.org/t/adding-scalar-data-to-triangle-mesh/3478 "2020-02-01T01:45:13Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![dennis](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/d/e56c9b/32.png) [@dennis](https://discourse.paraview.org/u/dennis)
#### Post date: [February 1, 2020, 1:45am UTC](https://discourse.paraview.org/t/adding-scalar-data-to-triangle-mesh/3478/1 "2020-02-01T01:45:13Z")

</div>

Hi everyone,

I imagine this should be easy to do in ParaView, but I haven’t had any luck with it:  
I have a set of files (one contains the geometry, another contains the connectivity, and another contains the scalar values that I would like to attach to the geometry). I’m able to create an object file from the geometry and connectivity files, and visualize the mesh in ParaView easily. But I don’t know how to attach my scalar data to the triangle points so I can visualize the mesh using different colormaps. Is this possible? How could I accomplish this?

Dennis

---

<div class="post-metadata">

### Author: ![Yoshino](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/bcef8e/32.png) [@Yoshino](https://discourse.paraview.org/u/Yoshino)
#### Post date: [February 2, 2020, 2:19am UTC](https://discourse.paraview.org/t/adding-scalar-data-to-triangle-mesh/3478/2 "2020-02-02T02:19:09Z")

</div>

Certainly it is possible. Since ur able to visualize the mesh in PV, u can definitely attach the Scalar Data to your mesh as **DataAttribute** (In this case: PointData). Then select colormap as that Scalar in **Display** panel.  
Just the same way u created the object file, I think.

---

<div class="post-metadata">

### Author: ![dennis](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/d/e56c9b/32.png) [@dennis](https://discourse.paraview.org/u/dennis)
#### Post date: [February 2, 2020, 2:30am UTC](https://discourse.paraview.org/t/adding-scalar-data-to-triangle-mesh/3478/3 "2020-02-02T02:30:58Z")

</div>

Hi Yoshino,

Thanks for your response. How would I go about adding it as an DataAttribute? Is that a filter that I should apply? Because I dont see one. Or I’m I supposed to write a python script?

Thanks,  
Dennis

---

<div class="post-metadata">

### Author: ![Yoshino](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/bcef8e/32.png) [@Yoshino](https://discourse.paraview.org/u/Yoshino)
#### Post date: [February 2, 2020, 7:59am UTC](https://discourse.paraview.org/t/adding-scalar-data-to-triangle-mesh/3478/4 "2020-02-02T07:59:14Z")

</div>

For me, I pre-processed my dataset and save as **.vtk** legacy format file([file-format.pdf](https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf)) with **DataAttribute** in it.  
U could read the PDF document first to have an overall view about attribute data.

---

<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: [February 3, 2020, 3:03am UTC](https://discourse.paraview.org/t/adding-scalar-data-to-triangle-mesh/3478/5 "2020-02-03T03:03:08Z")

</div>

@dennis : Welcome to the community.

Please precise the format of each of your files.

---

<div class="post-metadata">

### Author: ![dennis](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/d/e56c9b/32.png) [@dennis](https://discourse.paraview.org/u/dennis)
#### Post date: [February 4, 2020, 7:41pm UTC](https://discourse.paraview.org/t/adding-scalar-data-to-triangle-mesh/3478/6 "2020-02-04T19:41:21Z")

</div>

@mwestphal: Thanks for your willingness to help. I was able to associate the mesh points with my scalar data. My files were: geometry.txt (x,y,z comma separated floating point numbers), connectivity.txt (x,y, z comma separated integer values, each indexing to a specific point in the geometry file), and scalar data text file (floating point values associated with each point in the geometry). I wrote a c++ script that parsed the data and I saved it in .vtp format. I opened the file in Paraview and everything looked like it is supposed to.
