Additive manufacturing has been applied in many fields, but its layer-by-layer fabrication process leads to a weak inter-layer bond strength of printed parts, so it cannot meet the higher requirements for mechanical properties of the industry. At present, many researchers are studying the printing path planning method to improve the mechanical properties of printed parts. This paper proposes a method to plan the printing path according to the actual stress of pipe parts, and introduces the realization process of an algorithm in detail, and obtains the printing control G-code. Additionally, a 5-axis material extrusion platform was built to realize the printing of polylactic acid pipes with plane and space skeleton curves, respectively, which verified the feasibility and applicability of the method and the correctness of the planning path with standard material extrusion filaments. Finally, the tensile and bending experiments prove that axial printing enhances the mechanical properties of pipe parts.