# How to write STL from x y z co-ordinates ?

**URL:** https://discourse.vtk.org/t/how-to-write-stl-from-x-y-z-co-ordinates/711
**Category:** Development
**Tags:** file-formats
**Created:** [April 9, 2019, 5:07am UTC](https://discourse.vtk.org/t/how-to-write-stl-from-x-y-z-co-ordinates/711 "2019-04-09T05:07:32Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![selvakarna](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/71c47a/32.png) [@selvakarna](https://discourse.vtk.org/u/selvakarna)
#### Post date: [April 9, 2019, 5:07am UTC](https://discourse.vtk.org/t/how-to-write-stl-from-x-y-z-co-ordinates/711/1 "2019-04-09T05:07:32Z")

</div>

How to write STL from x y z co-ordinates? x y z are extracted from 3D volume images, so my goal is x y z convert to STL?

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [April 9, 2019, 12:47pm UTC](https://discourse.vtk.org/t/how-to-write-stl-from-x-y-z-co-ordinates/711/2 "2019-04-09T12:47:45Z")

</div>

STL is a surface geometry format, so you will need to extract a surface from the 3D volume images first.

Relevant examples:

**Extracting an isocontour from a structured points** (it will work with a 3D image volume as well)  
[https://lorensen.github.io/VTKExamples/site/Cxx/VisualizationAlgorithms/IronIsoSurface/](https://lorensen.github.io/VTKExamples/site/Cxx/VisualizationAlgorithms/IronIsoSurface/)

**Saving an STL**  
[https://lorensen.github.io/VTKExamples/site/Python/IO/WriteSTL/](https://lorensen.github.io/VTKExamples/site/Python/IO/WriteSTL/)

---

<div class="post-metadata">

### Author: ![selvakarna](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/71c47a/32.png) [@selvakarna](https://discourse.vtk.org/u/selvakarna)
#### Post date: [April 9, 2019, 2:22pm UTC](https://discourse.vtk.org/t/how-to-write-stl-from-x-y-z-co-ordinates/711/3 "2019-04-09T14:22:57Z")

</div>

Thank you sir, i will check and update you.

---

<div class="post-metadata">

### Author: ![selvakarna](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/71c47a/32.png) [@selvakarna](https://discourse.vtk.org/u/selvakarna)
#### Post date: [April 9, 2019, 2:27pm UTC](https://discourse.vtk.org/t/how-to-write-stl-from-x-y-z-co-ordinates/711/4 "2019-04-09T14:27:15Z")

</div>

Sir i have generated Triangulation from X Y Z , but i cont generate 3D STL shape? can you share sample code?
