# VTU extracting polygonal geometry information in c++ - example code ?

**URL:** https://discourse.vtk.org/t/vtu-extracting-polygonal-geometry-information-in-c-example-code/15117
**Category:** Support
**Created:** [January 6, 2025, 5:55pm UTC](https://discourse.vtk.org/t/vtu-extracting-polygonal-geometry-information-in-c-example-code/15117 "2025-01-06T17:55:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Nicholas\_Yue](https://discourse.vtk.org/user_avatar/discourse.vtk.org/nicholas_yue/32/3751_2.png) [@Nicholas\_Yue](https://discourse.vtk.org/u/Nicholas_Yue)
#### Post date: [January 6, 2025, 5:55pm UTC](https://discourse.vtk.org/t/vtu-extracting-polygonal-geometry-information-in-c-example-code/15117/1 "2025-01-06T17:55:15Z")

</div>

I am looking for VTK C++ code which illustrate the extraction of polygonal mesh information from VTU files.

My current aim is to write some C++ code (for self learning) to read a \*.vtu file and write out a \*.obj file.

Eventually, I plan to write out the polygonal mesh information from \*.vtu file to a custom file format hence I am interested in the details/internals for VTU

Thank you.

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [January 6, 2025, 6:23pm UTC](https://discourse.vtk.org/t/vtu-extracting-polygonal-geometry-information-in-c-example-code/15117/2 "2025-01-06T18:23:29Z")

</div>

Hello @Nicholas_Yue,

The `vtkDataSetSurfaceFilter` can help you convert an unstructured grid to a polydata. See [VTK: vtkDataSetSurfaceFilter Class Reference](https://vtk.org/doc/nightly/html/classvtkDataSetSurfaceFilter.html#details)

---

<div class="post-metadata">

### Author: ![Nicholas\_Yue](https://discourse.vtk.org/user_avatar/discourse.vtk.org/nicholas_yue/32/3751_2.png) [@Nicholas\_Yue](https://discourse.vtk.org/u/Nicholas_Yue)
#### Post date: [January 6, 2025, 6:24pm UTC](https://discourse.vtk.org/t/vtu-extracting-polygonal-geometry-information-in-c-example-code/15117/3 "2025-01-06T18:24:53Z")

</div>

Thank you @jaswantp this looks promising, I will do some R&D with the class.
