## 3 Mathematical Modeling of Tree-like Fractals  
The structure of a tree-like fractal subject to this study is illustrated in Figure 3, and the following are defined:  
* The points \(P_{ij}\) represent the nodes of the fractal. Figure 1: Flowchart of the proposed computational model for CAD models with fractal filling. Figure 2: CAD part, with the shell defined by two hemispheres. * A branch is represented by a line segment of length \(l_{i}\) connecting two nodes. * A node \(P_{i}\), is a child node of \(P_{k}\) if: (1) \(i>k\); and (2) the branches of lengths \(l_{m}\) that connect the two nodes always respect \(m>k\). For example, \(P_{3,1}\) is a child of \(P_{2,1}\), whereas \(P_{3,3}\) is not (Figure 3). * A node \(P_{i}\) is a parent node if it has at least one child node. * A leaf is the final node. * \(ORG\) represents the origin (root) of the fractal. The root is displaced (linearly) from a global coordinate system \(OXYZ\) by a vector \([V_{X},V_{Y},V_{Z}]^{\mathrm{T}}\). Furthermore, the orientation of the first branch is given by the angles \(\theta_{1}\), \(\theta_{2}\), \(\theta_{3}\) (using a \(ZYX\) rotation convention). * \(\alpha_{i}\) are angles between two connected branches. **Definition 1**. : _A tree-like fractal structure is a collection of points (root, nodes, leaves) connected through branches with the following properties:_  
**Property 1**. : _Each node defined by a point \(P\) from the fractal structure can be uniquely defined using transformation matrices by [16]:_  
\[ \begin{split} P=ORG\cdot R_{Z1}(\alpha_{1})\cdot T_{Y1}(l_{1}) \cdot R_{Z2}(\pm\alpha_{2})\cdot T_{Y2}(l_{2})\cdot\ldots\cdot R_{Zi}(\pm \alpha_{i})\cdot T_{Yi}(l_{i}),\\ \alpha_{1}=0,\,i=1\ldots n,n\in\mathbb{N}\end{split}  \tag{1}\]  
_where various permutations of the \(\alpha_{i}\) signs produce different nodes. \(ORG\) represents the origin (root) of the fractal structure with respect to a chosen coordinate system \(OXYZ\):_  
\[ORG=T\cdot R_{Z}\cdot R_{Y}\cdot R_{X} \tag{2}\]  
Figure 3: Schematical representation of a tree-like fractal. _with:_  
\[T= \begin{bmatrix}1&0&0&0\\ V_{X}&1&0&0\\ V_{Y}&0&1&0\\ V_{Z}&0&0&1\end{bmatrix} ,\;\;R_{Z}= \begin{bmatrix}1&0&0&0\\ 0&\cos(\theta_{1})&-\sin(\theta_{1})&0\\ 0&\sin(\theta_{1})&\cos(\theta_{1})&0\\ 0&0&0&1\end{bmatrix} , \tag{3}\]  
\[R_{Y}= \begin{bmatrix}1&0&0&0\\ 0&\cos(\theta_{2})&0&\sin(\theta_{2})\\ 0&0&1&0\\ 0&-\sin(\theta_{2})&0&\cos(\theta_{2})\end{bmatrix} ,\;\;R_{X}= \begin{bmatrix} 1&0&0&0\\ 0&1&0&0\\ 0&0&\cos(\theta_{3})&-\sin(\theta_{3})\\ 0&0&\sin(\theta_{3})&\cos(\theta_{3})\end{bmatrix} .\]  
\(R_{Zi}(\pm\alpha_{i})\) _represents rotation matrices about the \(Z\) axis, and \(T_{Yi}(l_{i})\) represents translation matrices along the \(Y\) axis:_  
\[R_{Zi}(\pm\alpha_{i})= \begin{bmatrix}1&0&0&0\\ 0&\cos(\pm\alpha_{i})&-\sin(\pm\alpha_{i})&0\\ 0&\sin(\pm\alpha_{i})&\cos(\pm\alpha_{i})&0\\ 0&0&0&1\end{bmatrix} ,T_{Yi}(l_{i})= \begin{bmatrix}1&0&0&0\\ 0&1&0&0\\ l_{i}&0&1&0\\ 0&0&0&1\end{bmatrix} . \tag{4}\]  
_The Cartesian coordinates of the point \(P\) representation are extracted from the transformation matrix using the following relation:_  
\[P_{XYZ}= \begin{bmatrix}P_{[2,1]},P_{[3,1]},P_{[4,1]}\end{bmatrix} ^{T}. \tag{5}\]  
**Property 2**. : _If \(d\) is the depth of the fractal (\(d=1\) are nodes after the branch with length \(l_{1}\), \(d=2\) are nodes after the branch with length \(l_{2}\), and so on), then \(d=i\) (see Equation (1)), and the total number of nodes \(N_{d}\) at depth \(d\) is:_  
\[N_{d}=2^{(d-1)}, \tag{6}\]  
_which means that if the depth \(d\) is given, all points \(P_{i,j}\) can be stored in a tabular (vector) representation with \(i\) being the number of rows and \(j=N_{d}\) the number of columns._  
**Property 3**. : _Each node is computed using a unique sequence of angles \(\alpha_{i}\) and lengths \(l_{i}\).