## 2 Methodology
To interrupt the topology optimization, the Python interface provided by Tosca including the \"hook\" function is used [23]. This function enables the execution of scripts during the interruption of the optimization. In the context of the developed optimization method, scripts are executed in Python and, for computational efficiency, in Julia (see Figure 2) [25; 26]. In the following, the four steps during the interruption will be explained. For the step _Determination of the material areas_, first, the surface of the part to be subdivided is needed. Therefore, during the interruption of the topology optimization, the interim result available in the interrupted iteration is exported as a smoothed surface mesh in the Standard Triangulation Language (STL) format using Tosca Structure (see Figure 3 top). Figure 2: Workflow of the developed optimization method. For smoothing, the standard Tosca procedure is applied in which all elements with an iso value below 0.3 are removed [23]. At this point, 0.3 is employed, since it is the default value in Tosca and thus was taken as given. A variation of this value as well as its effect on the result has to be investigated in the future. In the very first iteration of the topology optimization, the derived surface mesh corresponds to the part defined in the _Part Geometry_ step. Based on the exported surface mesh, the boundary (offset 1) between the contour and interface area (see Figure 3 center) as well as the boundary (offset 2) between the interface and hatching area (see Figure 3 bottom) is determined. These two offsets each describe the boundary between the areas with different porosities and thus enable distinguishing them from each other. To calculate the offsets, a spatial grid is created within a bounding box that describes the maximum dimensions of the exported surface mesh (see Figure 3 top). The nodes of the grid are then used to generate a signed distance field (SDF). For this purpose, the minimum distance as well as the position (inside or outside the surface mesh) of each node to the surface mesh is required [17]. The minimum distance results from the distance of the considered node to the closest triangle of the surface mesh [27]. Using the principle of winding numbers, it is possible to determine the position (inside or outside the surface mesh) of the considered node with respect to the surface mesh [28]. Once the SDF is available, the marching tetrahedra algorithm can be used to generate the two offsets (see Figure 3 center and bottom) consisting of triangles with the desired distance to the surface mesh [29]. Figure 3: Surface meshes of the interim result (**top**) as well as offset 1 (**center**) and offset 2 (**bottom**). With the surface meshes available for the interim result (see Figure 4 top), a division into the three porous areas can be performed. For this purpose, the respective regions between the surface meshes are meshed with tetrahedral elements (TE) by TetGen without changing the position of the triangles of the surface meshes, thus ensuring the conformity of the mesh [30]. As a result, each porous area is geometrically represented in the TE mesh (see Figure 4 bottom). In the _Material assignment_ step, the material properties now can be automatically retrieved from a database (_Engineering constants_) and assigned to the respective elements in the three porous areas. The material properties of the three porous areas are stored in this database as engineering constants which were derived from material characterizations [31]. Due to the offset generation by means of an SDF, the three porous areas are currently present in all spatial directions (see Figure 4 bottom). Therefore, the assigned material areas are now processed in such a way that a progression as shown in Figure 1 (left) occurs and thus takes into account the SLM. It is important to note that the three porous areas are created exclusively in the layer planes (\(x\)-\(z\) plane) along the \(y\)-axis.