1 Introduction

Additive manufacturing technology allows components development with complex geometries and high versatility. A relevant aspect of this technology is the possibility of optimizing materials for improved performance in terms of strength-to-weight ratio [1, 2], such as the manufacturing of lattice structures capable of absorbing large amounts of energy [3, 4] and exhibiting tunable directional material properties [5]. The size and shape of the internal material structures significantly influence the mechanical response of the printed parts, mainly explained by an internal or local stress distribution given by the infill pattern, and the strength and density fraction relative to the base material [6, 7]. Ganeshkumar et al. [8] investigated the mechanical response of polylactic acid (PLA) by modifying the printing pattern and density fraction using gyroid, rhombille, circular, truncated octahedron, and hexagonal structures. The results indicated that the hexagonal pattern generates the superior mechanical response, with a more significant effect of the density fraction.

The process of topological optimization, usually applied to the design and shape of the material, offers the capability to optimize the infill structures and modify the internal pattern, improving the mechanical response in terms of a specific and defined external stimulus. From additive manufacturing, applying topological optimization with optimized fiber orientation variation based on structural requirements is possible [9, 10]; however, in some cases, the design constraints make it not feasible to modify the surface [11,12,13,14,15,16] and optimization is carried out solely on the infill structure. In such situations, a process known as full-envelope graded infill optimization is employed to avoid altering the overall mechanical design. There are limited studies reported on this process, which combines all the aforementioned optimization methods. An example of work conducted in this area is the study by Hoang et al. [17], who addressed the ability to perform topological optimization on structures coated with non-periodic infill patterns using additive manufacturing.

There have been several studies conducted on topological optimization in the field of engineering with applications to manufactured and validated components. Stepanek et al. [18] analyzed the design improvement of a tool holder using topological optimization and additive manufacturing through DMLS. Huang et al. [19] evaluated the design and manufacturing at multiple scales of thermoplastic composites reinforced with continuous fibers using 3D printing. They concluded that the use of 3D printing and advanced design through topological optimization can produce high-performance and lightweight structures considering complex geometries.

In fused filament fabrication, many different types of infill patterns can be applied [20], which are defined as a percentage of infill density indicating the amount of material used in the selected pattern. This parameter indicating the quantity of interior infill material is bounded by the perimeters of the print geometry. These perimeters are typically concentric lines that follow the outer structure and are perpendicular to the normal vector at that point on its surface. The surface finish and specific stiffness of the piece depend on these lines, which are unique to each geometry, while the stiffness of the infill is independent of the shape of the printed object.

Based on the previous discussion, it is emphasized that manufacturing critical mechanical components using additive methods allows for greater freedom in design and conception of parts, presenting more complex geometries with differentiated infill configurations and reduced weight. The major advantage lies in the fact that this method enables the creation of geometries through successive material deposition [21,22,23], and compared to subtractive methods, it significantly reduces waste generation [1, 21]. Additionally, an increasing adoption of this technology has been observed in industrial applications, ranging from prototyping and modeling to the industrial production of components and final products [24] for the construction, biomedical, and aerospace industries [21].

Furthermore, the porous nature of the infill in additive manufacturing processes, such as fused deposition modeling [25], leads to the creation of parts with a superior strength-to-weight ratio compared to solid traditional structures. This includes other notable characteristics such as increased energy absorption capacity, improved buckling stability, and reduced stress concentrations [26]. The deposition path and volume fraction define the internal structure of the material, influencing the macroscopic physical properties and the final macromechanical response of the component. Generally, a higher infill density or volume fraction is associated with greater strength [27]. However, the development of design methodologies for additive manufacturing, particularly optimal deposition strategies, remains a challenge due to the inferior mechanical properties of the deposited material [28,29,30,31].

The objective of this study is to analyze the influence of infill density and perimeter on the mechanical response of PLA and maximize the improvement in mechanical strength through intelligent infill topology optimization. Experimental tests and virtual tests using FEM in the ANSYS Workbench® software will be conducted to achieve this objective. The specimens are manufactured with different infill densities and print orientations to analyze the correlation between the results of virtual tests and experimental tests following the ASTM D638 standard. To maximize mechanical strength through the versatility of additive manufacturing, topology optimization of a mechanical element will be investigated based on specific load, deformation, and constraint conditions to appropriately modify the internal design and achieve an optimal distribution of infill density. Finally, the results will be compared with experimental tests under controlled load conditions.

2 Materials and methods

2.1 Manufacturing

To analyze the variation in print orientation with respect to infill density, type IV specimens specified in ASTM D638 were fabricated using PLA material (see Fig. 1a). The degree of anisotropy was studied considering two orientations. The first orientation involved flat alignment, where both ends were in contact with the printing bed, and consecutive layers were deposited parallel to the loading direction. The second orientation involved vertical alignment, where only one end was in contact with the bed, and layers were deposited perpendicular to the loading direction (see Fig. 1b).

Fig. 1
figure 1

Schematic representation of tensile specimens: a specimen geometry with specific dimensions in mm and b studied printing orientation

The material samples were fabricated using 1.75-mm diameter PLA filaments with the printing parameters specified in Table 1. A 3D printer, Anet A8, manufactured by Shenzen Getech Co., was used for the printing process. The printer had a printing area of 220 × 220 × 240 mm, an acrylic frame, and a maximum resolution of 100 μm. Prior to fabrication, the printer was calibrated and maintained under controlled conditions with constant process parameters to minimize manufacturing process variability.

Table 1 Printing parameters

For the specimen manufacturing process, different fill densities were considered, expressed as a percentage of the total volume in each case, inversely proportional to the distance between infill lines. The specimens were fabricated in batches with varying density values, while maintaining the pattern of parallel straight infill lines at a 45° angle. Each batch consisted of 5 specimens with different infill densities, incremented by 10% from 10 to 100%. This configuration was duplicated for each printing orientation (flat alignment and vertical), resulting in a total of 100 specimens, 50 for each printing orientation with different infill density percentages. To minimize the effects of shell parameters on the material’s mechanical response, they were kept fixed by using only 1 perimeter for the specimen manufacturing.

A second type of specimen was fabricated to characterize the material’s Poisson’s ratio relationship (see Fig. 2a). This rectangular-shaped specimen was designed with the same thickness as the type IV specimen used to characterize the influence of infill density and perimeters on the mechanical properties of printed PLA material. BX120-20AA strain gauges (see Fig. 2b) were used to measure deformation. The gauges were attached to the specimens using cyanoacrylate adhesive, aligned with the axis of the specimen’s front surface. Welding terminals were also attached to the specimen to isolate any potential force on the strain gauge resulting from cable movement, which could lead to erroneous deformation measurements. A total of 8 specimens of this type were fabricated, 4 for each orientation (flat and vertical), with varying infill density percentages from 20 to 80%, incremented by 20% each.

Fig. 2
figure 2

Components used in the determination of Poisson’s ratio: a dimensions of the sample subjected to tensile stress; b strain gauge mounted on the sample to determine Poisson’s ratio

2.2 Tensile test and data processing

The tensile tests were performed following the standard ASTM D638, at a velocity of 5 mm/min, 23 °C and 50% of relativity humidity. The setup of the machine for the specimens to characterize the infill and perimeter properties is shown in Fig. 3a). A bicolumn universal test system Instron 3369 with extensometer was used to run the tensile tests. This machine allows tensile and compression tests up to 50 kN, with a data collection of 500 Hz, a maximum test speed of 500 mm/mm, and 1193 mm of effective vertical space. To acquire the data a dynamic tension measurement module NI-9235 on up to 8 channels was used, which allows up to 10,000 samples per second per channel, at a resolution of 24 bits, calibrated for strain gauges of 120 Ω. BX120-20AA, uniaxial strain gauges of 120 Ω and 20 mm were used to measure the axial and lateral deformation of some of the specimen designed to the characterize Poisson’s ratio.

Fig. 3
figure 3

Schematic representation of experimental tensile tests: a determination of ultimate stress and Young’s modulus; b determination of Poisson’s ratio

The samples were loaded until failure while the experimental data were obtained by the integrated software in the test machine and processed to calculate Young’s modulus and the ultimate stress. In the first step of the test, Young’s modulus was calculated using the data of the extensometer on a small deformation (between 0.0001 and 0.00015 mm/mm). In the second step, the ultimate stress was calculated by dividing the maximum load reached during the test and the cross-sectional area measured at the beginning of it. Under the same conditions, the tensile test is now performed on the specimens to characterize Poisson’s ratio. The setup for this test is shown in Fig. 3b.

The specimen is loaded producing an axial elongation (\({\epsilon }_{a}\)) and a lateral contraction (\({\epsilon }_{t}\)). Previous to the application of the load, the initial deformations of the gauges are measured; these values are subtracted from the values reported by the gauges during the test. This way it is assured that an initial value of zero is taken. This calibration is necessary to minimize any possible error due to external factors. Once the gauges have been calibrated, the specimen is deformed, and two measurements are made with the same load (\(P\)), computing the average value of the deformation for each axis, where Poisson’s ratio can finally be calculated by Eq. (1):

$$\mu =-\frac{\left(\frac{\partial {\epsilon }_{t}}{\partial P}\right)}{\left(\frac{\partial {\epsilon }_{a}}{\partial P}\right)}$$
(1)

Then, the load is released, and the specimen is pulled again to take 2 new measurements, which are averaged to report the final value as Poisson’s ratio of that specimen. This procedure was repeated for all de samples.

2.3 Virtual tensile test

The results of the experimentally obtained mechanical properties, which describe the effects of infill density and shells, were validated using virtual tests conducted through finite element simulation in ANSYS Workbench 2022 R2® software. The geometry of the virtual test specimens is presented in Fig. 4, which corresponds to the type 1 specimen as per ASTM D638 standard. This geometry was experimentally tested to evaluate the accuracy obtained when varying the geometric conditions of printed materials. The experimental tests conducted to validate the virtual tests consisted of 20 samples with 5 different infill densities: 7%, 20%, 40%, 60%, and 80%, with a printing direction of 0°.

Fig. 4
figure 4

Type I specimen according to the D638 standard

The boundary conditions applied in the virtual experiments consisted of restraining 3 translational degrees of freedom and 3 rotational degrees of freedom on the bottom face of the specimen. The top face was restricted in all 3 rotational degrees of freedom, and the translational degrees of freedom along axes perpendicular to the loading direction were also restrained. The material used in the simulation was modeled with plasticity using a bilinear model. The incremental Newton–Raphson method was employed, utilizing quadratic SOLID186 elements, which are 20-node hexahedral 3D elements. Additionally, the Green–Lagrange strain tensor was considered to account for possible nonlinear effects. A mesh convergence study was conducted, resulting in a 1-mm element size for the virtual tests. The mesh consisted of 63,450 nodes and 12,692 elements, providing 55,584 degrees of freedom.

2.4 Topological optimization of infill density

The topological optimization was conducted on a gravitational hook, chosen due to the predominantly tensile load conditions and its relevance in the field of engineering. By maintaining constant dimensions, the impact of anisotropy during the mechanical response was minimized. The original and modeled geometries can be observed in Fig. 5.

Fig. 5
figure 5

The component selected to apply the topological optimization of infill density: a real gravitational hook and b 3D model for manufacturing in PLA

The topological optimization was performed using ANSYS Workbench 2022 R2® software. A discrete optimization approach was employed to generate the infill structure using the Sequential Convex Programming (SCP) method. The objective of this method is to distribute the density fraction in order to maximize the mechanical strength of a given part while maintaining constant the total mass, total volume, and original shape of the part. In the discretized design domain \(\Omega\), each element can be filled with one of the \(n\) defined density fractions \({\rho }_{1}\), \({\rho }_{2}\),…,\({\rho }_{n}\). Thus, for an arbitrary finite element \(i\), a set of Boolean variables can be assigned \({\alpha }_{i}^{1}\), \({\alpha }_{i}^{2}\),….,\({\alpha }_{i}^{n-1}\) to indicate the condition of the element, and its respective assigned density fraction. For example, for a structure with three possible density fractions \({\rho }_{1}\), \({\rho }_{2}\), and \({\rho }_{3}\) with \({\rho }_{1}<{\rho }_{2}<{\rho }_{3}\), each element requires two Boolean variables to identify its density. For \({\alpha }_{i}^{1}=0\), the element \(i\) exhibits the lowest possible density fraction \({\rho }_{1}\) while \({\alpha }_{i}^{1}=1\) implies that the element \(i\) has a percentage of infill density greater than \({\rho }_{1}\), i.e., \({\rho }_{2}\) or \({\rho }_{3}\). For the second Boolean variable \({\alpha }_{i}^{2}=0\), the element \(i\) has the density fraction \({\rho }_{2}\) while \({\alpha }_{i}^{2}=1\) implies that the element \(i\) has density fraction \({\rho }_{3}\). This algorithm can be generalized to \(n\) infill density \({\rho }_{1}\), \({\rho }_{2}\),…,\({\rho }_{n}\) by means of the scheme presented in Fig. 6a.

Fig. 6
figure 6

Schematic representation of the topological optimization process: a algorithm of density fraction assignment for each element \(i\); b discretized hook part model with 100 kN and boundary constraints; c topological optimization from different values of targeted mass fraction; d models M0 to M5 resulting from the method

Based on Fig. 5, the gravitational hook was manufactured using fused polylactic acid (PLA) through three stages. First stage includes a linear simulation of the part at operating load condition (see Fig. 6b) to obtain the resulting internal stress distribution pattern. The second step is to transfer the numerical results to the optimization module of the software, generating a new part shape, subset of the original one, according to the following conditions: (a) entire volume of the part is defined as the working domain, with boundary condition surfaces as exclusion regions; (b) optimization objective set as maximizing part strength with respect to a final targeted part mass. Here, several models with optimized density fraction are developed using identical parameters of target overall mass fractions of 75, 50, 25, 10, and 5% of the control model, generating the respective geometries \({g}_{1}\), \({g}_{2}\), \({g}_{3}\), \({g}_{4}\), and \({g}_{5}\) (see Fig. 6c). In the third stage, the final part with the optimized density fraction distribution is developed by superimposing the geometries obtained in the previous step (see Fig. 6d).

Each generated model keeps the original part shape, but internal areas are assigned with different density fraction \({\rho }_{1}\), \({\rho }_{2}\), \({\rho }_{3}\), \({\rho }_{4}\), \({\rho }_{5}\), and \({\rho }_{6}\). The higher density fractions correspond to areas obtained from optimizations with a lower target mass. The density values of the fractions assigned to each zone must be consistent with the original mass value of the part. The developed models M0 to M5, ordered according to the number of zones with differentiated density fraction, were obtained as follows: control model M0 is the original part (\({g}_{0}\)) with 50% density fraction (\({\rho }_{1}^{1}\)). Model M1 includes two differentiated infill zones; the previous control model combined with the geometry \({g}_{2}\), which is obtained from the optimization with 50% target mass. These two zones are assigned with density fraction \({\rho }_{1}^{2}=40\%\) and \({\rho }_{1}^{2}=60\%\) respectively. Model M2 includes three differentiated zones, previous Model M1 combined with the optimized shape for a targeted mass fraction of 10%, with resulting density fractions of \({\rho }_{1}^{3}=36\%\), \({\rho }_{2}^{3}=60\%\) and \({\rho }_{3}^{3}=75\%\) respectively. Models M0 to M6 developed with the given method are shown in Fig. 6d.

The maximum number of iterations considered during the topological optimization process was 500, with a convergence precision of 0.1% and a penalty factor of 3. For the mechanical validation through virtual testing, a 2-mm element size was used, employing second-order hexahedral solid186 elements with 36,936 nodes and 7324 elements, resulting in 35,388 degrees of freedom. The Green–Lagrange strain formulation was utilized to account for potential nonlinear effects, employing an incremental Newton–Raphson method.

3 Results and analysis

3.1 Effect of infill density on uniaxial tensile response

Figure 7a presents the ultimate stress results obtained from tensile tests on PLA samples varying the infill density. It can be observed that the stress results obtained in the specimens fabricated in the Z direction do not show a significant improvement until reaching a fill percentage of 50%. This is because the amount of infill used is insufficient to generate a significant effect on layer adhesion. Additionally, it was expected that the stress values in the X direction would be higher than those obtained in the Z direction. However, this is not the case and is attributed to the fact that, in the case of a small cross-sectional area of the specimen consisting only of a thin wall without infill, the energy required to initiate a fracture is lower than that necessary to induce layer delamination failure. Furthermore, in cases of low infill levels, combined stresses are generated in the neck of the specimen, which introduces combined stress states that affect the performance of the specimen.

Fig. 7
figure 7

Tensile test results varying fill density and printing direction: a ultimate stress vs. fill density; b Young’s modulus vs. fill density; c normalization of ultimate stress vs. fill density; d normalization of Young’s modulus vs. fill density

In Fig. 7b, the variation of Young’s modulus with changing infill density is observed. Once again, similar properties have been observed in the specimens fabricated in the Z direction up to a fill level of 50%, while the X direction specimens follow a less pronounced curve. It has been noted that beyond a fill level of 70%, the properties tend to converge, behaving similarly to a solid piece.

Ultimately, it has been observed that projecting the curves to a fill level of 0 does not yield mechanical properties equal to zero. This is due to the existence of a “baseline” of properties determined by the part's perimeters. To isolate this effect, the minimum value obtained for each type of test was subtracted, allowing the value exclusively attributable to the infill to be obtained in each case.

Figures 7c and d show the normalized fitting for curves of Fig. 7a and b, respectively. Based on these results, Eqs. (2), (3), (4), and (5) are derived, describing the behavior of rupture stress and effective stiffness in each printing direction. These equations allow obtaining the properties corresponding to intermediate infill values. When obtaining the properties using these equations, the previously subtracted value during parameter normalization, which is related to the part’s perimeter, is added back. It is important to note that all the parts considered in this study have a single perimeter.

$${\sigma }_{Ux}=0.2{\alpha }^{2}+0.1\alpha +0.1$$
(2)
$${\sigma }_{Uz}=0.1{\alpha }^{3}-0.6{\alpha }^{2}+1.8\alpha -1$$
(3)
$${E}_{x}=18{\alpha }^{2}-36\alpha +44$$
(4)
$${E}_{z}=1.9{\alpha }^{3}-8.3{\alpha }^{2}+1.4\alpha +24$$
(5)

The results obtained from measuring Poisson’s ratio while varying the infill density and printing orientation can be visualized in Fig. 8. It can be observed that the modulus is practically independent of the filling conditions due to the negligible variation. Based on these findings, the average values in the X and Z directions will be considered, which are 0.464 and 0.316, respectively.

Fig. 8
figure 8

Summary of results obtained for Poisson’s coefficient with varying fill density and printing orientation

3.2 Effect of printing perimeter on ultimate stress and Young’s modulus

Figure 9 presents the results obtained for ultimate stress and Young’s modulus when varying the number of perimeters in the tensile samples. In Fig. 9a, it can be observed that the ultimate strength is higher in the specimens fabricated in the X direction. Furthermore, both in the X and Z directions, the force required to induce fracture increases linearly as the number of perimeters is increased. In Fig. 9b, it is observed that the samples fabricated in the Z direction exhibit higher effective stiffness compared to those fabricated in the X direction. Additionally, equations characterizing these properties depending on the printing direction for our case study were derived, which can be seen in (6) and (7) for ultimate stress, and (8) and (9) for Young’s modulus.

Fig. 9
figure 9

Tensile test results for different number of perimeters: a ultimate stress vs. number of perimeters; b Young’s modulus vs. number of perimeters

$${\sigma }_{Ux}=8.1P-1.13$$
(6)
$${\sigma }_{Uz}=6.35P-1.31$$
(7)
$${E}_{x}=452.31P+121.61$$
(8)
$${E}_{z}=558.53P+104.15$$
(9)

3.3 Correlation between virtual and experimental tensile tests

The results prior to topological simulation of virtual tensile tests can be visualized in Fig. 10. The performed adjustment after normalizing the perimeter factor to the mechanical response of PLA for the different infill percentage provides accurate results. It can be observed that there is a good agreement between the curves obtained from computational simulation (expected value) and the curves obtained from experimental tests (obtained value) for ultimate stress and elastic modulus.

Fig. 10
figure 10

Fitting curves for virtual tests (expected value) vs experimental tests (obtained value): a maximum tensile stress; b Young’s modulus

For the ultimate stress case (see Fig. 10a), the maximum error percentage obtained corresponds to a fill percentage of 20%, with an error of 27.35%. However, this error decreases as the fill percentage increases in the material (see Table 2), reaching a minimum at 80% fill, with an experimental error of 0.25%.

Table 2 Fit obtained between virtual and experimental tests in tensile for ultimate stress

The observed effect for Young’s modulus (see Fig. 10b) is the same as for the ultimate stress. The maximum error obtained was for an infill percentage of 7%, with an error of 24.43%. However, the error decreases as the infill percentage increases, reaching the minimum value at 2.51% (see Table 2).

3.4 Increased strength of porous PLA with optimized infill density

The models M0 to M5 were simulated using the finite element method to quantify the improvement in mechanical strength. The boundary conditions were maintained, but the load value applied was calculated in such a way that it produces a maximum equivalent stress equal to the ultimate stress of the material in the original part (M0). The definition of the material considers the properties of ultimate stress and specific elastic modulus for each value of density fraction. The distribution of equivalent stress (σeq) generated in Models M1 to M5 is shown in Fig. 11. The maximum σeq is much higher in M5, which has a larger number of discrete infill density zones (see Table 3). Although this indicates that the stress distribution is less favorable for this optimized component, failure is delayed owing to higher density fraction and superior mechanical properties, such as ultimate stress. The minimum local safety factor (SF) values reported (see Table 3 and Fig. 11) demonstrate a substantial increase in the mechanical strength for the optimized parts. The highest value of the minimum SF obtained is close to 2, and compared to M0, the most critical zone of the optimized part provides superior mechanical performance to the part.

Fig. 11
figure 11

Equivalent stress distribution and safety factor of models 0 to 5

Table 3 Mechanical performance of optimized samples

For validating the models, batches of 4 samples were manufactured for each of the optimized parts M0 to M5 and subjected to experimental loading (see Fig. 12a). The fracture load measured in destructive tests is presented in Fig. 12b. A clear trend of increasing fracture strength with the number of density fraction zones is observed. To describe the failure, it must be understood that 3D-printed materials exhibit a characteristic failure depending on their configuration, printing parameters, and the stress to which they are subjected [32,33,34,35,36]. In this context, Benamira et al. [34] investigated the effects of printing parameters on failures in 3D-printed PLA. They observed a relationship between print orientation and failure and noted that the interaction between orientation and failure varies depending on the infill density. Examining Fig. 12, it can be seen that local cracks (see Fig. 12a) correlate with the locations of maximum stress calculated by finite element method (see Fig. 11). However, the final fracture zone appears near to the location of maximum stress. Analyzing the results, it is observed that the failure zone is located in a section change region, which sensitizes the component to damage. In addition, there is a change in the infill densities due to the topological optimization process, resulting in a change in the stiffness of both zones and a co-deformation process near the stiffness change. These results show that the prediction of the fracture zone using this topological optimization system requires a local approach and a more advanced model based on micromechanics or porous plasticity that incorporates the nonlinearities of the stress–strain behavior of the material [37]. The mean value of the failure force, along with the gain for each optimized piece compared to the non-optimized M0, is summarized in Table 3.

Fig. 12
figure 12

Schematic representation and validation of topological optimization results: a Optimized PLA hook part M5 before (left) and after testing (right). b Fracture load of models M0 to M5

4 Conclusions

The experimental results indicated that infill density exhibits a polynomial increase in the ultimate stress and stiffness observed in the tensile tests, and it varies between different printing directions. In addition, a significant effect of the enveloping material or perimeter numbers on the mechanical response was observed, making it necessary to normalize the stress–strain response curves. The perimeter linearly increases the ultimate stress and stiffness for each printing direction, which can be utilized to predict their behavior, influence, and project virtual optimization tests.

A 258% increase in the load-bearing capacity prior to failure was observed in the optimized part compared to the non-optimized case. This improvement was achieved without affecting the material usage, with a 23% increase in fabrication time, and without incurring additional costs.

The structural optimization method of infill density fraction allowed the generation of porous structures for the production of parts with enhanced mechanical strength while maintaining a constant total mass, shape, and functionality. The iterative method can be applied a finite number of times to gradually achieve higher mechanical strength.

Due to the mechanism of improvement based on geometric changes and the material used for rearrangement having the same properties as the base material, it is expected that the intelligent reinforcement approach employed in this study can be widely applied to any printing material, yielding positive improvement results.