Researchers have developed an instruction-level optimization framework that modifies three-dimensional printer toolpaths after slicing, reducing material consumption by twenty-two to twenty-five percent without compromising geometric accuracy or structural performance. In conventional fused deposition modeling, software translates computer-aided design files into machine-readable numerical control code, known as G-code, using static, globally uniform parameters. A study authored by Laith Al-Juboori introduces a post-slicing pipeline that intervenes directly at this instruction level, optimizing toolpaths without altering original CAD geometry or re-executing slicing algorithms. Validated across three functional geometries—a quadcopter frame, an ASTM D638 tensile specimen, and a complex mounting bracket—the framework maintained a sub-voxel geometric root-mean-square deviation below 0.05 millimeters. Concurrently, targeted reinforcement delivered a twelve percent increase in peak mechanical load and a nine percent increase in flexural stiffness across tested quadcopter arms, accompanied by a moderate seven to nine percent increase in total printing time under controlled experimental conditions.
In commercial additive manufacturing, standard slicing software converts three-dimensional geometries into planar toolpaths using static heuristics. These algorithms routinely assign uniform layer heights, fixed extrusion widths, and constant nominal feedrates across entire parts, regardless of local geometric complexity or functional requirements. As a consequence, conventionally sliced components frequently suffer from inefficient material usage, suboptimal surface quality, and limited adaptability in high-stress zones. Furthermore, variations in slicing software engines can produce widely divergent toolpath kinematics and extrusion behaviors for identical digital geometries printed on the same machine.
Existing efforts to overcome these manufacturing limitations have generally divided into slicer-level modifications and post-processing tools, each presenting notable operational trade-offs. Slicer-level strategies—such as geometry-aware slicing, non-planar deposition, and multi-axis printing—frequently demand iterative computer-aided design transformations, specialized hardware configurations, or customized firmware modifications that remain inaccessible to standard desktop setups. Conversely, manual toolpath design environments provide explicit control over individual motion blocks, but their reliance on exhaustive manual input renders them impractical for complex geometric assemblies. Meanwhile, conventional post-processing software has largely remained restricted to global parameter scaling, such as uniform feedrate reductions or retraction tweaks, which fail to address localized stress distributions or curvature variations. A critical gap has therefore persisted for automated, instruction-level systems capable of localized adaptation. To resolve this, the presented framework establishes four operational requirements: printer safety through numerically stable instructions, backward compatibility without CAD alteration, contextual intelligence combining geometric and process reasoning, and end-to-end automation minimizing manual intervention.
The operational architecture of the framework relies on a decoupled, modular pipeline that reconstructs toolpaths before applying localized modifications. The process begins with standard slicer-generated G-code, which is read line-by-line by a dedicated parser. Because standard slicing engines frequently omit repeated spatial coordinates to optimize file size, the parser tracks modal states across Cartesian coordinates, instantaneous feedrates, and extrusion values to recover continuous toolpath trajectories. This reconstructed state is then fed into three parallel analysis engines: a geometric curvature analyzer, a functional reinforcement rule engine, and an unsupervised artificial intelligence weak-zone detector. The outputs from these three modules are synthesized into a coherent instruction modification policy that calculates bounded adjustments for incremental extrusion and local feedrates. Crucially, the decoupled structure ensures that geometric analysis, functional rules, and data-driven detection operate independently, allowing individual modules to be updated or substituted without altering the underlying toolpath rewriting engine or compromising basic hardware safety protocols.
Local geometric curvature is calculated along the horizontal toolpath using the angle between consecutive motion vectors across sequential points. Sharp corners and tight arcs exhibit large angular variations, identifying high-curvature zones where thinner layers are required to preserve surface fidelity and suppress stair-stepping artifacts. Conversely, low-curvature regions, such as linear paths and broad arcs, exhibit minimal angular divergence, allowing thicker layers that reduce overall material usage without degrading exterior quality. To maintain structural cohesion, adaptive layer height adjustments operate under strict physical constraints. Original vertical layer boundaries and total layer counts are preserved verbatim, maintaining vertical alignment for walls, infill, and bridges. Layer height variations are capped at plus or minus twenty-five percent for wall perimeters and forty percent for infill, while unsupported bridge regions are completely excluded from layer thinning. Furthermore, all height transitions are filtered using a moving median filter to prevent abrupt dimensional steps along the toolpath.
To enforce physical extrusion correctness and prevent compounding rounding errors, the optimized G-code is converted into relative extrusion mode using M83 commands. Absolute extrusion coordinates from the source file are transformed into incremental delta E values, ensuring that scaling modifications apply strictly to individual path segments rather than accumulating across the entire print. The instantaneous volumetric flow rate is computed for every deposited segment by multiplying layer height, extrusion width, and feedrate, and bounded to remain within ninety percent of hardware limits. In benchmark tests, the peak volumetric flow reached 9.8 cubic millimeters per second, well below the 12.0 cubic millimeters per second threshold established for the filament. Furthermore, retraction moves are identified and preserved verbatim; all 247 retraction events and their cumulative volume of 124.3 cubic millimeters were maintained without alteration, preventing unintended stringing, oozing, or nozzle leakage while ensuring that printer-specific pressure advance firmware calibrations remain functionally valid.
Functional reinforcement and motion smoothing operate in tandem to optimize component durability and deposition dynamics. In functional components such as the quadcopter frame, motor arms are detected radially from the part center, and extrusion within these identified bands is scaled by a reinforcement factor of 1.3 to enhance rigidity and vibration resistance. Concurrently, feedrates are adaptively reduced along sharp turns to curb toolhead acceleration jerk and machine vibration, mitigating mechanical resonance that could induce surface imperfections. To avoid localized polymer overheating or under-extrusion caused by excessive nozzle dwell time, the framework imposes a strict minimum feedrate threshold of 15 millimeters per second. Because this smoothing operates strictly within the toolpath’s original kinematic boundaries, it respects configured firmware acceleration and jerk limits without demanding custom hardware reconfiguration. Sensitivity testing showed that minimum feedrates primarily dictate printing time increases, which range from six to twelve percent across standard operational ranges while protecting fine geometric details.
To identify subtle structural vulnerabilities that simple geometric rules miss, the framework incorporates an unsupervised machine learning module based on k-means clustering. For every deposited toolpath point, excluding travel and retraction moves, the system constructs a three-dimensional feature vector containing local curvature angle, the rate of extrusion change per unit length, and binary arm-zone membership. These features undergo z-score normalization to ensure zero mean and unit variance, preventing angular degrees from dominating distance metrics during clustering. By evaluating the within-cluster sum of squares and silhouette scores across cluster counts from two to ten, the researchers identified an optimal cluster count of five, which maximized silhouette separation at 0.61. Clusters exhibiting high curvature above 40 degrees and extrusion gradients exceeding 0.2 inverse millimeters are classified as weak zones. In experimental validation with intentional defects, eighty-two percent of physical part fractures occurred in these algorithmically flagged regions, confirming the predictive efficacy of data-driven weak-zone detection.
Empirical validation was performed on a Creality Ender-3 V2 3D printer using a 0.4-millimeter nozzle and carbon-fiber-reinforced polyamide filament dried at 70 degrees Celsius before printing. Baseline G-code was generated in Ultimaker Cura 5.0 using standard parameters, including 0.2-millimeter layer heights, 250 degrees Celsius extrusion temperatures, and 50 millimeters per second printing speeds. Three independent prints of each G-code variant were fabricated across three distinct geometries: a quadcopter frame, an ASTM D638 tensile coupon, and an industrial mounting bracket with curved interfaces and overhangs. On the quadcopter, total extruded volume dropped from 3,401.8 to 2,549.3 cubic millimeters, representing 25.1 percent material savings with an 8 percent print time increase. Tensile specimens achieved 22.3 percent material savings with only a 2.9 percent reduction in ultimate tensile strength, while the mounting bracket achieved 24.8 percent savings without functional failure. Structured-light 3D scanning confirmed an average surface deviation of 0.079 millimeters for optimized prints versus 0.081 millimeters for original prints.
Surface metrology and ablation testing further illuminated the discrete contributions of each module alongside quantified operational boundaries. Optical profilometry demonstrated a 31 percent reduction in surface roughness Ra across high-curvature junctions, dropping from 12.4 to 8.6 micrometers. Ablation tests confirmed that adaptive layer height accounted for 16 percent of the total 25 percent material savings, while feedrate smoothing governed surface finish and machine stability. The unsupervised clustering module identified 23 percent more localized weak zones than static geometric rules alone. Execution benchmarks on an Intel Core i7 desktop showed the algorithm processed a 28-megabyte quadcopter G-code file in 8.3 to 11.3 seconds, scaling linearly up to 77.6 seconds for 250-megabyte files. Nevertheless, the authors emphasize that experimental validation remains limited to a single material, one printer class, and three specific geometries. Future research must expand testing across direct-drive systems, non-Cartesian architectures, steep vertical overhangs, and dynamic fatigue cycles before industrial adoption can occur.
Subject of Research: Post-slicing G-code optimization for material-efficient fused deposition modeling
Article Title: AI-assisted, curvature-aware post-slicing G-code optimization for material-efficient FDM printing
Article References: Al-Juboori, L. (2026). AI-assisted, curvature-aware post-slicing G-code optimization for material-efficient FDM printing. Journal of King Saud University – Engineering Sciences, 38(5), Article 35. https://doi.org/10.1007/s44444-026-00109-y
Image Credits: AI Generated
DOI: 10.1007/s44444-026-00109-y
Keywords: Fused Deposition Modeling, G-code Optimization, Additive Manufacturing, Adaptive Layer Height, Curvature-Aware Toolpaths, Material Efficiency, Relative Extrusion, K-means Clustering, Weak-Zone Detection, Feedrate Smoothing, Polyamide Filament, Quadcopter Frame, Three-Point Bend Testing, Optical Profilometry, Surface Roughness, Structured-Light Scanning, Ultimaker Cura
News Source: Denise Maddox. (November 18, 2026). Post-slicing toolpath optimization reduces 3D printing material use by 25 percent. Scienmag.



