# Conversion of .vtk polygon data file to .stl file format

**URL:** https://discourse.vtk.org/t/conversion-of-vtk-polygon-data-file-to-stl-file-format/7952
**Category:** Support
**Tags:** file-formats
**Created:** [March 1, 2022, 1:05pm UTC](https://discourse.vtk.org/t/conversion-of-vtk-polygon-data-file-to-stl-file-format/7952 "2022-03-01T13:05:55Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![KALEEMULLAHJANKHAN](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/bc8723/32.png) [@KALEEMULLAHJANKHAN](https://discourse.vtk.org/u/KALEEMULLAHJANKHAN)
#### Post date: [March 1, 2022, 1:05pm UTC](https://discourse.vtk.org/t/conversion-of-vtk-polygon-data-file-to-stl-file-format/7952/1 "2022-03-01T13:05:55Z")

</div>

Hello Team,

I am a beginner and blocked in my research. I kindly need help of anyone here.

I have a .vtk file format (having Polydata as “26.3162314062377 2.03114038667601 7.867” and Polygon data as “34 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33”) and I want to convert it to .stl file format. Kindly share the script for its conversion or any other way to overcome this issue.

Thanks and kind regards

---

<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: [March 1, 2022, 1:12pm UTC](https://discourse.vtk.org/t/conversion-of-vtk-polygon-data-file-to-stl-file-format/7952/2 "2022-03-01T13:12:37Z")

</div>

Open in ParaView and save as .stl

[https://www.paraview.org/download/](https://www.paraview.org/download/)

---

<div class="post-metadata">

### Author: ![KALEEMULLAHJANKHAN](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/bc8723/32.png) [@KALEEMULLAHJANKHAN](https://discourse.vtk.org/u/KALEEMULLAHJANKHAN)
#### Post date: [March 1, 2022, 1:29pm UTC](https://discourse.vtk.org/t/conversion-of-vtk-polygon-data-file-to-stl-file-format/7952/3 "2022-03-01T13:29:45Z")

</div>

Thanks for the response. I already have done it but I could not visualize that .stl file

---

<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: [March 1, 2022, 1:32pm UTC](https://discourse.vtk.org/t/conversion-of-vtk-polygon-data-file-to-stl-file-format/7952/4 "2022-03-01T13:32:57Z")

</div>

please share your .vtk file

---

<div class="post-metadata">

### Author: ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)
#### Post date: [March 1, 2022, 1:33pm UTC](https://discourse.vtk.org/t/conversion-of-vtk-polygon-data-file-to-stl-file-format/7952/5 "2022-03-01T13:33:56Z")

</div>

I believe stl presumes triangles, do the polygons need triangulation ?

---

<div class="post-metadata">

### Author: ![KALEEMULLAHJANKHAN](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/bc8723/32.png) [@KALEEMULLAHJANKHAN](https://discourse.vtk.org/u/KALEEMULLAHJANKHAN)
#### Post date: [March 1, 2022, 1:37pm UTC](https://discourse.vtk.org/t/conversion-of-vtk-polygon-data-file-to-stl-file-format/7952/6 "2022-03-01T13:37:05Z")

</div>

I now successfully visualized the .stl file. actually I need to convert that .stl file to .off file format to mesh it with CGAL, but this .stl file could not read by meshio for conversion

---

<div class="post-metadata">

### Author: ![KALEEMULLAHJANKHAN](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/bc8723/32.png) [@KALEEMULLAHJANKHAN](https://discourse.vtk.org/u/KALEEMULLAHJANKHAN)
#### Post date: [March 1, 2022, 1:40pm UTC](https://discourse.vtk.org/t/conversion-of-vtk-polygon-data-file-to-stl-file-format/7952/7 "2022-03-01T13:40:35Z")

</div>

[dfn.vtk](https://discourse.vtk.org/uploads/short-url/kOmH3ioOppR5cDzKDiAZLg8TEj4.vtk) (62.0 KB)

This is my .vtk file sir

---

<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: [March 2, 2022, 8:34am UTC](https://discourse.vtk.org/t/conversion-of-vtk-polygon-data-file-to-stl-file-format/7952/8 "2022-03-02T08:34:59Z")

</div>

ParaView save it in stl perfectly.  
[testd.stl](https://discourse.vtk.org/uploads/short-url/vFxFZfq2lP7fPPrCoSihhdZqWz2.stl) (66.9 KB)

---

<div class="post-metadata">

### Author: ![KALEEMULLAHJANKHAN](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/bc8723/32.png) [@KALEEMULLAHJANKHAN](https://discourse.vtk.org/u/KALEEMULLAHJANKHAN)
#### Post date: [March 3, 2022, 4:30am UTC](https://discourse.vtk.org/t/conversion-of-vtk-polygon-data-file-to-stl-file-format/7952/9 "2022-03-03T04:30:16Z")

</div>

Yes sir, Thanks. I have visualized it. I needed .stl to further process it to .off format but the main problem now is that I cannot convert this .stl to triangulated .off format.

---

<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: [March 3, 2022, 7:54am UTC](https://discourse.vtk.org/t/conversion-of-vtk-polygon-data-file-to-stl-file-format/7952/10 "2022-03-03T07:54:41Z")

</div>

> [@KALEEMULLAHJANKHAN](#):
>
> this .stl to triangulated .off format.

Afaik, VTK can not write to .off format. Cant help you there.

---

<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: [June 13, 2024, 11:09am UTC](https://discourse.vtk.org/t/conversion-of-vtk-polygon-data-file-to-stl-file-format/7952/11 "2024-06-13T11:09:32Z")

</div>

A post was split to a new topic: [modify stl with clip](https://discourse.vtk.org/t/modify-stl-with-clip/14037)
