# Towards an Automated Design Evaluation Method for Wire Arc Additive Manufacturing
## 3 Methods
### Test Implementation  
In order to test the proposed method, we have written a command line software, which takes Step files as input and highlights critical facets in Gmsh (Gmsh is \"a three-dimensional finite element mesh generator with built-in pre- and post-processing facilities\" [44]). For performance reasons, a combined Python-Rust (Rust is a modern system-level programming language like C++ that allows performant execution while ensuring memory safety [45]) architecture was chosen of which Figure 6 gives an overview. The source code and the tested example parts are available through a GitLab repository [46].  
To facilitate simple adaption of design constraints and feature classification to varied manufacturing capabilities, a flexible configuration file based on the Toml (Toml is a simple human-readable configuration format based on text files [47]) format was developed. The configuration file allows the definition of design features with their corresponding design constraints and classification filters. The classification filters restrict the application of the design constraints to a certain geometry region.  
The evaluation of a geometry can roughly be divided into the three stages: pre-, main-, and post-processing. In detail, the steps are as follows:1. Via Python, Gmsh is controlled to load the 3D solid geometry in the Step format. Gmsh then triangulates the surface according to a specified element size.
2. The generated mesh data, which are the triangles' center points and face normals, are then handed over to a Rust method. In the Rust method, first, a kd-tree is built from the point data, and then the 3D-MAT is calculated using the shrinking ball algorithm [48]. A kd-tree is a space-partitioning method that enables efficient nearest neighbor search on point clouds, which improves the computational performance of the 3D-MAT algorithm. The kd-tree is a binary search tree that is built by alternatingly dividing the geometry along the three spatial axes into subspaces until in every subspace only a defined number of points is left [49]. The shrinking ball algorithm developed by [PERSON] et al. approximates the 3D-MAT for every surface point and the corresponding surface normal by iteratively shrinking spheres to fit them into the 3D point cloud. Starting with the initial radius set to the maximum diameter of the axis-aligned bounding box, the current sphere center is calculated: \[\mathbf{c}=\mathbf{b}+r^{i}\mathbf{n}_{b}.\] (4) An updated radius \(r^{i+1}\) is then derived according to Equations (5) and (6) with \(\mathbf{p}\) being the nearest neighbor to \(\mathbf{c}\) that is within the radius \(r^{i}\) and is different from the base point \(\mathbf{b}\) (cmp. Figure 3) [50]. The nearest neighbor is efficiently found by performing the search on the kd-tree. This iteration is repeated until no point is found that satisfies the criteria, indicating an empty sphere. \[s =\|\mathbf{p}-\mathbf{b}\|\] (5) \[r^{i+1} =\frac{s}{2}(\mathbf{p}-\mathbf{b})\cdot\mathbf{n}\] (6) Finally, the angle \(\alpha\) is calculated using Equation (1), and the calculated radii, distances (secant lengths), and angles are returned to the Python program.
3. In the Python program, the radii gradients are calculated over neighboring facets (Equation (2)). Then, for every feature, the particular indicator data are filtered by another indicator as specified in the configuration file. To visualize the results, the filtered data are feature-wise added to Gmsh, whereby the highlighted faces are restricted to those critical according to the specified manufacturing limits.  
Figure 6: Overview of the implemented software architecture.