Open Access

3D print orientation optimization and comparative analysis of NSGA-II versus NSGA-II with Q-learning

 and   
Jul 01, 2025

Cite
Download Cover

Introduction

This research aims to develop an optimized approach for determining the optimal orientation of 3D models in fused deposition modeling (FDM) printers. Improper orientation can lead to increased printing time, excessive material waste, and reduced surface quality, negatively impacting production efficiency and costs. Therefore, optimizing print orientation presents a complex challenge due to the need to balance conflicting objectives: minimizing support material and printing time while ensuring high surface quality [1].

The non-dominated sorting genetic algorithm-II (NSGA-II) is one of the optimization methods to handle multiple conflicting objectives by generating a Pareto front. However, a significant challenge in implementing NSGA-II lies in its ability to explore the solution space effectively, often stagnating in local optima due to static parameter settings. This limitation necessitates an adaptive approach to enhance the diversity and quality of solutions [2, 3].

To address this issue, NSGA-II is integrated with Q-learning, a reinforcement learning (RL) method that dynamically adjusts algorithm parameters based on reward feedback. Q-learning enhances population diversity in the initial stages for broader exploration and focuses on exploiting promising solutions near the Pareto front in later stages. This hybrid approach aims to accelerate convergence and improve the overall optimization performance [4, 5].

This research focuses on the optimization orientation of 3D models by considering multiple objective functions, minimizing support material, minimizing printing time, and optimizing surface quality. By employing NSGA-II, this research aims to obtain a Pareto front representing a range of optimal solutions. However, the quality of the Pareto front is highly dependent on the initial solutions provided. Therefore, RL by the Q-learning method is integrated into NSGA-II to generate better and more targeted initial solutions [6]. The research problem addressed in this study is optimizing the print orientation of 3D models by considering conflicting objective functions using the integration of Q-learning within NSGA-II.

The quality of solutions provided to obtain an optimal Pareto front in NSGA-II depends on the initial solutions. A well-chosen initial solution can accelerate convergence and expand the coverage of the Pareto front, enabling the algorithm to balance conflicting objectives better [7]. Previous studies have demonstrated the effectiveness of hybrid approaches in improving the performance of NSGA-II, especially when integrated with RL techniques. Comparative analyses show that NSGA-II outperforms other algorithms like MOPSO in terms of solution diversity and generational distance but faces challenges in parameter tuning. By integrating Q-learning, this research addresses these gaps, providing a more robust framework for multi-objective optimization in 3D printing. The proposed method offers significant improvements in minimizing support material (2.1%), printing time (3.8%), and surface roughness (1.9%), validating its practicality through slicer software.

Materials and Method

Determining the optimal orientation in 3D printing has been the focus of various studies because the model orientation influences the efficiency of the 3D printing process, including the volume of support material, printing time, and printed surface quality. Various methods have been proposed to optimize model orientation, especially in multi-objective contexts.

Several algorithms have been employed to optimize 3D printing orientation. NSGA-II has been applied for multi-objective optimization, considering support material, printing time, and surface roughness [8]. The results demonstrated that NSGA-II effectively generates well-distributed Pareto fronts in additive manufacturing contexts. Additionally, automatic optimization methods have been developed to reduce support structures using pattern-search algorithms [9].

Comparative studies between NSGA-II and other algorithms have highlighted its strengths and weaknesses. NSGA-II has been reported to excel in generating diverse Pareto fronts, although it requires significant computational resources for convergence [10]. When compared with MOPSO, NSGA-II performed better in terms of solution diversity and generational distance, while MOPSO outperformed in terms of spacing metrics [11].

Q-learning has been utilized to enhance the performance of optimization algorithms. This approach enables the initial solution generation process to be guided by reward-based evaluations. The integration of Q-learning with NSGA-II has proven effective in accelerating convergence and improving solution quality by prioritizing high-reward solutions [12]. RL assists NSGA-II in focusing exploration on promising areas of the solution space, thereby reducing unnecessary exploration.

Despite the significant advantages offered by hybrid approaches combining NSGA-II and Q-learning, certain challenges remain. Comparisons between NSGA-II and NSGA-III on many-objective problems revealed computational overhead and complexity in managing multiple objectives. Moreover, optimization outcomes heavily depend on parameter tuning, which can be further improved using adaptive techniques such as Q-learning [13].

This research builds upon previous approaches by integrating Q-learning into NSGA-II for optimizing 3D printing orientation. Unlike previous approaches, this method explicitly addresses tradeoffs between material usage, printing time, and surface quality through a hybrid framework. The proposed method aims to enhance optimization efficiency and quality by leveraging reward-based adaptation.

Research and Methodology

The research focuses on optimizing the orientation of 3D models for FDM printing to address three critical objectives: minimizing support material, reducing print time, and improving surface quality. The study integrates NSGA-II, a widely used multi-objective optimization algorithm, with Q-learning, a RL technique. This integration aims to enhance the quality of solutions by guiding the exploration of the solution space through reward-based evaluations. The methodology is designed to achieve a balance between conflicting objectives while ensuring practical applicability of the optimized orientations.

The dataset used in this research is a 3D model low-poly bunny geometry, which is analyzed for various orientations. The data for the objectives support material, print time, and surface roughness are derived from geometric properties of the models and are validated using slicing software. MATLAB is employed as the primary platform for implementing NSGA-II and Q-learning, along with the necessary scripts for evaluating objective functions. The validation process involves comparing optimized orientations in a slicer environment to estimate the practicality of the solutions.

Three objective functions are defined to evaluate the performance of each orientation:

Support material: Calculated as the surface area requiring additional support, derived from overhang detection based on a critical angle threshold.

Print time: Estimated from the model's dimensions, slicing parameters, and printer-specific settings such as speed and layer height.

Surface roughness: Quantified by analyzing stair-step effects and angle deviations of surfaces in the model. These functions collectively determine the tradeoffs in the optimization process.

The optimization framework sequentially integrates NSGA-II and Q-learning. NSGA-II initializes a population of solutions (orientations) and evaluates them using the defined objective functions. Q-learning assigns rewards based on the relative performance of solutions, updating a Q-table to prioritize promising areas of the solution space. The integration allows NSGA-II to use Q-learning's guidance during selection and crossover processes, enhancing both exploration and convergence toward Pareto-optimal solutions. The framework is executed across multiple generations to progressively refine the solutions.

The final optimized orientations are validated using Makerbot Desktop Slicer (Matlab R 2023B, Makerbot Slicer 3.10.1.1389) to simulate 3D printing parameters. The slicer provides estimates of support material requirements, print time, and surface quality for each optimized orientation. This validation ensures that the theoretical solutions align with practical printing scenarios. The outcomes are compared between standard NSGA-II and RL-NSGA-II to analyze improvements in solution quality and distribution, demonstrating the effectiveness of the integrated approach in optimizing 3D printing orientations.

Optimization model

The optimization model aims to determine the best printing orientation for a 3D model to minimize support material, print time, and surface roughness. The decision variables are the rotational angles around the X, Y, and Z axes (θx, θy, θz) with the range [−180°, 180°]. The model is evaluated using three conflicting objective functions (support area, print time, and surface roughness). This multi-objective approach generates a Pareto front, allowing users to select solutions based on specific priorities such as minimizing material usage or improving surface quality.

Integration of Q-learning

The integration of Q-learning with NSGA-II aims to enhance solution quality and accelerate convergence in the multi-objective optimization process. In this approach, Q-learning serves as a RL mechanism to guide population selection based on rewards obtained from evaluating objective functions. Each solution in the search space is represented as a state (s), while an action (a) corresponds to changes in the rotation of the 3D model orientation. The Q-value (Q(s,a)), which represents the expected reward for taking a specific action in a given state, is stored in a Q-table. This value is iteratively updated using the Bellman equation: Q(s,α)Q(s,α)+α[r+γmax(Q(s',α'))Q(s,α)] Q(s,\,\alpha) \leftarrow Q(s,\,\alpha) + \alpha [r + \gamma \max (Q({s^{'}},\,{\alpha^{'}})) - Q(s,\,\alpha)] where:

α is the learning rate to control the speed of Q-tables.

r is the reward obtained from the evaluation of the objective function.

γ is the discount factor, which weighs the future value of subsequent actions.

Max (s, α) is the maximum Q-value for the next state (s).

The integration process begins with an initialize evaluation of the population to compute rewards based on the objective functions. The rewards are calculated as a weighted combination of three objectives: support material (f1), print time (f2), and surface roughness (f3). (r=(αwf1+βwf2+γwf3) (r = - ({\alpha_w}{f_1} + {\beta_w}{f_2} + {\gamma_w}{f_3}) where αw, βw, and γw are weights for each objective, reflecting their relative importance. These rewards are used to update the Q-table, prioritizing solutions with higher rewards for selection in the next generation.

Once the best-performing population is selected, genetic operators such as crossover and mutation are applied to generate new solutions, which are then evaluated and fed back into the Q-learning framework. The new solutions are validated to ensure that their orientations remain within the specified rotation bounds.

Integrating Q-learning offers several significant advantages, including more directed exploration, better-distributed Pareto fronts, and faster convergence compared with standard NSGA-II. By leveraging reward-based guidance, the algorithm directs the search toward more optimal solution regions, yielding better tradeoffs among conflicting objectives. The outcome is a well-represented Pareto front, enabling decision-makers to select printing orientations to specific requirements. This approach demonstrates great potential for improving the effectiveness and efficiency of orientation optimization.

Pseudocode

No more than three levels of headings should be used. All headings must be in 10pt font. Every word in a heading must be capitalized except for short minor words as listed in Section III-B.

Algorithm: NSGA-II with Q-Learning for 3D Print Orientation Optimization

Input:

num_generations: Number of generations.

pop_size: Population size.

crossover_prob: Crossover probability.

mutation_prob: Mutation probability

stl_file: 3D model in STL format.

results_file: File to save results.

Output:

Load and validate STL model (vertices, faces).

Initialize population with random orientations within [−180°, 180°].

Define Q-learning parameters:

num_actions: Number of actions.

alpha: Learning rate.

gamma: Discount factor.

epsilon: Exploration probability.

Q_table: Initialize Q-table with zeros.

Evaluate initial population using objective functions:

Support material.

Print time.

Surface roughness.

For each generation (gen = 1 to num_generations):

Evaluate current population objectives.

Perform non-dominated sorting to rank solutions.

Calculate crowding distances.

Select parents using rank and crowding distance.

Compute state metrics (diversity, hypervolume) and discretize to state index.

Choose action using epsilon-greedy strategy:

Action 1: Increase crossover probability.

Action 2: Decrease crossover probability.

Action 3: Add random solutions.

Action 4: Mutate extreme solutions.

Action 5: Increase mutation probability.

Apply selected action to update population and parameters.

Generate offspring through multi-parent crossover and mutation.

Combine parent and offspring populations and re-evaluate objectives.

Perform non-dominated sorting and select next generation.

Compute rewards based on changes in diversity, hypervolume, and crowding distance.

Update Q-table using Q-learning update rule.

Extract Pareto-optimal solutions from final population.

Save results (initial and final objectives, Pareto front) to Excel file.

NSGA-II in multi objective

It selects individuals within a population to form a Pareto front, where no solution dominates another. This results in optimal solutions for multiple, often conflicting objectives are widely applied in multi-objective contexts, such as minimizing production time and cost or enhancing product quality, with strengths in generating a well-distributed Pareto front and providing many solution options [14]. Recent efforts have further enhanced NSGA-II's performance by incorporating hybrid strategies, such as integrating local search techniques that improve convergence and maintain solution diversity, making it especially effective in complex environment [15]. Automated parameter tuning and adaptive strategies, including RL, have also been employed to dynamically optimize NSGA-II's parameters, further increasing its capability to tackle large-scale, real-world problems. These advancements effectively demonstrate NSGA-II's adaptability and effectiveness across varied domains, from industrial production optimization to environmental and agricultural applications, such as optimizing irrigation and fertilizer use in farming systems [16]. This capability is illustrated in Figure 1.

Figure 1:

NSGA-II flowchart [13]. NSGA-II, non-dominated sorting genetic algorithm II.

Integration NSGA-II and Q-learning

Q-learning is a popular RL method in optimization because it effectively addresses decision-making problems structured as a Markov decision process (MDP). Through Q-learning, an agent can select the optimal action that yields the highest reward, making it particularly effective in navigating complex solution spaces and iteratively discovering optimal solutions [12].

The research on improving solution quality and accelerating convergence has increasingly turned to integrating Q-learning into evolutionary algorithms, specifically through Q-learning. Q-learning enables NSGA-II to start with high-quality initial solutions, allowing NSGA-II to concentrate its search on potentially better solutions [17, 18]. This approach leverages the exploratory strength of RL in navigating the solution space, as well as the ability of NSGA-II to provide solution diversity through the Pareto front. Additionally, this integration helps to overcome the limitations of each technique when used independently in solving multi-objective problems [19].

This approach leverages RL with Q-learning to enhance the solution search quality of NSGA-II through reward-based evaluation of each individual in the population. Each individual is assessed based on three objectives: support material volume, printing time, and surface roughness. The reward value evaluates a solution's performance in terms of minimizing support material, reducing printing time, and improving the surface quality of the printed output. Only the initial solutions with the highest rewards are selected to proceed to the further selection process [20].

Then, a selected percentage of individuals with the highest reward values undergo crossover and mutation operations to generate a new generation expected to perform better in achieving the three objective functions. This reward-based selection guides NSGA-II in narrowing the solution search space by focusing primarily on individuals with the best performance in minimizing support material, reducing printing time, and enhancing surface quality. This approach significantly improves search efficiency, as NSGA-II can directly focus exploration on high-probability areas to find optimal solutions without revisiting low-quality solutions.

In the hybrid combination shown in Figure 2, Q-learning facilitates the initial exploration to identify high-quality solutions, while NSGA-II performs advanced exploitation to form the Pareto front. This results in a well-distributed and convergent set of optimal solutions, producing a stable and high-quality Pareto front. This approach enables the identification of optimal print orientations that minimize cost and printing time while improving surface quality in the 3D printing process.

Figure 2:

Flowchart of the Q-learning and NSGA-II hybrid combination [21]. NSGA-II, non-dominated sorting genetic algorithm II.

Experimental setup
Dataset 3D model

This research utilized a moderately complex 3D model, as presented in Table 1, to evaluate the effectiveness of optimizing print orientation in additive manufacturing. The model, represented by bunny.stl, is characterized by a medium level of geometric complexity.

Dataset of 3D model

No. 3D model Dimensions (cm)
Facet Support area Print time Surface roughness
X Y Z
1 bunny 0 0 0 292 2,168.3 1,023 101

The 3D model is stored in the standard tessellation language (STL) format, which is the industry standard for 3D printing. The STL format represents the surface of a 3D model as a polyhedral structure composed of triangular facets. Each facet is defined by vertex coordinates in text format to describe the outer geometry of the model; however, it does not include additional attributes such as color or texture.

The bunny.stl 3D model, as shown in Figure 3, serves as a basis for evaluating the optimization method. Freely available slicers, such as Cura and Makerbot Desktop, are used to test the method in more complex real-world scenarios, providing insights into how orientation affects printing outcomes for complex geometries.

Figure 3:

Medium-complexity 3D model (low poly bunny, author's own work).

Optimization parameters
NSGAII

For the NSGAII, the population size was set to 50, and the optimization ran for 10 generations. Genetic operators were applied with a crossover probability of 0.9 and a mutation probability of 0.1. The algorithm was configured to optimize three objectives: support material, print time, and surface roughness. The search space was defined by rotational angles (θx,θy,θz) within the range of [−180°, 180°]. The NSGA-II evaluates solutions using non-dominated sorting, which groups the population into Pareto-optimal solution represent the best tradeoffs among the objectives.

NSGA-II with Q-learning

For the NSGAII with Q-learning, additional parameters were introduced to guide the optimization process using RL [22]. The Q-learning configuration included a learning rate (α of 0.1, a discount factor (γ) of 0.9, and an exploration rate (ɛ) of 0.2 to balance exploration and exploitation [23]. A Q-table was initialized with 100 states, representing the discretized orientations of a 3D model, and 6 actions corresponding to ±10° rotation along each axis. Rewards were calculated based on the weighted sum of the objective functions to prioritize solutions that simultaneously improve multiple objectives.

Objective functions

This research uses three primary objective functions to evaluate the quality of 3D model orientation in the printing process.

Minimization of support area

The larger the area requiring support material, the higher the cost and time needed to complete the printing process. Therefore, the first objective is to minimize the support area (as can be shown in Figure 4) to reduce material consumption and costs [8], [9]. The floating surface area can be calculated using the following mathematical Eq. (3): SA=ΣiAi|dTni|δ SA = {\Sigma_i}{A_i}|{d^T}{n_i}|\delta where:

Ai is the area of a triangular facet on the surface of the 3D model.

ni is the normal vector of the triangular facet, which represents the orientation of the facet in 3D space.

d is the unit vector that indicates the build direction (typically aligned with the Z-axis in 3D printing).

δ is a binary value serving as an indicator (0 or 1).

Figure 4:

3D Model with visualization of normal vectors.

Minimization of print time

Proper model orientation can significantly reduce print time. The fewer the layers and the shorter the travel distance of the printer nozzle, the faster the printing process will be completed. This second objective aims to minimize the total print time, which is beneficial for enhancing production efficiency [8, 9]. Print time can be calculated using the following mathematical equation: BT=maxi(dTvi1,dTvi2,dTvi3)mini(dTvi1,dTvi2,dTvi3) BT = \mathop {max}\limits_i ({d^T}v_i^1,{d^T}v_i^2,{d^T}v_i^3) - \mathop {min}\limits_i ({d^T}v_i^1,{d^T}v_i^2,{d^T}v_i^3) where:

d is vector normal direction.

v1, v2, and v3 represent the three vertices of triangle i on the surface of the 3D model.

Minimization of surface roughness

The surface quality produced by a 3D printer is influenced by the model's orientation. Specific orientations can reduce the “stair-stepping” effect or visible layer lines on the surface [8, 9], as shown in Figure 5. This third objective minimizes surface roughness to achieve a smoother, higher-quality print finish. Surface quality can be calculated using the Eq. (5).

Figure 5:

Stair-stepping effect due to layer stacking on an inclined surface [8].

The surface roughness for each triangular facet can be calculated based on its orientation relative to the build direction: RAi=tsin=(θi) {RA}_i = {t \over {\sin = ({\theta_i})}} where:

t is layer height.

θ is the orientation angle of the i triangular facet relative to the build direction.

The average surface roughness for a 3D model can be calculated by averaging the surface roughness of each triangular facet based on its orientation relative to the build direction: RAi=INΣi=1NRAi {RA}_i = {I \over N}\Sigma_{i = 1}^N{RA}_i where:

n is the total number of triangular facets (or surfaces) on the 3D model.

RAi represents the roughness contribution of a single triangular facet based on its orientation relative to the build direction.

Tradeoff among objective function

The optimization of 3D printing orientation involves three conflicting objective functions: minimizing support material, minimizing print time, and minimizing surface roughness. These objectives are interdependent, creating inherent tradeoffs in the optimization process. This section discusses the nature of these tradeoffs and their implications for finding optimal solutions.

Balancing the tradeoffs among the objectives is a fundamental challenge in the optimization of 3D printing orientation. The inherent conflicts between minimizing support material, print time, and surface roughness make it impossible to optimize all three objectives simultaneously without some level of compromise. The optimization process addresses this by generating a Pareto front, which represents a set of solutions where each solution achieves a unique tradeoff among the objectives. Solutions on the Pareto front are non-dominated, meaning that no single solution is superior across all objectives. This allows decision-makers to prioritize specific objectives based on their requirements, such as favoring reduced surface roughness for esthetic applications or shorter print times for rapid prototyping.

Understanding the tradeoffs among support material, print time, and surface roughness is critical for selecting an optimal 3D printing orientation. The Pareto front provides a framework for analyzing these tradeoffs and helps in decision-making by presenting a range of non-dominated solutions. The integration of Q-learning into NSGA-II further enhances this process by improving solution quality and accelerating convergence toward a well-distributed Pareto front.

Results and Discussion
NSGAII

This visualization of the results presents an analysis of NSGA-II performance in minimizing the specified objective functions in support area, print time, and surface roughness. The analysis includes the Pareto optimal front, a histogram of the objective function distribution, a line chart of the history of the objective function values across generations, and a comparison between the initial and optimal objective function values.

Figure 6 shows the analysis of the comparison between the initial and final solutions obtained through the optimization process using NSGA-II on the 3D model bunny.stl, demonstrating significant improvements. In the initial solution, the support material was recorded at 2,099.17 mm2 and successfully minimized to 1,813.02 mm2, indicating that the NSGA-II method achieved a 13.61% improvement in reducing support material requirements. The printing time, initially recorded at 1,254.62 s, was reduced to 663.83 s, resulting in a 47.10% increase in efficiency. Additionally, surface roughness, initially measured at 111.02, was reduced to 81.16, reflecting an efficiency improvement of 26.91%.

Figure 6:

Bar chart of the initial value of objective function with the final value of objective function. NSGA-II, non-dominated sorting genetic algorithm II.

These results highlight the effectiveness of NSGA-II in significantly improving the printing process efficiency in terms of reducing support material, minimizing printing time, and enhancing surface quality. The substantial changes in all three objective functions demonstrate the success of NSGA-II in optimizing the 3D model orientation, producing solutions with better objective function values. This reflects the algorithm's capability to effectively minimize support material, reduce printing time, and improve the printed surface quality.

The histogram in Figure 7 shows the distribution of objective function values generated during the optimization process, providing insights into the diversity of solutions. The support material exhibits a range between 17,000 mm2 and 19,000 mm2, with the highest concentration of solutions around 18,000 mm2. Printing time spans a range from 500 s to 900 s, with a uniform distribution across this interval. Surface roughness values range from 70 to 95, with the highest frequency observed between 75 and 85. This distribution reflects the diversity of solutions identified by the algorithm within the solution space, highlighting the tradeoffs among the optimized objective functions during the optimization process. This diversity indicates the algorithm's capability to explore various potential solutions in the search for the best balance among the objectives.

Figure 7:

Histogram of the distribution objective function.

Figure 8 shows the convergence trend of objective function values across 10 generations, revealing significant improvements. The support material decreased to 87% of its initial value, printing time gradually reduced to 53.6%, and surface roughness decreased to 73.6%.

Figure 8:

Line chart history of three objective function with NSGAII used bunny.stl as 3D model. NSGA-II, non-dominated sorting genetic algorithm II.

The graph illustrates the gradual changes in objective function values throughout the optimization process, reflecting the ability of the NSGA-II algorithm to generate progressively better solutions across generations. This demonstrates the algorithm's effectiveness in simultaneously minimizing all three objective functions.

Figure 9 shows a three-dimensional Pareto front that illustrates the relationship between support material, printing time, and surface roughness. This plot displays the Pareto-optimal solutions produced by the algorithm, with each point representing a different combination of objective function values.

Figure 9:

Pareto optimal front for the bunny 3D Model by NSGA-II. NSGA-II, non-dominated sorting genetic algorithm II.

The Pareto front highlights the tradeoffs among the objective functions, where improvements in one objective may be accompanied by changes in the others. This reflects the balance achieved by the algorithm in optimizing all three objectives simultaneously.

The right part of Figure 10 shows the validation results of these orientations in the printing simulation. From the simulation, the estimated material support requirement is 385,679 g, with an estimated printing time of 20 hr 8 min. This validation process is used to evaluate the orientation of optimization results in the context of 3D printing with slicer software.

Figure 10:

Validate optimal orientation with Makerbot desktop slicer.

NSGAII-learning

This section visualizes how Q-learning can improve the performance of NSGA-II by utilizing solution performance-based rewards to guide the selection and exploration process of the population. Q-learning helps NSGA-II in selecting individuals with the best potential to produce a higher quality Pareto front, accelerate convergence, and increase solution diversity. This integration is expected to optimize the algorithm evolution process and produce more efficient solutions to multi-objective problems.

Figure 11 shows a comparison between the initial objective function values and the optimized values for the 3D model bunny.stl using the NSGA-II algorithm combined with Q-learning, demonstrating significant improvements. The optimized objectives include support material, printing time, and surface roughness.

Figure 11:

Bar chart of the initial value of objective function with the final value of objective function for the bunny 3D Model by NSGA-II with Q-learning. (Author's own work). NSGA-II, non-dominated sorting genetic algorithm II.

In the initial solution, the support material was recorded at 2,089.09 mm2, printing time at 1,231.23 s, and surface roughness at 109.81. After the optimization process using NSGA-II with Q-learning, all three objectives were reduced: support material decreased to 1,756.0 mm2 (a reduction of 15.96%), printing time dropped to 553.624 s (a reduction of 55.03%), and surface roughness was minimized to 74.272 (a reduction of 32.37%).

The bar chart in Figure 11 illustrates the significant changes from the initial values to the optimized values, highlighting the algorithm's capability to identify more optimal solutions based on the defined objective functions. The combination of NSGA-II with Q-learning provides an effective approach to improving printing efficiency by reducing support material requirements, printing time, and surface roughness for the 3D model.

Figure 12 shows the validation of the optimal orientation of the bunny.stl 3D model using Makerbot Desktop Slicer software. The left part of the image shows the optimal orientation obtained from the NSGA-II algorithm with a rotation of θx = 83.75, θy = −10.21, and θz = −9.58. This orientation is a Pareto-optimal solution that considers support material, print time, and surface roughness.

Figure 12:

Histogram of three objective function with NSGAII-Q-learning. NSGA-II, non-dominated sorting genetic algorithm II.

Figure 12 shows the distribution of the values of the three objective functions, namely support material, printing time, and surface roughness, generated by the NSGA-II algorithm with Q-learning during the optimization process of the 3D bunny.stl model.

In the support material histogram, the distribution of values range from 17,000 mm2 to 18,200 mm2, with the highest frequency occurring around 17,800 mm2. This shows that most of the solutions generated require support material in this range, reflecting the algorithm's tendency to minimize material requirements without losing the flexibility to explore other solutions.

The print time histogram shows values spread in the range of 500–650 s, with the highest frequency around 500 s. This distribution shows that the algorithm tends to generate solutions more often with low printing times, although there are still variations in solutions with higher printing times.

In the surface roughness histogram, the values are spread between 70 and 82, with a peak frequency around 72 to 74. The resulting solutions mostly have good surface quality, with low roughness, although there are some solutions that show higher surface roughness values, as part of a tradeoff to optimize other objective functions.

Overall, this histogram reflects the algorithm's ability to explore the solution space widely and produce solutions that consider the balance between the three objective functions. The distribution of solutions shows the flexibility of the algorithm in offering alternatives that suit user needs based on priority to support material, printing time, or surface roughness. The high frequency of certain values confirms the optimization pattern resulting from the integration of NSGA-II with Q-learning.

Figure 13 shows the convergence graph illustrates the percentage changes in the three objective functions—support material, printing time, and surface roughness—relative to their initial values across 10 generations during the optimization of the bunny. stl model using NSGA-II combined with Q-learning.

Figure 13:

Line chart of three objective function for the bunny 3D model by NSGA-II with Q-learning. NSGA-II, non-dominated sorting genetic algorithm II.

The graph for support material shows a gradual decrease from 100% in the first generation to 84.2% in the 10th generation. This decline indicates the algorithm's consistent reduction of support material requirements during the optimization process, although the rate of improvement diminishes after the 7th generation.

The graph for printing time displays a more significant reduction, from 100% in the first generation to 67.7% in the 10th generation. The largest decrease occurs in the early stages, particularly between the first and third generations, with the rate of improvement slowing in subsequent generations. This demonstrates the algorithm's effectiveness in minimizing printing time, especially during the initial optimization phases.

The graph for surface roughness exhibits the steepest decline among the three objective functions, from 100% in the first generation to 45.1% in the 10th generation. The most substantial reduction occurs in the early generations, particularly between the first and third generations, with values stabilizing after the 7th generation. This highlights the algorithm's ability to quickly generate solutions with significantly improved surface quality.

Overall, the graph demonstrates different convergence patterns for each objective function. Surface roughness experiences the most significant reduction, followed by printing time, while support material remains more stable after certain generations. These varying patterns reflect the priorities and tradeoffs in the optimization process, where NSGA-II, combined with Q-learning, progressively explores solutions to achieve a balance among the objective functions.

The distribution of points on this Pareto front illustrates the tradeoffs between objective functions:

Solutions with lower support material tend to have higher print times, indicating a tradeoff between material efficiency and print duration.

Solutions with lower surface roughness (better surface quality) tend to be distributed at the bottom of the front, indicating that optimization for smoother surfaces can affect other parameters such as print time and support material.

This Pareto front reflects the set of optimal solutions in a multi-objective context, where no solution directly dominates the others. Users can choose solutions based on their priority among the objective functions, such as minimizing print time or support material, depending on their specific 3D printing needs. This Figure 14 shows the success of the algorithm in producing a solution that is balanced between the three objective functions through an exhaustive exploration of the search space.

Figure 14:

Pareto optimal front for the bunny 3D model by NSGA-II with Q-learning. NSGA-II, non-dominated sorting genetic algorithm II.

Figure 15 shows the validation of the optimal orientation of the bunny.stl 3D model using Makerbot Desktop Slicer software. The left part of the image shows the optimal orientation obtained from the NSGA-II algorithm with a rotation of θx = −56.33, θy = −20.74, and θz = −14.71. This orientation is a Pareto-optimal solution that considers support material, print time, and surface roughness.

Figure 15:

Validate optimal orientation NSGAII-Q learning with Makerbot desktop slicer. NSGA-II, non-dominated sorting genetic algorithm II.

The right part of the figure shows the validation results of these orientations in the printing simulation. From the simulation, the estimated material support requirement is 38,152, with an estimated printing time of 19 hr 52 min. This validation process is used to evaluate the orientation of optimization results in the context of 3D printing with slicer software.

Comparison NSGAII with NSGAII-Q learning

Figure 16 and Table 1 present a comparison between the optimization results of the NSGA-II algorithm and the NSGA-II algorithm combined with Q-learning (RL-NSGA-II) for the 3D model bunny.stl. Figure 16 illustrates the histogram distributions of the initial solutions from both algorithms for three objective functions: support material, printing time, and surface roughness.

Figure 16:

Histogram comparison NSGAII with NSGAII-Q learning. NSGA-II, non-dominated sorting genetic algorithm II.

For the support material histogram, RL-NSGA-II generates a more concentrated distribution of solutions in the lower range (1.8 × 104 mm2 to 2.2 × 104 mm2) compared with NSGA-II, which frequently produces solutions in a higher range (2.0 × 104 mm2 to 2.3 × 104 mm2).

In the printing time histogram, RL-NSGA-II shows a concentration of solutions in shorter time ranges (800–1,200 s), whereas NSGA-II exhibits a broader distribution, reaching up to 1,800 s.

For surface roughness, RL-NSGA-II tends to produce solutions with lower values (80–120), whereas NSGA-II solutions extend to higher roughness values, reaching up to 140.

This comparison demonstrates that RL-NSGA-II is capable of producing solutions that are more concentrated in the optimal value ranges for all three objective functions. This reflects the improved efficiency of RL-NSGA-II in the optimization process.

Meanwhile, Table 2 compares the final optimization results of the two algorithms based on the three objective functions. The combination of NSGA-II and Q-learning demonstrates improved efficiency across all objective functions compared with NSGA-II alone. Support material was reduced from 2,129.70 mm2 with NSGA-II to 2,085.70 mm2 with the NSGA-II and Q-learning combination, achieving an efficiency improvement of 2.1%. Printing time decreased from 11,847 s to 11,393 s, yielding a 3.8% improvement. Surface roughness also slightly improved, decreasing from 108 to 106, with an efficiency increase of 1.9%.

Comparison of NSGAII with NSGAII-Q learning

3D model Objective NSGA_II NSGAII-Q learning Efficiency improvement
Bunny Material support 212,970 208,570 2.1
Print time 1,1847 11,393 3.8
Surface roughness 1.08 1.06 1.9

NSGA-II, non-dominated sorting genetic algorithm II.

The integration of Q-learning with NSGA-II not only influenced the distribution of initial solutions but also enhanced the final optimization results, as demonstrated by the histogram distributions and the outcomes in the table. This highlights the effectiveness of integrating Q-learning in improving the performance of the NSGA-II algorithm.

Closing
Conclusions

The integration of Q-learning with NSGA-II (RL-NSGA-II) shows improved optimization outcomes compared with the standard NSGA-II in 3D printing parameter optimization. The analysis indicates that RL-NSGA-II produces solutions with reduced support material, shorter print times, and better surface roughness, as observed in both histogram distributions and final optimization results. Validations using slicer software demonstrate the practical feasibility of the optimized orientations, aligning the theoretical outcomes with real-world applications.

Limitations

The study is limited to a specific 3D model (bunny. stl) and a predefined set of printing parameters. The generalizability of RL-NSGA-II to other 3D models and broader parameter spaces has not been fully explored. Additionally, the computational overhead introduced by RL may limit its scalability for complex or high-dimensional optimization problems.

Contribution work

This work contributes to the field of 3D printing optimization by combining NSGA-II with Q-learning to enhance the exploration and exploitation of the solution space. The integration provides a structured approach to balancing multiple conflicting objectives, offering a practical and efficient method for improving material usage, printing time, and surface quality. The validation framework further ensures the applicability of the optimization results in real-world 3D printing scenarios. We would like to convey our gratitude, as the work has been supported by the Graduate Informatics Department, Faculty of Information Technology, and the research body (LPPM-UPH), at Universitas Pelita Harapan, with a contract no. P-088-FTI/XII/2024, under the corresponding author's name.

Language:
English
Publication timeframe:
1 times per year
Journal Subjects:
Engineering, Introductions and Overviews, Engineering, other