Image2Gcode: Image-to-G-code generation for additive manufacturing using diffusion-transformer model

Mechanical design and manufacturing workflows conventionally begin with conceptual design, followed by the creation of a detailed computer-aided design (CAD) model and fabrication through material-extrusion (MEX) printing. This process requires converting CAD geometry into machine-readable G-code through slicing and path planning. While each step is well established, the dependence on CAD modeling remains a major bottleneck: constructing object-specific 3D geometry is slow, expertise-intensive, and poorly suited to rapid or ad hoc prototyping scenarios. Even minor design variations typically necessitate manual updates in CAD software, making iteration time-consuming, designer-dependent, and difficult to scale. To address this limitation, we introduce Image2Gcode, an end-to-end data-driven framework that bypasses the CAD stage and generates printer-ready G-code directly from images and part drawings. Instead of relying on an explicit 3D model, a hand-drawn or captured 2D image serves as the sole input. The framework first extracts slice-wise structural cues from the image and then employs a denoising diffusion probabilistic model (DDPM) over G-code sequences, parameterized by a one-dimensional convolutional network. Through iterative denoising, the model transforms Gaussian noise into coherent, executable print-move trajectories with corresponding extrusion parameters, establishing a direct and interpretable mapping from visual input to native toolpaths. By producing structured G-code directly from 2D imagery, Image2Gcode eliminates the need for CAD or STL intermediates, lowering the entry barrier for additive manufacturing and accelerating the design-to-fabrication cycle. This approach supports low-overhead, on-demand prototyping from simple sketches or visual references and integrates naturally with upstream 2D-to-3D reconstruction modules to enable a fully automated pipeline from concept to physical artifact. The result is a flexible, computationally efficient framework that advances accessibility and responsiveness in design iteration, repair workflows, and distributed manufacturing contexts. • End-to-end framework that converts 2D images directly into printer-ready G-code for MEX printing. • Denoising diffusion–Transformer model defined over G-code sequences. • Visual inputs condition executable G-code generation via cross-attention, bypassing explicit CAD and STL stages. • Generated toolpaths are structurally consistent with target geometries and validated through real 3D printing experiments.

Authors

Institutions

Publication Details

Journal
Additive Manufacturing Letters
Published
2026-03-22
DOI
https://doi.org/10.1016/j.addlet.2026.100374
Primary Topic
Additive Manufacturing and 3D Printing Technologies
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Image2Gcode: Image-to-G-code generation for additive manufacturing using diffusion-transformer model

Yayati Jadhav, Peter Pak, Amir Barati Farimani, Ziyue Wang
Additive Manufacturing Letters
Additive Manufacturing and 3D Printing Technologies
article

Image2Gcode: Image-to-G-code generation for additive manufacturing using diffusion-transformer model

Yayati Jadhav, Peter Pak, Amir Barati Farimani, Ziyue Wang
article en

Abstract

Mechanical design and manufacturing workflows conventionally begin with conceptual design, followed by the creation of a detailed computer-aided design (CAD) model and fabrication through material-extrusion (MEX) printing. This process requires converting CAD geometry into machine-readable G-code through slicing and path planning. While each step is well established, the dependence on CAD modeling remains a major bottleneck: constructing object-specific 3D geometry is slow, expertise-intensive, and poorly suited to rapid or ad hoc prototyping scenarios. Even minor design variations typically necessitate manual updates in CAD software, making iteration time-consuming, designer-dependent, and difficult to scale. To address this limitation, we introduce Image2Gcode, an end-to-end data-driven framework that bypasses the CAD stage and generates printer-ready G-code directly from images and part drawings. Instead of relying on an explicit 3D model, a hand-drawn or captured 2D image serves as the sole input. The framework first extracts slice-wise structural cues from the image and then employs a denoising diffusion probabilistic model (DDPM) over G-code sequences, parameterized by a one-dimensional convolutional network. Through iterative denoising, the model transforms Gaussian noise into coherent, executable print-move trajectories with corresponding extrusion parameters, establishing a direct and interpretable mapping from visual input to native toolpaths. By producing structured G-code directly from 2D imagery, Image2Gcode eliminates the need for CAD or STL intermediates, lowering the entry barrier for additive manufacturing and accelerating the design-to-fabrication cycle. This approach supports low-overhead, on-demand prototyping from simple sketches or visual references and integrates naturally with upstream 2D-to-3D reconstruction modules to enable a fully automated pipeline from concept to physical artifact. The result is a flexible, computationally efficient framework that advances accessibility and responsiveness in design iteration, repair workflows, and distributed manufacturing contexts. • End-to-end framework that converts 2D images directly into printer-ready G-code for MEX printing. • Denoising diffusion–Transformer model defined over G-code sequences. • Visual inputs condition executable G-code generation via cross-attention, bypassing explicit CAD and STL stages. • Generated toolpaths are structurally consistent with target geometries and validated through real 3D printing experiments.

Additive Manufacturing LettersVol. 17
Carnegie Mellon University (US)
Affordable and clean energy
Openalex Percentile: Top 13%
Additive Manufacturing and 3D Printing Technologies
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.