# How can I convert Vtk STL polydata into opencascade poly\_triangulation and vise versa ?

**URL:** https://discourse.vtk.org/t/how-can-i-convert-vtk-stl-polydata-into-opencascade-poly-triangulation-and-vise-versa/7568
**Category:** Support
**Created:** [January 5, 2022, 1:20pm UTC](https://discourse.vtk.org/t/how-can-i-convert-vtk-stl-polydata-into-opencascade-poly-triangulation-and-vise-versa/7568 "2022-01-05T13:20:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![osezer](https://discourse.vtk.org/user_avatar/discourse.vtk.org/osezer/32/4496_2.png) [@osezer](https://discourse.vtk.org/u/osezer)
#### Post date: [January 5, 2022, 1:20pm UTC](https://discourse.vtk.org/t/how-can-i-convert-vtk-stl-polydata-into-opencascade-poly-triangulation-and-vise-versa/7568/1 "2022-01-05T13:20:20Z")

</div>

Hello, I would like to convert opencascade’s poly\_triangulation(occt) into VTK polydata and visualize it, or otherway around as well. vtk polydata to poly\_triangulation (occt). I didn’t find any proper document or example so any help would be awesome.

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [January 5, 2022, 11:01pm UTC](https://discourse.vtk.org/t/how-can-i-convert-vtk-stl-polydata-into-opencascade-poly-triangulation-and-vise-versa/7568/2 "2022-01-05T23:01:42Z")

</div>

You can only go one way OpenCascade → VTK  
[https://dev.opencascade.org/doc/overview/html/occt\_user\_guides\_\_vis.html](https://dev.opencascade.org/doc/overview/html/occt_user_guides__vis.html)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [January 6, 2022, 9:21am UTC](https://discourse.vtk.org/t/how-can-i-convert-vtk-stl-polydata-into-opencascade-poly-triangulation-and-vise-versa/7568/3 "2022-01-06T09:21:04Z")

</div>

F3D also have a OpenCascade reader:

> <https://github.com/f3d-app/f3d/blob/master/src/vtkF3DOCCTReader.cxx>

---

<div class="post-metadata">

### Author: ![osezer](https://discourse.vtk.org/user_avatar/discourse.vtk.org/osezer/32/4496_2.png) [@osezer](https://discourse.vtk.org/u/osezer)
#### Post date: [January 6, 2022, 11:12am UTC](https://discourse.vtk.org/t/how-can-i-convert-vtk-stl-polydata-into-opencascade-poly-triangulation-and-vise-versa/7568/4 "2022-01-06T11:12:57Z")

</div>

I did a very similar way to read occt STL and convert into VTK PolyData and able to show in viewer which works fine. But since we can write PolyData into file, wouldn’t be possible read vertices and faces and write into Poly\_Trian(occt) and convert back to it ?

I was thinking that, we have " polyData-\>GetPolys();" and “polyData-\>GetVerts();” and they contain faces and vertices so maybe we can utilize that ?
