I was wondering how slicers work, how their code runs to generate a G-Code file. How is an STL file interpreted through a slicer.

How does the math work for generating supports, build plate adhesion?

I couldn't find any information, so can anyone help with this technical question


  • $\begingroup$ This doesn't seem to have anything to do with the firmware (marlin) or a specific slicer (Ultimker Cura) but with slicing in general. $\endgroup$
    – Trish
    Commented Jul 19, 2020 at 12:52

1 Answer 1


Slicing in General

An STL is a set of triangle surfaces. A Watertight STL - for slicing purposes - has surfaces that always create closed outlines if cut parallel to the XY plane.

A Slicer does exactly that: it creates plane-cuts at the indicated Z-heights, takes the plane-cut's outline(s), and decides a direction and order in which to follow the generated path. Then it uses this outline to generate the infill pattern, for example, as explained here.

The more paths there are and the smaller the triangles that are cut up, the more complex the solution process becomes and the longer it takes.

Support calculation

A slicer usually identifies areas that need support by calculating at which angle an STL Surface cuts a given plane cut. Under standard settings, this would be about less than 60° to the XY-plane with the normal of the surface having a negative Z-component - which means that a needle poking out of that surface points towards the bed.

The most simple form of support generation simply generates a grid pattern between such areas and the bed or next surface below. Tree support on the other tries to generate a support structure that bends around the object without intersecting and only relying on the support of itself.

Build Plate adhesion

A skirt and brim are just taking the outline of the build-plate intersection and surround that with outlines.

A Raft is generated like the simple support case, but taking the whole base of the object, adding a little edge around it and then generating the support grid there.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .