# An Accelerated Slicing Algorithm for Frep Models
## 4 Results
### Case Study 2: Slicing of a Free-Form Model  
A free-form model is an FRep model with the following defining function:  
\[f(x_{1},x_{2},\dots,x_{n})=\sum_{i=1}^{m}\alpha_{i}\phi_{i}(x_{1},x_{2},\dots,x_ {n}) \tag{11}\]  
where \(\alpha_{i}\) are real number coefficients and \(\phi_{i}\)\((x_{1},x_{2},\dots,x_{n})\) are basis functions. In general, \(\phi_{i}\)\((x_{1},x_{2},\dots,x_{n})\) can be any continuous functions from some predefined class. In the considered example, we used bilinear spline functions. Computing the defining function is performed with the loop operation and depends on the number of the basis functions. The number of basis functions increases with the accuracy or the number of dimensions of the model together with the computational complexity. The proposed slicing algorithm is applied to \(\phi_{i}\)\((x_{1},x_{2},\dots,x_{n})\) with local support. It reduces the number of calculations of the basis functions in the FRep defining function computation. The set of calculated basis functions is limited by four nearest neighbour basis functions around the point of interest. To construct the bilinear spline, the following function is used (Figure 11):  
\[\phi(x,y)= \begin{cases}|1-x||1-y|,&if|1-x|\leq 1\ and\ |1-y|\leq 1\\ 0,&otherwise>0\end{cases}  \tag{12}\]  
The free-form object consists of following basis functions:  
\[\phi_{i}(x,y)=\phi\bigg{(}\frac{x-x_{i}}{h_{x}},\frac{y-y_{i}}{h_{y}}\bigg{)} \tag{13}\]  
Figure 10: Plot of the experimental results with the filter model (the shape of the channel’s entry holes: a circle with petals). The parameters \(x_{i}\) and \(y_{i}\) define the center of the support of \(\phi_{i}(x,y)\), \(h_{x}\) and \(h_{y}\) define dimensions of the rectangular area the function \(\phi_{i}(x,y)\) affects. This area can be written as \(([x_{i}-h_{x};x_{i}+h_{x}],[y_{i}-h_{y};y_{i}+h_{y}])\). Therefore, the defining function of the considered free-form object is  
\[f(x,y)=\sum_{i=1}^{m}a_{i}\phi_{i}(x,y) \tag{14}\]  
For this FRep model the following function \(\Gamma=\Gamma(x_{i},y_{i})\) exists:  
\[\Gamma(x_{i},y_{i})=\{([x_{i}-h_{x};x_{i}],[y_{i};y_{i}+h_{y}]),([x_{i};x_{i} +h_{x}],[y_{i};y_{i}+h_{y}]),([x_{i}-h_{x};x_{i}],[y_{i}-h_{y};y_{i}]),([x_{i} ;x_{i}+h_{x}],[y_{i}-h_{y};y_{i}])\}. \tag{15}\]  
This function \(\Gamma(x_{i},y_{i}):R\times R\to X\times X\), where \(X\subseteq\) is a set of intervals in \(R\), returns the bounding boxes \(B_{j}\) which are quarters of the supports of the basis function \(\phi_{i}(x,y)\). The unit function for the bounding box \(B_{j}\) is:  
\[u_{j}=\sum_{k}\alpha_{k}\phi_{k}(x,y) \tag{16}\]  
where \(\phi_{k}\) are basis functions with the supports that include \(B_{j}\). There can be one to four \(\phi_{k}\) functions in the sum. Free-form functions are widespread in the task of topology optimization. The compliance minimization problem with boundary conditions shown in Figure 11(a) was solved. The free-form function with plot presented in Figure 11(b) is a solution of this problem. It defines the solid body shown Figure 11(c). The proposed slicing algorithm is successfully applied to process the free-form FRep model. Its performance is two-fold higher for the free-form model with \(100\times 200\) points if compared with the standard slicing algorithm (Table 4 and Figure 13). Figure 11: Plot of \(z=\phi(x,y)\). Figure 12: An example of a free-form model obtained via topology optimization algorithm: (**a**) boundary conditions of the topology optimization task for compliance minimization, (**b**) the plot for the obtained free-form function \(f(x,y)\) and (**c**) the optimized shape defined by the free-form function \(f(x,y)\).