Generating G-code
G-code is generated by your slicer. The slicer is a program that takes the file of your 3D model and slices it up into many layers. A model created for 3D printing is constructed by a contiguous surface of triangles. This forms the entire skin of your model, without any gaps or overlapping.
The following image is a model created with TopMod.
![Generating G-code](https://static.packt-cdn.com/products/9781782169888/graphics/graphics/9888OS_AppendixB_01.jpg)
When the slicer program slices the model, it generates a perimeter of each Z layer. A sliced layer is illustrated in the following image:
![Generating G-code](https://static.packt-cdn.com/products/9781782169888/graphics/graphics/9888OS_AppendixB_02.jpg)
In order to create a perimeter for the slicer, some or all of the triangles that intersect the XY plane for the Z height may be used. In the following image, we can see the places where some triangles may be eliminated due to size or redundancy:
![Generating G-code](https://static.packt-cdn.com/products/9781782169888/graphics/graphics/9888OS_AppendixB_03.jpg)
This is one reason why different slicers may produce different results. As shown in the following image, we can see a difference in the 39th Z height layer of this model:
![Generating G-code](https://static.packt-cdn.com/products/9781782169888/graphics/graphics/9888OS_AppendixB_04.jpg)
The narrow undercut of the perimeter is sharper in the Slic3r profile as opposed to the...