# A G-Code-Driven Modeling and Thermo-Mechanical Coupling Analysis Method for the FDM Process of Complex Lightweight Structures

**Authors:** Dinghe Li, Yiheng Dun, Zhuoran Yang, Rui Zhou, Yuxia Chen

PMC · DOI: 10.3390/ma19061200 · Materials · 2026-03-18

## TL;DR

This paper introduces a new method for simulating the FDM 3D printing process using G-code to better predict thermal and mechanical behavior in complex structures.

## Contribution

A G-code-driven, filament-level modeling and simulation workflow for FDM with improved robustness for complex geometries and infill strategies.

## Key findings

- High-temperature zones follow newly deposited paths with peak temperatures near 220 °C.
- Displacement and von Mises stress are strongly influenced by infill topology and boundary conditions.
- The centroid-based element selection strategy improves simulation robustness for complex meshes.

## Abstract

Accurate prediction of thermo-mechanical behavior in Fused Deposition Modeling (FDM) is often limited by mismatches between idealized Computer-Aided Design (CAD) geometry and path-dependent material deposition. This paper presents a G-code-driven, filament-level modeling and process-simulation workflow for complex geometries and infill strategies, especially toolpaths with in-plane inclinations. Extrusion segments are parsed from slicing G-code to obtain endpoints and process parameters, and each filament is reconstructed as a path-aligned rectangular bead using a dedicated local coordinate system. Progressive deposition is simulated in ANSYS Parametric Design Language (APDL) via an element birth–death method, enhanced by a centroid-based element selection strategy that reduces dependence on strictly aligned hexahedral partitions and improves robustness for complex meshes. A nonlinear transient thermal analysis is performed, and temperatures are mapped to the structural model through an indirect thermo-mechanical coupling scheme to predict warpage and residual stresses. Case studies on square plates with triangular and hexagonal infills (with/without sidewalls and a bottom base) show that the high-temperature zone follows newly deposited paths with peak temperatures near 220 °C, while displacement and von Mises stress accumulate and are strongly affected by infill topology and boundary conditions.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC13028547/full.md

## Figures

28 figures with captions in the complete paper: https://tomesphere.com/paper/PMC13028547/full.md

## References

34 references — full list in the complete paper: https://tomesphere.com/paper/PMC13028547/full.md

---
Source: https://tomesphere.com/paper/PMC13028547