In order to optimize the tool path of 3D printing such that the efficiency is improved, by summerizing the pros and cons of existing methods, we proposed a noval tool path optimization algorithm for layered 3D printings based on solving the Traveling Salesman Problem. Our algorithm first adjusts the major printing direction using Principal Components Analysis, and then applies the greedy strategy and generates multiple printing paths by interleavingly appending the filling segments and contour segments along the major printing direction. Thereafter, by considering the multiple printing paths as “cities”, and elaborately defining the distances between them, we successfully model the problem of minimizing the flying distances as a kind of Traveling Salesman Problem. Af-ter converting the accurate solution of TSP to our problem, we are able to get the global optimized tool path with the given multiple printing paths. Experiments demonstrate that the proposed algorithm not only miminizes the flying distances, but also reduces the switches between printing status and flying status, and boosts the percentage of long segments in the whole tool path as well, thus the printing efficiency is significently imporved without sac-rifying the printing quality.