How does 3D printing work? From a 3D file to a part, layer by layer

By Sina Esfahani, OmniTechs · Published 30 November 2026

3D printing works layer by layer: a 3D printer builds an object from thin horizontal layers. On the common home and workshop machine, the filament printer (FDM), it works like this: a 3D file describes the shape, a program on your computer called a slicer cuts that shape into layers and plans the paths, and the printer melts a plastic strand and lays those paths down, one layer on top of the next. A part 24 mm tall printed in 0.2 mm layers is 120 layers.

Every step in that chain leaves a trace. Where a part is weak, how accurate its dimensions are and how its surface looks depend mostly on the slicer settings and on how the layers bond to each other.

To see it for yourself, open a free slicer, load a model and drag the preview up one layer at a time. You are looking at exactly what the printer will do.

The chain in five steps:

  1. Model. An STL or 3MF file describes only the surface of the shape, as a mesh of triangles.

  2. Slicer. It cuts the shape into layers, usually 0.2 mm, and fills each layer with walls, infill and, where needed, supports.

  3. G-code. The slicer writes everything out as lines of coordinates, temperatures and how much filament to push during each move.

  4. Extrusion. The print head melts 1.75 mm filament and pushes it through a nozzle, usually 0.4 mm, as a line about 0.45 mm wide.

  5. Layers. Each new hot line fuses with the cooled layer below. That boundary between layers is usually the weakest direction of the part.

Step 1: the model describes only the shape

Everything starts with a 3D model, either drawn in a CAD program or downloaded. For printing it usually becomes an STL or 3MF file.

An STL describes only the outer surface of the object, as triangles with three corner points each. The format has no standard support for colour or texture (Library of Congress). A 3MF also defines a unit of scale and can carry materials, colour and print settings (3MF Consortium).

Two things from this step show up in your print. A round hole or a dome is made of flat triangles. If they are coarse, the printer faithfully prints a polygon; exporting STEP to STL with smooth curves shows how to avoid that. And a model drawn in a different unit can arrive in the slicer far too small or too large. Always check the dimensions after loading. Which format keeps what is covered in 3D printing file formats compared.

Step 2: the slicer turns the shape into paths

The slicer is the program that turns a shape into a print job. It cuts the model into horizontal layers and works out, layer by layer, where the print head must travel. Well-known slicers are Bambu Studio, PrusaSlicer, OrcaSlicer and Cura; which one suits your printer is covered in slicers compared.

In each layer the slicer creates three kinds of path:

  • Walls (perimeters): the outline. According to Prusa, the strength of a model is mostly set by the number of walls, not the infill. Prusa's own profiles use at least two.

  • Infill: a pattern inside that mainly supports the top layers. Prusa says 10 to 15% suits most models and more than 30% is rarely needed.

  • Top and bottom layers: the solid skin. Prusa gives three top layers at 0.3 mm layer height and nine at 0.1 mm, so the skin stays about the same thickness.

If part of the model starts in mid-air, the slicer adds supports, because every layer has to rest on something. Small blemishes can remain where supports started (Prusa).

This is also where you choose the layer height. For a 0.4 mm nozzle, Bambu Lab calls 0.08 to 0.28 mm a reasonable range; Prusa keeps the layer height below 80% of the nozzle diameter, so below 0.32 mm. Thinner layers give finer steps on sloped surfaces and take longer. How to choose is in 3D printing layer height.

This Teaching Tech video starts at the file formats, STL and G-code, then covers what a slicer is, layer height, extrusion width, walls, infill and supports.

Beginners guide to 3D printer slicers (Teaching Tech)

Step 3: G-code is the list the printer works through

The slicer saves the result as G-code: thousands of lines that the printer carries out one by one. A line can look like this (an example): G1 X90.6 Y13.8 E0.52 F12000.

  • G1 is a straight move; X, Y and Z are the end point in millimetres.

  • E is the extruder axis: how much filament is pushed into the print head during that move.

  • F is the speed in millimetres per minute; 12000 is 200 mm/s.

There are temperature commands too. In Marlin firmware, M104 sets the nozzle temperature and carries on straight away; M109 waits until the temperature is reached (Marlin).

You do not need to read G-code to print. It does help to know that the printer knows nothing about your model: it only follows these lines. The commands people actually edit are in G-code commands you will edit.

Step 4: extrusion, melting and laying down

In the print head, the extruder pushes the filament into the hotend. There it melts and leaves the nozzle as a thin line. That line is roughly as wide as the opening; Bambu Lab's example uses 0.45 mm for a 0.4 mm nozzle.

How much plastic has to flow each second is the volumetric speed: layer height times line width times speed. Bambu Lab's example is 0.2 × 0.45 × 200 mm/s = 18 mm³/s. Every hotend can only melt so much. For Bambu PLA Basic on a Bambu Lab H2S the limit is 25 mm³/s. If a setting asks for more, the slicer lowers the speed. Push more plastic than the hotend can melt and you get under-extrusion, weak layer bonding or surface defects (Bambu Lab).

For dimensional accuracy, what matters here is that the printer lays down exactly as much plastic as the slicer expects. If it does not, walls come out too thick or too thin and holes do not fit. How to measure that is in calibrate dimensional accuracy.

Step 5: layers, and why print orientation matters

The first layer is pressed against the heated bed; in Bambu Studio's default profiles it is half the nozzle diameter, so 0.2 mm for a 0.4 mm nozzle. After that, each layer goes on top of the last. The hot new line partly remelts the cooled line below, and polymer molecules diffuse across the boundary. How strong that bond becomes depends on the temperature difference, the material and the shape of the line. As the plastic cools it contracts, which leaves stress in the part (NIST).

That gives three consequences:

  • Strength. A printed part is not equally strong in every direction. In Polymaker's PolyLite PLA datasheet, test bars reach 52.3 MPa tensile strength along the layers and 40.5 MPa across them, about 23% less. Those bars were printed at 100% infill. So orient a part so that the largest pulling load runs along the lines; how strong are 3D printed parts works through it.

  • Dimensional accuracy. In height, everything is made of whole layers. A 2 mm cube with a 0.2 mm first layer and 0.24 mm layers after it comes out 1.88 mm tall, unless the slicer adjusts the last layers (Bambu Lab). The first layer is squashed and can come out wider, known as elephant's foot; Prusa suggests about 0.2 mm of compensation for a 0.4 mm nozzle. See elephant's foot and, for fits, 3D printing tolerances and clearance.

  • Finish. Layer lines stay visible. On a shallow slope they become steps, and a top surface over too little infill can sag. Sanding, ironing or a different orientation each solve something different; choose a 3D print finish helps you pick.

Where to adjust for strength, accuracy and finish

What you want to improve and where in the chain

First step for each goal, drawn from the sources in the sections above (Prusa, Bambu Lab, NIST, Polymaker).
You wantWhere in the chainFirst step
A stronger partSlicer and layersMore walls first, then orientation; infill after that
Better fit of holes and pinsExtrusion and slicerPrint a test piece with the critical dimension and measure it
An exact heightSlicerDivide the height by the layer height; if it does not divide, change the layer height or the model
Smoother sloped surfacesSlicerThinner layers, or turn the surface to face differently on the bed
Fewer support marksModel and slicerTurn the model so less of it hangs in mid-air
A shorter printSlicer and extrusionThicker layers up to your hotend's volumetric limit; less infill

The trade-off between the visible face, supports and load is covered in choose 3D print orientation.

Worked example: from file to print time and layer count

A hypothetical example to run through the chain, not a measured print. You have a holder of 40 × 30 × 24 mm (24 mm tall) in PLA. You slice with a 0.4 mm nozzle, 0.45 mm line width, a 0.2 mm first layer and 0.2 mm layers. Suppose the slicer reports 18 g of filament. Replace the 18 g and the dimensions with the figures for your own model.

  1. Layer count. 24 mm ÷ 0.2 mm = 120 layers.

  2. Volume of plastic. PLA has a density of 1.24 g/cm³ (Bambu Lab PLA Basic). 18 g ÷ 1.24 = 14.5 cm³, or 14,516 mm³.

  3. Length of filament. 1.75 mm filament has a cross-section of 3.1416 × 0.875 × 0.875 = 2.405 mm². 14,516 ÷ 2.405 = 6,035 mm: about 6 metres of filament.

  4. Length of all the lines. One line is 0.45 × 0.2 = 0.09 mm² in cross-section. 14,516 ÷ 0.09 = 161,289 mm: about 161 metres of line, 1.3 metres per layer on average.

  5. Pure extrusion time. If every line ran at 200 mm/s, the volumetric speed would be 18 mm³/s. 14,516 ÷ 18 = 806 seconds: just over 13 minutes.

  6. Floor. On an H2S with PLA Basic the limit is 25 mm³/s, and the slicer will not let the flow exceed it. 14,516 ÷ 25 = 581 seconds. On that printer, this part needs at least 9 minutes 41 seconds of pure extrusion, whatever speed you set.

The slicer's estimate will be longer than those 13 minutes. Outer walls print more slowly, the head has to accelerate and brake, it travels between lines without printing, a small layer is slowed down so it can cool, and before the first layer the printer heats up and calibrates. Prusa describes that per-layer slowdown: the slicer lowers the speed until a layer takes at least a set time. In the Bambu Studio preview you can see the time and share of total print time for each line type, which shows where the extra minutes go.

A different layer height, a different result (with the same 18 g of filament):

  • 0.28 mm layers. (24 − 0.2) ÷ 0.28 = 85 layers, plus the first: 86 layers. At 200 mm/s the volumetric speed becomes 0.45 × 0.28 × 200 = 25.2 mm³/s. That is just above the hotend's 25, so the slicer slows down to 25 mm³/s. Pure extrusion time drops from 806 to 581 seconds: exactly the floor. Even thicker layers would make this part coarser on this printer, not faster.

  • 0.12 mm layers. (24 − 0.2) ÷ 0.12 = 198.3. After 198 layers you are at 0.2 + 23.76 = 23.96 mm. The centre of a further layer would sit at 24.02 mm, above the model, so Bambu Studio leaves that layer out. That gives 199 layers and a part 23.96 mm tall, 0.04 mm short, unless the precise Z height feature adjusts the last layers (Bambu Lab). At 200 mm/s the volumetric speed is 0.45 × 0.12 × 200 = 10.8 mm³/s, so pure extrusion time becomes 14,516 ÷ 10.8 = 1,344 seconds, just over 22 minutes.

In short: the layer count follows from height and layer height, print time has a floor set by what the hotend can melt, and a height that does not divide by the layer height gets rounded.

Resin and powder: also layer by layer, but different

Not every 3D printer uses filament. A resin printer cures liquid resin layer by layer with light; because the liquid supports nothing, supports are often needed, and afterwards you clean the part and post-cure it under UV light. In powder bed fusion, such as SLS, a laser fuses a layer of powder, a roller spreads the next layer, and the loose powder supports the part, so no support structures are needed (Loughborough University). Which process suits your part is compared in FDM, SLA or SLS. Metal printing is a different world again; see metal or plastic 3D printing.

When you know enough, and what to do next

You understand how 3D printing works when you can look at a print and point to the step that decided each feature. A weak spot usually comes from layer direction or the number of walls, an off dimension from extrusion or rounding to whole layers, and a rough surface from layer height, supports or orientation. Once you can do that, you no longer need this page; go to the guide for your next question:

If you would rather have a part printed than print it yourself, the OmniTechs 3D printing service lets you upload an STL, 3MF or OBJ for a price estimate based on real weight and real print time. OmniTechs prints FDM in PLA and PETG in Groningen, from a single piece.