PURPOSE: To prevent movement of a tool in the direction of Z-axis during machining, by moving the tool in a closed area defined by a cross line of a plane perpendicular to the rotary shaft of the tool and the profile of material and a cross line of a target profile, in a NC machine tool, and forming a tool path data.
CONSTITUTION: A device for forming a tool path data required by a NC machine tool for roughly machining a desired profile is provided with a data input device 21 such as a keyboard, table or light pen for inputting data such as material profile 1, target profile 2 or machining means, and a first cross line calculating means 22 for receiving an output from said input device 21 calculates a cross line between a plane perpendicular to the rotary shaft of the tool and the profile 1 of material. Similarly, a second cross line calculating means 23 calculates a cross line between said plane and the target profile 2. Then a tool path data calculating means 24 machines an area surrounded by said two cross lines, thereafter a path for repeating the machining toward the lower portion of the material profile 1 is calculated and outputted as NC data from a data output device 25 such as a paper tape boring device.