# How to reduce the size of the ASCII format stl files, made of \*.vtp files in Paraview?

**URL:** https://discourse.paraview.org/t/how-to-reduce-the-size-of-the-ascii-format-stl-files-made-of-vtp-files-in-paraview/6821
**Category:** ParaView Support
**Created:** [March 29, 2021, 2:34pm UTC](https://discourse.paraview.org/t/how-to-reduce-the-size-of-the-ascii-format-stl-files-made-of-vtp-files-in-paraview/6821 "2021-03-29T14:34:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![aliv](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/5e9695/32.png) [@aliv](https://discourse.paraview.org/u/aliv)
#### Post date: [March 29, 2021, 2:34pm UTC](https://discourse.paraview.org/t/how-to-reduce-the-size-of-the-ascii-format-stl-files-made-of-vtp-files-in-paraview/6821/1 "2021-03-29T14:34:22Z")

</div>

Hi All,

I want to reduce the number of figures when I Save Data to \*.stl in paraview/5.15.1  
However, there is no option to define the accuracy and teh default values are like this  
solid Visualization Toolkit generated SLA File  
facet normal -0.013389295051727881 0.0027716056821197022 -0.99990651812054931  
outer loop  
vertex 67.768898010253906 -95.073287963867188 -0.040442027151584625  
vertex 67.221076965332031 -95.636665344238281 -0.034668009728193283  
vertex 66.669998168945312 -95.067840576171875 -0.025712057948112488  
endloop  
endfacet  
facet normal -0.0055525086269436448 0.010364286584985546 -0.99993087321650986  
which increase teh output file size in an inefficient way.  
my ideal one would be something with 3 figures, like what follows  
facet normal -0.0100.000 -0.999  
outer loop  
vertex 67.769 -96.235 -0.040  
vertex 67.221 -95.636 -0.034  
vertex 67.768 -95.073 -0.040  
endloop  
endfacet

your help would be highly appreciated

Thanks in advance,  
Ali

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [March 29, 2021, 3:16pm UTC](https://discourse.paraview.org/t/how-to-reduce-the-size-of-the-ascii-format-stl-files-made-of-vtp-files-in-paraview/6821/2 "2021-03-29T15:16:02Z")

</div>

You should be able to write a Python script or help post-process your STL files by reducing the encoding of the float as ascii…

Such script should be fairly easy to write.

---

<div class="post-metadata">

### Author: ![dave3d](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dave3d/32/2549_2.png) [@dave3d](https://discourse.paraview.org/u/dave3d)
#### Post date: [March 29, 2021, 4:09pm UTC](https://discourse.paraview.org/t/how-to-reduce-the-size-of-the-ascii-format-stl-files-made-of-vtp-files-in-paraview/6821/3 "2021-03-29T16:09:27Z")

</div>

How about converting it to a binary STL file? Then your really long string numbers become 4 byte floats?

To convert to binary STL, I’d do it in python using PyMeshLab. Just the the binary flag in the save\_current\_mesh method to write a binary STL.  
[https://pymeshlab.readthedocs.io/en/latest/](https://pymeshlab.readthedocs.io/en/latest/)
