> For the complete documentation index, see [llms.txt](https://monasheng.gitbook.io/zerotohero/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://monasheng.gitbook.io/zerotohero/3d-printing-zero-to-hero/core-skills/slicing.md).

# Slicing

{% embed url="<https://www.youtube.com/watch?v=5dOCRJiTnY4>" %}

{% hint style="info" %}
:man\_mage: **Important**: *Slicing* is the process of converting a `.stl` file into printable machine instructions, encoding relevant material properties, layer/infill settings, and print orientation in the process.

You perform slicing using a *Slicer Program*. In this module, for maximum compatibility with the printers we provide students, we use the *PrusaSlicer* program.
{% endhint %}

## `.gcode`

`.gcode` files are simply a list of instructions intended for readibility by CNC machines.&#x20;

In a sense, `.gcode` is a programming language, like C or Python, though people rarely write it the same way.&#x20;

Nowadays, `.gcode` is almost always generated by a computer program - either CAD/CAM software in the case of CNC Mills/Lathes/Wire Cutters, or so-called *slicer* programs for 3D printers.

<figure><img src="/files/4PHeRn2TcNakxbyWCfuL" alt=""><figcaption></figcaption></figure>

Encoded 3D printer `.gcode` files will typically include machine instructions for:

* preheating the bed,
* setting nozzle temperatures,
* starting & stopping filament flow, and,
* positioning of the print head.

<figure><img src="/files/id4eePOnS9VqFFCJidpi" alt=""><figcaption></figcaption></figure>

## Loading, Translation & Orientation

When loading your `.stl` file into a slicer program, you can ordinary set it's orientation and position on a virtual print bed.

In doing so, you might want to consider how you could place multiple parts in one print, or whether certain orientations of your part are more sensible for this manufacturing technique (i.e. if that part is prismatic, printing along the constant cross-section would be sensible).

<figure><img src="/files/UnqkMhzFvCkYk1vpReSN" alt=""><figcaption></figcaption></figure>

Most slicer programs also have a 'snap to side' feature - where you can select a flat face and place this parallel to and on the print bed.

<figure><img src="/files/sjuZptgDbbTaBOuyPark" alt=""><figcaption></figcaption></figure>

## Parameter Selection

3D Printing slicers have a *wide* range of adjustable print parameters. We will touch on these more later, when we get to [Advanced Slicing](/zerotohero/3d-printing-zero-to-hero/advanced-skills/advanced-slicing.md). For now, consider only the following:

### Presets

Most slicers, including *PrusaSlicer*, have a range of setting presets that you can select from. These normally encode a beginner-friendly set of parameters that are likely to result in a good print.

<figure><img src="/files/rzJ3jFnzcEXogffaJrNX" alt=""><figcaption></figcaption></figure>

#### Resolution

*PrusaSlicer* has a range of settings that correspond to trading-off vertical resolution (layer height) with print speed, called e.g. *Detail, Fast, Draft, etc.* For most applications, where surface finish is not essential, you can usually choose the coarsest/fastest of these.

#### Material

Via a drop-down, most slicers, including *PrusaSlicer*, will allow you to select the material/filament that you are printing. This setting will inform how the printer preheats the bed, and how hot the extruder runs.

{% hint style="danger" %}
:zap: **Warning:** Depending on your slicing software, it's intended use, and the printer you are *actually* using, it may be possible to slice for materials (i.e. set temperatures) that your printer is unable to handle.

Mercifully, *PrusaSlicer* allows you to select your 3D printer before slicing, and only shows you materials that your printer can handle.
{% endhint %}

### Infill

3D prints are normally non-structural, and thus are rarelly printed fully-solid. Instead, they are usually printed as hollow shells supported by an inner web known as an *infill.* This infill can provide near-solid strength and stiffness to your part, with significantly less filament usage and print time.&#x20;

Slicer programs ordinarily allow you to change the pattern and density of an infill, and we will touch on this more in [Advanced Slicing](/zerotohero/3d-printing-zero-to-hero/advanced-skills/advanced-slicing.md). For now, know that $$20%$$ infill is normally more than enough to reach near-full-density stiffness and strength.

<figure><img src="/files/U8zRR1ENWcJr0Vz3CG1b" alt=""><figcaption><p>Various 3D printing infills. Note that while it doesn't sound like much, 20-30% infill can lead to a very strong and stiff part! From: <a href="https://filament2print.com/gb/blog/71_importance-infill-3d-printing.html">https://filament2print.com/gb/blog/71_importance-infill-3d-printing.html</a></p></figcaption></figure>

### Supports

3D printers cannot deposit molten plastic into thin air - lest it droop and fall onto the build plate. Thus, if your parts have any overhanging features, a slicer program will typically build-up so-called *support material* underneath to *support* the part during printing.

Supports are normally intentionally weaker than the finished part, to make it easy to remove them once printed. They are auto generated, and might be hollow or meshed.

Slicer programs normally allow you to control where/how much support it used. For beginners, we recommend asking for *supports everywhere -*  which will add them wherever needed to ensure that your part prints well.

<figure><img src="/files/URWwj4pzzsyeZrbb8zQN" alt=""><figcaption></figcaption></figure>

## Preview View

Upon slicing, most programs will show a preview of the finished, printed part, complete with layer lines and the ability to preview the print head motion both in- and out-of-plane. This can be useful for collision-checking, as well as verifying the provision of any support material.

<figure><img src="/files/Yi1gFPSJIWHz9oJ4GmbE" alt=""><figcaption></figcaption></figure>

## Useful PrusaSlicer Hotkeys

<table><thead><tr><th width="141">Hotkey</th><th>Function</th></tr></thead><tbody><tr><td><code>Ctrl</code> + <code>R</code></td><td>Slice / Reslice</td></tr><tr><td><code>Ctrl</code> + <code>G</code></td><td>Export Gcode</td></tr><tr><td><code>+</code></td><td>Duplicate selected object</td></tr><tr><td><code>F</code></td><td>Place on face tool</td></tr><tr><td><code>M</code></td><td>Move tool</td></tr><tr><td><code>L</code></td><td>Show / hide legend (that top left box)</td></tr></tbody></table>
