# Research and Implementation of Axial 3D Printing Method for PLA Pipes
## 3 Path Planning Method for Axial Printing
### Tangent Plane Coordinates Acquisition  
In the case of obtaining the coordinates of the section points of the skeleton curve and its tangent vectors and the coordinates of the bottom curve equation, the coordinate point set on any tangent plane can be obtained by utilizing the coordinate system transformation.  
The transformation of the three-dimensional coordinate system, which is essentially the transformation of the origin and the orthogonal basis vectors, is represented by translation and rotation in space. According to the computer graphics theory, two graphs with different positions and the same shape in space can reach the position of another graph through the transformation of the coordinate system. As shown in Figure 10, shape A reaches the position of shape B through rotation, and then the position of shape C is obtained through translation.  
The transformation of the position between two shapes can be viewed as the transformation between vectors that are perpendicular to the shape. Figure 11 shows that the vector T1 parallel to the  
Figure 10: Shape transformation.  
Figure 9: Angle position.  
\(Z\)-axis can be converted into a vector T4 through the transformation of the coordinate system. First, rotate the vector T1 counterclockwise by \(\theta\) around the \(Y\)-axis to obtain the vector T2. Next, rotate the vector T2 counterclockwise by \(\delta\) around the \(Z\)-axis to obtain the vector T3. Finally, the vector T3 is moved from the origin \(O\) to the point \(P\), to obtain the vector T4.  
Simultaneously, with the vector transformation on the shape, the coordinates of the points on the shape also change correspondingly. Knowing the coordinates of the shape A, the coordinates on the shape C can be obtained after the coordinate system transformation. Therefore, when the coordinates of the bottom surface are known, the coordinate value of the point set on any tangent plane of the pipe part can be obtained by the method of coordinate system transformation.  
The transformation of the coordinate axis is realized by matrix transformation.  
The rotation matrix around the \(Y\)-axis is:  
\[RotY(u)=\left[\begin{array}{ccc}\cos u&0&-\sin u\\ 0&1&0\\ \sin u&0&\cos u\end{array}\right] \tag{7}\]  
The rotation matrix around the \(Z\)-axis is:  
\[RotZ(u)=\left[\begin{array}{ccc}\cos u&\sin u&0\\ -\sin u&\cos u&0\\ 0&0&1\end{array}\right] \tag{8}\]  
The moving distance is the distance from the point on the skeleton curve to the origin:  
\[T(u)=\left[\begin{array}{ccc}1&0&0\\ 0&1&0\\ x_{s}(u)&y_{s}(u)&z_{s}(u)\end{array}\right] \tag{9}\]  
where, \(\theta\) and \(\delta\) are calculated as follows.  
The tangent vector of the cross-section points on the skeleton curve is:  
\[P(u_{i})^{\prime}=\left(x^{\prime}{}_{s}(u_{i}),y^{\prime}{}_{s}(u_{i}),z^{ \prime}{}_{s}(u_{i})\right) \tag{10}\]  
The modulus of the tangent vector at the cross-section point is:  
\[\left|P(u_{i})^{\prime}\right|=\sqrt{x^{\prime}{}_{s}(u_{i})^{2}+y^{\prime}{} _{s}(u_{i})^{2}+z^{\prime}{}_{s}(u_{i})^{2}} \tag{11}\]  
The following can be obtained from the geometric relationship:  
\[\theta_{i}=\arccos\frac{z^{\prime}{}_{s}(u_{i})}{\left|P(u_{i})^{\prime}\right|} \tag{12}\]  
Figure 11: Vector transformation: (**a**) \(Y\)-axis rotation, (**b**) \(Z\)-axis rotation, (**c**) Translation.  
\[\delta_{i}=\arctan\frac{y^{\prime}{}_{s}(u_{i})}{x^{\prime}{}_{s}(u_{i})} \tag{13}\]  
The coordinates of the bottom curve are \(Q\Big{(}t_{j}\Big{)}=\Big{(}x_{c}\Big{(}t_{j}\Big{)},y_{c}\Big{(}t_{j}\Big{)},z_ {c}\Big{(}t_{j}\Big{)}\Big{)}\) and are represented as a matrix as \(Q\Big{(}t_{j}\Big{)}=\Big{[}\begin{array}{cc}x_{c}\Big{(}t_{j}\Big{)}&y_{c} \Big{(}t_{j}\Big{)}&z_{c}\Big{(}t_{j}\Big{)}\end{array}\Big{]}\).  
Then, the coordinate value of any point on any tangent plane can be expressed in the matrix form as:  
\[Q_{i,j}=Q\Big{(}t_{j}\Big{)}\times RotY(\theta_{i})\times RotZ(\delta_{i}) \times T(u_{i}) \tag{14}\]  
where, \(Q_{i,j}\) is the matrix form of the coordinate value of the point on the \(j+1\) path on the \(i+1\) tangent plane.