A novel design method for TPMS lattice structures with complex contour based on moving elements method

Over the past few decades, there have been many important achievements on the design, research, and development of minimal surface lattice structures. In this work, we propose a modeling method for triply periodic minimal surfaces (TPMS) lattice structures with complex contours. This method is based on moving elements method (MEM) and mainly includes the following parts: dividing the model mesh, solving the iso-surface of the TPMS in the model, obtaining the TPMS lattice structure triangular surface of the model outline, integrating the interior of the model and the outline, and finally generating an STL file that can be used for additive manufacturing. Furthermore, the representative femur model, rabbit model, and gear model are provided as case studies to verify the validity and correctness of the proposed modeling method. Then, this approach is compared with the distance field-based method (DFBM) in terms of modeling speed and modeling accuracy. The research results show that the time required by the MEM method was reduced by 3055.56%, 2799.70% compared to the DFBM method, when filling the network primitive and network gyroid lattice structures in the femur model. Moreover, this method provides technical means and simulation data for designing TPMS lattice structures with complex contour, and offers the underlying design ideas for the development and application of the excellent physical properties of TPMS lattice structures in medicine and engineering.


Introduction
Benefiting from structural advantages such as lightweight, high strength [1], superior energy absorption [2][3][4] and shock impact [5], the periodic lattice structure with parametric design has been widely used in impact protection devices [6], aerospace [7], and body implants [8,9]. Advanced manufacturing features of 3D printing [10][11][12], such as freedom design, layer-by-layer sintering, and conformal manufacturing, provide a powerful tool for the fabrication of lattice structures with complex geometric topologies [12][13][14], the steel-copper functionally graded material parts [15], and the NiTi shape memory alloys with high-quality and complex geometry [16]. For instance, a lightweight phase-change thermal controller structure based on lattice structure used in spacecraft is designed and manufactured with AlSi10Mg by direct metal laser melting [17]. And the mass of the lightweight structure is 60% lighter than most traditional structures with the same dimensions. The mechanical analysis for the strength of the designed structure shows that the maximum stress (bar stress or von Mises stress) of the lattices and the shell is 40.3 MPa and 3.2 MPa respectively, which is much lower than the yield stress of ALSI10Mg. Moreover, the test results show that the thermal capacity of the controller based on lattice structures is increased by 50%. In addition, the performance of the manufactured part is also affected by the number of cycles of the powder material [18] and the processing parameters in laser powder bed fusion metal additive manufacturing [19], apart from the effect of different design methods on the structural properties.
Minimal surfaces (also called TPMS) are composed of infinite, non-self-intersecting, periodic surface in three principle directions, and have been easily found in nature [20,21]. TPMS lattice structures are more similar with natural structures without excessive connection joints due to highly interconnected with high porosities, compared with the most utilized truss lattices. Therefore, TPMS lattice structures have attracted the attention of many scholars due to its excellent physical properties, such as zero-value mean curvature and mathematical definition [22][23][24][25]. And it has been proved that TPMS lattice structures have good mechanical properties compared with conventional lattice structures [26]. Additionally, the TPMS lattice structure mainly refer to the lattice structure of four basic topological configurations, such as primitive style (P-style), gyroid style (G-style), diamond style (D-style), and I-wrapped package style (IWPstyle) [27,28]. Furthermore, hybrid conformations, graded conformations [29,30], and network-like or sheet-like structures [31] from these four conformations were also investigated in view of mechanical properties. Additionally, the electrical conductivity, thermal conductivity, and decontamination properties of TPMS lattice structure have been reported successively [32][33][34]. For example, the finned metal foam-phase change materials based on TPMS lattice structures were designed, and its heat transfer performances were processed. The results indicated that TPMS-based foams provide great promise for use in thermal energy storage systems and thermal management systems [35]. For the piezoelectric performance, P-style piezocomposite with the same volume fraction of 50% can increase output voltage by nearly 50% under compressive strains 2-8% compared to a piezocomposite with three intersecting ceramic cuboids [33]. More importantly, it is worth noting that such polycrystalline structures of metals consisting of grains of a few nanometers in size, which resemble essentially the TPMS of Schwarz primitive diamond, provide superior thermal and mechanical stabilities than any other forms of metastable solid states known so far [36]. Moreover, the unusual two-scale singlecrystal micro-lattice with a diamond-triply periodic minimal surface geometry (lattice constant, approximately 30 µm) is found in the biomineralized skeleton of the knobby starfish. Due to lattice-level structural gradients and dislocations, the damage tolerance of this hierarchical biological micro-lattice was enhanced, thus providing novel insights for designing multiscale-multistage novel lightweight synthetic metamaterials with unique properties [37]. In a word, TPMS has been proved to be an advanced concept for the design and application of multiscale lattice structure with special functional or physical properties. Therefore, many scholars have tried to apply the TPMS lattice structure to multi-functional components such as medical implants, lightweight structures, and integrated load-bearing or heat-dissipating structures to give full play to the excellent physical properties of TPMS.
Owning to the multiple advantages of lattice-filled parts, including high stiffness-to-weight ratio, robustness to load changes, and resistance to damage, few researchers have tried to apply the TPMS lattice structure to the filling of complex contour structure models to meet the needs of lightweight or special performance, such as Boolean operation [38], space element mapping method [39], and Boolean operation of distance field [40]. Meanwhile, there are some drawbacks to the existing model method for TPMS lattice structure with complex contour, such as the tradeoff between the modeling speed and modeling accuracy of complex models [41]. This work aims to provide a design method suitable for conformal lattice structures and improve the above issue. Firstly, the modeling framework of TPMS lattice structures with complex contour is proposed. Then, the evaluation of the proposed modeling method is processed in view of modeling accuracy and modeling speed. Finally, the proposed approach is used to generate TPMS lattice structure with complex contour. The results show that the proposed modeling framework can arbitrarily fill lattice structures for complex models, and has good modeling speed and accuracy.
The rest of this paper is organized as follows. In Sect. 2, we describe the moving element method (MEM), especially the marching tetrahedra (MT), and marching triangle (MTR) used in this paper. In Sect. 3, the proposed modeling method is evaluated in views of accuracy and modeling speed. In Sect. 4, different gradient TPMS lattice structures are generated by the introduced modeling method. Section 5 provides the conclusions of this work.

Methods
Generally, the moving cube (MC), moving square (MS), MT, and MTR methods are collectively referred to as MEM [42,43]. Among them, the MC and MT methods have been widely used in the field of medical image modeling and 3D reconstruction of implicit function surfaces due to their characteristic of low space complexity, low time complexity, fast operation speed, and simple implementation. Since TPMS is an implicit function surface, the moving elements is a technology of triangulating the surface, which coincides with the description method of the file format STL commonly used in additive manufacturing. Herein, the proposed methods are used to generate TPMS lattice structures, including MT and MTR. Specially, MT method is used to gain iso-surface of TPMS lattice structures, and MTR is used to realize the stitching of the complex contour triangles of model.

Description of TPMS
As mentioned earlier, TPMS is a minimal surface that exhibits periodicity in three independent directions in threedimensional space (the average curvature of any point on the surface is zero), and usually is presented as Eq. (1) in the form of an implicit surface.
where A k is the amplitude factor, k is the trigonometric period, r is the position vector in Euclidean space, p k is the phase offset, and r is the independent variable.
And the most common TPMS units, P-style, and G-style surfaces are described as Eq. (2).
where X = 2 x∕T, Y = 2 y∕T, Z = 2 z∕T , T respected the period of the minimal surface. The NP, NG, SP, and SG describe the network primitive style, network gyroid style, shell primitive style, and shell gyroid style respectively.

MT method
In this section, we review the properties of MC and MT modeling methods, followed by an introduction to the flow of MT modeling approach. Owning to the characteristic of creating a polygonal representation of constant density surfaces from a 3D array of data, the MC was proposed for the first time to help physicians understand the complex anatomy present in the slices clearly. And MC has been the most popular method used to generate iso-density surface of volume data in computer graphics field [44]. However, the MC method has many problems during the modeling process, such as the difficulty in achieving the consistency between the topological surface and the data; the resulting surfaces contain many triangles of poor aspect ratio [45], and the lengthy looking-up table needed to be constructed resulting in the method being difficult to implement [46]. Additionally, the voxel ambiguity also existed in the modeling process. MT is a variation of MC, which overcomes the shortcomings abovementioned [47]. Compared to the MC approach, the MT method is more facile to be implemented since there are only 16 intersection patterns that exist.
Furthermore, the MT method can avoid the ambiguity situation. Next, the flow of MT modeling method is introduced. Firstly, the space is divided into tetrahedral units, and then all tetrahedral units are traversed. Moreover, the triangles are gained through connecting the intersection points of the tetrahedron and the iso-surface in a certain order. Furthermore, the surface fitting is realized. Additionally, the detailed process of modeling is presented below.
At the first step, the pre-designed space should be divided into tetrahedral elements. Herein, the rectangular parallelepiped area commonly used in the MC is selected for tetrahedral division, due to that the MT approach is derived from MC. According to the sampling accuracy, the cuboid area is divided into small cubes. And its geometric dimensions (length, width, and height) are equal to the sampling accuracy. Furthermore, the cube is divided into 5 tetrahedrons using the five-division method. Therefore, the surface fitting accuracy can be controlled by the number of tetrahedral units and the average size of triangles, which were decided by the sampling accuracy.
At the second step, the value of implicit function equation of TPMS at each corner of tetrahedron is calculated. Furthermore, the states of tetrahedron vertices are divided into two categories, including filled circles and hollow circle, according to the comparison between the calculated value and the zero value. Particularly, the filled circles and the hollow circles are defined as follows: (i) filled circles-the function values for TPMS at all corners of the tetrahedron are larger than or equal to zero; (ii) hollow circles-the function values for TPMS at all corners of the tetrahedron are smaller than zero. Thus, the 4-bit binary state value cube index of the cube is obtained, including 16 states. Through rotation and symmetry operations, the states of the triangulation can be displayed as the two states in Fig. 1.
At the third step, the equivalence triangle patch is solved through linear interpolation theory. If the state values of  Fig. 2, the two endpoints at different state on the edge are described by P 1 (x 1 , y 2 , z 3 ) and P 2 (x 2 , y 2 , z 2 ) , and the intersection point of TPMS iso-surface and cube edge is presented byP 0 (x 0 , y 0 , z 0 ).
where 1 and 2 describe the function values of P 1 (x 1 , y 2 , z 3 ) and P 2 (x 2 , y 2 , z 2 ) at the TPMS function. Then, the equivalence triangle patch was obtained through connecting the points.
At the final step, the fitting surface of TPMS is obtained through connecting the triangular patches solved by all tetrahedrons.

MTR method
The MTR algorithm is an iso-surface construction algorithm that reduces the dimension of the tetrahedron in the MT algorithm into a triangle. The algorithm process is the same as the MC and MT algorithms, but the MTR algorithm is different from the MT algorithm in the following points: The MTR algorithm is to determine the positional relationship between the triangle and the contour. (ii) Different from MT algorithm of fitting the iso-surface, the MTR algorithm is to fit the surface inside the iso-surface. (iii) Since the MTR algorithm determines the triangle, there are a total of 8 vertex states of the triangle. If all vertices of a triangle are outside the curve, the triangle does not produce triangular patches. Moreover, the remaining 7 cases can be summarized into three subdivision states after symmetry and rotation, as shown in Fig. 3.

Modeling framework
The modeling space used by the MC algorithm that can realize the modeling of TPMS lattice structure is larger than the model space to be filled, especially for thin-walled structures [48]. The larger modeling space greatly increases the number of tetrahedral that need to be processed. In this section, the modeling method for TPMS lattice structure with complex contour is introduced by combining the mentioned above algorithms. Firstly, the tetrahedral elements in the pre-filled model are solved by the finite element meshing method, because the tetrahedral mesh obtained by the finite element meshing satisfies the principle of minimum angle maximization. Secondly, the MT algorithm is used to traverse the tetrahedral elements gained above, and then the triangular patch set of the TPMS iso-surface inside the model is achieved. To obtain the same TPMS lattice structure generated by the implicit function-driven, the abovementioned TPMS isosurface need to be sealed.
The closed operation algorithm mainly includes the following parts. Above all, triangular patches on the surface of the model are extracted through tetrahedral elements. Since a tetrahedron is composed of four triangular faces, it can be divided into two types according to the different positions of the triangular faces: (i) inner trianglethis triangular facet is shared by two tetrahedrons; (ii) surface triangle-it is unique to a tetrahedron. Herein, the basic process of obtaining the triangular facets of the  specified model is presented. To ensure that the normal vector of the triangular facets is facing towards, firstly, all the tetrahedral elements are converted into four triangular in a clockwise direction. Then, the set of triangles for an object of class triangle is solved. After sorting the set of triangles, the row-Index of all repeated triangles is gained by difference operation. Thereafter, the triangles inside the model are deleted depending on the abovementioned row-Index. Finally, the MTR algorithm introduced above is used to traverse each triangle surface to acquire a set of contour triangle surfaces of the lattice structure. Additionally, the duplicate vertices and triangular facets that degenerate into one point are deleted to output an STL file suitable for additive manufacturing.

Algorithm for generation of TPMS lattice structures
The modeling framework is described in detail in Sect. 3.2, and the mathematical definition of TPMS is presented in Sect. 2.1. Herein, the program for the modeling of TPMS lattice structures is shown in Table 1. Firstly, the model to be processed is converted to a tetrahedral mesh. Secondly, the required minimal surface form is generated in MATLAB by Eq. (2). Then, the MT algorithm is used to obtain the internal triangular patches of the model and the triangular In this paragraph, the program for meshing the 3-D geometry is presented. And the meshing tool used in this paper is the "generateMesh" function in Matlab, and the specific usage form is shown in "generateMesh" in Table 1. In addition, the "generateMesh" function creates a triangular mesh for a 2-D geometry and a tetrahedral mesh for a 3-D geometry. By default, the mesh generator uses internal algorithms to choose suitable sizing parameters for the particular geometry. Since the focus of this paper is to compare the effectiveness of different modeling methods, the meshing method is only to gain the pre-processing model required for 3D printing. Therefore, the parameter settings of this paper are described; as shown in "Tetrahedral mesh" in Table 1, the algorithm in line 2 is used to generate the PDE model of the 3-D geometry. Additionally, the algorithm on line 6 describes the choice of parameters in the generateMesh function. Specifically, "GeometricOrder" and "linear" represent a linear tetrahedral mesh that uses a traditional solver to solve a 3-D geometric model. "Hmax" indicates that the maximum unit side length of the tetrahedron selected in this paper is 0.3, and the other parameters use the default parameters.
Moreover, the flow chart of NG modeling with femur contour is provided based on the above algorithm, as shown in Fig. 4. To achieve a preliminary model for comparative analysis of modeling methods, the preferred input femoral model is meshed by finite element software, as mentioned in Table 1. Then, the MEM method is applied to gain the internal triangular patches and contour triangular patches of the femur model; thus, the femoral model based on NG lattice structure suitable for 3D printing is gained. Since the speed of modeling is positively related to the accuracy of the modeling model, which is closely related to the number of triangles in the model, therefore, the modeling speed and robustness of obtaining TPMS lattice structures with complex contour are the indicators to evaluate the effectiveness of the modeling method in this paper. Furthermore, we adopt the following ideas to compare and analyze the effectiveness of the proposed modeling methods. Firstly, the quality of the introduced model obtained by the two modeling methods is compared, including the number of surface patches and the number of patch defects. Secondly, the modeling speed of the two methods is analyzed, under the premise that the quality of the models obtained by the two methods is not much different. The quantitative analysis of the effectiveness of specific modeling methods will be introduced in Sect

Results and discussions
At present, the modeling methods of TPMS lattice structure mainly include four types, such as MEM, spatial element mapping method, DFBM [41], and surface Boolean operation algorithm. Among them, there are obvious individual difference, randomness, and success rates during the Boolean and spatial element mapping method, with the distinctive experience of the operators. Nevertheless, the remaining two ways have the characteristics of simple operation and high degree of automation. Herein, the MEM and DFBM are compared in this section. Specially, the cylinder model and the femur model, filled by two differ forms of porous structure, are used to evaluate the modeling speed and robustness of MEM and DFBM, as described in the idea of validating the modeling method in Sect. 3. Depending on the modeling speed and robustness of that, the advantages and disadvantages of the two modeling methods and the scope of application are compared and analyzed. Furthermore, the NP and NG

Generation of TPMS lattice structures with complex contour
To compare and analyze the modeling speed of the abovementioned two methods, the NP and NG lattice structure with a unit size of 4 mm are used to fill the cylindrical model and the femoral model, as shown in the following Fig. 6. As shown in Fig. 6(b), (e), the NP lattice structure is applied to infill the femur and cylinder model respectively. And  Table 4. (4)

Evaluation for the modeling method of lattice structure
With the rapid development of additive manufacturing technology, lattice structures based on TPMS have been widely used in biological implants due to their advantages of light weight, high strength, good connectivity, and controllable topology. However, the symmetric continuity of the TPMS lattice structure in three directions limits its application in models with complex contours. Therefore, the efficient or robust modeling method for constructing TPMS lattice structures with complex contours has broad application prospects in biological implants. It has been shown that the modeling time is largely affected by the modeling accuracy [41]. The influence of modeling accuracy on modeling time can be described by the empirical formula.
where k is the empirical coefficient, limited by computer computing functions and algorithms; a is the number of tetrahedral meshes; b is the number of surface triangle meshes. Therefore, the modeling time of the model is positively related to the number of triangular patches. Depending on the above point of view, we assume that the accuracy of the structures obtained by the two algorithms is the same when the difference in the number of triangular patches of lattice structures is within 5%, using the same model filled by the same lattice structure. Additionally, the abovementioned lattice structure modeling algorithms are all written in MATLAB. The operating environment of computer is AMD-4800U CPU@ 1.8 GHz 4.2 GHz, with the operating memory of 16 GB. Furthermore, convergence studies with a range of calculation times were conducted to improve the correctness of calculated data and obtain stable sample data, Table 4 The program expression of the cylinder function Program 2 WX = 20; % Height of cylinder phi_1 = @(x,y,z)(z-0.5.*wx).*(z > = 0) + (-0.5.*wx-z).*(z < 0); % Top and bottom equations of the cylinder phi_2 = @(x,y,z)(x.^2 + y.^2-400); % Outer cylinder equation phi_3 = @(x,y,z)(-x.^2-y.^2 + 196); % Inner cylinder equation cylinder = @(x, y, z)max(phi_1(x, y,z),max(phi_2(x,y,z), phi_3(x,y,z))); % Cylinder general equation  Fig. 7. Moreover, calculation times of ten were produced for each model. And the NG obtained by modeling method is shown in Figs. 8 and 9.

Modeling speed
The following conclusions can be obtained from Fig. 10: (i) simple geometric-compared with the MEM, the DFBM algorithm is faster when filling the cylindrical model with the TPMS lattice, which could be explained by the reason that both TPMS and the cylindrical model can be expressed by functions. It can be clearly seen from the figure that the MEM method has high modeling speed for complex such as femur model. We can easily get that the cylinder model takes less time to fill lattice structures by modeling method compared with the femur model, such as NP and NG lattice structures. As shown in Fig. 11, furthermore, the MEM method requires 85.997 s, while the DFBM method needs only 7.197 s when filling the NP lattice structures. During the process of infilling the NG lattice structure in the cylinder model, the modeling time required by DFBM and MEM approaches is 7.458 s and 107.519 s, respectively. Additionally, the robustness advantage analysis of using the DFBM modeling approach in the cylinder model is introduced in Sect. 4.2.2.
Moreover, the distance fields of TPMS and simple geometric are solved through substituting the sampling points into the equation. Furthermore, the simple TPMS lattice structure is constructed by zero iso-surface obtained by the MC algorithm. To gain the iso-surface of the curved surface, nonetheless, the cylindrical model needs to be meshed first and then the divided tetrahedral elements are traversed during the modeling process of the moving element approach.  [41] This also explains why the MEM is significantly slower than the DFBM in the modeling of simple geometry. (ii) TPMS lattice structure with complex contour: It is noted that MEM only needs to traverse the tetrahedral elements inside the model and the triangles of the model outline, instead of performing operations on all the elements in the model bounding box, which contribute to reduce the time of the construction of complex contour TPMS. Nevertheless, the DFBM operation method needs to calculate the shortest distance between the sampling point and the triangular patch set during modeling a complex contour TPMS, which causes a long modeling time, notwithstanding the number of sampling points could be tremendously reduced through screening of voxels. Additionally, it is found that the tetrahedral meshing time occupies large proportion throughout modeling by the MEM. Consequently, it is noteworthy that computing time could be reduced through the identical tetrahedral mesh model during filling the coequal model with different types of TPMS. Generalizing in the summary, the comparison of the modeling speed during the two ways mentioned above can be acquired as the following: (i) The DFBM is better than moving element approach when filling the simple model. (ii) The moving element technique presents higher performance during filling a model with complex contour, compared with DFBM. As shown in Table 5, Figs. 10 and 11, the time of the MEM method was reduced by 3055.56% compared with the DFBM when filling the NP lattice structure in the femur model. Moreover, the time required for MEM was reduced by 2799.70% when filling the NG structure in the femur model. In addition, the MEM modeling method takes 1094.90% more time than the DFBM, when filling the NP structure in the cylinder model. And the MEM modeling method requires 1341.66% more time than the DFBM, when filling the NG structure.

Robustness
To improve the manufacturing accuracy and processing efficiency of the construction model, the error triangles of the model should be as few as possible, and the outer contour based on the lattice structure should be consistent with the outer contour of the model. Furthermore, the error In contrast, the TPMS lattice structure based on the MEM performs better in contour accuracy. Herein, the quantitative analysis of cylinder and femoral model filled by lattice structure is solved, as shown in Table 6 and Fig. 12, to compare the pros and cons of the two ways mentioned above in contour accuracy.
As shown in Fig. 12, the wrong triangular patches generated by the two modeling methods of MEM and DFBM are mainly overlapping triangular patch, crossed triangular patch and interference housing. It is easy to find that DFBM produces significantly fewer erroneous triangular patches than MEM, when the simple model (such as cylinder model) is infilled by different lattice structures, including NP and NG. However, the number of erroneous triangular patches generated by MEM is not much different from that of DFBM for the femur model infilled with lattice structures. Particularly, the number of overlapping patches produced by DFBM is 45.45% less than that of MEM when the cylinder model is infilled with NP lattice structure, and DFBM does not generate crossed-type erroneous patches, as shown in Fig. 13.
It is intuitively gained that TPMS lattice structure with less errors in triangle patch could be constructed through the MEM and DFBM. Furthermore, the error triangles mentioned in the former involve overlaps and intersections, which are primarily engendered by the conversion of data format and the small intersection of tetrahedral element and surface. In addition to the overlapping triangles, there are too many erroneous triangles in the TPMS constructed by DFBM, which is mainly caused by the distortion of the algorithm. Additionally, the reasons and corrective methods for the errors of triangular faces will be explained. (i) Overlapping triangles: The triangular facets overlap with the adjacent triangles, mainly caused by the existence of long and narrow triangles on the surface (the acute angle is too small or the obtuse angle is too large). Therefore, it could be solved by the automatic repair of Magics Software or deleting the long and narrow triangle and connecting the adjacent triangles manually.
(ii) Cross triangular facets: The form of this error is generally caused by the selection of data accuracy and the conversion of the data format, which can be eliminated by the automatic repair of Magics Software or redrawing the triangle manually. (iii) Sheet: It is the independent parts that are cut by multiple planes or curved surfaces, when the turning angle of planes or curved surfaces is larger than the slope of lattice structure. Consequently, these errors can be deleted directly. In a word, the MEM is superior to DFBM in view of the accuracy for the contour and the modeling time for complex models. Additionally, DFBM requires less time and produces less error patches in constructing cylinder model infilled with lattice structures.

Conclusion and future work
In this paper, we propose a modeling method for obtaining the TPMS lattice structure with complex contour boundary. The MEM is used to traverse the tetrahedral elements extracted from the model, and the TPMS lattice structures with complex contour are further solved. To verify the effectiveness and superiority of this approach, some examples are introduced, and comparisons with other state-of-theart methods are also presented. Experimental results show that our algorithm outperforms other approaches in terms of modeling time and modeling accuracy, compared with DFBM. Especially, the time used for MEM approach is reduced by 3055.56% compared with DFBM when filling the NP lattice structure in the femur model. And the time required time for MEM filling the NG lattice structure is reduced by 2799.70% compared with the DFBM. Meanwhile, the number of erroneous triangular patches generated by the MEM approach is reduced by 78.95% compared to the DFBM, when filling the NP structure. Furthermore, the proposed modeling algorithm has good performance in terms of modeling speed, adaptability, robustness, and error triangular patches. However, there are still some issues like overlapping triangle patches and too many shells. In future work, we will analyze triangular overlap, multi-shell, etc., to reduce the workload of manual error repair in the fabrication of TPMS lattice structures. Additionally, the modeling method for complex contour structure proposed in this paper expands the application field of TPMS porous structure, especially in the field of bone implants that can exert the characteristics of TPMS. At the same time, the modeling method has potential application value in the optimization of complex contour structures, such as the lightweight of topology optimization and the generative design of complex structures. Therefore, our next work will focus on the micro-level of bone implants to further advance this modeling method application verification, including the attachment rate of cell culture, the effect of microstructure on cell culture, and how to reduce the stress shielding of implants.
Author contribution Xiangyu Ma, David Z. Zhang, and Xuewei Yu designed the work, performed the research, and analyzed the data. Xiangyu Ma, Zhihao Ren, Shenglan Mao, and Xunjia Zheng discussed the results and wrote the manuscript. All authors contributed to drafting and revising the manuscript.