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

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!

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.

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 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.

• Surely the spout not being watertight is correct for one of the ends and should not be repaired.
– Ross
Dec 25, 2017 at 3:42
• 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. Jan 2, 2018 at 5:20