Tool path generation is a fundamental problem in 5-axis CNC machining, which consists of tool orientation planning and cutter-contact (CC) point planning. The planning strategy highly depends on the type of tool cutters. For ball-end cutters, the tool orientation and CC point location can be planned separately; while for flat end cutters, the two are highly dependent on each other. This paper generates a smooth tool path of workpiece surfaces for flat end mills from two stages: Computing smooth tool orientations on the surface without gouging and collisions and then designing the CC point path. By solving the tool posture optimization problem the authors achieve both the path smoothness and the machining efficiency. Experimental results are provided to show the effectiveness of the method.