Model Slicing and Contour Data Organization for 3D Printing Preparation

Model Slicing and Contour Data Organization for 3D Printing Preparation

Verified Sources
Nov 3, 2026

Model slicing is the step that converts a 3D CAD/mesh model (commonly an STL triangulated surface) into layer-wise toolpaths and finally into printer instructions (typically G-code) by (1) cutting the model with horizontal slicing planes, (2) extracting 2D contours for each layer, and (3) filling each layer’s bounded regions with infill/toolpaths according to selected settings. This produces the geometric “blueprint” that the printer executes as it builds the part layer-by-layer from bottom to top.2

A key intermediate artifact is contour data: perimeters/shell outlines (external and internal boundaries) plus additional internal boundaries (e.g., island outlines, hole boundaries) that define where material is allowed at a given layer height zz. The slicer’s contour extraction is the basis for perimeter routing, infill region construction, and subsequent ordering/path planning into executable commands.2

Core learning terms

  • Model slicing
  • Contour data
  • Perimeter (shell)
  • Infill
  • Toolpath

Footnotes

  1. What is Slicing in 3D Printing? A Guide for Engineers (Wevolver) - https://www.wevolver.com/article/what-is-slicing-in-3d-printing-a-guide-for-engineers - Describes converting models into per-layer outlines/perimeters and then G-code. ↩

  2. Toolpath Planning for Continuous Extrusion Additive Manufacturing (Oregon State/Research PDF) - https://research.engr.oregonstate.edu/rdml/sites/research.engr.oregonstate.edu.rdml/files/toolpath-planning-continuous-final.pdf - Explains intersection of triangular mesh with slicing planes, perimeter curves, infill filling, and toolpath/G-code transformation. ↩ ↩2

  3. STUDY ON STL-BASED SLICING PROCESS FOR 3D PRINTING (UT web PDF) - http://utw10945.utweb.utexas.edu/sites/default/files/2017/Manuscripts/StudyonSTLBasedSlicingProcessfor3DPrinting.pdf - Discusses slicing pipeline from STL to contours/toolpaths for layer-by-layer deposition. ↩

3D Printing Slicing & Toolpath Basics (Layer → Contours → G-code)

1) The Model Slicing Pipeline (From Mesh to Layers)

Most practical slicers implement a pipeline that can be summarized as follows:

  1. Input ingestion & mesh checks: read STL (triangulated surface), scale/position the model, and (optionally) repair mesh issues such as non-manifold geometry and intersecting triangles before slicing.
  2. Layering (plane selection): choose a constant or adaptive layer height; the slicer defines a set of slicing plane heights zz for the build.2
  3. Plane–mesh intersection: compute where the slicing plane intersects the model’s triangles, producing line segments that form candidate outlines.2
  4. Contour extraction & topology building: convert intersection results into ordered closed curves (outer boundary, holes, and internal boundaries) for each layer.2
  5. Region decomposition: interpret contours as boundaries to form closed regions representing printable material spaces for perimeters and infill.2
  6. Infill generation & boundary offsets: create internal fill toolpaths inside the regions and offset perimeters to achieve requested wall counts and widths.2
  7. Toolpath planning & G-code emission: map each feature type (perimeter, infill, top/bottom, support, travel) into an ordered list of printer moves; emit motion and extrusion commands (e.g., G0/G1G0/G1-style concepts) with parameters like feedrate and extrusion amounts.2

A research-oriented description of slicer behavior emphasizes: intersection of triangular mesh facets with slicing planes to generate perimeter curves at each layer, filling enclosed areas with infill patterns, and transforming curves into toolpath instructions (then G-code).

Footnotes

  1. STL to 3D Printer: How to 3D Print STL Files? (Xometry) - https://www.xometry.com/resources/3d-printing/3d-printing-stl-files - Covers STL import and preparation steps; mentions slicing in slicer software and mesh readiness. ↩

  2. Toolpath Planning for Continuous Extrusion Additive Manufacturing (Oregon State/Research PDF) - https://research.engr.oregonstate.edu/rdml/sites/research.engr.oregonstate.edu.rdml/files/toolpath-planning-continuous-final.pdf - Explains intersection of triangular mesh with slicing planes, perimeter curves, infill filling, and toolpath/G-code transformation. ↩ ↩2 ↩3 ↩4 ↩5 ↩6

  3. Additive Path Planning - Slicing (MIT fab CBA) - https://fab.cba.mit.edu/classes/865.21/topics/path_planning/additive.html - Explains slicing planes, contour computation per slice, and filling contours with toolpaths. ↩ ↩2 ↩3

  4. STUDY ON STL-BASED SLICING PROCESS FOR 3D PRINTING (UT web PDF) - http://utw10945.utweb.utexas.edu/sites/default/files/2017/Manuscripts/StudyonSTLBasedSlicingProcessfor3DPrinting.pdf - Discusses slicing pipeline from STL to contours/toolpaths for layer-by-layer deposition. ↩ ↩2

  5. What is Slicing in 3D Printing? A Guide for Engineers (Wevolver) - https://www.wevolver.com/article/what-is-slicing-in-3d-printing-a-guide-for-engineers - Describes converting models into per-layer outlines/perimeters and then G-code. ↩

  6. G-code in 3D Printing: How It Works and File Types Explained (3D Wikipedia) - https://www.3dmag.com/3d-wikipedia/g-code-3d-printing-explained - Describes feature-type mapping to motion/extrusion commands and conceptually how slicers output them. ↩

From STL to Layer Contours (Conceptual Steps)

  1. 1
    Step 1

    Parse the triangulated surface and ensure it’s suitable for planar slicing (e.g., repair common mesh issues).

    Footnotes

    1. STL to 3D Printer: How to 3D Print STL Files? (Xometry) - https://www.xometry.com/resources/3d-printing/3d-printing-stl-files - Covers STL import and preparation steps; mentions slicing in slicer software and mesh readiness. ↩

  2. 2
    Step 2

    Define the set of zz levels (layer height strategy) for the build volume.2

    Footnotes

    1. Toolpath Planning for Continuous Extrusion Additive Manufacturing (Oregon State/Research PDF) - https://research.engr.oregonstate.edu/rdml/sites/research.engr.oregonstate.edu.rdml/files/toolpath-planning-continuous-final.pdf - Explains intersection of triangular mesh with slicing planes, perimeter curves, infill filling, and toolpath/G-code transformation. ↩

    2. Additive Path Planning - Slicing (MIT fab CBA) - https://fab.cba.mit.edu/classes/865.21/topics/path_planning/additive.html - Explains slicing planes, contour computation per slice, and filling contours with toolpaths. ↩

  3. 3
    Step 3

    For each plane at height zz, compute intersection points/segments between the plane and the mesh triangles.

    Footnotes

    1. Toolpath Planning for Continuous Extrusion Additive Manufacturing (Oregon State/Research PDF) - https://research.engr.oregonstate.edu/rdml/sites/research.engr.oregonstate.edu.rdml/files/toolpath-planning-continuous-final.pdf - Explains intersection of triangular mesh with slicing planes, perimeter curves, infill filling, and toolpath/G-code transformation. ↩

  4. 4
    Step 4

    Join segments into perimeters/shell outlines and boundaries of internal voids (holes/islands) per layer.2

    Footnotes

    1. Toolpath Planning for Continuous Extrusion Additive Manufacturing (Oregon State/Research PDF) - https://research.engr.oregonstate.edu/rdml/sites/research.engr.oregonstate.edu.rdml/files/toolpath-planning-continuous-final.pdf - Explains intersection of triangular mesh with slicing planes, perimeter curves, infill filling, and toolpath/G-code transformation. ↩

    2. STUDY ON STL-BASED SLICING PROCESS FOR 3D PRINTING (UT web PDF) - http://utw10945.utweb.utexas.edu/sites/default/files/2017/Manuscripts/StudyonSTLBasedSlicingProcessfor3DPrinting.pdf - Discusses slicing pipeline from STL to contours/toolpaths for layer-by-layer deposition. ↩

  5. 5
    Step 5

    Treat outer contours as solid regions and holes as excluded regions; derive region polygons used by perimeter and infill generation.2

    Footnotes

    1. Toolpath Planning for Continuous Extrusion Additive Manufacturing (Oregon State/Research PDF) - https://research.engr.oregonstate.edu/rdml/sites/research.engr.oregonstate.edu.rdml/files/toolpath-planning-continuous-final.pdf - Explains intersection of triangular mesh with slicing planes, perimeter curves, infill filling, and toolpath/G-code transformation. ↩

    2. STUDY ON STL-BASED SLICING PROCESS FOR 3D PRINTING (UT web PDF) - http://utw10945.utweb.utexas.edu/sites/default/files/2017/Manuscripts/StudyonSTLBasedSlicingProcessfor3DPrinting.pdf - Discusses slicing pipeline from STL to contours/toolpaths for layer-by-layer deposition. ↩

  6. 6
    Step 6

    Generate multiple wall lines by offsetting boundaries inward/outward based on wall width and number of perimeters.2

    Footnotes

    1. STUDY ON STL-BASED SLICING PROCESS FOR 3D PRINTING (UT web PDF) - http://utw10945.utweb.utexas.edu/sites/default/files/2017/Manuscripts/StudyonSTLBasedSlicingProcessfor3DPrinting.pdf - Discusses slicing pipeline from STL to contours/toolpaths for layer-by-layer deposition. ↩

    2. Additive Path Planning - Slicing (MIT fab CBA) - https://fab.cba.mit.edu/classes/865.21/topics/path_planning/additive.html - Explains slicing planes, contour computation per slice, and filling contours with toolpaths. ↩

  7. 7
    Step 7

    Choose an infill pattern and generate internal toolpaths constrained by the contour-defined region boundaries.2

    Footnotes

    1. Toolpath Planning for Continuous Extrusion Additive Manufacturing (Oregon State/Research PDF) - https://research.engr.oregonstate.edu/rdml/sites/research.engr.oregonstate.edu.rdml/files/toolpath-planning-continuous-final.pdf - Explains intersection of triangular mesh with slicing planes, perimeter curves, infill filling, and toolpath/G-code transformation. ↩

    2. Additive Path Planning - Slicing (MIT fab CBA) - https://fab.cba.mit.edu/classes/865.21/topics/path_planning/additive.html - Explains slicing planes, contour computation per slice, and filling contours with toolpaths. ↩

  8. 8
    Step 8

    Translate 2D contours/infill into ordered printer moves and output machine-ready instructions (G-code).2

    Footnotes

    1. What is Slicing in 3D Printing? A Guide for Engineers (Wevolver) - https://www.wevolver.com/article/what-is-slicing-in-3d-printing-a-guide-for-engineers - Describes converting models into per-layer outlines/perimeters and then G-code. ↩

    2. Toolpath Planning for Continuous Extrusion Additive Manufacturing (Oregon State/Research PDF) - https://research.engr.oregonstate.edu/rdml/sites/research.engr.oregonstate.edu.rdml/files/toolpath-planning-continuous-final.pdf - Explains intersection of triangular mesh with slicing planes, perimeter curves, infill filling, and toolpath/G-code transformation. ↩

2) Contour Data Organization: What Gets Stored Per Layer

In a slicer, contour data organization is the internal representation of what the printer can build at a specific layer. Practically, contour data includes:

  • Outer perimeter
  • Inner perimeter
  • Island/region boundaries
  • Ring orientation
  • Layer index/order

A contour-set per layer typically separates:

  1. External boundary: the outermost loop(s) that define the part silhouette for that layer.
  2. Hole boundaries: loops representing voids (including holes created by the CAD geometry).
  3. Internal features/islands: boundaries created by concavities, internal cavities, or separation between solid areas.

This organization is consistent with slicer approaches that “compute perimeter curves for the model at each layer” and then “generate space-filling curves” within boundaries using an infill pattern. For example, the MIT teaching notes describe slicers as computing the contour within each slice and then filling the contour with toolpaths.

Contour → Region → Toolpath (why organization matters)

  • Perimeters must be routed along boundaries; their placement depends on which loops are outer/inner.
  • Infill must stay inside solid boundaries but outside holes—so the slicer must correctly interpret contour topology as region membership.2
  • Path planning (ordering travel vs extrusion) uses the contour graph to reduce crossings and improve print quality/efficiency.2

Footnotes

  1. Toolpath Planning for Continuous Extrusion Additive Manufacturing (Oregon State/Research PDF) - https://research.engr.oregonstate.edu/rdml/sites/research.engr.oregonstate.edu.rdml/files/toolpath-planning-continuous-final.pdf - Explains intersection of triangular mesh with slicing planes, perimeter curves, infill filling, and toolpath/G-code transformation. ↩ ↩2

  2. Additive Path Planning - Slicing (MIT fab CBA) - https://fab.cba.mit.edu/classes/865.21/topics/path_planning/additive.html - Explains slicing planes, contour computation per slice, and filling contours with toolpaths. ↩

  3. STUDY ON STL-BASED SLICING PROCESS FOR 3D PRINTING (UT web PDF) - http://utw10945.utweb.utexas.edu/sites/default/files/2017/Manuscripts/StudyonSTLBasedSlicingProcessfor3DPrinting.pdf - Discusses slicing pipeline from STL to contours/toolpaths for layer-by-layer deposition. ↩ ↩2

  4. G-code in 3D Printing: How It Works and File Types Explained (3D Wikipedia) - https://www.3dmag.com/3d-wikipedia/g-code-3d-printing-explained - Describes feature-type mapping to motion/extrusion commands and conceptually how slicers output them. ↩

type="tip" title="Pro Tip: Verify contours visually" content="Before trusting G-code, inspect the layer preview: slicers typically color-code perimeters, infill, top/bottom, and travel. Contour mistakes show up immediately as missing walls, wrong hole behavior, or unexpected infill islands."

Footnotes

  1. G-code in 3D Printing: How It Works and File Types Explained (3D Wikipedia) - https://www.3dmag.com/3d-wikipedia/g-code-3d-printing-explained - Describes feature-type mapping to motion/extrusion commands and conceptually how slicers output them. ↩

3) From Contour Data to Perimeters and Infill

Once contours exist per layer, the slicer must produce two major families of toolpaths:

3.1 Perimeters (shells)

Perimeter generation is fundamentally boundary-following plus offsetting:

  • The slicer decides the number of wall/perimeter lines.
  • It computes wall lines by offsetting from the outer boundary toward the inside, using settings like wall width and (often) algorithms that handle thin walls and “detect thin walls” behavior.

For instance, PrusaSlicer’s layer/perimeter documentation describes default treatment of walls as outside + inside perimeters and conditions where infill is placed between inside/outside perimeters when there’s sufficient space.

3.2 Infill

Infill is region-filling:

  • The slicer constructs a constrained interior region bounded by the contours.
  • It then generates parallel lines (rectilinear) or curved patterns (e.g., gyroid) depending on selected infill type.
  • It spaces those lines based on infill density and line width, producing a dense set of extrusion segments inside the region.

Research and educational material describe the general concept:

  • “space-filling curves” are generated over the area within the boundary curves based on an infill pattern type.
  • slicing must “compute the contour within each slice, and then fill that contour with a toolpath,” with uniform or adaptive slicing strategies.

Footnotes

  1. Layers and perimeters | Prusa Knowledge Base - https://help.prusa3d.com/article/layers-and-perimeters_1748 - Documents layer/perimeter behavior including inside/outside perimeters and thin-wall handling. ↩

  2. Toolpath Planning for Continuous Extrusion Additive Manufacturing (Oregon State/Research PDF) - https://research.engr.oregonstate.edu/rdml/sites/research.engr.oregonstate.edu.rdml/files/toolpath-planning-continuous-final.pdf - Explains intersection of triangular mesh with slicing planes, perimeter curves, infill filling, and toolpath/G-code transformation. ↩

  3. Additive Path Planning - Slicing (MIT fab CBA) - https://fab.cba.mit.edu/classes/865.21/topics/path_planning/additive.html - Explains slicing planes, contour computation per slice, and filling contours with toolpaths. ↩

type="warning" title="Warning: Contour topology errors propagate" content="If the slicer misinterprets contours (e.g., holes treated as solids, self-intersecting loops, or thin-wall ambiguities), perimeter routing and infill region construction can be wrong—leading to gaps, weak walls, or unintended solid bridges."2

Footnotes

  1. Toolpath Planning for Continuous Extrusion Additive Manufacturing (Oregon State/Research PDF) - https://research.engr.oregonstate.edu/rdml/sites/research.engr.oregonstate.edu.rdml/files/toolpath-planning-continuous-final.pdf - Explains intersection of triangular mesh with slicing planes, perimeter curves, infill filling, and toolpath/G-code transformation. ↩

  2. STL to 3D Printer: How to 3D Print STL Files? (Xometry) - https://www.xometry.com/resources/3d-printing/3d-printing-stl-files - Covers STL import and preparation steps; mentions slicing in slicer software and mesh readiness. ↩

4) G-code and Feature Ordering: How Contours Become Motion

Even after contour extraction, the slicer must output printer-specific instructions. In common practice:

  • Printable moves for perimeters/infill/top/bottom become linear extrusion commands (conceptually G1G1-like).
  • Non-printing travel moves become rapid motion commands (conceptually G0G0-like).
  • Thermal and configuration commands (e.g., hotend/bed heating) also appear in the stream as the printer executes the job.

A slicer “bridge” view is: it “translates a digital model—usually in STL or 3MF format—into G-code… layer by layer,” and for each layer it identifies which triangles intersect the slicing plane and calculates intersection points to create 2D outlines (perimeters/shells).

Also, slicers may optimize travel behavior. For example, OrcaSlicer documentation describes settings that reduce retractions for certain infill-travel moves that occur entirely inside infill regions, which demonstrates that feature ordering and move planning are coupled to how internal infill regions (derived from contours) are represented.

Footnotes

  1. G-code in 3D Printing: How It Works and File Types Explained (3D Wikipedia) - https://www.3dmag.com/3d-wikipedia/g-code-3d-printing-explained - Describes feature-type mapping to motion/extrusion commands and conceptually how slicers output them. ↩

  2. What is Slicing in 3D Printing? A Guide for Engineers (Wevolver) - https://www.wevolver.com/article/what-is-slicing-in-3d-printing-a-guide-for-engineers - Describes converting models into per-layer outlines/perimeters and then G-code. ↩

  3. G-Code Output - OrcaSlicer Wiki (OrcaSlicer) - https://www.orcaslicer.com/wiki/print_settings/others/others_settings_g_code_output.html - Documents how slicer travel/retraction behavior depends on infill region representation and settings. ↩

3D Printing Preparation Timeline (Slicing-Centric)

Mesh & model prep

Pre-slice

Scale, orient, and repair/validate the mesh for planar slicing."

Footnotes

  1. STL to 3D Printer: How to 3D Print STL Files? (Xometry) - https://www.xometry.com/resources/3d-printing/3d-printing-stl-files - Covers STL import and preparation steps; mentions slicing in slicer software and mesh readiness. ↩

Layer plane selection

Slice time

Choose layer heights zz and define slicing positions.2"

Footnotes

  1. Toolpath Planning for Continuous Extrusion Additive Manufacturing (Oregon State/Research PDF) - https://research.engr.oregonstate.edu/rdml/sites/research.engr.oregonstate.edu.rdml/files/toolpath-planning-continuous-final.pdf - Explains intersection of triangular mesh with slicing planes, perimeter curves, infill filling, and toolpath/G-code transformation. ↩

  2. Additive Path Planning - Slicing (MIT fab CBA) - https://fab.cba.mit.edu/classes/865.21/topics/path_planning/additive.html - Explains slicing planes, contour computation per slice, and filling contours with toolpaths. ↩

Intersections → contours

Contour extraction

Intersect triangles with each plane; assemble perimeter and hole loops per layer.2"

Footnotes

  1. Toolpath Planning for Continuous Extrusion Additive Manufacturing (Oregon State/Research PDF) - https://research.engr.oregonstate.edu/rdml/sites/research.engr.oregonstate.edu.rdml/files/toolpath-planning-continuous-final.pdf - Explains intersection of triangular mesh with slicing planes, perimeter curves, infill filling, and toolpath/G-code transformation. ↩

  2. STUDY ON STL-BASED SLICING PROCESS FOR 3D PRINTING (UT web PDF) - http://utw10945.utweb.utexas.edu/sites/default/files/2017/Manuscripts/StudyonSTLBasedSlicingProcessfor3DPrinting.pdf - Discusses slicing pipeline from STL to contours/toolpaths for layer-by-layer deposition. ↩

Perimeters + infill

Toolpath build

Offset boundary loops into wall lines; fill bounded regions with infill patterns.2"

Footnotes

  1. Toolpath Planning for Continuous Extrusion Additive Manufacturing (Oregon State/Research PDF) - https://research.engr.oregonstate.edu/rdml/sites/research.engr.oregonstate.edu.rdml/files/toolpath-planning-continuous-final.pdf - Explains intersection of triangular mesh with slicing planes, perimeter curves, infill filling, and toolpath/G-code transformation. ↩

  2. Layers and perimeters | Prusa Knowledge Base - https://help.prusa3d.com/article/layers-and-perimeters_1748 - Documents layer/perimeter behavior including inside/outside perimeters and thin-wall handling. ↩

G-code ordering

Export

Plan travel/extrusion sequencing and emit motion/thermal commands.3"

Footnotes

  1. What is Slicing in 3D Printing? A Guide for Engineers (Wevolver) - https://www.wevolver.com/article/what-is-slicing-in-3d-printing-a-guide-for-engineers - Describes converting models into per-layer outlines/perimeters and then G-code. ↩

  2. G-code in 3D Printing: How It Works and File Types Explained (3D Wikipedia) - https://www.3dmag.com/3d-wikipedia/g-code-3d-printing-explained - Describes feature-type mapping to motion/extrusion commands and conceptually how slicers output them. ↩

  3. G-Code Output - OrcaSlicer Wiki (OrcaSlicer) - https://www.orcaslicer.com/wiki/print_settings/others/others_settings_g_code_output.html - Documents how slicer travel/retraction behavior depends on infill region representation and settings. ↩

Where Contour Organization Impacts Printing Features

Qualitative mapping of contour importance by feature type.

Common Edge Cases in Contour Data Organization

Knowledge Check

Question 1 of 4
Q1Single choice

In most slicers, what does the contour data represent for a given layer?