## 5 Methods and Algorithms
### Infill Strategies  
Within the scope of this contribution, four different infill patterns are analyzed (see Figure 10): standard-zigzag, raster, enclosed-zigzag and defined-end-zigzag. The raster is composed of parallel lines with identical printing direction where the path is interrupted between each straight segment. The standard-zigzag connects the parallel lines of the raster, creating a zigzag pattern with alternating printing direction. The enclosed-zigzag initially covers the contour of the polygon and subsequently fills the inside of the polygon with the standard-zigzag pattern. The defined-end-zigzag pattern is based on the standard-zigzag pattern including the possibility to select a defined start and end point in the polygon. From the point of view of the object to be printed, the impact of geometric deviations to be expected varies and is to be weighted according to the application. Cavities can cause internal weaknesses in the workpiece that can hardly be corrected afterwards. Volume build up, on the other hand, can be corrected, within limits, by subtractive machining. In any case, knowledge of the location of the expected deviation enables potential correction via welding process parameters (see Figure 13). For each pattern, a main orientation can be identified. It is defined through the start point of the pattern as well as its parallel main lines. The main orientation is then defined by the plane of the infill through being perpendicular to the main infill lines as well as pointing away from the start vertex (cf. Figure 11). To analyze the quality of each infill pattern within a given area, a coverage analysis is conducted. This analyses the actual coverage of the desired polygon shape through the material output along the calculated geometric path. A geometric approximation is made, expanding each path line segment to a rectangular area of defined width \(d_{path}\) and length \(l_{segment}\). Points along the path where the welding process starts or ends are additionally marked with an octagonal shape of radius \(d_{path}\) (see Figure 12). By mapping these shapes onto a matrix grid with a defined resolution, it can be counted how many times a grid part has been covered by the calculated path. Figure 11: Main orientation (red) of two zigzag infills. Figure 9: Slice decomposition algorithm. This approach was already used by [PERSON] et al. [33] for measuring the workpiece height with subsequent height control. The actual measured robot path was superimposed on a grid to store the measured part heights. In the case of a 2.5D setup, the workpiece height can be directly correlated with the path coverage. By comparing the coverage analysis presented here with the measured coverage or part height of a real object, weld seam modeling can be improved. Furthermore, a predictive control is conceivable, which does not react to a varying workpiece geometry in the next layer, as described by [PERSON] et al. [33]. With this predictive control, the workpiece height could ultimately be ensured in the first layer through dynamic process parameter adaption. Comparing this matrix \(M_{path}\) with the grid matrix \(M_{slice}\) of equal resolution and size, which contains the mapped area that the original slice covers, areas with too much material (\(coverage>1\)), covered with material (\(coverage=1\)) or not covered with material (\(coverage=0\)) can be identified. The analysis provides information about material placed both inside and outside the slice contour. Coverage is captured using three different indices. \(k_{tot}\) is defined as the percentage of the intended slice area covered by the path. \(k_{area}\) is defined as the ratio of total covered area to total intended slice area. \(k_{vol}\) is defined as the added material volume divided by the designed material volume. All four infill strategies shown in Figure 10 were tested on three test slices: a rectangle, a triangle and a U-shaped slice. The results are shown in Table 2. Exemplary results of the analysis of the rectangle are presented in Figure 13.