Next Article in Journal
Electrospun Conductive Composites with Anisotropic Microstructures and Tunable Mechanical Properties for Wearable Bioelectronics
Previous Article in Journal
Recycling and Degradation of Polymeric Materials: Exploring Different Perspectives in Plastic Waste Management
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Generic Geometric Code-Parsing Framework for Corner Optimization in Curved-Surface Directed Energy Deposition

School of Materials Science and Engineering, Central South University, Changsha 410083, China
*
Author to whom correspondence should be addressed.
Materials 2026, 19(4), 683; https://doi.org/10.3390/ma19040683
Submission received: 8 January 2026 / Revised: 31 January 2026 / Accepted: 7 February 2026 / Published: 11 February 2026

Abstract

Laser-cladding directed energy deposition enables both the repair and fabrication of complex metallic components with curved surfaces. However, during multi-axis deposition on curved substrates, sharp transient feed-rate fluctuations at corner segments—together with an approximately constant powder feed rate—readily cause local over-deposition and geometric defects (e.g., nodules and humps). These defects compromise surface-profile fidelity, thereby creating a major barrier to practical deployment. To overcome this limitation, we propose a corner-oriented path-optimization strategy based on geometric code parsing. By operating directly on the toolpath without modifying the Computer-Aided Design model or slicing workflow, the proposed method suppresses corner overbuild and associated morphological distortion in curved-surface directed energy deposition, substantially improving dimensional consistency and surface quality. Overall, this strategy provides a scalable and broadly applicable route toward high-precision, high-reliability, industrial-scale curved-surface additive manufacturing.

1. Introduction

Metal additive manufacturing is a cornerstone of advanced manufacturing. Among the available approaches, laser-cladding directed energy deposition (DED) has attracted considerable interest in aerospace, mold manufacturing, and high-end equipment remanufacturing, owing to its capability for near-net-shape fabrication, robust metallurgical bonding, and functionally graded multi-material architectures [1,2,3,4,5]. Extending DED from planar substrates to complex curved surfaces—such as cylinders [6], gears [7], blades [8], cutting dies [9], and conformal-cooling molds—enables rapid, localized repair and performance enhancement of high-value components, thereby expanding design freedom and improving in-service performance [10,11,12,13,14].
However, DED on curved surfaces introduces process–formability challenges beyond those on planar substrates. First, surface inclination modulates gravity-driven flow, capillary forces, and the shielding-gas field around the melt pool, reshaping melt-pool morphology and solidification dynamics [15,16,17]. Second, in multi-axis systems, coordinating the translational motion of the deposition head with the substrate rotation becomes critical and sensitive to kinematic transients. At path corners, Computer Numerical Control (CNC) acceleration–deceleration can cause sharp fluctuations in traverse speed [18,19,20]. With powder feed rate and laser power kept approximately constant, the deposited mass per unit length rises near corners, resulting in local overbuild and defects (e.g., nodules and humps) that degrade geometric accuracy and surface quality of the cladded track and impede industrial adoption [21,22,23,24,25]. Accordingly, this work targets CNC-induced corner feedrate transients that drive localized over-deposition and contour distortion under near-constant powder and power input. This issue is especially relevant for curved-surface rotary die manufacturing, where a finite machining allowance is intentionally reserved after deposition for final finishing. In laser powder DED, the as-built dimensional capability is typically at the sub-millimeter to ~1 mm level (e.g., IT15–IT17 tolerance grades and profile errors approaching ~1 mm), while post-machining allowances of approximately 0.45–0.5 mm are commonly planned [26]. Therefore, corner overbuild of comparable magnitude can rapidly consume the reserved allowance and substantially increase finishing effort, underscoring the practical necessity of corner-specific optimization. Mitigating such corner-induced over-deposition can improve manufacturing yield and repeatability, thereby reducing rework, material waste, and energy consumption in DED production. Accordingly, tightly controlled track morphology and stable process behavior are prerequisites for high-precision curved-surface DED and for robust scale-up.
To address these challenges, researchers have systematically optimized process parameters and deposition paths, yielding notable improvements in deposition quality for curved-surface DED. Methodologically, the related studies can be broadly categorized into three streams: (i) curved-surface toolpath generation and deposition head control to stabilize standoff and bead morphology on nonplanar geometries; (ii) corner-quality improvement via feedrate pre-regulation and axis-velocity tuning to suppress corner accumulation under quasi-constant powder and power input; and (iii) multi-axis path planning that improves motion smoothness and geometric fidelity.
Within these streams, Calleja et al. [27] investigated continuous five-axis laser deposition of representative curved components (e.g., blades) and introduced a feedrate-calculation framework with variable-feed programming to promote uniform deposition; adaptive regulation of traverse speed improved bead uniformity. Wang et al. [28] addressed trajectory planning for remanufacturing complex curved parts and developed a path-generation method coupling point-cloud slicing with NURBS surface fitting. Together with an identified effective defocus-distance window, the approach maintains alignment between the nozzle axis and the local surface normal while accommodating continuous height variations, enabling stable tracking of curved cladding trajectories and high-quality cladded layers. Montoya-Zapata et al. [29] reported a computational optimization-based velocity pre-regulation strategy that curbs corner accumulation by pre-planning and controlling nozzle velocity. Accounting for CNC kinematic constraints, Pereira et al. [30] developed a process-optimization approach that suppresses right-angle corner build-up by tuning axis velocities and positioning accuracy, yielding a more stable layer height and reduced corner accumulation in thin-walled orthogonal features. Liu et al. [31] introduced a scan-path planning algorithm for curved parts that jointly accounts for process parameters, surface characteristics, and bead morphology, improving path-positioning and orientation accuracy and enabling high-precision repair on curved surfaces. More recently, He et al. [32] proposed a feedrate-preserved motion-planning method for five-axis DED that optimizes rotary-axis motion under kinematic constraints to better maintain the realized feedrate along freeform paths. Zhao et al. [33] proposed an integrated DED system and optimized process-planning algorithm that combines contour offset, zigzag infill, and a constraint-compensation strategy to reduce edge/node forming defects and improve geometric accuracy in complex parts. Beyond geometry and kinematics-driven planning, statistical design-of-experiments and data-driven modeling have also been adopted to quantify parameter sensitivity and guide optimization in manufacturing-related processes. For example, Milojević and Stojanović employed the Taguchi method (with ANOVA) together with an ANN-based model to analyze factor contributions and predict optimal conditions, showing good agreement between the statistical optimization and learning-based prediction [34].
Despite these advances, corner segments on curved toolpaths remain prone to overbuild and shape distortion, as curvature and traverse speed can change abruptly. Mainstream slicers (e.g., Cura and Slic3r) typically generate largely planar, layer-wise toolpaths [35,36,37], while conventional CNC controllers handle corners mainly via kinematic approximations [38,39], with limited awareness of the coupled powder feed rate and thermal input that govern bead growth in DED [40,41]. This gap is further exacerbated by proprietary, closed control stacks in industrial systems, which hinder geometric Code (G-code) level reconstruction of the realized trajectory and speed for post-processing [42]. Therefore, there is a need for a workflow that, without altering existing CAD modeling and slicing procedures, performs secondary parsing and dynamic reconstruction of standard G-code to enable targeted optimization of corner paths in curved-surface DED—a technically underexplored yet highly practical direction for engineering applications.
In this work, we propose and validate a generic G-code post-processing framework for curved-surface DED that improves corner accuracy at the process-execution level. Implemented within open-source host software, the framework embeds an algorithmic engine that automatically flags high-risk corners and locally re-parses and interpolates standard G-code to reconstruct the as-executed toolpath and feedrate profile, thereby improving geometric fidelity in curved-surface DED. We demonstrate the approach on a curved-surface laser-cladding platform by depositing M2 high-speed-steel powder onto a 316L stainless-steel cylinder. Systematic assessment of the as-built quality confirms the improvements enabled by the proposed framework. Overall, this strategy offers a practical route to high-precision, scalable curved-surface DED for complex components, while reducing corner overbuild, preserving machining allowance, and lowering finishing and rework burden in curved-surface remanufacturing.

2. Materials and Methods

2.1. Materials and Laser Cladding Equipment

A custom-built curved-surface laser-cladding DED platform was used in this study. The system comprised a fiber laser, a coaxial powder-feeding nozzle, a four-axis CNC stage (linear X/Y/Z axes and a rotary C axis for drum rotation), a powder-delivery unit, a water-cooling system, and control software. Detailed specifications of the DED platform components are summarized in Table S1. Information on the software tools used in this work is provided in Table S2. The deposition head (Figure 1a,b) provided lateral motion in the X-Y plane, whereas the Z axis controlled layer-wise lift. The cylindrical drum was rotated about its own axis by the C axis, enabling deposition on the curved surface.
Gas-atomized M2 high-speed-steel (HSS) powder with a particle-size range of 75–250 μm (Figure 1c,d) and composition summarized in Table 1 was purchased from Hunan Hualiu New Material Co., Ltd. (Changsha, China) and delivered coaxially into the melt pool at a constant mass flow rate. A 316L stainless-steel cylindrical drum (50 mm in diameter) served as the substrate; its surface was machined and sandblasted to enhance wettability and adhesion. Key process variables included laser power, traverse speed, powder feed rate, and shielding-gas flow rate. An operating window was established through preliminary trials. For comparative experiments, laser power, powder feed rate, shielding-gas flow rate, hatch spacing, and layer step height were kept identical; thus, differences in build quality are attributed to the post-processed G-code reconstruction confined to corner segments.

2.2. Process Planning Software

Building on the open-source software Slic3r v1.2.9.80 and PrintRun v2.0.0, we developed a process-planning framework for curved-surface DED by extending the conventional planar-slicing pipeline into a unified workflow that supports curved-surface slicing transformations, G-code parsing, and corner optimization.
Figure 2 summarizes the software architecture. The system comprises three tightly coupled modules: modeling, planning, and post-processing. The modelling module ingests triangular-mesh models (e.g., STL), applies geometric transformations, and converts representations between planar and curved coordinate systems, providing standardized inputs for subsequent slicing and toolpath computation. As the system core, the planning module performs slicing, specifies process parameters, and generates and optimizes toolpaths. After slicing, each layer cross-section is partitioned into functional regions (outer and inner contours, infill, and supports), which are then labeled with geometric and semantic attributes. Toolpaths are then generated for the outer wall, inner wall, and infill, and standard G-code is exported. The post-processing module then performs second-pass parsing and localized G-code rewriting where needed (e.g., in corner segments), optionally enables expert-guided fine-tuning of local toolpaths, and exports the finalized G-code to the CNC controller for execution. With this integrated “modelling–planning–post-processing” architecture, the software remains compatible with mainstream slicing engines while enabling transparent, G-code-level secondary planning and corner optimization for G-code from diverse sources, thereby improving build quality and process stability in curved-surface laser cladding.

2.3. Origin of Corner-Accumulation Defects

In our curved-surface DED system, straight toolpath segments along the cylinder generatrix yield a relatively stable cladded-track morphology when the translational motion of the X/Y axes is properly coordinated with the rotation of the C axis. At contour corners, however, the X/Y velocity vector changes abruptly, whereas the rotary C-axis acceleration–deceleration is not fully synchronized with that of the linear axes. In addition, owing to the reduction-gear train, the drum’s actual tangential surface speed can deviate substantially from the commanded CNC speed during acceleration and deceleration transients. This transient mismatch effectively reduces the local traverse speed while the powder delivery rate remains unchanged, thereby increasing the deposited mass per unit length near corner segments and giving rise to macroscopic overbuild defects, such as nodules and humps.
Corner-region defects arise partly because geometric modeling and path planning are formulated in Cartesian coordinates, whereas slicer-generated G-code implicitly assumes straight-line (polyline) motions in a planar domain. Curved-surface DED instead couples translation of the deposition head with rotation of a cylindrical drum: the head feeds in the machine X-Y directions, the Z axis provides layer-wise lift, and the C axis rotates the drum to effectively “unwrap” the surface during deposition. The servo-driven head can closely follow a commanded constant-speed profile, but drum rotation is transmitted through a reduction gear train, which introduces acceleration–braking transients at segment start and end. As a result, even with a constant programmed feed rate, the drum’s tangential surface speed drops near these transients, creating kinematic conditions that promote corner accumulation.
To qualitatively elucidate the corner-accumulation mechanism, we approximate the DED over a short time interval as a one-dimensional, steady powder-feeding process. The powder mass flow rate is denoted by m, the scanning speed by ν the spot width by w, the material density by ρ , and the local deposit height by h. Approximating the deposited volume V over a time step Δt as a rectangular prism of length ν Δt, width w , and height h. Therefore, the deposited volume per unit time can be written as [43]:
V   =   m ρ ν   w   h ,
Accordingly, the local deposit height h can be approximately expressed as:
h     m ρ   ν   w ,
Here, the capture efficiency and effective width are treated as locally constant over a short time interval; therefore, the relation is used to explain the trend in corner accumulation rather than to predict absolute height under full 3D melt-pool dynamics. Single-track results (Figure S2 and Table S3) further show that bead height decreases with increasing ν , consistent with the trend implied by Equation (2).
Under constant powder feed and fixed laser power, the local deposit height h is governed primarily by the traverse speed ν . When the CNC controller enforces deceleration at corners while the powder feed rate remains unchanged, ν drops sharply, and h increases accordingly, leading to local overbuild and the formation of nodules that protrude above the surrounding track. Conversely, if ν increases at corners, the deposited mass per unit length decreases, which can cause under-deposition and a locally reduced track height.
In practical curved-surface DED, the effective bead width w and capture efficiency can vary with standoff distance, surface inclination, powder-stream overlap, and local thermal history, which jointly influence melt-pool size, wetting, and dilution [44]. Consequently, deviations from the idealized h ∝ 1/ ν scaling may occur, especially under strong 3D thermal coupling in multi-track or multi-layer deposition. In this work, the 1D relation is intentionally employed as a first-order, physically interpretable explanation of why CNC-induced feedrate transients at corners promote local over-deposition under near-constant powder and power input.
Moreover, on a cylindrical substrate, the local traverse speed ν is not only shaped by corner deceleration but also by the kinematic mapping between the commanded rotary motion and the tangential surface velocity, which introduces an additional source of corner-specific speed transients. Specifically, the drum radius and the deposit height jointly determine the linear mapping between the C-axis angular velocity and the tangential linear speed:
ν t   =   ω C   ( r   +   h ) ,
where ν t denotes the tangential speed of the drum at the deposition track, ω C is the C-axis angular velocity, r is the drum radius, and h is the local deposit height. As the effective drum diameter increases during layer-by-layer deposition, continued use of the initial speed-to-angle conversion factor causes the C-axis tangential surface speed to drift progressively from the target value.
The analysis above suggests that empirical tuning of corner parameters (e.g., reducing the feed rate) is unlikely to eliminate corner-region defects at their root. Instead, a systematic optimization strategy is required at the levels of path planning and motion control to regulate corner-speed transients and impose robust constraints on speed variation.

2.4. Linear Mapping from Planar Paths to Cylindrical-Surface Paths

Conventional slicers model and slice STL meshes in a Cartesian coordinate system, producing toolpaths defined in the planar coordinate frame (x, y, z). The drum-based curved-surface fabrication considered here can be regarded as “unwrapping” the cylindrical surface along a generatrix to form a planar development. Accordingly, curved-surface deposition can be achieved without altering the original path geometry by establishing a one-to-one mapping between planar toolpaths and drum rotation about the C axis. For a cylinder of radius R, the circumferential coordinate s on the unwrapped plane is related to the drum rotation angle θ by:
s   =   R   θ ,
Provided that the distance from the laser-spot center to the drum axis remains constant, the relation above ensures an isometric (equal-arc-length) mapping between the planar and cylindrical paths. In the path-transformation module, we first parse the translational commands in the G-code into discrete path points s (xi, yi, zi) in the working coordinate frame, where yi denotes the circumferential coordinate on the unwrapped plane. Subsequently, these points are mapped according to:
θ i   =   y i R   ×   180 π ,   Z i   =   Z i ,   X i   =   X i ,
The mapping converts planar path points into C-axis rotation commands, decoupling head translation from drum rotation and enabling curved-surface deposition.
During layer-by-layer deposition on the drum surface, the local effective radius increases after each layer and can be approximated as ΔR ≈ h, where h is the single-layer height. If this coordinate conversion is repeated for every layer, the same planar path must be re-encoded into G-code using an updated diameter each time, substantially increasing the computational and implementation burden of curved-surface toolpath planning in slicers. Notably, for a cylindrical drum, the angular sequence associated with a given contour is uniquely determined by its geometry; interlayer radius growth primarily rescales the arc length without changing the underlying angular progression. On this basis, we propose a first-layer angular-vector reuse strategy that accommodates diameter growth across layers without re-slicing and re-generating the full toolpath for each layer. The influence of first-layer deviations on multilayer stability and the associated error-propagation analysis are discussed in Supplementary Section S3.2.
For the first layer, conventional toolpath planning is performed on the unwrapped plane, and the resulting planar path is mapped onto the cylindrical surface via s = R θ . This mapping yields an angular sequence { θ i(1)} for all first-layer path points, which we define as the baseline angular trajectory. For subsequent layers (k > 1), the effective radius R(k) is updated recursively from the known layer height, whereas the angular coordinates are not recomputed. Accordingly, the C-axis commands at layer k reuse the first-layer sequence by setting θ i(k) = θ i(1), thereby enforcing strict interlayer alignment in the angular direction. If a small radius correction is required during fabrication, it is sufficient to update the global radius parameter R(k) in the path-transformation module without recalculating per-layer angles or path-point locations. Overall, this scheme preserves the geometric consistency of toolpath planning while decoupling interlayer diameter growth from angular planning, such that the angular sequence remains invariant throughout fabrication. As a result, curved-surface G-code generation and management are simplified, and a unified geometric basis is provided for subsequent localized corner refinement and online process adjustment.
From a practical standpoint, the angular-sequence reuse remains stable as long as the first-layer radius-equivalent deviation is small relative to the drum-scale effective radius, such that the induced tangential-speed perturbation (first-order proportional to δR1/Reff; see Supplementary Section S3.2) remains minor. In our rotary-die setting, a machining allowance is intentionally reserved after deposition; therefore, moderate first-layer height nonuniformity that does not cause pronounced standoff changes will not compromise downstream finishing. The method may begin to lose robustness when severe first-layer overbuild/under-deposition locally alters standoff and melt-pool behavior, in which case periodic updating of the effective radius or in-process monitoring can be used to maintain stability.

2.5. Corner Identification on Curved-Surface Toolpaths

After STL slicing and mapping from planar paths to drum-based curved-surface toolpaths, the trajectories are delivered to the CNC system as G-code. Corner-path optimization, therefore, begins with fine-grained G-code parsing. To this end, we developed a standalone G-code parsing module that extracts geometric paths, feed rates, and layer information from G-code generated by diverse slicers. Based on these data, the module automatically detects and labels corner locations, providing the basis for subsequent corner interpolation and speed-matching algorithms. For a closed path, any three consecutive points Pi−1, Pi and Pi+1 form a local corner unit. Define the adjacent segment vectors as:
SV   =   P i 1 P i ,     VE   =   P i P i + 1 ,
where the start point is S (xi−1, yi−1), the end point is E (xi+1, yi+1), and the vertex is V (xi, yi). The cosine of the internal angle α at V is computed using the vector dot product:
cos α i   =   SV · VE SV VE ,
Expanding in the x-y plane, the expression can be written as:
cos α i   =   x i     x i 1 x i + 1     x i   +   y i     y i 1 y i + 1     y i x i     x i 1 2   +   y i     y i 1 2 x i + 1     x i 2   +   y i + 1     y i 2 ,
For a straight segment, α i = π , and therefore cos α i = −1. When the toolpath turns at this point, α i becomes smaller than π . As α i decreases, cos α i increases toward 1, indicating an increasingly sharp corner. Accordingly, α i can be used as a geometric metric of corner sharpness.
Corner identification based solely on geometric angles can introduce numerous weak turns, diluting the focus of targeted optimization. Moreover, in extremely low-speed regions, even moderate turns may have a limited effect on deposit height. To address this, we introduce a dual-threshold criterion that combines the cosine of the internal angle with the local traverse speed. Specifically, we denote the cosine threshold as (cos α th) and the speed threshold as v th. A corner unit is flagged only if it satisfies both criteria:
cos α i     cos α t h , v i ¯   =   1 2   v i 1   +   v i     v t h ,
Accordingly, the point is labeled as a high-risk corner. Here, cos α th controls the required degree of geometric turning: when cos αi exceeds this threshold, the corner is considered sufficiently sharp to warrant optimization. The speed threshold v th represents the minimum allowable traverse speed for stable melt-pool formation within the current processing window. When the local speed v i exceeds v th, corner-speed variations exert a stronger influence on the deposited mass per unit length, and hence on deposit height and melt-pool morphology; such corners are therefore prioritized for optimization. In practice, both thresholds are adjustable to accommodate different materials, geometries, and processing windows.

2.6. Sample Fabrication and Characterization

To systematically evaluate the impact of corner-path optimization on build quality in curved-surface DED, all validation experiments were conducted on the surface of a cylindrical drum. Two representative closed contours—a square and a complex arc-shaped profile—were selected as test geometries. With the drum diameter fixed and all process parameters (including laser power, powder feed rate, and layer thickness) held constant, multiple specimens for each contour were fabricated on the drum surface using two strategies: an unoptimized baseline path and the proposed corner-path optimization. The resulting builds were compared in terms of circumferential height distribution, corner overbuild severity, circumferential continuity, and the incidence of macroscopic defects (e.g., bulges, collapses, and humps).
To characterize defect-prone regions, cross-sections of baseline and optimized builds were extracted across the corner and arc-transition regions by wire electrical discharge machining. All sections were ground sequentially with sandpaper and polished with diamond abrasives. Optical micrographs were acquired on an optical microscope (CX40M, Shanghai Shunyu Hengping Scientific Instrument Co., Ltd., Shanghai, China) without chemical etching. For SEM observation, the polished sections were briefly etched in aqua regia for 2–4 s, rinsed with deionized water, and dried before imaging by scanning electron microscopy (TESCAN MIRA 4, TESCAN ORSAY HOLDING, a.s., Brno, Czech Republic). The equipment, key preparation, and imaging conditions are summarized in Table 2.

3. Results and Discussion

This section demonstrates that corner defects in curved-surface directed energy deposition are primarily driven by CNC-induced corner feedrate transients under near-constant powder and power input, and that such defects can be mitigated by execution-aware G-code post-processing. Two complementary strategies are validated: LPI smooths local feedrate transitions via corner-path re-interpolation, and CMI reconstructs coordinated multi-axis corner motion to regulate the realized corner feedrate profile. The effectiveness is supported by improved corner morphology and circumferential height continuity, together with defect-suppressed corner cross-sections in metallographic observations. Application-level validation on a rotary-die case further indicates that the proposed workflow is practical for reliable curved-surface deposition and subsequent machining.

3.1. Overview of the Path-Optimization Algorithm

Our corner-path optimization algorithm takes G-code exported from diverse slicers as input and follows a four-step pipeline—identification, decision, interpolation, and regeneration—to locally reconstruct the trajectory and traverse-speed profile in corner regions during drum-based curved-surface deposition. By reshaping both the path geometry and motion commands at these critical segments, the algorithm mitigates corner overbuild and suppresses hump-like defects.
The algorithmic workflow is illustrated in Figure 3. First, during parameter initialization, the algorithm imports the target G-code file and defines two thresholds based on the part geometry and the established processing window: a corner-angle threshold and a traverse-speed threshold. The corner-angle threshold determines whether a geometric turn is sufficiently sharp to warrant optimization, whereas the traverse-speed threshold filters segments in which speed transients are more likely to induce local overbuild. For geometrically sensitive features (e.g., small steps or sharp concave corners), users can additionally annotate points via the interface. These user-specified points are appended to the optimization list, complementing automatic detection and reducing the risk of missing high-risk corners.
The workflow then proceeds to G-code parsing and corner identification. The program reorganizes the G-code by layer and contour, converts consecutive linear-interpolation commands into an ordered sequence of path points, and computes cos αi for each local corner unit {Pi−1, Pi, Pi+1} using a three-point vector model. In parallel, feed-rate commands for adjacent segments are extracted from the G-code and converted into the corresponding traverse speeds ν i−1 and ν i. For each candidate point Pi, the point is automatically labeled as a high-risk corner if cos α i exceeds the preset threshold (indicating a pronounced geometric turn) and the local mean traverse speed is no lower than the speed threshold (indicating elevated overbuild risk). User-preselected points are included unconditionally. Finally, all labeled corners, together with their upstream and downstream path attributes (e.g., coordinates, segment lengths, and speeds), are organized into a linked-list structure that serves as the input for subsequent interpolation and trajectory reconstruction.
After high-risk corners are identified, the algorithm proceeds to interpolation-strategy selection and local path reconstruction. To accommodate different machine kinematics and geometric-fidelity requirements, we implement two complementary corner-handling strategies. (1) The Linear Progressive Interpolation (LPI) algorithm is used when traverse speeds are moderate (F ≤ 300 mm min−1), the system is primarily three or four-axis, and corner-geometry tolerances are relatively loose. Without materially altering the original polyline vertex, this method offsets by a short distance along the incoming and outgoing straight segments to define entry and exit points, and then inserts several intermediate sub-segments between them. In this way, both the path direction and the traverse-speed command evolve smoothly from the straight-segment values toward the corner region, thereby suppressing abrupt acceleration–deceleration peaks in the CNC controller. (2) The Compound Motion Interpolation (CMI) algorithm is adopted when traverse speeds are high (300 < F ≤ 600 mm min−1) or when stricter requirements are imposed on contour continuity and geometric accuracy. This strategy constructs a filet circle at the corner, identifies the tangency points, and discretizes the resulting arc into short segments such that the deposition head follows an approximately circular trajectory at near-constant speed in the workpiece frame. Meanwhile, based on the arc geometry and the desired traverse speed, complementary velocity components for the deposition head and the drum platform are computed along each axis such that their superposed relative motion remains consistent with the intended contour. Through this cooperative coordination between deposition-path shaping and platform motion, the corner-region speed field is smoothed while preserving the target geometry.
After interpolating all high-risk corners and reallocating the associated speeds, the algorithm proceeds to G-code regeneration and verification. At this stage, the updated path points and feed-rate commands are written back into the G-code to produce an optimized file that preserves the original program structure while introducing localized point densification and speed smoothing in corner and start/stop regions. The software can optionally re-run the corner-identification module to verify the optimized G-code. If any residual corners violate the prescribed thresholds, an additional interpolation–correction cycle is applied until all corners satisfy both geometric and speed constraints. Without altering the intended contour, the proposed algorithm performs localized G-code interpolation and speed-profile reconstruction to bring corner-region traverse speeds closer to their target values in drum-based curved-surface DED. This process-level refinement mitigates local overbuild caused by multi-axis kinematic mismatch under approximately constant powder feeding, providing an algorithmic basis for subsequent experimental evaluation of circumferential height distribution, corner morphology, and roundness.
In practice, the user imports slicer-generated G-code, sets the corner-angle and speed thresholds, runs LPI or CMI locally on flagged corners, and exports an optimized G-code file that can be executed directly on the same CNC system without modifying the controller.

3.2. Linear Progressive Interpolation (LPI) Algorithm

For most medium-scale features under typical scanning-speed conditions, we prioritize the LPI algorithm for high-risk corner treatment. The core idea is to keep the original corner vertex essentially unchanged while subdividing the incoming and outgoing segments into multiple short sub-segments. The feed rate is then adjusted continuously along these sub-segments according to a predefined schedule, such that the head speed decreases gradually from the nominal straight-segment value to a safe threshold and subsequently recovers smoothly to its nominal value. In this way, an abrupt speed step is converted into a gradual transition, preventing the CNC controller from imposing a sharp deceleration at a single point.
As shown in Figure 4, each corner to be optimized is represented by three points: the start point S, the vertex V, and the end point E, with coordinates S (xS, yS), V (xV, yV), and E (xe, ye), respectively. The steady feed rate before entering the corner is denoted as Fs, and the steady feed rate after leaving the corner as Fe. A feed-rate threshold Fv is specified based on the processing window, satisfying Fs > Fv and Fe > Fv. This threshold Fv represents the minimum feed rate that maintains melt-pool stability without noticeable overbuild under the current laser power and powder feed rate, thereby providing sufficient deceleration margin in the vicinity of the corner.
Geometrically, the incoming segment SV is uniformly subdivided into N sub-segments, and the outgoing segment VE is uniformly subdivided into M sub-segments. For the incoming segment, the endpoint of the t1-th sub-segment, denoted by S t 1 , is given by:
S t 1 x s   +   x v     x s t 1 N ,   y s   +   y v     y s t 1 N ,   t 1   =   1 ,   ,   N ,
The corresponding feed rate F t 1 is linearly decreased from Fs to Fv.
F t 1 =   F s F s   F v t 1 1 N 1 ,   t 1 = 1 ,   ,   N ,
With the above formulation, a single linear move in the original G-code is replaced by N consecutive G1 commands. Each sub-segment has the same geometric length, whereas the feed rate is reduced in a stepwise manner, corresponding to the short segments in Figure 4 that progressively approach the vertex V from S1, S2, …, SN−1.
A symmetric treatment is applied to the outgoing segment VE. The endpoint of the t2-th sub-segment, denoted by E t 1 , is a sub-segment, denoted by:
E t 2 x s   +   x v     x s t 2 M ,   y s   +   y v     y s t 2 M ,   t 2   =   1 ,   ,   M ,
The corresponding feed rate F t 2 is linearly increased from   F ν to Fe.
F t 2 =   F ν + F e     F ν t 2 1 M 1 ,   t 2 = 1 ,   ,   M ,
Under the LPI scheme, a progressive deceleration zone is constructed on the incoming side of the corner, followed by a progressive acceleration zone on the outgoing side; several sub-segments near the vertex operate at speeds close to F ν . Accordingly, given the approximate inverse dependence of deposit height on traverse speed, h     m ρ   ν   w , material accumulation is redistributed from a single geometric point to a short path interval, thereby reducing the peak height at the corner. Because LPI relies only on standard three-axis linear interpolation, it is readily compatible with industrial DED systems whose controllers are proprietary and difficult to modify. Here we define the typical operating regime of LPI as a traverse speed not exceeding ~300 mm min−1 and a forming-error requirement of better than 0.03 mm. Under these conditions, the added sub-segments introduce a toolpath-dependent time overhead that depends on the CNC implementation and path complexity (see Supplementary Section S3.3), while effectively suppressing overbuild defects in curved-surface printing that arise from abrupt corner-speed drops under approximately constant powder feeding.

Application of the LPI Algorithm

To verify the practical implementability of LPI on real G-code, we deposited a closed 20 mm × 20 mm square toolpath on a cylindrical drum (50 mm in diameter). In this experiment, the dual-threshold criterion proposed in Section 2.5 was employed to identify high-risk corners from the G-code segments. For the square toolpath, which consists of four distinct 90-degree turns, the thresholds were determined based on the geometry and deposition speed. Specifically, the angle threshold cos α th was set to −0.1, and the velocity threshold ν th was set to 150 mm min−1.
In the original G-code, the path comprised only four linear commands (Figure 5b): the square contour was formed by alternating X-axis translation with C-axis drum rotation, and the feed rate for all segments was set to 300 mm min−1. On this basis, all four corner vertices were optimized using the LPI scheme. Within the established processing window, we set F nominal = 300 mm min−1, with to Fs = Fe = 300 mm min−1 and a corner-safe threshold ν th = 150 mm min−1. Geometrically, a 5 mm speed-transition zone was allocated on each side of every vertex and uniformly divided into five sub-segments (N = 5), yielding a 1 mm discretization step. Along each incoming segment, the feed rate was linearly reduced as 300 → 262.5 → 225 → 187.5 → 150 mm·min−1; after the corner, it was symmetrically restored as 150 → 187.5 → 225 → 262.5 → 300 mm·min−1.
With this treatment, the original square path (four G1 commands) was expanded into a high-resolution toolpath comprising 39 linear-interpolation commands. Compared with the unoptimized G-code, the optimized version preserves the square contour and vertex locations while introducing a 5 mm speed-buffer zone around each corner. Consequently, the speed change in the corner neighborhood is transformed from a point-like jump into a distributed transition. From both CNC-execution and process-physics perspectives, this reconstruction reduces local deposition peaks associated with abrupt corner-speed drops, providing an algorithmic basis for subsequent experiments aimed at achieving a more uniform circumferential height distribution and mitigating corner overbuild on the drum surface.

3.3. Compound Motion Interpolation (CMI) Algorithm

In drum-based curved-surface DED, at high scanning speeds and under stringent requirements on geometric accuracy and contour continuity, linear progressive interpolation implemented in a purely three-axis setting may not fully suppress corner-induced speed fluctuations or contour distortion. To address this limitation, we extend the LPI framework and develop a CMI algorithm based on cooperative compensation between the deposition head trajectory and drum-platform motion. Specifically, the algorithm prescribes a filet arc for the deposition head path in the workpiece coordinate frame, while commanding the drum platform to execute a complementary translational motion. As a result, the deposited track on the workpiece surface still conforms to the ideal straight-line contour S-V-E, whereas the relative motion through the corner is transformed into a smooth arc.
As shown in Figure 6, each corner to be optimized is defined by the start point S (xS, yS), the vertex V (xV, yV), and the end point E (xe, ye), with the internal angle SVE   =   α . Here, PsPe denotes the deposition-path segment for the deposition head, whereas D1DN denotes the corresponding platform-motion path. Coupled motion interpolation first determines the inscribed filet circle associated with the corner. The tangency points on SV and VE are Ps (xps, yps) and Pe (xpe, ype), respectively; the circle center is O (xc, yc) with radius R. Let β be the included angle between OP s and OP e , where β     ( π , π ) . It follows that β   =   π α , indicating that the central angle of the fillet arc is directly determined by corner sharpness.
The chordal approximation of a filet arc and the associated constant-feed motion decomposition follow standard corner-smoothing and feedrate-planning principles in CNC interpolation under kinematic constraints [45,46]. To approximate the arc PsPe in the CNC system using a finite number of linear commands, the algorithm partitions the fillet arc into N2 equal angular intervals. The angle (in radians) between adjacent chord directions is constrained by a prescribed threshold J v , ensuring sufficiently smooth changes in path direction.
N 2     β J v , θ = β N 2 ,
where θ denotes the central-angle increment for each subdivision. In practice, N2 is chosen as the smallest positive integer that satisfies this constraint. For the t-th subdivision (t = 1, 2, …, N2), the position vector of the deposition head with respect to the circle center is given by:
P t x t ,   y t   =   ( x c   +   R   cos β θ t , y c   +   R   sin β θ t ) ,
This yields a chordal approximation of the circular arc using N2 straight segments.
The key idea of CMI is that the DED head traverses the filet arc at a constant feed rate, while the drum platform executes a complementary in-plane translation. Their superposed relative motion is therefore equivalent to the straight-line motion along SV or VE prescribed in the original G-code. Let the target traverse speed on segment SV be Fs, with Cartesian velocity components x F s , y F s . For the t-th discrete point Pt on the arc, the deposition head follows the arc at the same constant speed; its instantaneous velocity components are denoted F t x , F t y and are computed as follows. When β > 0,
F t x ,   F t y = ( F s   sin β θ t ,   F s   cos β θ t ) ,
when β < 0,
F t x ,   F t y = ( F s   sin β θ t ,   F s   cos β θ t ) ,
Accordingly, the in-plane velocity components of the platform, F d x ,   F d y , are defined as the difference between the original straight-line velocity and the deposition head velocity:
F d   =   F d x ,   F d y   =   ( x F s     F t x ,   y F s     F t y ) ,
That is, at each time step, the platform’s translational velocity compensates for the deviation between the deposition head velocity and the target straight-line velocity, such that the superposed relative velocity remains aligned with the original SV direction. Suppose the platform reaches the target point Dt−1 at the previous step; the corresponding time increment is given by:
T t   =   P t P t   +   1 F s ,
The platform target position at the next step is then updated recursively as:
D t   =   D t 1   +   F d T t ,
When the toolpath reaches the arc endpoint Pe, platform translation is terminated, and the motion reverts to the straight-line segment VE specified in the original G-code.
The CMI algorithm replaces the sharp corner S-V-E with a smooth circular arc and compensates the associated geometric deviation through superposed motions of the deposition head and the platform, thereby ensuring that the deposited track conforms to the original polyline contour. Because the deposition head traverses the arc at a constant speed Fs, the CNC controller no longer needs to impose aggressive acceleration–deceleration at the vertex V, and the resulting corner-neighborhood speed field becomes smoother. Together with the inverse height–speed relationship established above, the local deposition behavior near surface corners is expected to approach that of straight segments, mitigating corner overbuild during DED. Here we define the typical operating regime of CMI as a traverse speed not exceeding ~600 mm min−1 and a forming-error requirement of better than 0.03 mm. Parameter-selection tradeoffs for the CMI filet discretization and code growth are discussed in Supplementary Section S3.4.
In our curved-surface DED system, the two algorithms are invoked on demand within a unified G-code optimization framework. For corners at moderate speeds and under relaxed accuracy requirements, LPI is applied preferentially owing to its implementation simplicity. For critical regions involving high-speed scanning, small corner radii, or stringent contour-continuity requirements, CMI is enabled to deliver a smoother speed field while maintaining closer agreement with the design geometry.

Application of the CMI Algorithm

To evaluate the feasibility and generality of CMI in real CNC programs, we selected a representative arc–polyline hybrid path on a cylindrical drum (50 mm in diameter) as a case study and locally reconstructed the G-code in the corner region. In this configuration, the machine executes coupled motions consisting of linear feed along the X axis and drum rotation about the C axis. The angle threshold cos α th was set to −0.1, while the velocity threshold ν th was maintained to 600 mm min−1. In the original G-code, the high-risk corner is implemented by three consecutive G1 commands (Figure 7b) with a prescribed feed rate of 600 mm min−1. Following the CMI strategy, this corner is replaced by a smooth, continuous filet arc. Here we adopt a virtual fillet radius of 1.0 mm. The tangency points between the fillet arc and the original segments SV and VE were determined under geometric constraints, yielding an arc start point Ps (X11.805, A46.774) and an arc end point Pe (X12.925, A109.358). The arc was then discretized into 10 consecutive linear-interpolation units under CMI, enabling explicit reconstruction of the corner trajectory in the G-code as a sequence of linear commands. The optimized G-code preserves the macroscopic contour of the original path while converting the high-risk corner into a transition that is continuous in both geometry and kinematics. As a result, speed-field discontinuities at the corner are reduced, allowing the feed-rate evolution to remain smooth under near-constant traverse-speed conditions and thereby suppressing excessive local energy input and material overbuild at the source.

3.4. Experimental Validation

To systematically benchmark the two proposed corner-path optimization algorithms, we performed DED printing on a 316L stainless-steel cylindrical drum (50 mm in diameter) using gas-atomized M2 HSS powder. The laser power was set to 600 W, the powder-feeding rotation speed to 0.2 r min−1, and the single-layer thickness to 0.20 mm. The scanning speed was 300 mm min−1 for the LPI condition and 600 mm min−1 for the CMI condition, while all other process parameters were held constant. Two representative closed contours—a square and a complex curvilinear profile—were selected, and samples fabricated with and without optimization were compared.

3.4.1. LPI-Based Optimization

We first examine the differences between the unoptimized toolpath and its LPI-optimized counterpart. Figure 8 compares the macroscopic morphologies of square specimens fabricated under the processing conditions described above. With the unoptimized toolpath, all four corners exhibit pronounced overbuild nodules, and the local deposit height at the corners is higher than that along the mid-span straight segments. This disparity produces a characteristic hump in the circumferential height trace. After introducing LPI under otherwise identical conditions, corner overbuild is substantially alleviated. Specifically, the peak height at each corner decreases, the height mismatch between corners and straight segments is reduced, and the circumferential height trace evolves from sharp peak–valley features to a smoother, lower-amplitude undulation.
Microscopy in Figure 9 shows that, in the unoptimized specimens, the ripple pattern near the corners is irregular and is accompanied by local indications of melt-pool backflow and metal accumulation. By contrast, the LPI-treated specimens exhibit a more uniform track-striation texture in the corner neighborhood, and the peak-to-valley spacing becomes comparable to that along straight segments. Mechanistically, LPI expands an originally pointwise speed drop at the corner into a progressive deceleration–acceleration sequence distributed over multiple sub-segments. As a result, the traverse speed in the corner region no longer forms a sharp trough; instead, it varies smoothly over a finite path length. Together with Equation (2), this smoothing implies that deposited material is redistributed from localized accumulation to pathwise sharing, thereby reducing the corner peak height. These observations indicate that, at a scanning speed of 300 mm min−1, LPI improves both macroscopic form fidelity and microscopic surface morphology in corner regions. To further examine the corner-region integrity after LPI optimization, a cross-sectional SEM image was acquired at the optimized corner location (Figure 9c). The cross-section exhibits a dense and continuous fused microstructure, and no obvious pores, microcracks, or lack-of-fusion defects are observed within the inspected area at this magnification. This microstructural evidence supports that the LPI-based corner-path reconstruction not only improves geometric continuity but also helps suppress defect formation associated with corner-induced process transients.

3.4.2. CMI-Based Optimization

When the scanning speed in curved-surface DED is increased to 600 mm min−1 and stricter requirements are imposed on contour continuity and geometric accuracy, linear progressive interpolation alone may be insufficient to fully eliminate residual height undulations and subtle contour distortions at corners. We therefore validated the CMI algorithm experimentally under the same set of process parameters. Figure 10 compares the macroscopic morphologies of a representative square printed on the drum surface before optimization and after CMI.
As shown in Figure 10a, the unoptimized toolpath leads to pronounced corner bulging, and both track height and width fluctuate substantially between adjacent corners, yielding a macroscopic contour that deviates from the designed geometry. After applying coupled motion interpolation (Figure 10b), the build quality of the same feature improves: corner overbuild is mitigated, and the deposited tracks transition smoothly across both inner and outer corners without obvious bulges or collapse. Consequently, the overall shape agrees well with the designed contour.
Figure 11 further presents cross-sectional micrographs of the corner region. In the unoptimized specimen (Figure 11a), the corner exhibits pronounced local sagging and sharp protrusions along the top profile. The cross-section also shows localized metal spatter and inclusions consistent with melt-pool instability, together with pore defects. By contrast, the CMI-treated specimen (Figure 11b) displays a more regular, continuous arc-shaped corner. The top surface is smoother, the sidewalls are closer to the designed vertical (near-vertical) geometry, and the interfacial transition is more gradual. No obvious pores or warpage traces are observed, suggesting that the melt-pool shape and solidification behavior are stabilized in the corner region.
The macroscopic and microscopic observations above are consistent with the kinematic rationale of CMI. Specifically, CMI replaces the original sharp polyline corner with a filet arc in the workpiece coordinate frame, allowing the deposition head to traverse the corner neighborhood at an approximately constant speed along an arc-like trajectory. Meanwhile, an in-plane compensatory motion of the drum platform offsets the geometric deviation introduced by the fillet, such that the corner-region relative speed field is transformed from a pointwise abrupt deceleration into a smooth variation distributed over a finite path length, without altering the target contour. Under approximately constant powder feeding and fixed laser power, this reconstructed speed field suppresses local peaks in energy and material input at corners, promoting more uniform deposition per unit length. Consequently, corner overbuild and necking defects are reduced, accompanied by improved cross-sectional profile fidelity and surface quality. Overall, CMI enhances corner-formation stability and geometric accuracy for complex toolpaths in curved-surface DED, supporting extension of the proposed optimization framework to engineering parts with more intricate surfaces and tighter tolerance requirements. Similarly, a cross-sectional SEM image was taken at the optimized corner region for the CMI strategy (Figure 11c). Compared with the defect-prone corner behavior discussed for unoptimized paths, the optimized cross-section shows a more compact and homogeneous morphology, with pores markedly reduced and no evident crack-like features in the examined region. These observations indicate that CMI effectively stabilizes the execution-level motion and local deposition conditions at corners, thereby improving corner-region microstructural integrity.
To better interpret the above microstructural differences, we note that the local thermal cycle is the physical mediator linking the realized corner kinematics to defect formation. In our comparisons, the baseline and optimized builds were conducted under identical laser power, powder-feed setting, layer thickness, shielding conditions, and substrate geometry; therefore, the dominant changed variable is the realized corner feedrate profile introduced by G-code post-processing. Abrupt corner deceleration under near-constant powder and power input increases the local heat and mass input per unit length and prolongs melt-pool lifetime, which can facilitate pore formation and crack initiation, whereas subsequent re-acceleration may reduce remelting and increase lack-of-fusion susceptibility. By smoothing the execution-level feedrate transient at corners, LPI/CMI mitigates abrupt thermal-cycle fluctuations, which is consistent with the reduced defect features observed in the optimized corner cross-sections.

3.5. Application-Level Validation

To demonstrate the engineering applicability of the proposed corner-path optimization strategy, we fabricated a cylindrical rotary die by curved-surface DED. Figure 12 shows the representative fabrication procedure and the resulting build. As illustrated in Figure 12a, cladding was performed on a pretreated 316L cylindrical drum using M2 HSS powder along a predefined closed contour. Enabled by first-layer angular-vector reuse and corner-path optimization, the deposited layer exhibits a continuous, uniform wrap-around morphology across complex corners and small-radius arcs, without obvious macroscopic overbuild or necking. This provides a stable geometric allowance for subsequent edge (blade) machining.
Figure 12b,c compare cross-sectional optical micrographs at the same location for specimens fabricated without optimization and with corner-path optimization, respectively. The unoptimized specimen (Figure 12b) exhibits abundant pores and microcracks within the deposit and near the interface, together with localized lack-of-fusion regions and an overall porous microstructure. This observation is consistent with the mechanism discussed above; however, we note that other 3D factors (e.g., local thermal history and melt-pool convection) may also contribute and cannot be fully excluded. When the CNC controller enforces abrupt deceleration and re-acceleration at corners while laser power and powder feed remain essentially constant, the local heat and mass input per unit length can be strongly modulated, which increases the susceptibility to porosity, lack-of-fusion, and cracking in corner regions. In particular, excessively low traverse speed can prolong melt-pool lifetime and promote defect formation, whereas subsequent re-acceleration may shorten effective dwell time and reduce remelting, increasing the likelihood of lack-of-fusion. By contrast, the CMI-optimized specimen (Figure 12c) shows a denser, more homogeneous cross-section, with pores reduced and often nearly absent, and a smooth, continuous interfacial transition. These features suggest that melt-pool morphology and solidification behavior in the corner region are effectively regulated. For rotary dies subjected to sustained contact stresses and cyclic impact loading, minimizing such microstructural defects is critical to suppress crack initiation and mitigate edge-chipping during service.
After DED cladding, the deposited layer was CNC-milled to remove the machining allowance and sharpen the cutting edge (Figure 12d). Because the preceding path planning ensured contour consistency and a uniform layer height, the reserved allowance was distributed uniformly along the contour. As a result, the cutting edge could be finished in a single pass, without frequent re-truing or repeated passes. This indicates that G-code-based corner optimization not only improves cladding quality but also streamlines subsequent subtractive processing. The rotary die was then deployed on a production line and operated stably during continuous die-cutting tests on polymer films (Figure 12e). The die maintained geometric integrity during cutting and produced clean edges, with no observable stringing, incomplete cuts, or local overcutting, indicating that the fabricated die satisfies the practical requirements of stable cutting and edge integrity in our production-line trial. Taken together, this multi-level validation—from macroscopic build quality and microstructural characterization to production-line testing—demonstrates that the proposed corner-path optimization algorithm is feasible and reliable for remanufacturing complex curved-surface components by DED and supports practical fabrication of high-value functional parts.
For rotary die manufacturing, the practical priority is to suppress corner overbuild and preserve a stable machining allowance for final finishing. Therefore, capturing and regulating execution-level corner feedrate transients is more critical in our application setting than attempting to predict absolute bead geometry using a fully coupled 3D melt-pool model. From an application perspective, this execution-aware G-code post-processing provides a practical route to suppress corner defects while maintaining a consistent finishing allowance for downstream edge machining, thereby improving process reliability and reducing rework in rotary-die remanufacturing.
Although the proposed G-code-based corner optimization has been validated on representative curved-surface deposits and a rotary-die case, its effectiveness has practical boundaries. For corners with very small radii, the available distance for speed transition is limited by both geometry and machine kinematic constraints. In experiments, such cases would typically manifest as residual corner peaks or local under-deposition near the corner neighborhood, and the improvement in corner height continuity becomes less pronounced under the same transition length and interpolation resolution. As a practical indicator, when the geometry-provided transition distance around the corner is insufficient to accommodate the prescribed feedrate transition, the optimized segments are compressed and residual feedrate transients can persist. In such cases, using a larger corner filet, increasing the local interpolation resolution, or coupling with process-parameter adaptation may be beneficial.
In addition, the present framework assumes quasi-constant powder delivery and laser power. If powder feeding becomes unstable, deposition nonuniformity may appear even when the feedrate profile is regulated. Practically, this would manifest as non-periodic height fluctuations or sporadic bulges/underfills along nominally constant-speed segments, and an increased tendency of dispersed porosity or lack-of-fusion features in cross-sections. Early checks that are useful in production include verifying powder-feed stability via time-based mass delivery (or feeder speed stability) prior to deposition and monitoring whether the height variation along steady segments increases abnormally. Future work will incorporate these factors into a more comprehensive robustness analysis and explore their mitigation through feed stabilization and monitoring, as well as tighter integration between toolpath post-processing and process control.

4. Conclusions

In this study, we propose and validate a corner-path optimization strategy based on G-code parsing to address corner overbuild and contour distortion in curved-surface DED arising from the mismatch between multi-axis kinematics and approximately constant powder feeding. The main conclusions are summarized as follows:
  • Corner overbuild and contour distortion in curved-surface DED are primarily associated with CNC-induced corner feedrate transients under near-constant powder delivery and laser power, which modulate the mass and heat input per unit length and thereby promote localized accumulation and defect formation at corners.
  • The proposed framework performs secondary parsing and localized reconstruction of standard G-code without altering conventional modeling and slicing workflows, converting pointwise speed discontinuities at corners into smooth and controllable speed transitions and improving geometric accuracy at the process-execution level.
  • Two complementary algorithms are developed. LPI smooths local feedrate transitions by re-interpolating corner segments, while CMI reconstructs coordinated multi-axis corner motion to regulate the realized corner feedrate profile. Together, they provide adaptive solutions across application scenarios with distinct accuracy–throughput requirements.
  • Experiments on a curved-surface laser-cladding platform demonstrate improved macroscopic build quality after optimization, including enhanced contour consistency and suppressed corner overbuild. Cross-sectional metallographic observations at representative corner regions further indicate a denser and more homogeneous fused morphology after optimization, supporting improved corner-region material integrity.
  • Application-level validation on a drum-based cylindrical rotary die confirms the engineering feasibility of the proposed workflow. The corner-path optimization helps preserve a stable machining allowance for downstream edge finishing and supports reliable die fabrication and operation, highlighting the potential to enhance manufacturing reliability in curved-surface remanufacturing.
Furthermore, future work will extend this execution-aware G-code post-processing toward artificial-intelligence and machine learning assisted optimization. Specifically, machine learning models trained on process and quality data can be used to predict corner defect risk and recommend robust interpolation settings under varying operating conditions, thereby enabling adaptive corner optimization beyond fixed heuristics. In parallel, we will explore transferring the same corner-motion reconstruction concept to other CNC processes involving acute-angle features, such as wire electrical discharge machining (WEDM), where interpolation and kinematic limits similarly govern corner fidelity.

Supplementary Materials

The following supporting information can be downloaded at: https://www.mdpi.com/article/10.3390/ma19040683/s1, Figure S1: Schematic of the experiment; Figure S2: Single-track deposition experiment; Table S1: Key equipment used in custom-built DED platform; Table S2: Software information; Table S3: Single-track deposition experiment. Refs. [47,48,49,50] are cited in Supplementary Materials.

Author Contributions

Conceptualization, L.J. and J.L.; methodology, L.J. and Z.L.; software, L.J.; validation, Z.L., X.P. and D.L.; investigation, X.P. and D.L.; data curation, X.P. and D.L.; writing—original draft preparation, L.J.; writing—review and editing, Z.L.; supervision, X.P., D.L., W.L., Z.C. and J.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The original contributions presented in this study are included in the article/Supplementary Material. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. DebRoy, T.; Wei, H.L.; Zuback, J.S.; Mukherjee, T.; Elmer, J.W.; Milewski, J.O.; Beese, A.M.; Wilson-Heid, A.; De, A.; Zhang, W. Additive manufacturing of metallic components–process, structure and properties. Prog. Mater. Sci. 2018, 92, 112–224. [Google Scholar] [CrossRef]
  2. Gu, D.; Shi, X.; Poprawe, R.; Bourell, D.L.; Setchi, R.; Zhu, J. Material-structure-performance integrated laser-metal additive manufacturing. Science 2021, 372, eabg1487. [Google Scholar] [CrossRef]
  3. Piscopo, G.; Iuliano, L. Current research and industrial application of laser powder directed energy deposition. Int. J. Adv. Manuf. Technol. 2022, 119, 6893–6917. [Google Scholar] [CrossRef]
  4. Zhang, K.; Chen, Y.; Marussi, S.; Fan, X.Q.; Fitzpatrick, M.; Bhagavath, S.; Majkut, M.; Lukic, B.; Jakata, K.; Rack, A.; et al. Pore evolution mechanisms during directed energy deposition additive manufacturing. Nat. Commun. 2024, 15, 1715. [Google Scholar] [CrossRef]
  5. Kanishka, K.; Acherjee, B. A systematic review of additive manufacturing-based remanufacturing techniques for component repair and restoration. J. Manuf. Process. 2023, 89, 220–283. [Google Scholar] [CrossRef]
  6. Lv, H.; Liu, Y.; Chen, H.; Liu, J.; Wei, Z. The effects of laser energy density on the re-manufacturing of LZ50 axle via extreme high-speed laser cladding: Microstructure, mechanical property, and fatigue performance. Mater. Sci. Eng. A 2025, 947, 149189. [Google Scholar] [CrossRef]
  7. Zhu, L.; Wang, S.; Pan, H.; Yuan, X.; Chen, X. Research on remanufacturing strategy for 45 steel gear using H13 steel powder based on laser cladding technology. J. Manuf. Process. 2020, 49, 344–354. [Google Scholar] [CrossRef]
  8. Kaierle, S.; Overmeyer, L.; Alfred, I.; Rottwinkel, B.; Hermsdorf, J.; Wesling, V.; Weidlich, N. Single-crystal turbine blade tip repair by laser cladding and remelting. CIRP J. Manuf. Sci. Technol. 2017, 19, 196–199. [Google Scholar] [CrossRef]
  9. Kattire, P.; Paul, S.; Singh, R.; Yan, W. Experimental characterization of laser cladding of CPM 9V on H13 tool steel for die repair applications. J. Manuf. Process. 2015, 20, 492–499. [Google Scholar] [CrossRef]
  10. Ahn, D.G. Directed energy deposition (DED) process: State of the art. Int. J. Precis. Eng. Manuf. Green Technol. 2021, 8, 703–742. [Google Scholar] [CrossRef]
  11. Paris, H.; Mandil, G. The development of a strategy for direct part reuse using additive and subtractive manufacturing technologies. Addit. Manuf. 2018, 22, 687–699. [Google Scholar] [CrossRef]
  12. Dezaki, M.L.; Serjouei, A.; Zolfagharian, A.; Fotouhi, M.; Moradi, M.; Ariffin, M.; Bodaghi, M. A review on additive/subtractive hybrid manufacturing of directed energy deposition (DED) process. Adv. Powder Mater. 2022, 1, 100054. [Google Scholar] [CrossRef]
  13. Li, S.H.; Kumar, P.; Chandra, S.; Ramamurty, U. Directed energy deposition of metals: Processing, microstructures, and mechanical properties. Int. Mater. Rev. 2023, 68, 605–647. [Google Scholar] [CrossRef]
  14. Balhara, H.; Botcha, B.; Wolff, S.J.; Bukkapatnam, S.T. Ripple formations determine the heterogeneous microstructure of directed energy deposition (DED)-printed 316L components. Mater. Des. 2023, 227, 111756. [Google Scholar] [CrossRef]
  15. Yang, Z.; Chen, X.; Zhu, L.; Ning, J.S.; Jiang, Z.; Yu, M.; Wang, S.; Xue, P.S.; Xu, P.H.; Xin, B. Comparative study on forming approaches in directed energy deposition of inclined thin-walled structures. Thin-Walled Struct. 2023, 191, 111074. [Google Scholar] [CrossRef]
  16. Gradl, P.; Cervone, A.; Colonna, P. Influence of build angles on thin-wall geometry and surface texture in laser powder directed energy deposition. Mater. Des. 2023, 234, 112352. [Google Scholar] [CrossRef]
  17. Zhou, H.; Zhu, G.; Li, J.; Li, G.; Zhang, X.; Liao, Y. Effect of the substrate inclination angle on 316L stainless steel fabricated by hollow-laser direct energy deposition. J. Manuf. Process. 2025, 133, 1277–1289. [Google Scholar] [CrossRef]
  18. Plakhotnik, D.; Glasmacher, L.; Vaneker, T.; Smetanin, Y.; Stautner, M.; Murtezaoglu, Y.; van Houten, F. CAM planning for multi-axis laser additive manufacturing considering collisions. CIRP Ann. 2019, 68, 447–450. [Google Scholar] [CrossRef]
  19. Woo, Y.Y.; Han, S.W.; Oh, I.Y.; Moon, Y.H.; Ha, W. Control of directed energy deposition process to obtain equal-height rectangular corner. Int. J. Precis. Eng. Manuf. 2019, 20, 2129–2139. [Google Scholar] [CrossRef]
  20. Gao, S.; Zhang, H.; Yang, J.; Xie, J.; Zhu, W. A Five-Axis Toolpath Corner-Smoothing Method Based on the Space of Master–Slave Movement. Machines 2024, 12, 834. [Google Scholar] [CrossRef]
  21. Wang, Q.; Li, J.; Nassar, A.R.; Reutzel, E.W.; Mitchell, W.F. Model-based feedforward control of part height in directed energy deposition. Materials 2021, 14, 337. [Google Scholar] [CrossRef]
  22. Ding, D.; Yuan, L.; Huang, R.; Jiang, Y.; Wang, X.; Pan, Z. Corner path optimization strategy for wire arc additive manufacturing of gap-free shapes. J. Manuf. Process. 2023, 85, 683–694. [Google Scholar] [CrossRef]
  23. Gihr, M.; Rashid, A.; Melkote, S.N. Bead geometry prediction and optimization for corner structures in directed energy deposition using machine learning. Addit. Manuf. 2024, 84, 104080. [Google Scholar] [CrossRef]
  24. Liu, H.; Wang, S.; Chen, H.; Xiong, J. Drop and hump behaviors in robotic arc-directed energy deposition with vertical position. Addit. Manuf. 2024, 82, 104049. [Google Scholar] [CrossRef]
  25. Mo, B.; Li, T.; Deng, L.; Shi, F.; Liu, W.; Zhang, H. Mechanisms and influencing factors of defect formations during laser-based directed energy deposition with coaxial powder feeding: A review. Virtual Phys. Prototyp. 2024, 19, e2404155. [Google Scholar] [CrossRef]
  26. Piscopo, G.; Salmi, A.; Atzeni, E. Investigation of dimensional and geometrical tolerances of laser powder directed energy deposition process. Precis. Eng. 2024, 85, 217–225. [Google Scholar] [CrossRef]
  27. Calleja, A.; Tabernero, I.; Ealo, J.A.; Campa, F.J.; Lamikiz, A.; De Lacalle, L.N. L Feed rate calculation algorithm for the homogeneous material deposition of blisk blades by 5-axis laser cladding. Int. J. Adv. Manuf. Technol. 2014, 74, 1219–1228. [Google Scholar] [CrossRef]
  28. Wang, X.; Sun, W.; Chen, Y.; Zhang, J.; Huang, Y.; Huang, H. Research on trajectory planning of complex curved surface parts by laser cladding remanufacturing. Int. J. Adv. Manuf. Technol. 2018, 96, 2397–2406. [Google Scholar] [CrossRef]
  29. Montoya-Zapata, D.; Posada, J.; Alvarez, P.; Creus, C.; Moreno, A.; Ortiz, I.; Ruiz-Salguero, O. Experimental and computational assessment of minimizing overfill in trajectory corners by laser velocity control of laser cladding. Int. J. Adv. Manuf. Technol. 2022, 119, 6393–6411. [Google Scholar] [CrossRef]
  30. Pereira, J.C.; Borovkov, H.; Zubiri, F.; Guerra, M.C.; Caminos, J. Optimization of thin walls with sharp corners in SS316L and IN718 alloys manufactured with laser metal deposition. J. Manuf. Mater. Process. 2021, 5, 5. [Google Scholar] [CrossRef]
  31. Liu, J.; Ba, Z.; Shu, D. Laser cladding path planning for curved metal parts. Metals 2024, 14, 1055. [Google Scholar] [CrossRef]
  32. He, D.; Deng, X.; Chen, Y.; Zhang, W.; Hao, J.; Hu, P.; Chen, L.; Lee, Y.; Tang, K. Feedrate-preserved motion planning for five-axis directed energy deposition of freeform metal parts. Addit. Manuf. 2024, 89, 104302. [Google Scholar] [CrossRef]
  33. Zhao, T.; Yan, Z.; Liu, H.; Zhang, B.; Pan, R.; Xiao, J.; Jiang, F.; Chen, S. Integration of direct energy deposition systems with an optimized process planning algorithm. J. Ind. Inf. Integr. 2025, 46, 100875. [Google Scholar] [CrossRef]
  34. Milojević, S.; Stojanović, B. Determination of tribological properties of aluminum cylinder by application of Taguchi method and ANN-based model. J. Braz. Soc. Mech. Sci. Eng. 2018, 40, 571. [Google Scholar] [CrossRef]
  35. Fortunato, G.M.; Nicoletta, M.; Batoni, E.; Vozzi, G.; De Maria, C. A fully automatic non-planar slicing algorithm for the additive manufacturing of complex geometries. Addit. Manuf. 2023, 69, 103541. [Google Scholar] [CrossRef]
  36. López-Arrabal, A.; Guzmán-Bautista, Á.; Solórzano-Requejo, W.; Franco-Martínez, F.; Villaverde, M. Axisymmetric non-planar slicing and path planning strategy for robot-based additive manufacturing. Mater. Des. 2024, 241, 112915. [Google Scholar] [CrossRef]
  37. van der Valk, P.C.W.M.; Mirzaali, M.J. Non-planar additive manufacturing with hydrogels: A review of flow control and toolpath strategies. npj Soft Matter 2025, 1, 5. [Google Scholar] [CrossRef]
  38. Beudaert, X.; Lavernhe, S.; Tournier, C. Feedrate interpolation with axis jerk constraints on 5-axis NURBS and G1 tool path. Int. J. Mach. Tools Manuf. 2012, 57, 73–82. [Google Scholar] [CrossRef]
  39. Tajima, S.; Sencer, B. Global tool-path smoothing for CNC machine tools with uninterrupted acceleration. Int. J. Mach. Tools Manuf. 2017, 121, 81–95. [Google Scholar] [CrossRef]
  40. Huang, Y.; Khamesee, M.B.; Toyserkani, E. A comprehensive analytical model for laser powder-fed additive manufacturing. Addit. Manuf. 2016, 12, 90–99. [Google Scholar] [CrossRef]
  41. Zapata, A.; Benda, A.; Spreitler, M.; Zhao, X.F.; Bernauer, C.; Yoshioka, H.; Zaeh, M.F. A model-based approach to reduce kinematics-related overfill in robot-guided laser directed energy deposition. CIRP J. Manuf. Sci. Technol. 2023, 45, 200–209. [Google Scholar] [CrossRef]
  42. Lynn, R.; Helu, M.; Sati, M.; Tucker, T.; Kurfess, T. The state of integrated computer-aided manufacturing/computer numerical control: Prior development and the path toward a smarter computer numerical controller. Smart Sustain. Manuf. Syst. 2020, 4, 25–42. [Google Scholar] [CrossRef]
  43. Wang, Q.; Li, J.; Gouge, M.; Nassar, A.R.; Michaleris, P.; Reutzel, E.W. Physics-based multivariable modeling and feedback linearization control of melt-pool geometry and temperature in directed energy deposition. J. Manuf. Sci. Eng. 2017, 139, 021013. [Google Scholar] [CrossRef]
  44. Zhang, Y.; Wang, T.; Peng, P.; Dong, J.; Cao, L.; Tian, C. Feedrate blending method for five-axis linear tool path under geometric and kinematic constraints. Int. J. Mech. Sci. 2021, 195, 106262. [Google Scholar] [CrossRef]
  45. Ward, R.; Sencer, B.; Jones, B.; Ozturk, E. Accurate prediction of machining feedrate and cycle times considering interpolator dynamics. Int. J. Adv. Manuf. Technol. 2021, 116, 417–438. [Google Scholar] [CrossRef]
  46. Tajima, S.; Sencer, B. Kinematic corner smoothing for high speed machine tools. Int. J. Mach. Tools Manuf. 2016, 108, 27–43. [Google Scholar] [CrossRef]
  47. Koren, Y. Control of Machine Tools. J. Manuf. Sci. Eng. 1997, 119, 749–755. [Google Scholar] [CrossRef][Green Version]
  48. Lin, R.S.; Koren, Y. Ruled surface machining on five-axis CNC machine tools. J. Manuf. Mater. Process. 2000, 2, 25–35. [Google Scholar] [CrossRef]
  49. Lo, C.C. Real-time generation and control of cutter path for 5-axis CNC machining. Int. J. Mach. Tools Manuf. 1999, 39, 471–488. [Google Scholar] [CrossRef]
  50. Hecker, R.L.; Flores, G.M.; Xie, Q.; Haran, R. Servocontrol of machine-tools: A review. Latin Lat. Am. Appl. Res. 2008, 38, 85–94. [Google Scholar]
Figure 1. DED experiment and experimental materials: (a) laser generator and (b) schematic diagram of deposition process. (c) powder morphology. (d) particle size distribution.
Figure 1. DED experiment and experimental materials: (a) laser generator and (b) schematic diagram of deposition process. (c) powder morphology. (d) particle size distribution.
Materials 19 00683 g001
Figure 2. The process planning software architecture.
Figure 2. The process planning software architecture.
Materials 19 00683 g002
Figure 3. Schematic of the algorithmic optimization workflow.
Figure 3. Schematic of the algorithmic optimization workflow.
Materials 19 00683 g003
Figure 4. Schematic of the LPI algorithm.
Figure 4. Schematic of the LPI algorithm.
Materials 19 00683 g004
Figure 5. Application of the LPI algorithm: (a) annotated G-code segments, (b) local corner refinement in G-code, and (c) toolpath comparison before and after optimization.
Figure 5. Application of the LPI algorithm: (a) annotated G-code segments, (b) local corner refinement in G-code, and (c) toolpath comparison before and after optimization.
Materials 19 00683 g005
Figure 6. CMI algorithm. (a) Schematic of the CMI algorithm. (b) Simulated corner-trajectory optimization result.
Figure 6. CMI algorithm. (a) Schematic of the CMI algorithm. (b) Simulated corner-trajectory optimization result.
Materials 19 00683 g006
Figure 7. Application of the CMI algorithm: (a) annotated G-code segments, (b) local corner refinement in G-code, and (c) toolpath comparison before and after optimization.
Figure 7. Application of the CMI algorithm: (a) annotated G-code segments, (b) local corner refinement in G-code, and (c) toolpath comparison before and after optimization.
Materials 19 00683 g007
Figure 8. LPI-based toolpath optimization mitigates corner overbuild in square deposits. (a) Before optimization; (b) after optimization.
Figure 8. LPI-based toolpath optimization mitigates corner overbuild in square deposits. (a) Before optimization; (b) after optimization.
Materials 19 00683 g008
Figure 9. Optical micrograph and SEM of the corner region. (a) Optical micrograph of the unoptimized toolpath. (b) Optical micrograph of the LPI-optimized toolpath. (c) SEM micrograph of the LPI-optimized toolpath.
Figure 9. Optical micrograph and SEM of the corner region. (a) Optical micrograph of the unoptimized toolpath. (b) Optical micrograph of the LPI-optimized toolpath. (c) SEM micrograph of the LPI-optimized toolpath.
Materials 19 00683 g009
Figure 10. CMI-based toolpath optimization mitigates corner overbuild in square deposits. (a) Before optimization; (b) After optimization.
Figure 10. CMI-based toolpath optimization mitigates corner overbuild in square deposits. (a) Before optimization; (b) After optimization.
Materials 19 00683 g010
Figure 11. Optical micrograph and SEM of the corner region. (a) Optical micrograph of the unoptimized toolpath. (b) Optical micrograph of the CMI-optimized toolpath. (c) SEM micrograph of the CMI-optimized toolpath.
Figure 11. Optical micrograph and SEM of the corner region. (a) Optical micrograph of the unoptimized toolpath. (b) Optical micrograph of the CMI-optimized toolpath. (c) SEM micrograph of the CMI-optimized toolpath.
Materials 19 00683 g011
Figure 12. Application-level validation of the proposed corner-path optimization in curved-surface DED. (a) Curved-surface DED cladding of M2 HSS powder on a pretreated 316L stainless-steel drum along a closed contour. (b) Cross-sectional optical micrograph of the specimen fabricated without toolpath optimization. (c) Cross-sectional optical micrograph of the specimen fabricated with toolpath optimization. (d) CNC milling of the cladded layer to remove machining allowance and sharpen the cutting edge. (e) Stable operation of the fabricated rotary die in continuous production-line die-cutting of polymer films.
Figure 12. Application-level validation of the proposed corner-path optimization in curved-surface DED. (a) Curved-surface DED cladding of M2 HSS powder on a pretreated 316L stainless-steel drum along a closed contour. (b) Cross-sectional optical micrograph of the specimen fabricated without toolpath optimization. (c) Cross-sectional optical micrograph of the specimen fabricated with toolpath optimization. (d) CNC milling of the cladded layer to remove machining allowance and sharpen the cutting edge. (e) Stable operation of the fabricated rotary die in continuous production-line die-cutting of polymer films.
Materials 19 00683 g012
Table 1. Chemical composition of M2 HSS powder.
Table 1. Chemical composition of M2 HSS powder.
ElementsCrMnMoSiVWCSPFe
Content (%)3.990.274.560.431.765.680.8190.0070.013Bal.
Table 2. Characterization equipment, key preparation, and testing conditions.
Table 2. Characterization equipment, key preparation, and testing conditions.
EquipmentManufactureConditions
CX40MShanghai Shunyu Hengping Scientific Instrument Co., Ltd., Shanghai, China10×; as-polished (no etching)
TESCAN MIRA 4TESCAN ORSAY HOLDING, a.s., Brno, Czech Republic20 keV, 5 kx; aqua regia etched 2–4 s
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Jiang, L.; Li, Z.; Pan, X.; Li, D.; Liu, W.; Chen, Z.; Liu, J. A Generic Geometric Code-Parsing Framework for Corner Optimization in Curved-Surface Directed Energy Deposition. Materials 2026, 19, 683. https://doi.org/10.3390/ma19040683

AMA Style

Jiang L, Li Z, Pan X, Li D, Liu W, Chen Z, Liu J. A Generic Geometric Code-Parsing Framework for Corner Optimization in Curved-Surface Directed Energy Deposition. Materials. 2026; 19(4):683. https://doi.org/10.3390/ma19040683

Chicago/Turabian Style

Jiang, Lan, Zhongkai Li, Xiaofang Pan, Danya Li, Wenxin Liu, Ziyang Chen, and Jun Liu. 2026. "A Generic Geometric Code-Parsing Framework for Corner Optimization in Curved-Surface Directed Energy Deposition" Materials 19, no. 4: 683. https://doi.org/10.3390/ma19040683

APA Style

Jiang, L., Li, Z., Pan, X., Li, D., Liu, W., Chen, Z., & Liu, J. (2026). A Generic Geometric Code-Parsing Framework for Corner Optimization in Curved-Surface Directed Energy Deposition. Materials, 19(4), 683. https://doi.org/10.3390/ma19040683

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop