1. Introduction
Additive manufacturing (AM) is a disruptive technology that is changing design paradigms, supply chains, and business models, and opening the way for innovative applications [
1,
2]. Additive manufacturing technologies, also known as rapid prototyping, 3D printing, shape-free manufacturing, as well as other terms, have been developed over 30 years. AM is a technology that enables the production of both simple and complex geometries in the same way [
3]. By manufacturing components directly from CAD models without the need for additional tools or cutting instruments, it allows the production of complex parts that are difficult to machine with subtractive manufacturing techniques [
4,
5,
6]. Unlike traditional manufacturing, which often involves removing large amounts of material and generates considerable waste, AM is much more efficient [
7]. This process uses only the necessary material, building three-dimensional objects layer by layer through controlled material addition, significantly minimizing waste.
One of the most widely used AM technologies is fused deposition modeling (FDM). FDM machines are likely some of the most accessible 3D printers, and their popularity has inspired numerous research efforts in materials, manufacturing, and mechanics [
8,
9]. In the FDM process, parts are fabricated by extruding a semi-melted thin filament through a heated nozzle [
6,
10]. This filament is deposited by the print head, called the extruder, following a predetermined path that guides the building process. As the extruder moves along this path, it “draws” heated layers on top of each other, outlining and filling the shape, layer by layer [
3,
7,
11]. The precise movements of the nozzle are controlled by adjusting key parameters, such as material flow rate and print speed [
12]. Additionally, the thermal energy of the filament facilitates its bonding with previously deposited layers. Once fused, the material cools and solidifies quickly and efficiently [
6]. This is because the ambient temperature is significantly lower than the polymer’s melting point. In fact, this solidification process is faster at the beginning when printing directly onto the platform [
13].
Low-cost FDM 3D printers provide good accuracy and high rigidity, while requiring a simple planning process, making them accessible and efficient for a wide range of applications [
14,
15]. These machines have a simple mechanism, consisting of a material deposition subsystem, called the print head, and a positioning subsystem for the x, y and z axes [
3,
16]. Since the final solid part is obtained by superimposing planar layers on the z-axis, the conventional FDM approach is often referred to as 2.5D printing [
17]. The proliferation of more affordable FDM printers is likely to play a vital role in polymer processing in the future, challenging traditional processes such as injection molding in some cases [
6,
18]. Building parts with complex geometries and multiple curvatures is a challenge for traditional FDM printers, as they are limited to printing planar layers [
14]. This approach can lead to issues when oblique loads are applied or when the printed part does not follow a simple planar surface, as the stress flow often crosses the layer bonding locations, potentially causing premature failures in the part [
16].
FDM utilizing traditional planar-layer and 3-axis printing methods experiences a significant stair-stepping effect on printed surfaces, which adversely affects both aesthetic quality and mechanical properties, particularly when the surface slope approaches horizontal [
19,
20]. Mechanical failures in printed components are often caused by defects between layers, and these interlayer defects are usually positioned according to the easiest printing orientation instead of the most mechanically advantageous one [
7]. It has been demonstrated that most fibers in 3D printing align in the direction of the extruder, improving the mesostructure of the printed part. Additionally, it has been shown that the triangular interfilament porosity (voids) decreases with an increase in the fiber volume fraction [
21].
With the growing adoption of 3D printing technologies, geometric algorithms for additive manufacturing are evolving rapidly. Each step in the processing chain that prepares 3D models for fabrication now includes various techniques to analyze and optimize geometry and machine instructions for diverse objectives [
22]. Although FDM technology has been in use for over two decades, recent research has shifted focus to extruding non-planar layers, aiming to reduce the stair-stepping effect and acknowledging that dependence on flat layers can introduce functional weaknesses in the final product [
8,
14,
23].
Several approaches have been classified into adaptive slicing, post-processing, and non-planar printing [
24]. Adaptive slicing is a strategic response in FDM to address these issues, applying thinner layers in regions with low surface slopes (nearly horizontal) and high curvatures to reduce surface roughness [
25]. Unfortunately, this method substantially increases build time due to the generation of additional layers [
3,
19,
26]. Additionally, if thinner layers are applied only in selected regions, the part will still be as weak as the areas with thicker layers. To improve the structural integrity of parts, [
18,
27] have demonstrated that greater structural strength can be achieved in planar prints if the face subjected to stress aligns with the direction of the filament.
Dimensional accuracy is a crucial aspect of additive manufacturing (AM) processes, as they tend to be less precise than traditional manufacturing methods [
28]. This accuracy is strongly influenced by the geometric description used to represent solid CAD objects, which impacts the quality of the final parts, particularly in the case of freeform surfaces [
29]. Since most additive manufacturing processes solidify objects layer by layer, the effect of this process on surface roughness and part accuracy has been widely studied, especially for freeform shapes that lack simple analytical forms and are defined by segments joined with specific continuity [
25,
30,
31]. One alternative used to improve both dimensional accuracy and the aesthetic appearance of parts is post-processing; however, this entails high costs and time depending on the requirements of the printed object [
32].
A new research trend aims to deposit extruded material using non-planar paths, following the shape of curved surfaces instead of layer-by-layer printing, as in FDM. Non-planar printing has facilitated the fabrication of complex geometries, improving their mechanical properties [
23]. In this type of printing, the z-value changes dynamically with the x–y values within the same layer, according to the shape of the freeform surface [
12], enhancing both mechanical properties and surface finish [
7]. This technique is particularly advantageous compared to conventional FDM for fabricating thin, curved parts (shells), functional prototypes of cranial bones, and other thin shell-like parts, by reducing the stair-stepping effect, increasing strength, and reducing the number of layers.
The quality of 3D-printed parts is evaluated based on various factors, such as mechanical properties and surface finish. Non-planar 3D printing has been shown to improve both properties. It should be noted that, despite the disadvantages presented by AM, all manufacturing occurs on a single machine, making the toolpath calculation considerably simpler. In contrast, subtractive manufacturing requires an experienced engineer to generate a suitable toolpath [
19,
22], which decentralizes part manufacturing, as this technology can be more easily developed anywhere.
Proposals such as non-planar slicing aim to improve fiber continuity and, consequently, the mechanical properties of printed parts. Practical implementation and comparative studies have shown that the non-planar layer method can outperform traditional techniques in terms of quality and efficiency, with potential for advanced applications such as printing conductive polymers [
6,
16].
In the topic of representing toolpaths in planar layers, an important method for this research is implicit representations. Brampton et al. [
33] introduced a level-set approach for automated fiber placement (AFP) technology, using the zero level-set to define primary fiber paths. While this ensures spacing, it has drawbacks like suboptimality and discontinuities. Building on this, [
34] developed a method to optimize fiber-reinforced structures using direct ink writing (DIW), where epoxy mixed with carbon fibers is extruded, aligning fibers for improved stiffness. By using level-set contours with B-spline parameterization, these studies designed structures for maximum stiffness while addressing DIW constraints such as sag, overlap, and continuity. The optimal designs, validated through experiments [
11], demonstrated superior stiffness, and the method was further extended to non-planar layers like cylindrical structures [
35], ensuring proper support and spacing for varying geometries.
Ahlers et al. [
24] proposed an innovative approach to FDM printing that combines flat and non-flat layers. Their algorithm, based on Slic3r, automatically detects which parts of the object should be printed with each type of layer. It introduces a simplified model to avoid collisions by defining two key parameters: the maximum non-flat angle and the maximum non-flat height. When generating three-dimensional extrusion paths, it adjusts them to follow the actual geometry of the object, improving surface quality and reducing print time for complex geometries. The main contribution is the detection of suitable areas for non-planar slicing, ensuring collision-free trajectories. Similarly, [
36] proposed a fused deposition modeling algorithm with planar and non-planar layers, dividing the CAD model into critical and non-critical domains. This mixed slicing strategy proved effective in enhancing print quality and the mesostructure of printed parts, and optimizing print time, particularly for complex geometries. The algorithm implements a three-plane intersection methodology to create curved trajectories and was successfully tested with examples requiring non-planar cuts.
Singamneni et al. [
6] developed a MATLAB code to extract points generated by a CAM module and arrange them in a sequence to produce deposition paths for FDM. These paths were created using four vectors at each surface point, considering the four neighboring points to construct cross-product vectors, which provided an improved representation of surface variations. Unlike traditional methods that align the z-coordinates of surface points, this approach avoids the drawbacks of previous techniques. Parts produced using this method showed a 40% increase in load-bearing capacity before fracture compared to conventionally printed parts, indicating the potential for improved strength through non-planar printing.
Research by Etienne et al. [
25] proposed a novel slightly curved slicing technique designed for 3-axis 3D printers. Instead of using flat cuts, this method generates curved layers that follow the contours of the model. Each layer is generated by the intersection of the mesh with curved planes rather than horizontal ones. A primary limitation of this approach is the relatively high execution time, particularly since it involves volume optimization. Another limitation is the limited angular freedom of the extrusion nozzle used in the study.
Rodríguez-Padilla et al. [
23] introduced a mathematical algorithm to project 3D printing trajectories onto non-planar surfaces tessellated in triangles. The algorithm takes 2D trajectory points, the STL file of the surface, and the projection direction to generate new trajectories on the target surface with G-code instructions. The plane equation for each triangle is calculated using its normal and centroid, ensuring a precise definition of the geometry. The approach focuses on printing curved layers on non-planar surfaces.
Zhao et al. [
5] developed two slicing methodologies for curved surfaces in robotic additive manufacturing: (I) a decomposition-based method and (II) a slicing method for cylindrical surfaces via transformation. In the first, the data model (STEP) is automatically decomposed into volumes using concave loops, generating tool paths in two steps: the slicing of curved surfaces and five-axis trajectories. For cylindrical slicing, the surface is extracted from a mesh model, its parameters are determined, and it is transformed into a planar-based model. The slicing and trajectory generation are then performed similarly to planar slicing. These trajectories were verified using a robotic fused deposition system. The cylindrical slicing algorithm was implemented in MATLAB
®.
Several studies have focused on non-planar algorithms for printers with more degrees of freedom. The authors of [
14] implemented non-planar 3D printing using a 6-degree-of-freedom robotic arm, focusing on feasible trajectory generation, path planning, parameter control, and tool orientation to avoid collisions on curved surfaces. They used point projections and empirical simulations, utilizing RobotStudio for inverse kinematics and MATLAB
® for trajectory generation. They successfully printed complex structures with varying curvatures while maintaining good construction time and surface quality.
On the other hand, [
19] developed a 5-axis additive manufacturing methodology that allows for variable thickness within a layer, using iso-parametric curves to generate extruder trajectories. These trajectories follow the direction of the variable thickness, aligning the nozzle with the normal surface and virtually eliminating stair-stepping issues on printed surfaces. The extruder’s path was projected onto a 2D plane using a parametric domain (u,v) to cover the entire projected surface. Similarly, the study conducted by [
37] focused on the optimization of 6-degree-of-freedom robots, achieving joint motion optimization through modifications in the print goal position.
In other research, some studies [
5,
29] focused on generating slices from direct models such as IGES and STEP, which allow for more precise contours and eliminate some of the drawbacks of the STL format, such as redundancy and inaccuracy. STL is considered inadequate for complex models, as it requires a large number of triangles to represent small features. The maximum deviation between the original CAD surface and a triangle in the tessellated model is referred to as chordal error [
38]. However, the most widely used slicing strategy remains unidirectional slicing based on tessellated models (STL), due to its simplicity and ease of implementation [
5].
The cost of the prototype is directly influenced by construction time, which depends on printing speed and affects the strength and mechanical behavior of the parts. Thus, finding an optimal balance between part strength and production costs has become increasingly important in additive manufacturing [
27]. These factors have led to the development of various slicing algorithms [
38].
Given the rapid evolution of additive manufacturing technologies, new approaches continue to be developed to address challenges related to material properties and toolpath generation [
12]. A robust mathematical algorithm is essential for developing both planar and non-planar cuts for parts with complex surface profiles (external and internal). This research combines planar and non-planar layer deposition, using algorithms specifically developed to generate precise extruder paths. Addressing this challenge has been a key focus of this study. A new slicing approach for fused deposition modeling (FDM) is proposed that generates non-planar paths and allows for parametric adjustment of filament direction, improving print quality and the structural integrity of parts. This work focuses on obtaining such structures using conventional FDM machines, which are more affordable and commercially accessible. Few studies have focused on filament direction parameterization in non-planar 3D printing.
This article is structured as follows: Introduction reviews the literature and defines the study’s objectives. Materials and Methods details the tools and methodologies used. Slicing and Mesh Refinement in FDM Technology discusses mesh enhancement and its relevance. Non-Planar and Planar Tool Path Generation explores tool path creation, while Adjustment of Velocity and Material Flow addresses tuning these parameters and material properties. Generating G-code for 3D Printing outlines the printing instruction process. The findings are presented in Results and Conclusions and analyzed in Discussion. Finally, Study Limitations highlights constraints, and Future Research and Applications suggests directions for further work.
2. Materials and Methods
Translating a printing pattern from a flat surface to a non-flat surface presents a challenge, as current software is primarily designed for planar slicing [
23]. In layer-by-layer construction, printing small details and critical features on irregular surfaces can be complicated and affect the surface quality of the parts [
26]. Path-planning strategies are developed to enhance shape accuracy and optimize infill distribution to improve print quality [
4]. Path planning is a crucial aspect of additive manufacturing, as it directly influences fundamental properties such as stiffness, strength, roughness, dimensional accuracy, and part fabrication time [
4,
7]. In particular, for FDM-manufactured parts, Milovanović et al. [
39] demonstrated that the crack growth direction is determined by the combination of the build orientation, highlighting the importance of proper planning to optimize material performance.
When 3D printing is performed using both planar layers parallel to the build plate and inclined layers, it is crucial to correctly separate these two regions to avoid interference during the printing process. The slicing of the STL model is necessary to convert the three-dimensional representation into two-dimensional layers, enabling the printer to understand how to build the object layer by layer. Inclined layers can help eliminate stair-stepping issues and improve structural continuity, while planar layers provide a solid foundation for the printing process. This combination demonstrates a favorable balance between surface quality and construction efficiency.
The planar slicing strategy divides the STL model into planar layers, each with a normal vector oriented perpendicular to the build platform (see
Figure 1). These layers are stacked vertically, and each one is parameterized for the subsequent generation of printing paths. The resulting intersection points shown in
Figure 1a,b indicate where the flat layers interact with the planar and non-planar boundary surfaces of the three-dimensional object. While this algorithm is relatively straightforward, it requires significant computational time due to the complexity of generating multiple paths and ensuring proper transitions between layers.
2.1. Slicing and Mesh Refinement in FDM Technology
The slicing process plays a very important role in FDM technology. A slicing algorithm breaks down the computer-aided design (CAD) 3D model into 2D layer contours that can be easily constructed [
40]. Traditionally, the FDM process begins with the conversion of 3D models to the stereolithography (.STL) format [
32]. This format tessellates the model, approximating it with a triangle mesh. Subsequently, the model is segmented into layers, which are sequentially fabricated by the 3D printing machine [
29]. The STL format has the advantage of being defined with data that can be easily obtained, such as vertices and normal vectors, without any parametric structure or differential attributes [
41,
42]. This format consists of a mesh of triangular facets that represent the outer surface of the solid object, where each triangular facet shares sides with adjacent elements, and the vertices are arranged according to the right-hand rule [
36]. In this research, the STL format is used because it has been consolidated as the predominant standard in the industry for layer-based manufacturing technology. Moreover, all commercial rapid prototyping systems today employ this format for the slicing process [
40]. To illustrate,
Figure 2 presents the STL code of two triangles that could form part of the surface of the object intended for printing.
Triangles are usually kept as large as possible to maintain a reduced file size. However, with this slicing approach, large triangles drastically reduce the surface quality of the printed object, increasing the chordal error, which represents a precision issue in the part [
43]. The maximum size of the triangles is reduced until the part reaches the required surface quality. Experience shows that the maximum length of a triangle side should be between 1 and 2 mm [
42]. There are different ways to refine triangles. One option is to use the CAD export settings, where the maximum size of the triangles can be defined. Meshmixer and Blender are examples of popular software that performs mesh operations for 3D printing. Another alternative is to integrate the refinement into the Python script that transforms the STL file. In the present research, triangle refinement is performed with a very simple approach using SALOME software version 9.9.0. This is carried out in such a way that the majority of triangles have a length of 2 mm. This procedure ensures that the triangles are small and homogeneous enough to maintain surface quality and that the model’s geometry is suitable for the printing process.
2.2. Non Planar and Planar Tool Path Generation
The generation of trajectories in 3D printing with inclined layers involves modifying the traditional planar slicing approach, replacing regular flat layers with layers that follow inclined geometries on the surface of printed objects. The inclined layers are not restricted and can adapt to complex surface contours, providing greater design flexibility.
In the method, the conventional slicing process is extended by integrating an algorithm that calculates inclined printing paths based on the geometric features of the object’s surface. The approach involves parameterizing the tessellated surfaces using two parameters, enabling precise control over the direction of the deposited filament (see
Figure 3). Upon acquiring the geometric data from the STL file, the G-code generation process is adapted to ensure smooth transitions between inclined layers. Unlike traditional slicing software, which is limited to planar slicing, the technique generates continuous printing paths on tessellated surfaces defined by triangles, effectively overcoming the current limitations of commercial slicers.
To construct the complete 3D object, both planar and inclined layers are combined while maintaining a constant layer height throughout the process. For each successive layer, the direction of the deposited filament is inverted, thereby enhancing the structural integrity of the printed object.
The structural domain Ω is divided into
n layers of thickness
h to form the layer domains, Ω
1, Ω
2,… Ω
n (
Figure 4). To generate the design algorithm, the toolpath for each layer is defined by the contour lines of a scalar function:
where
is the angle with respect to the x-axis that the toolpaths will have,
x and
y are the coordinates, and
c is an arbitrary constant.
Equation (1) is rewritten in parametric form, so that it is general for any triangle given the values
,
, and
that correspond to the values at the triangle nodes, as follows:
where the parameters ξ and η are values between [0,1]. To be consistent with Equation (1), the values of
are defined as follows (see
Figure 5):
where
and
represent the point’s location extracted from the STL file, and the angle
defines its orientation relative to the x-axis. Note that this angle
is distinct and independent from the triangle’s inclination, meaning the filament orientation involves both the triangle plane’s orientation and the angle
relative to the x-axis. The printing paths are implicitly defined by the scalar function
, and the definition for each layer is given as
The parameter allows the spacing between paths to be controlled, adjusting the distance between them according to the desired geometric characteristics for 3D printing.
To define each trajectory in the triangles, the level function is set equal to a constant k, thereby determining the relationship between ξ and η:
To determine the trajectory points that intersect with the sides of the triangle, the parameters
and
are set to specific values. For side (a), the condition
is established, indicating that the point lies precisely on this side of the triangle. Similarly, for side (b), the parameter
. This approach allows for the calculation of the exact intersection points based on the geometry of the tessellated triangles. Specifically, when
, the following is obtained:
similarly for side (b)
and finally for side (c)
The trajectory can only intersect the triangle on two sides; therefore, a straightforward algorithm is employed to discard any intersections that do not occur within the triangle. This is because the parameters must remain between 0 and 1, and values outside this range are not valid. Using these two intersection points, the points can be spaced equidistantly and concatenated with the adjacent triangles to generate a trajectory along the layer. The coordinates x, y, and z are then obtained from the parameters and using the triangle’s vertex coordinates, allowing us to accurately represent the trajectory in three-dimensional space.
To print the trajectories obtained, one option is to use a 5- or 6-axis CNC machine, which would enable the extruder’s axis to align with the normal of the layer at the deposition point. However, these machines require specialized equipment and complex setups [
25] and are typically more expensive. In contrast, a 3-axis machine can be sufficient as long as the normal vector
of the printed layer does not deviate significantly from vertical and the flow control remains similar to that of planar toolpaths. This condition is suitable for slightly curved parts [
20]. Furthermore, 3-axis printing is widely established, well understood, and accessible to most users. With low-cost 3D printers available, end users have an unprecedented ability to manufacture their own customized parts [
31]. Consequently, the methodology was implemented on an Ender 3 printer due to its versatility and affordability.
2.3. Adjustment Velocity and Material Flow
One of the most significant obstacles in non-planar printing is defining correctly the printing speed. This is because in non-planar 3D printing, the toolpaths move dynamically in the z-direction, so the printing speed is limited by the maximum speed on the z-axis, which is drastically slower than what can be achieved on the x and y axes. Additionally, the maximum speed of the print head is also limited by the maximum feed rate of the thermoplastic [
3]. Higher speeds can reduce the extrusion volume, which decreases the stability of the print. This practical concern can be mitigated by controlling the speed to achieve smooth movement on the z-axis and uniform deposition [
25].
In non-planar printing, the material is deposited at various angles, and a uniform speed does not always guarantee the same print quality due to the curvatures and complexity of the surface. Speed control allows for the proper amount of material to be deposited along sharp curves, ensuring that the surface quality is uniform throughout the layer [
14]. However, controlling the amount of material extrusion is more practical, as maintaining a constant speed helps minimize vibration. This results in precise control over the extrusion rate while constantly changing the slope along the curve. In this work, the speed value was maintained at 50% of the maximum to minimize sudden movements in the system, similar to the research conducted in [
14,
25]. The amount of extrusion is calculated individually for each line by multiplying the Euclidean distance between the current point and the next by the filament flow factor. To avoid overloading the non-planar surface, a correction factor is necessary [
36]. The extrusion value (E) corresponds to the length of filament pushed through the extruder for a given print trajectory (cf. Equation (3)), computed as follows [
7]:
where
is the dimensionless extrusion factor,
is the wall thickness of each printed line (determined by the nozzle diameter),
is the layer thickness entered by the user, and
correspond to the x and y coordinates of the start and end points, respectively, with all values in millimeters. A challenge related to variations in material flow arises from the extrusion nozzles, as the vast majority of printers use very short nozzles, resulting in very little angular freedom [
25]. Therefore, in this study, a pointed nozzle (see
Figure 6) was used instead of the standard one to allow greater freedom of movement when “drawing” the non-planar path, thus avoiding collisions and improving the print quality of non-planar layers [
44]. The printer’s speed was carefully adjusted in relation to the extrusion rate to ensure a uniform and smooth print.
In the 3D printing process, the print head must accelerate to reach maximum speed and decelerate on each path. During each travel movement, additional G-code commands are inserted to quickly raise the print head and retract the filament by several millimeters before movement, and then return the head and filament after the movement. This helps prevent filament stretching and dragging of the print head across the support [
7]. Once the extrusion values for all print lines are calculated, the print file for the support is written using the user’s input values for printing and travel speeds.
2.4. Material Properties
Polymeric composites are materials formed by combining polymers with other components. These composites are increasingly used in FDM due to their enhanced mechanical, thermal, and electrical properties. Common examples include carbon fiber-reinforced PLA, glass fiber-reinforced ABS, and polyethylene terephthalate glycol (PETG) [
45]. In the present study, the commercial filaments used were PLA, ABS, TPU, and PETG, which are the most common materials used in low-cost printers.
Studies have shown that the properties of ABS plastic used in 3D printers are altered by the printing process, with the solid material exhibiting anisotropic behavior [
46]. Consequently, if the infill has different orientations relative to other segments, the resulting design’s strength will be difficult to predict. Furthermore, the effects of infill density, considered in this experiment, have not been thoroughly investigated.
Table 1 summarizes the recommended parameters for printing each filament used in this study.
2.5. Generating G-Code for 3D Printing
The process planning involves transforming a 3D model into a set of instructions for the machine to manufacture the part from the model [
3]. The G-code contains commands that control the movement of the extruder along the points of the path, and it also includes instructions for setting temperature, extrusion speed, and linear movement (G1 command) [
1,
23]. An algorithm was created to generate G-code for 3D printing of any surface represented by a tessellated file (STL), but its use can be expanded to other surface manufacturing applications where a path trajectory for the printer’s extruder is required. Irregular thermal cycles due to layer deposition in FDM lead to stress accumulation, causing distortion, which results in poor layer adhesion and subsequently reduces strength.
The extrusion temperature plays a vital role in the growth of the neck in the bonding zone since the temperature cannot be maintained for long periods to complete the bond between filaments [
48]. Thermal gradients strongly influence the quality of the produced parts, along with several other printing parameters such as extrusion temperature, chamber temperature, nozzle speed, and the dimensions of the extruded filament [
1,
9,
39]. Since creating strong and dimensionally stable parts has been a challenging objective of FDM technology, studying the effect of manufacturing parameters on 3D printed parts is a necessity [
27]. Therefore, inputting the appropriate parameters into the G-Code is of utmost importance. In the present research, the start G-code prepares the printer by setting the heated bed temperature to 60 °C and the extruder temperature to 205 °C and purges the extruder for PLA (see
Table 2).
The end G-code concludes the printing task by turning off the heating elements and raising the extruder. Its general format is given by G1 F1500 Xx Yy Zz Ee (for example, G1 F1500 X106.024 Y92.497 Z15.279 E8168.6632), where F1500 refers to the extrusion speed (1500 mm/min), (x, y, z) is the position corresponding to each projected point, and E is the accumulated length of the filament to be extruded. To generate multiple layers, the initial set of points is repeated but inverted in sequence, while the z value is incremented in steps of 0.4 mm [
23].