<p>I am also trying to write my own slicer and so I would just like to offer some additional information. </p>

<p>What you will find is that .stl files just store triangles and don't validate that the triangles assemble to create a printable model so a lot if not most .stl files are going to have data that isn't exactly what you want it to be. So you will want to have additional steps before you get to slicing, to fix up the data you get from the stl file. </p>

<p>A lot of stl models are designed for 3d graphics where intersecting other triangles and not being manifold isn't an issue. So you will probably want to write some code to test your models before trying to slice them. </p>

<p>For example if you just sliced the layers of the <a href="https://www.thingiverse.com/thing:821" rel="nofollow noreferrer">Utah Teapot</a>
 <a href="https://i.sstatic.net/d7qm0.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/d7qm0.gif" alt="Teapot"></a> and don't repair the model for 3D printing first you will get two different types of errors. The handle of the teapot does not actually attach to the teapot and is a separate model. And the spout of the teapot is a separate model that intersects the teapot. Both the handle and spout are also open at the ends and not water tight.</p>

CC BY-SA 3.0
2017-12-25T03:42:40.620Z
Surely the spout not being watertight is correct for one of the ends and should not be repaired.
Ross
CC BY-SA 3.0
2018-01-02T05:20:10.287Z
As a 3D object to display on a computer the spout not being closed is not an issue and will look how you would expect a teapot to look. But for constructing a physical model you need information about the thickness of the walls of the spout. This information about the thickness should be given by including information about the inside walls of the shape, and the lip of the spout.
user802599
CC BY-SA 3.0
2017-12-18T04:08:57.500Z
2017-12-19T23:14:23.823Z
2017-12-19T23:14:23.823Z
user802599
<p>You can't prove that because it isn't true. An STL file is just a collection of triangles. There is no guarantee that an intersection with the slicing plane will consist of closed-loop polygons. To be suitable for 3D printing an STL file should represent one or more closed, disjoint polyhedra (which would yield closed-loop polygons) but this is not always the case. Many slicers have heuristics to try and "fix" bad STL files on a best-effort basis. Especially considering the possibility of rounding errors, it is important to at least detect polygons that are almost (but not quite) closed and connect their endpoints together.</p>

CC BY-SA 3.0
2017-12-17T11:43:43.570Z
2017-12-17T11:43:43.570Z
Tom van der Zanden
<p>I am writing my own slicer and wonder if there is a mathematical proof that proves that the intersection of the slicing plane with the STL file will only produce closed-loop polygons for every given slicing plane?</p>

<p>Thanks!</p>

<software>
Proof that Slicing Plane/STL intersection will only produce Closed-Loop Polygons?
Thetravellingfool
# Proof that Slicing Plane/STL intersection will only produce Closed-Loop Polygons?

(Asked by: username_0 on 2017-12-17)

I am writing my own slicer and wonder if there is a mathematical proof that proves that the intersection of the slicing plane with the STL file will only produce closed-loop polygons for every given slicing plane?

Thanks!

**Tags:** software


---

## 2 answers

### Answer by username_3 on 2017-12-17. Score: 5 | Accepted answer

You can't prove that because it isn't true. An STL file is just a collection of triangles. There is no guarantee that an intersection with the slicing plane will consist of closed-loop polygons. To be suitable for 3D printing an STL file should represent one or more closed, disjoint polyhedra (which would yield closed-loop polygons) but this is not always the case. Many slicers have heuristics to try and "fix" bad STL files on a best-effort basis. Especially considering the possibility of rounding errors, it is important to at least detect polygons that are almost (but not quite) closed and connect their endpoints together.


---

### Answer by username_1 on 2017-12-18. Score: 2

I am also trying to write my own slicer and so I would just like to offer some additional information.

What you will find is that .stl files just store triangles and don't validate that the triangles assemble to create a printable model so a lot if not most .stl files are going to have data that isn't exactly what you want it to be. So you will want to have additional steps before you get to slicing, to fix up the data you get from the stl file.

A lot of stl models are designed for 3d graphics where intersecting other triangles and not being manifold isn't an issue. So you will probably want to write some code to test your models before trying to slice them.

For example if you just sliced the layers of the [Utah Teapot](https://www.thingiverse.com/thing:821)
[![Teapot](https://i.sstatic.net/d7qm0.gif)](https://i.sstatic.net/d7qm0.gif) and don't repair the model for 3D printing first you will get two different types of errors. The handle of the teapot does not actually attach to the teapot and is a separate model. And the spout of the teapot is a separate model that intersects the teapot. Both the handle and spout are also open at the ends and not water tight.

> **Comments:**
> **username_2**: Surely the spout not being watertight is correct for one of the ends and should not be repaired.  
> **username_1**: As a 3D object to display on a computer the spout not being closed is not an issue and will look how you would expect a teapot to look. But for constructing a physical model you need information about the thickness of the walls of the spout. This information about the thickness should be given by including information about the inside walls of the shape, and the lip of the spout.  

---

