← Back to Projects

Mesh Slicer

Created
Mesh Slicer

📖 Project Overview

I work extensively with 3D printing in my day job, and it is always something I have been interested in.

One thing that people may not realize, though, is that 3D printing is a bit of a misnomer. Yes, the output of it is a three-dimensional object, but the process involved can be very similar to the inkjet printer you may have sitting at your desk.

What happens is that the 3D model is first 'sliced' by a horizontal plane in very small increments. What you end up with when you do this is a collection of two-dimensional polygons, which you can visualize here.

The slicing involves some pretty complex algorithms that find the triangles in the model and determine the intersections with the slicing plane, resulting in a line segment. These segments can then be strung together to form closed looped polygons.

From there, you determine whether the polygon is filled or not, and the printer prints out small two-dimensional layers on top of one another until the 3D part is formed.

Now this is a pretty simple generalization of the process, and there are many different types of 3D printers. This project was a fun exercise in algorithms and object-oriented coding, and it works pretty well.

Source code can be found here.