# Sensitivity Analysis and Filtering of Machinable Parts Using Density-Based Topology Optimization
## 2 The Case Study
### Parameters for the Results Analysis
#### 2.3.2 Machinability  
The machinability of the optimized shape is analyzed by assessing the accessibility of a hypothetical tool to each frontier element. A frontier element refers to the last element with a density higher than the chosen threshold. This analysis involves an element-by-element evaluation.  
To initiate the analysis, the set of elements exceeding the selected density threshold is divided into distinct groups:  
* The external layer (EL): comprising all the elements located on the boundaries of the design domain. These elements are always accessible because they do not have any solid interface with the exterior.
* The core layers (CL): representing the internal solid region, consisting of all the elements forming the shape of the part excluding the frontier elements.
* The frontier layer (FL): consisting of the elements above the density threshold and located between the solid and void phases.  
The frontier layer (FL) can be determined by considering that it includes all the elements exceeding the threshold but not belonging to the EL or CL groups, as stated in Equation (7):  
\[\sum_{n=1}^{n}N=\sum_{e=1}^{e}EL+\sum_{c=1}^{c}CL+\sum_{f=1}^{f}FL \tag{7}\]  
The FL is divided into three distinct groups in the subsequent step. These groups are based on the accessibility of the elements for a tool. The groups are as follows:  
1. Elements directly accessible for a tool: These are the elements within the FL that can be readily machined using a tool.
2. Elements not directly accessible but machinable by machining a neighboring element: These elements are not directly accessible to a tool but can still be manufactured through the machining of a neighboring element.
3. Non-machinable elements: This group consists of elements within the FL that are not machinable.  
This division allows for a more detailed understanding of the machinability characteristics of the elements within the FL, providing insights into their accessibility for machining operations. For the FL elements in groups 1 and 2, the process for identifying them is as follows:  
For an element to be considered directly accessible for a tool, it must satisfy a specific condition: at its free faces, there must be a row of elements with densities below the selected threshold that extends to the boundaries of the design domain. To illustrate this process, let us consider the simplified 2D example in Figure 4, where the identification process is depicted. The blue elements represent those with densities exceeding the threshold, while the green element \(e_{(x,y)}\) is the element currently being analyzed.  
To determine if an element satisfies the condition of being directly accessible for a tool in the y axis, the row and column leading to that element are analyzed from the outside towards the inside in both directions (shaded elements in the central pane of Figure 4). If, at any point during the analysis, an element is encountered with a density exceeding the threshold, the condition is not fulfilled for that specific element.  
To be considered machinable through its neighbor, an element must meet a specific condition: a free row must extend to its free face. To determine this, the neighboring rows are analyzed from the outside towards the inside until reaching the free face of the element. If, during this analysis, none of the studied lines contains an element with a density above the threshold, then the condition is fulfilled. Figure 5 illustrates this process in a similar manner to the explained process in Figure 4 but in the x axis direction.  
The output parameter is a percentage of the machinable elements with respect to all the frontier elements. A value of 100% would mean that the design is fully manufacturable. The MATLAB (r) code of this process and the rest of the machining filter (which is explained in subsequent epigraphs) are shown in Appendix A.