# Sensitivity Analysis and Filtering of Machinable Parts Using Density-Based Topology Optimization
## 4 Additions to Filtering
### Machining Filter  
The new machining filter developed for this study utilizes the analysis method described in Section 2.3.2 to identify elements. Non-machinable elements are identified, and an individual machinability radius, \(R_{\text{mach}}\), is assigned to each of them. The determination of \(R_{\text{mach}}\) involves analyzing the neighboring elements of the element under analysis, using the filter radii described in Equation (4) and Table 1. This process is performed individually for each Cartesian axis, so the designer can obtain machinable parts in a concrete direction,  
The analysis begins with the smallest practical radius of 1.5. Suppose a neighboring element is deemed machinable through direct access or neighbor access. In that case, this radius is adopted, and the elements influenced by this radius are not analyzed further until the next iteration, for computational efficiency. Suppose there are no machinable elements within the neighborhood defined by the radius. In that case, the next radius in Table 1 is examined, and this process continues until at least one machinable element is found. This process in MATLAB(r) code is shown in Appendices B and C.  
Once the non-machinable elements are detected, as explained in Section 2.3.2, and the filter radii are obtained, the filtering process can begin. It is graphically described in Figure 11, and it is also broken down step by step in the next section. Figure 10: Flowchart of the TO method, with the machining filter highlighted in pink for clarity of later explanations. Coloured in blue, the Optimality Criteria loop is showcased. In pink, the machining filter step is represented. Figure 11: Machining filter, step by step, in x direction. Yellow arrows represent the distance of filtered element to the next non-machinable element in x direction. Green arrows represent the element from whom the filtered element adopts its new density. (**a**) Initial blueprint design. (**b**) Highlighted in pink, the elements covered by the filter radii. (**c**) First column filtering. (**d**) Design after first column filtering. (**e**) Element detection for subsequent columns (second column represented). (**f**) Filtering of subsequent columns (second column represented). (**g**) Design after second column filtering. (**h**) Final design after filtering. The process starts with the blueprint design, which is the resultant density field of the design variable update in the OC loop. This is represented in Figure 11a, where blue elements have a density over the chosen threshold. Then the filter radii are obtained using the MATLAB(r) code of Appendix A, considering that, in this case, a machinable result in the x direction is desired. The elements highlighted in pink in Figure 11b are the ones affected by the filter radii. Now, two conditions are evaluated: the element density is above the density threshold, and pink elements are present in the machining direction at any point of the density field. If an element meets both conditions, its density is turned into zero. This is done to give a first access to the filter for working as will be now described. This first column filtering is represented in Figure 11c, where elements in red are the elements that meet the mentioned conditions. In the same figure, the yellow arrows point to the nearest pink elements in the machining direction, evidencing the existence of non-accessible elements. In Figure 11d, the design after the first column filtering is represented. The rest of the columns are filtered in a similar way: the elements to filter are selected if they meet the conditions described above, but in this case, they take the density of the element before them in the machine direction, the (x \(-\) 1, y) element. In Figure 11e, the second column element detection is represented in a similar way as in Figure 11c. In Figure 11f, green arrows represent the elements from whom the filtered elements take their new density. Figure 11g represents the density field after the second column filtering.