# Refinement of stl files

**URL:** <https://discourse.slicer.org/t/refinement-of-stl-files/243>\
**Category:** Support\
**Created:** [May 2, 2017, 1:12pm UTC](https://discourse.slicer.org/t/refinement-of-stl-files/243 "2017-05-02T13:12:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![virajbelekar](https://avatars.discourse-cdn.com/v4/letter/v/b782af/32.png) [@virajbelekar](https://discourse.slicer.org/u/virajbelekar)\
**Post date:** [May 2, 2017, 1:12pm UTC](https://discourse.slicer.org/t/refinement-of-stl-files/243/1 "2017-05-02T13:12:26Z")

</div>

Hello,

I saved a .stl file of the portal vein system from my CT scan. So basically a .stl file is a 2D surface mesh of the geometry. The thing is, this mesh which I have generated is very fine having very small elements. I do not want such a refined 2D file. Is there any way to control the refinement of the file?

Thanks and Regards  
Viraj

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [May 2, 2017, 1:44pm UTC](https://discourse.slicer.org/t/refinement-of-stl-files/243/2 "2017-05-02T13:44:48Z")

</div>

If you are using the “Model Maker” module, you can reduce the number of triangles during surface generation with the “Decimation” parameter.

---

<div class="post-metadata">

**Author:** ![arankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/arankin/32/155_2.png) [@arankin](https://discourse.slicer.org/u/arankin)\
**Post date:** [May 2, 2017, 2:03pm UTC](https://discourse.slicer.org/t/refinement-of-stl-files/243/3 "2017-05-02T14:03:03Z")

</div>

Optionally, you can post-process with MeshLab. They have a number of pre-made filters for polygon reduction.

Adam

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [May 2, 2017, 2:38pm UTC](https://discourse.slicer.org/t/refinement-of-stl-files/243/4 "2017-05-02T14:38:28Z")

</div>

See also the Surface Toolbox:

[https://www.slicer.org/wiki/Documentation/Nightly/Modules/SurfaceToolbox](https://www.slicer.org/wiki/Documentation/Nightly/Modules/SurfaceToolbox)

---

<div class="post-metadata">

**Author:** ![virajbelekar](https://avatars.discourse-cdn.com/v4/letter/v/b782af/32.png) [@virajbelekar](https://discourse.slicer.org/u/virajbelekar)\
**Post date:** [May 2, 2017, 4:13pm UTC](https://discourse.slicer.org/t/refinement-of-stl-files/243/5 "2017-05-02T16:13:02Z")

</div>

I am using segment editor followed by the segmentation module!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 2, 2017, 4:18pm UTC](https://discourse.slicer.org/t/refinement-of-stl-files/243/6 "2017-05-02T16:18:48Z")

</div>

In Segmentations module, you can reduce number of triangles in the surface mesh by the following steps:

- click `Update` button in the `Closed surface` row in `Representations` section
- click `Binary labelmap -> Closed surface` path
- double-click on the value in the `Decimation factor` line, and enter a value of 0.8 (value between 0.0-1.0; the larger the value, the less triangles you’ll have in the mesh)
- click `Convert`

You can convert from Segmentation to Model node by using the `Export/Import segments` section and then use Surface toolbox module to further smooth or decimate the mesh.
