## 3. Cutter Position Points Interpolation and Data Alignment on Both Sides
Therefore, the projection curve of a spatial curve can be fitted on the Y-X plane and the Y-Z plane, and the spatial curve of a single machining tool path can be expressed in the form of parametric equations with \(y=t\):  
\[x=f_{1}(t), \tag{3}\]  
\[z=g_{1}(t), \tag{4}\]  
The path length of each interpolation interval of a single machining-tool-path can be obtained as follows:  
\[s_{k}=\int_{t_{k}}^{t_{k+1}}\sqrt{\left({f_{1}^{(1)}(t)}\right)^{2}+\left({g_ {1}^{(1)}(t)}\right)^{2}+1}, \tag{5}\]  
Similarly, the path length of each interpolation interval of the cutter tail points can be obtained:  
\[{s_{k}}^{\prime}=\int_{t_{k^{\prime}}}^{t_{k+1}^{\prime}}\sqrt{\left({f_{2}^{ (1)}(t)}\right)^{2}+\left({g_{2}^{(1)}(t)}\right)^{2}+1}, \tag{6}\]  
Figure 4: Interpolation of cutter position points coordinates and orientation. Calculate the number of interpolation steps \(N\) according to the set interpolation step size \(\Delta d\):  
\[N=\max(\frac{s_{k}}{\Delta d}+1,\frac{{s_{k}}^{\prime}}{\Delta d}+1), \tag{7}\]  
The path length sequence \([s_{k,1},s_{k,2},\cdots,s_{k,N}]\) from the interpolation cutter position points to the interpolation interval starting point can be obtained by using the interpolation steps \(N\):  
\[s_{k,n}=\frac{ns_{k}}{N},n=1,2,3,\cdots,N, \tag{8}\]  
Similarly, the path length sequence \([{s_{k,1}}^{\prime},{s_{k,2}}^{\prime},\cdots,{s_{k,N}}^{\prime}]\) of cutter tail interpolation points can be obtained:  
\[{s_{k,n}}^{\prime}=\frac{{ns_{k}}^{\prime}}{N},n=1,2,3,\cdots,N, \tag{9}\]  
Then, iteratively calculate the equation parameter sequence \([t_{k,1},t_{k,2},\cdots,t_{k,N}]\) and \([t_{k,1}{}^{\prime},t_{k,2}{}^{\prime},\cdots,t_{k,N}{}^{\prime}]\) through numerical method:  
\[s_{k,n}=\int_{t_{k}}^{t_{k}+i\Delta t}\sqrt{\left({f_{1}}^{(1)}(t)\right)^{2} +\left({g_{1}}^{(1)}(t)\right)^{2}+1}, \tag{10}\]  
\[{s_{k,n}}^{\prime}=\int_{t_{k}}^{t_{k}+j\Delta t}\sqrt{\left({f_{2}}^{(1)}(t) \right)^{2}+\left({g_{2}}^{(1)}(t)\right)^{2}+1}, \tag{11}\]  
\[z=g_{1}(t), \tag{4}\]0  
\[z=g_{1}(t), \tag{4}\]1  
where \(i\) and \(j\) represent the number of iterations: \(i=1,2,3,\cdots,j=1,2,3,\cdots;\Delta t\) is the iteration step length. The interpolation cutter position point coordinates \(p_{k,n}=\left(x_{k,n},y_{k,n},z_{k,n}\right)\) can be obtained by substituting the equation parameter sequence \([t_{k,1},t_{k,2},\cdots,t_{k,N}]\) into Equations (3) and (4). Similarly, the interpolation cutter tail point coordinates \({p_{k,n}}^{\prime}=\left(x_{k,n}{}^{\prime},y_{k,n}{}^{\prime},z_{k,n}{}^{ \prime}\right)\) can be obtained. Finally, cutter-orientation interpolation is performed through \(p_{k,n}\) and \(p_{k,n}{}^{\prime}\):  
\[z=g_{1}(t), \tag{4}\]2  
\[z=g_{1}(t), \tag{4}\]3  
After interpolating the cutter position points of the template surface, simply align the interpolation points on the template surface to the projected surface. The uniformity of cutter position points on both sides should be consistent after position data alignment, as shown in \[z=g_{1}(t), \tag{4}\]4 The path length sequence \([S_{1},S_{2},\cdots,S_{K}]\) from the original cutter position points of a single machining-tool-path to the starting point of this tool path before interpolation is as follows:  
\[z=g_{1}(t), \tag{4}\]5  
where: \(k=1,2,\cdots,K;\kappa=1,2,\cdots,k\).