AI Terakoya Home:Materials Science:3D Printing Introduction:Chapter 3
🌐 EN | 日本語 (準備中) Last sync: 2025-11-16
Learning Objectives
Upon completing this chapter, you will be able to explain:
Basic Understanding (Level 1)
- Definition of Additive Manufacturing (AM) and basic concepts of ISO/ASTM 52900 standard
- Characteristics of the 7 AM process categories (MEX, VPP, PBF, MJ, BJ, SL, DED)
- Structure of STL file format (triangle mesh, normal vectors, vertex order)
- History of AM (from 1986 stereolithography to modern systems)
Practical Skills (Level 2)
- Load STL files in Python and calculate volume and surface area
- Perform mesh verification and repair using numpy-stl and trimesh
- Understand basic principles of slicing (layer height, shell, infill)
- Interpret basic G-code structure (G0/G1/G28/M104, etc.)
Application Capability (Level 3)
- Select optimal AM process based on application requirements
- Detect and fix mesh problems (non-manifold, inverted normals)
- Optimize build parameters (layer height, print speed, temperature)
- Evaluate STL file quality and determine printability
1.1 What is Additive Manufacturing (AM)?
1.1.1 Definition of Additive Manufacturing
Additive Manufacturing (AM) is defined by ISO/ASTM 52900:2021 as “a process of joining materials to make objects from 3D model data, usually layer upon layer”. In contrast to traditional subtractive manufacturing (machining), AM adds material only where needed, offering revolutionary characteristics:
- Design Freedom : Enables manufacturing of complex geometries impossible with conventional methods (hollow structures, lattice structures, topology-optimized shapes)
- Material Efficiency : Uses material only where needed, reducing waste to 5-10% (conventional machining wastes 30-90%)
- On-Demand Manufacturing : Enables small-batch, high-variety production of customized products without tooling
- Part Consolidation : Integrates multiple components that would traditionally require assembly into a single build, eliminating assembly steps
Industrial Significance
The AM market is experiencing rapid growth. According to Wohlers Report 2023:
- Global AM market size: $18.3B (2023) $83.9B forecast (2030, CAGR 23.5%)
- Application breakdown: Prototyping (38%), Tooling (27%), End-use parts (35%)
- Major industries: Aerospace (26%), Medical (21%), Automotive (18%), Consumer goods (15%)
- Material distribution: Polymers (55%), Metals (35%), Ceramics (7%), Other (3%)
1.1.2 History and Development of AM
Additive manufacturing technology has approximately 40 years of history, reaching the present through the following milestones:
flowchart LR
A[1986
SLA Invention
Chuck Hull] --> B[1988
SLS Launch
Carl Deckard]
B --> C[1992
FDM Patent
Stratasys]
C --> D[2005
RepRap
Open Source]
D --> E[2012
Metal AM Adoption
EBM/SLM]
E --> F[2023
Industrial Scale
Large-Scale & High-Speed]
style A fill:#e3f2fd
style B fill:#fff3e0
style C fill:#e8f5e9
style D fill:#f3e5f5
style E fill:#fce4ec
style F fill:#fff9c4
- 1986: Stereolithography (SLA) Invention - Dr. Chuck Hull (3D Systems founder) invented the first AM technology using layer-by-layer curing of photopolymer resin (US Patent 4,575,330). The term “3D Printing” also originated during this period.
- 1988: Selective Laser Sintering (SLS) Launch - Dr. Carl Deckard (University of Texas) developed technology to sinter powder materials with a laser, opening possibilities for metals and ceramics.
- 1992: Fused Deposition Modeling (FDM) Patent - Stratasys commercialized FDM technology, establishing the foundation for currently the most widespread 3D printing method.
- 2005: RepRap Project - Professor Adrian Bowyer announced the open-source 3D printer “RepRap”. Combined with patent expiration, this accelerated cost reduction and democratization.
- 2012 onwards: Industrial Adoption of Metal AM - Electron Beam Melting (EBM) and Selective Laser Melting (SLM) found practical use in aerospace and medical fields. GE Aviation began mass production of LEAP fuel injection nozzles.
- 2023 Present: Era of Scale-up and High-Speed - New technologies such as Binder Jetting, continuous fiber composite AM, and multi-material AM entering industrial implementation stage.
1.1.3 Major Application Areas of AM
Application 1: Rapid Prototyping
The first major use of AM, rapidly manufacturing prototypes for design verification, functional testing, and market evaluation:
- Lead Time Reduction : Traditional prototyping (weeks to months) AM achieves in hours to days
- Accelerated Design Iteration : Low-cost production of multiple versions optimizes design
- Improved Communication : Visual and tactile physical models unify stakeholder understanding
- Typical Examples : Automotive appearance models, consumer electronics housings, medical device pre-surgical simulation models
Application 2: Tooling & Fixtures
Application of AM for manufacturing jigs, tools, and molds used in production facilities:
- Custom Fixtures : Rapid fabrication of assembly and inspection fixtures tailored to production lines
- Conformal Cooling Molds : Injection molds with 3D cooling channels following product geometry instead of straight lines (30-70% cooling time reduction)
- Lightweight Tools : Lattice-structure lightweight end effectors reducing operator burden
- Typical Examples : BMW assembly line fixtures (over 100,000 annually manufactured with AM), Golf TaylorMade driver molds
Application 3: End-Use Parts
Direct manufacturing of final products with AM has increased rapidly in recent years:
- Aerospace Components : GE Aviation LEAP fuel injection nozzle (consolidated from 20 parts to single AM part, 25% weight reduction, over 100,000 annual production)
- Medical Implants : Titanium artificial hip joints and dental implants (optimized to patient-specific anatomy, porous structures promoting bone integration)
- Custom Products : Hearing aids (over 10 million annually manufactured with AM), sports shoe midsoles (Adidas 4D, Carbon DLS technology)
- Spare Parts : On-demand manufacturing of discontinued and rare parts (automotive, aircraft, industrial machinery)
AM Constraints and Challenges
AM is not universal and has the following constraints:
- Build Speed : Unsuitable for mass production (injection molding 1 part/seconds vs AM several hours). Economic breakeven typically below 1,000 units
- Build Size Limitations : Build volume (typically around 200x200x200mm for many systems) requires split manufacturing for larger parts
- Surface Quality : Layer lines remain visible, requiring post-processing (polishing, machining) for high-precision surfaces
- Material Property Anisotropy : Mechanical properties may differ between build direction (Z-axis) and in-plane (XY plane), particularly for FDM
- Material Cost : AM-grade materials are 2-10x more expensive than general-purpose materials (though offset by material efficiency and design optimization)
1.2 Seven AM Process Categories by ISO/ASTM 52900
1.2.1 Overview of AM Process Classification
ISO/ASTM 52900:2021 standard classifies all AM technologies into 7 process categories based on energy source and material feed method. Each process has unique advantages and disadvantages, requiring selection of optimal technology based on application.
flowchart TD
AM[Additive Manufacturing
7 Process Categories] --> MEX[Material Extrusion
MEX]
AM --> VPP[Vat Photopolymerization
VPP]
AM --> PBF[Powder Bed Fusion
PBF]
AM --> MJ[Material Jetting
MJ]
AM --> BJ[Binder Jetting
BJ]
AM --> SL[Sheet Lamination
SL]
AM --> DED[Directed Energy Deposition
DED]
MEX --> MEX_EX[FDM/FFF
Low Cost & Widespread]
VPP --> VPP_EX[SLA/DLP
High Precision & Surface Quality]
PBF --> PBF_EX[SLS/SLM/EBM
High Strength & Metal Capable]
style AM fill:#f093fb
style MEX fill:#e3f2fd
style VPP fill:#fff3e0
style PBF fill:#e8f5e9
style MJ fill:#f3e5f5
style BJ fill:#fce4ec
style SL fill:#fff9c4
style DED fill:#fce4ec
1.2.2 Material Extrusion (MEX)
Principle : Thermoplastic filament is heated, melted, extruded through a nozzle and deposited layer-by-layer. The most widespread technology (also called FDM/FFF).
Process: Filament → Heated Nozzle (190-260°C) → Melt Extrusion → Cooling Solidification → Next Layer Deposition
Features:
- Low Cost : Equipment price $200-$5,000 (desktop), $10,000-$100,000 (industrial)
- Material Diversity : PLA, ABS, PETG, Nylon, PC, Carbon fiber composites, PEEK (high-performance)
- Build Speed : 20-150 mm/s (medium), layer height 0.1-0.4mm
- Accuracy : ±0.2-0.5 mm (desktop), ±0.1 mm (industrial)
- Surface Quality : Layer lines clearly visible (improvable with post-processing)
- Material Anisotropy : Z-axis direction (build direction) strength 20-80% lower (interlayer bonding weakness)
Applications:
- Prototyping (most common use, low cost & fast)
- Jigs & Tools (manufacturing floor use, lightweight & customizable)
- Educational models (widely used in schools/universities, safe & low cost)
- End-use parts (custom hearing aids, prosthetics, architectural models)
Representative FDM Equipment
- Ultimaker S5 : Dual heads, build volume 330x240x300mm, $6,000
- Prusa i3 MK4 : Open-source derived, high reliability, $1,200
- Stratasys Fortus 450mc : Industrial, ULTEM 9085 compatible, $250,000
- Markforged X7 : Continuous carbon fiber composite capable, $100,000
1.2.3 Vat Photopolymerization (VPP)
Principle : Liquid photopolymer resin is selectively cured layer-by-layer using UV laser or projector light, then stacked.
Process: UV Irradiation → Photopolymerization Reaction → Solidification → Build Platform Raises → Next Layer Irradiation
Two main VPP methods:
- SLA (Stereolithography) : UV laser (355 nm) scanned by galvanometer mirrors, point-by-point curing. High precision but slow.
- DLP (Digital Light Processing) : Entire layer exposed at once with projector. Fast but resolution dependent on projector pixels (Full HD: 1920x1080).
- LCD-MSLA (Masked SLA) : Uses LCD mask, similar to DLP but lower cost ($200-$1,000 desktop systems numerous).
Features:
- High Precision : XY resolution 25-100 μm, Z resolution 10-50 μm (highest among all AM technologies)
- Surface Quality : Smooth surface (Ra < 5 μm), layer lines barely visible
- Build Speed : SLA (10-50 mm/s), DLP/LCD (100-500 mm/s, area dependent)
- Material Limitation : Photopolymer resins only (mechanical properties often inferior to FDM)
- Post-Processing Required : Washing (IPA etc.) → Post-cure (UV irradiation) → Support removal
Applications:
- Dental applications (orthodontic models, surgical guides, dentures, millions produced annually)
- Jewelry casting wax models (high precision & complex geometries)
- Medical models (surgical planning, anatomical models, patient education)
- Master models (silicone molding, design verification)
1.2.4 Powder Bed Fusion (PBF)
Principle : Powder material is spread thin, selectively melted/sintered with laser or electron beam, cooled and solidified, then stacked. Applicable to metals, polymers, and ceramics.
Process: Powder Spreading → Laser/Electron Beam Scanning → Melting/Sintering → Solidification → Next Layer Powder Spreading
Three main PBF methods:
- SLS (Selective Laser Sintering) : Laser sintering of polymer powder (PA12 nylon etc.). No support needed (surrounding powder provides support).
- SLM (Selective Laser Melting) : Complete melting of metal powder (Ti-6Al-4V, AlSi10Mg, Inconel 718 etc.). Enables high-density parts (relative density >99%).
- EBM (Electron Beam Melting) : Metal powder melting with electron beam. High-temperature preheating (650-1000°C) reduces residual stress, faster build speed.
Features:
- High Strength : Melting and resoildification achieve mechanical properties comparable to wrought materials (tensile strength 500-1200 MPa)
- Complex Geometry Capable : Support-free (powder provides support) enables overhangs
- Material Diversity : Ti alloys, Al alloys, stainless steel, Ni superalloys, Co-Cr alloys, nylon
- High Cost : Equipment price $200,000-$1,500,000, material cost $50-$500/kg
- Post-Processing : Support removal, heat treatment (stress relief), surface finishing (blasting, polishing)
Applications:
- Aerospace parts (weight reduction, consolidation, GE LEAP fuel nozzle etc.)
- Medical implants (patient-specific geometry, porous structures, Ti-6Al-4V)
- Molds (conformal cooling, complex geometries, H13 tool steel)
- Automotive parts (lightweight brackets, custom engine components)
1.2.5 Material Jetting (MJ)
Principle : Similar to inkjet printing, droplets of material (photopolymer resin or wax) are jetted from print heads, immediately cured with UV, then stacked.
Features:
- Ultra-High Precision : XY resolution 42-85 μm, Z resolution 16-32 μm
- Multi-Material : Ability to use multiple materials and colors within single build
- Full-Color Build : CMYK resin combinations enable over 10 million colors
- Surface Quality : Extremely smooth (layer lines barely visible)
- High Cost : Equipment $50,000-$300,000, material cost $200-$600/kg
- Material Limitation : Photopolymer resins only, moderate mechanical properties
Applications: Medical anatomical models (reproducing soft/hard tissue with different materials), full-color architectural models, design verification models
1.2.6 Binder Jetting (BJ)
Principle : Liquid binder (adhesive) jetted onto powder bed using inkjet method, bonding powder particles. After building, sintering or infiltration treatment improves strength.
Features:
- High-Speed Building : No laser scanning required, entire layer processed at once, build speed 100-500 mm/s
- Material Diversity : Metal powder, ceramics, sand molds (for casting), full-color (gypsum)
- Support-Free : Surrounding powder provides support, recyclable after removal
- Low Density Issue : Fragile before sintering (green density 50-60%), relative density 90-98% even after sintering
- Post-Processing Required : Debinding → Sintering (metal: 1200-1400°C) → Infiltration (copper/bronze)
Applications: Sand casting molds (large castings like engine blocks), metal parts (Desktop Metal, HP Metal Jet), full-color figurines (memorial items, educational models)
1.2.7 Sheet Lamination (SL)
Principle : Sheet materials (paper, metal foil, plastic film) are laminated and bonded by adhesive or welding. Each layer is contour-cut with laser or blade.
Representative Technologies:
- LOM (Laminated Object Manufacturing) : Paper/plastic sheets, bonded with adhesive, laser cut
- UAM (Ultrasonic Additive Manufacturing) : Metal foils ultrasonically welded, CNC-milled for contours
Features: Large builds possible, low material cost, medium precision, limited applications (mainly visual models, embedded sensors in metal)
1.2.8 Directed Energy Deposition (DED)
Principle : While feeding metal powder or wire, melting with laser/electron beam/arc and depositing on substrate. Used for large parts or repair of existing parts.
Features:
- High Deposition Rate : Deposition rate 1-5 kg/h (10-50x faster than PBF)
- Large-Scale Capable : Minimal build volume limitations (using multi-axis robotic arms)
- Repair & Coating: Worn part restoration, surface hardening layer formation
- Low Precision : Accuracy ±0.5-2 mm, post-processing (machining) required
Applications: Turbine blade repair, large aerospace parts, tool wear-resistant coating
Guidelines for Process Selection
Optimal AM process varies by application requirements:
- Precision Priority → VPP (SLA/DLP) or MJ
- Low Cost & Widespread → MEX (FDM/FFF)
- Metal High-Strength Parts → PBF (SLM/EBM)
- Mass Production (sand molds) → BJ
- Large-Scale & High-Speed Deposition → DED
1.3 STL File Format and Data Processing
1.3.1 Structure of STL Files
STL (STereoLithography) is the most widely used 3D model file format in AM , developed by 3D Systems in 1987. STL files represent object surfaces as a collection of triangle meshes.
Basic Structure of STL Files
STL File = Normal Vector (n) + 3 Vertex Coordinates (v1, v2, v3) × Number of Triangles
Example of ASCII STL format:
solid cube
facet normal 0 0 1
outer loop
vertex 0 0 10
vertex 10 0 10
vertex 10 10 10
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0 0 10
vertex 10 10 10
vertex 0 10 10
endloop
endfacet
...
endsolid cube
Two types of STL format:
- ASCII STL : Human-readable text format. Large file size (10-20x Binary for same model). Useful for debugging and verification.
- Binary STL : Binary format, smaller file size, faster processing. Standard for industrial use. Structure: 80-byte header + 4-byte (triangle count) + 50 bytes per triangle (12B normal + 36B vertices + 2B attribute).
1.3.2 Key Concepts of STL Files
1. Normal Vector
Each triangle face has a defined normal vector (outward direction) distinguishing object “inside” from “outside”. Normal direction is determined by right-hand rule :
Normal n = (v2 - v1) × (v3 - v1) / |(v2 - v1) × (v3 - v1)|
Vertex Order Rule: Vertices v1, v2, v3 are arranged counter-clockwise (CCW), and when viewed from outside, the counter-clockwise ordering makes normals point outward.
2. Manifold Condition
For an STL mesh to be 3D printable, it must be manifold :
- Edge Sharing : Every edge is shared by exactly 2 triangles
- Vertex Sharing : Every vertex belongs to a continuous triangle fan
- Closed Surface : No holes or openings, forms completely closed surface
- No Self-Intersection : Triangles do not intersect or penetrate each other
Non-Manifold Mesh Issues
Non-manifold meshes are not 3D printable. Typical problems:
- Holes : Unclosed surfaces, edges belonging to only one triangle
- T-junctions : Edges shared by 3 or more triangles
- Inverted Normals : Mixed triangles with normals pointing inward
- Duplicate Vertices : Multiple vertices at same position
- Degenerate Triangles : Triangles with zero or near-zero area
These problems cause slicer software errors and lead to build failures.
1.3.3 Quality Metrics for STL Files
STL mesh quality is evaluated by the following metrics:
- Triangle Count : Typically 10,000-500,000. Avoid too few (coarse model) or too many (large file size & processing delay).
- Edge Length Uniformity : Extreme mix of large and small triangles reduces build quality. Ideally 0.1-1.0 mm range.
- Aspect Ratio : Elongated triangles (high aspect ratio) cause numerical errors. Ideally aspect ratio < 10.
- Normal Consistency : All normals pointing outward. Mixed inverted normals cause inside/outside determination errors.
STL File Resolution Trade-offs
STL mesh resolution (triangle count) is a trade-off between precision and file size:
- Low Resolution (1,000-10,000 triangles) : Fast processing, small file, but curved surfaces appear faceted
- Medium Resolution (10,000-100,000 triangles) : Appropriate for most applications, good balance
- High Resolution (100,000-1,000,000 triangles) : Smooth curved surfaces, but large file size (tens of MB), processing delays
When exporting STL from CAD software, control resolution with Chordal Tolerance or Angle Tolerance. Recommended values: chordal tolerance 0.01-0.1 mm, angle tolerance 5-15 degrees.
1.3.4 STL Processing with Python
Major Python libraries for handling STL files:
- numpy-stl : Fast STL read/write, volume & surface area calculation, normal vector operations. Simple and lightweight.
- trimesh : Comprehensive 3D mesh processing library. Mesh repair, Boolean operations, raycasting, collision detection. Feature-rich but many dependencies.
- PyMesh : Advanced mesh processing (remeshing, subdivision, feature extraction). Installation somewhat complex.
Basic numpy-stl usage:
# Requirements:
# - Python 3.9+
# - numpy>=1.24.0, <2.0.0
"""
Example: Basic numpy-stl usage:
Purpose: Demonstrate core concepts and implementation patterns
Target: Beginner to Intermediate
Execution time: ~5 seconds
Dependencies: None
"""
from stl import mesh
import numpy as np
# Load STL file
your_mesh = mesh.Mesh.from_file('model.stl')
# Basic geometric information
volume, cog, inertia = your_mesh.get_mass_properties()
print(f"Volume: {volume:.2f} mm³")
print(f"Center of Gravity: {cog}")
print(f"Surface Area: {your_mesh.areas.sum():.2f} mm²")
# Number of triangles
print(f"Number of Triangles: {len(your_mesh.vectors)}")
1.4 Slicing and Toolpath Generation
The process of converting STL files into commands (G-code) that 3D printers understand is called Slicing. This section covers the basic principles of slicing, toolpath strategies, and G-code fundamentals.
1.4.1 Basic Principles of Slicing
Slicing is the process of horizontally cutting a 3D model at constant height (layer height) and extracting the contour of each layer:
flowchart TD
A[3D Model
STL File] --> B[Slice in Z-axis
Layer-by-Layer]
B --> C[Extract Layer Contours
Contour Detection]
C --> D[Generate Shells
Perimeter Path]
D --> E[Generate Infill
Infill Path]
E --> F[Add Supports
Support Structure]
F --> G[Optimize Toolpath
Retraction/Travel]
G --> H[G-code Output]
style A fill:#e3f2fd
style H fill:#e8f5e9
Layer Height Selection
Layer height is the most critical parameter determining the trade-off between build quality and build time:
| Layer Height | Build Quality | Build Time | Typical Applications |
|---|---|---|---|
| 0.1 mm (Ultra-fine) | Very high (layer lines barely visible) | Very long (2-3x) | Figurines, medical models, end-use products |
| 0.2 mm (Standard) | Good (layer lines visible but acceptable) | Standard | General prototypes, functional parts |
| 0.3 mm (Coarse) | Low (layer lines prominent) | Short (0.5x) | Initial prototypes, internal structure parts |
Layer Height Constraints
Layer height must be set to 25-80% of nozzle diameter. For example, with 0.4mm nozzle, layer height of 0.1-0.32mm is the recommended range. Exceeding this causes insufficient extrusion or nozzle dragging on previous layers.
1.4.2 Shell and Infill Strategies
Shell (Perimeter) Generation
Shell (Shell/Perimeter) is the path forming the outer perimeter of each layer:
- Shell Count (Perimeter Count) : Typically 2-4 lines. Affects external quality and strength.
- 1 line: Very weak, high transparency, decorative use only
- 2 lines: Standard (good balance)
- 3-4 lines: High strength, improved surface quality, improved airtightness
- Shell Order : Inside-out is common. Outside-in used when emphasizing surface quality.
Infill Patterns
Infill forms internal structure, controlling strength and material usage:
| Pattern | Strength | Print Speed | Material Usage | Features |
|---|---|---|---|---|
| Grid | Medium | Fast | Medium | Simple, isotropic, standard choice |
| Honeycomb | High | Slow | Medium | High strength, excellent weight ratio, aerospace use |
| Gyroid | Very High | Medium | Medium | 3D isotropic, curved, latest recommendation |
| Concentric | Low | Fast | Low | Flexibility priority, follows shells |
| Lines | Low (anisotropic) | Very Fast | Low | High-speed printing, directional strength |
Infill Density Guidelines
- 0-10% : Decorative items, non-load-bearing parts (material saving priority)
- 20% : Standard prototypes (good balance)
- 40-60% : Functional parts, high strength requirements
- 100% : End-use products, watertightness requirements, maximum strength (build time 3-5x)
1.4.3 Support Structure Generation
Parts with overhang angles exceeding 45 degrees require Support Structures :
Support Types
- Linear Support : Vertical pillar supports. Simple and easy to remove but high material usage.
- Tree Support : Tree-like branching supports. 30-50% material reduction, easy removal. Standard support in Cura and PrusaSlicer.
- Interface Layers : Thin interface layer on support top. Easy removal, improved surface quality. Typically 2-4 layers.
Critical Support Parameters
| Parameter | Recommended Value | Effect |
|---|---|---|
| Overhang Angle | 45-60° | Supports generated above this angle |
| Support Density | 10-20% | Higher density more stable but difficult to remove |
| Support Z Distance | 0.2-0.3 mm | Gap between support and part (removability) |
| Interface Layers | 2-4 layers | Number of interface layers (balance of surface quality and removability) |
1.4.4 G-code Fundamentals
G-code is the standard numerical control language for controlling 3D printers and CNC machines. Each line represents one command:
Major G-code Commands
| Command | Category | Function | Example |
|---|---|---|---|
| G0 | Movement | Rapid movement (no extrusion) | G0 X100 Y50 Z10 F6000 |
| G1 | Movement | Linear movement (with extrusion) | G1 X120 Y60 E0.5 F1200 |
| G28 | Initialization | Return to home position | G28 (all axes), G28 Z (Z-axis only) |
| M104 | Temperature | Set nozzle temperature (non-blocking) | M104 S200 |
| M109 | Temperature | Set nozzle temperature (blocking) | M109 S210 |
| M140 | Temperature | Set bed temperature (non-blocking) | M140 S60 |
| M190 | Temperature | Set bed temperature (blocking) | M190 S60 |
G-code Example (Build Start Section)
; === Start G-code ===
M140 S60 ; Start heating bed to 60°C (non-blocking)
M104 S210 ; Start heating nozzle to 210°C (non-blocking)
G28 ; Home all axes
G29 ; Auto bed leveling (bed mesh measurement)
M190 S60 ; Wait for bed temperature to reach target
M109 S210 ; Wait for nozzle temperature to reach target
G92 E0 ; Reset extrusion distance to zero
G1 Z2.0 F3000 ; Raise Z-axis 2mm (safety clearance)
G1 X10 Y10 F5000 ; Move to priming position
G1 Z0.3 F3000 ; Lower Z-axis to 0.3mm (first layer height)
G1 X100 E10 F1500 ; Draw prime line (clear nozzle clogs)
G92 E0 ; Reset extrusion distance to zero again
; === Build Start ===
1.4.5 Major Slicing Software
| Software | License | Features | Recommended Use |
|---|---|---|---|
| Cura | Open Source | Easy to use, abundant presets, standard Tree Support | Beginners to intermediate, FDM general purpose |
| PrusaSlicer | Open Source | Advanced settings, variable layer height, custom supports | Intermediate to advanced, optimization focus |
| Slic3r | Open Source | PrusaSlicer predecessor, lightweight | Legacy systems, research use |
| Simplify3D | Commercial ($150) | Fast slicing, multi-process, detailed control | Professional, industrial use |
| IdeaMaker | Free | Raise3D dedicated but versatile, intuitive UI | Raise3D users, beginners |
1.4.6 Toolpath Optimization Strategies
Efficient toolpaths improve build time, quality, and material usage:
- Retraction : Pulling back filament during travel to prevent stringing.
- Distance: 1-6mm (Bowden tube systems 4-6mm, direct drive 1-2mm)
- Speed: 25-45 mm/s
- Excessive retraction causes nozzle clogs
- Z-hop (Z-axis lift) : Raising nozzle during travel to avoid collisions with part. 0.2-0.5mm lift. Slight build time increase but improved surface quality.
- Combing : Restricting travel paths to infill areas, reducing travel marks on surfaces. Effective when appearance is priority.
- Seam Position : Strategy for aligning layer start/end points.
- Random: Random placement (less noticeable)
- Aligned: Line them up (easier to remove seam with post-processing)
- Sharpest Corner: Place at sharpest corner (less noticeable)
Python Examples
Example 1: Loading STL File and Retrieving Basic Information
# Requirements:
# - Python 3.9+
# - numpy>=1.24.0, <2.0.0
"""
Example: Example 1: Loading STL File and Retrieving Basic Information
Purpose: Demonstrate neural network implementation
Target: Beginner to Intermediate
Execution time: 5-10 seconds
Dependencies: None
"""
# ===================================
# Example 1: Loading STL File and Retrieving Basic Information
# ===================================
import numpy as np
from stl import mesh
# Load STL file
your_mesh = mesh.Mesh.from_file('model.stl')
# Retrieve basic geometric information
volume, cog, inertia = your_mesh.get_mass_properties()
print("=== STL File Basic Information ===")
print(f"Volume: {volume:.2f} mm³")
print(f"Surface Area: {your_mesh.areas.sum():.2f} mm²")
print(f"Center of Gravity: [{cog[0]:.2f}, {cog[1]:.2f}, {cog[2]:.2f}] mm")
print(f"Number of Triangles: {len(your_mesh.vectors)}")
# Calculate bounding box (minimum enclosing cuboid)
min_coords = your_mesh.vectors.min(axis=(0, 1))
max_coords = your_mesh.vectors.max(axis=(0, 1))
dimensions = max_coords - min_coords
print(f"\n=== Bounding Box ===")
print(f"X: {min_coords[0]:.2f} to {max_coords[0]:.2f} mm (Width: {dimensions[0]:.2f} mm)")
print(f"Y: {min_coords[1]:.2f} to {max_coords[1]:.2f} mm (Depth: {dimensions[1]:.2f} mm)")
print(f"Z: {min_coords[2]:.2f} to {max_coords[2]:.2f} mm (Height: {dimensions[2]:.2f} mm)")
# Simple build time estimation (assuming 0.2mm layer height, 50mm/s speed)
layer_height = 0.2 # mm
print_speed = 50 # mm/s
num_layers = int(dimensions[2] / layer_height)
# Simple calculation: estimation based on surface area
estimated_path_length = your_mesh.areas.sum() / layer_height # mm
estimated_time_seconds = estimated_path_length / print_speed
estimated_time_minutes = estimated_time_seconds / 60
print(f"\n=== Build Estimation ===")
print(f"Number of Layers (0.2mm/layer): {num_layers} layers")
print(f"Estimated Build Time: {estimated_time_minutes:.1f} minutes ({estimated_time_minutes/60:.2f} hours)")
# Output example:
# === STL File Basic Information ===
# Volume: 12450.75 mm³
# Surface Area: 5832.42 mm²
# Center of Gravity: [25.34, 18.92, 15.67] mm
# Number of Triangles: 2456
#
# === Bounding Box ===
# X: 0.00 to 50.00 mm (Width: 50.00 mm)
# Y: 0.00 to 40.00 mm (Depth: 40.00 mm)
# Z: 0.00 to 30.00 mm (Height: 30.00 mm)
#
# === Build Estimation ===
# Number of Layers (0.2mm/layer): 150 layers
# Estimated Build Time: 97.2 minutes (1.62 hours)
Example 2: Mesh Normal Vector Verification
# Requirements:
# - Python 3.9+
# - numpy>=1.24.0, <2.0.0
# ===================================
# Example 2: Mesh Normal Vector Verification
# ===================================
import numpy as np
from stl import mesh
def check_normals(mesh_data):
"""Check STL mesh normal vector consistency
Args:
mesh_data: numpy-stl Mesh object
Returns:
tuple: (flipped_count, total_count, percentage)
"""
# Check normal direction using right-hand rule
flipped_count = 0
total_count = len(mesh_data.vectors)
for i, facet in enumerate(mesh_data.vectors):
v0, v1, v2 = facet
# Calculate edge vectors
edge1 = v1 - v0
edge2 = v2 - v0
# Calculate normal with cross product (right-hand system)
calculated_normal = np.cross(edge1, edge2)
# Normalize
norm = np.linalg.norm(calculated_normal)
if norm > 1e-10: # Verify not zero vector
calculated_normal = calculated_normal / norm
else:
continue # Skip degenerate triangles
# Compare with stored normal in file
stored_normal = mesh_data.normals[i]
stored_norm = np.linalg.norm(stored_normal)
if stored_norm > 1e-10:
stored_normal = stored_normal / stored_norm
# Check direction alignment with dot product
dot_product = np.dot(calculated_normal, stored_normal)
# If dot product is negative, directions are opposite
if dot_product < 0:
flipped_count += 1
percentage = (flipped_count / total_count) * 100 if total_count > 0 else 0
return flipped_count, total_count, percentage
# Load STL file
your_mesh = mesh.Mesh.from_file('model.stl')
# Execute normal check
flipped, total, percent = check_normals(your_mesh)
print("=== Normal Vector Verification Results ===")
print(f"Total Triangles: {total}")
print(f"Flipped Normals: {flipped}")
print(f"Flipped Ratio: {percent:.2f}%")
if flipped == 0:
print("\nAll normals point in correct direction")
print(" This mesh is 3D printable")
elif percent < 5:
print("\nSome normals are flipped (minor)")
print(" Slicer likely to auto-correct")
else:
print("\nMany normals are flipped (critical)")
print(" Recommend repair with tools (Meshmixer, netfabb)")
# Output example:
# === Normal Vector Verification Results ===
# Total Triangles: 2456
# Flipped Normals: 0
# Flipped Ratio: 0.00%
#
# All normals point in correct direction
# This mesh is 3D printable
Example 3: Manifold Check
# ===================================
# Example 3: Manifold (Watertight) Check
# ===================================
import trimesh
# Load STL file (trimesh automatically attempts repair)
mesh = trimesh.load('model.stl')
print("=== Mesh Quality Diagnosis ===")
# Basic information
print(f"Vertex count: {len(mesh.vertices)}")
print(f"Face count: {len(mesh.faces)}")
print(f"Volume: {mesh.volume:.2f} mm³")
# Check manifold properties
print(f"\n=== 3D Printability Check ===")
print(f"Is watertight (closure): {mesh.is_watertight}")
print(f"Is winding consistent (normal consistency): {mesh.is_winding_consistent}")
print(f"Is valid (geometric validity): {mesh.is_valid}")
# Diagnose problem details
if not mesh.is_watertight:
# Detect number of holes
try:
edges = mesh.edges_unique
edges_sorted = mesh.edges_sorted
duplicate_edges = len(edges_sorted) - len(edges)
print(f"\nProblems detected:")
print(f" - Mesh has holes")
print(f" - Duplicate edges: {duplicate_edges}")
except:
print(f"\nMesh structure has problems")
# Attempt repair
if not mesh.is_watertight or not mesh.is_winding_consistent:
print(f"\nExecuting automatic repair...")
# Fix normals
trimesh.repair.fix_normals(mesh)
print(" Normal vectors corrected")
# Fill holes
trimesh.repair.fill_holes(mesh)
print(" Holes filled")
# Remove degenerate faces
mesh.remove_degenerate_faces()
print(" Degenerate faces removed")
# Merge duplicate vertices
mesh.merge_vertices()
print(" Duplicate vertices merged")
# Check post-repair state
print(f"\n=== Post-Repair State ===")
print(f"Is watertight: {mesh.is_watertight}")
print(f"Is winding consistent: {mesh.is_winding_consistent}")
# Save repaired mesh
if mesh.is_watertight:
mesh.export('model_repaired.stl')
print(f"\nRepair complete! Saved as model_repaired.stl")
else:
print(f"\nAutomatic repair failed. Recommend dedicated tools like Meshmixer")
else:
print(f"\nThis mesh is 3D printable")
# Output example:
# === Mesh Quality Diagnosis ===
# Vertex count: 1534
# Face count: 2456
# Volume: 12450.75 mm³
#
# === 3D Printability Check ===
# Is watertight (closure): True
# Is winding consistent (normal consistency): True
# Is valid (geometric validity): True
#
# This mesh is 3D printable
Chapter Exercises
Exercise 1: AM Process Selection
For the following applications, select the most appropriate AM process and explain your reasoning:
- Dental crown model (accuracy ±50μm)
- Prototype smartphone case (low cost, quick iteration)
- Titanium artificial hip joint (high strength, patient-specific)
- Architectural model with multiple colors
- Automotive jig for assembly line
Answer Hints
- VPP (SLA/DLP) - Highest precision, excellent surface finish
- MEX (FDM) - Lowest cost, fastest iteration
- PBF (SLM) - Metal capability, high strength, customizable geometry
- MJ or BJ - Multi-material/color capability
- MEX or PBF(SLS) - Cost-effective for tooling
Exercise 2: STL File Analysis
Write a Python script that:
- Loads an STL file and calculates its volume and surface area
- Determines if it fits within a 200x200x200mm build volume
- Estimates material cost (assuming PLA at $20/kg, density 1.24 g/cm³)
- Checks for manifold errors and reports any issues
Implementation Hint
Use numpy-stl for basic info and trimesh for manifold checking. Calculate material mass from volume and density, then multiply by cost per kg.
Exercise 3: Slicing Parameter Optimization
For a mechanical part requiring both strength and surface quality:
- Determine optimal layer height (nozzle = 0.4mm)
- Select appropriate infill pattern and density
- Choose shell count
- Estimate build time difference between 0.1mm and 0.3mm layer heights
Answer Approach
- Layer height: 0.2mm (balance of quality and speed)
- Infill: Gyroid at 40% (good strength, isotropic)
- Shells: 3 lines (good surface quality and strength)
- Time: 0.3mm approximately 2/3 faster than 0.1mm (inverse relationship)
Exercise 4: G-code Analysis
Analyze the following G-code snippet and explain what it does:
G28
M190 S60
M109 S200
G92 E0
G1 X50 Y50 Z0.2 F3000
G1 X100 Y50 E5 F1500
G1 X100 Y100 E10 F1500
Answer
- G28: Home all axes
- M190 S60: Heat bed to 60°C and wait
- M109 S200: Heat nozzle to 200°C and wait
- G92 E0: Reset extruder position
- G1 X50 Y50 Z0.2 F3000: Move to start position at 0.2mm height
- G1 X100 Y50 E5 F1500: Draw line while extruding (prime nozzle)
- G1 X100 Y100 E10 F1500: Continue drawing perpendicular line
Exercise 5: Material Comparison
Compare PLA, ABS, and PETG for FDM printing across:
- Printing temperature range
- Strength and flexibility
- Ease of printing
- Best applications
| Comparison Table Material | Temp Range | Properties | Ease | Applications |
|---|---|---|---|---|
| PLA | 190-220°C | Moderate strength, brittle | Easy | Prototypes, visual models |
| ABS | 220-250°C | Strong, impact resistant | Moderate | Functional parts, enclosures |
| PETG | 220-250°C | Strong, flexible, chemical resistant | Moderate | Functional parts, outdoor use |
Exercise 6: Support Structure Design
For a part with a 60-degree overhang:
- Determine if support is needed (support angle threshold = 45°)
- Calculate approximate support material percentage
- Choose between linear and tree supports and justify
- Suggest optimal interface layer settings
Analysis
- Yes, support needed (60° > 45° threshold)
- Support volume depends on geometry, typically 10-30% of part volume
- Tree support recommended: 30-50% less material, easier removal
- Interface layers: 3-4 layers at 0.2mm Z-distance for good surface and easy removal
Chapter Summary
This chapter covered the fundamentals of Additive Manufacturing:
- AM Definition : Layer-by-layer material joining process per ISO/ASTM 52900, offering design freedom, material efficiency, and part consolidation
- Seven AM Processes : MEX (FDM), VPP (SLA/DLP), PBF (SLS/SLM/EBM), MJ, BJ, SL, DED - each with unique strengths and applications
- STL File Format : Triangle mesh representation with normal vectors, requiring manifold geometry for printability
- Python STL Processing : Using numpy-stl and trimesh for analysis, verification, and repair
- Slicing Principles : Layer height selection, shell/infill strategies, support generation, and G-code output
- Process Selection : Matching AM technology to application requirements (precision, cost, material, speed)
References
- ISO/ASTM 52900:2021 - Additive manufacturing - General principles - Fundamentals and vocabulary
- Wohlers Report 2023 - 3D Printing and Additive Manufacturing Global State of the Industry
- Gibson, I., Rosen, D., & Stucker, B. (2021). Additive Manufacturing Technologies (3rd ed.). Springer
- Chua, C. K., & Leong, K. F. (2017). 3D Printing and Additive Manufacturing: Principles and Applications (5th ed.). World Scientific
- numpy-stl Documentation: https://numpy-stl.readthedocs.io/
- trimesh Documentation: https://trimsh.org/
- Ultimaker Cura Documentation: https://github.com/Ultimaker/Cura
- PrusaSlicer Documentation: https://github.com/prusa3d/PrusaSlicer
Preview of Next Chapter
Chapter 4 will explore advanced topics in additive manufacturing:
- Multi-material and gradient material printing
- Topology optimization for AM design
- Post-processing techniques (heat treatment, surface finishing, infiltration)
- Quality control and non-destructive testing
- Industrial AM workflow and automation
- Emerging technologies: 4D printing, bioprinting, construction-scale AM
Disclaimer
- This content is provided solely for educational, research, and informational purposes and does not constitute professional advice (legal, accounting, technical warranty, etc.).
- This content and accompanying code examples are provided “AS IS” without any warranty, express or implied, including but not limited to merchantability, fitness for a particular purpose, non-infringement, accuracy, completeness, operation, or safety.
- The author and Tohoku University assume no responsibility for the content, availability, or safety of external links, third-party data, tools, libraries, etc.
- To the maximum extent permitted by applicable law, the author and Tohoku University shall not be liable for any direct, indirect, incidental, special, consequential, or punitive damages arising from the use, execution, or interpretation of this content.
- The content may be changed, updated, or discontinued without notice.
- The copyright and license of this content are subject to the stated conditions (e.g., CC BY 4.0). Such licenses typically include no-warranty clauses.