Method for generating control data for controlling a tool on a machine tool for processing a clamped-in workpiece by way of a processing process, in particular machining, wherein the machine tool comprises a control apparatus and a tool for controlling the tool in relation to the clamped-in workpiece with a three-dimensional free tool movement by: - Generating a path program on the basis of a setpoint geometry of generated setpoint parameters for controlling the machine tool, wherein the path program describes at least one path, wherein the path consists of a plurality of supporting points and line elements and each line element connects a pair of the supporting points to one another, - Controlling the machine tool in accordance with the generated path program, - Detection of actual parameters of the processing process by a feedback loop, characterised by: - Iteratively optimising the path program on the basis of detected actual parameters for generating a new path program with corresponding updated new technology parameters, and with a new path which are dynamically supplied in real time during processing by the machine tool and which dynamically change and/or dynamically replace the previous path program, the previous technology parameters and the previous path during processing, wherein the technology parameters comprise tool types, processing-relevant technology parameters and machine-related information, - wherein CAM functionality for changing the order of the supporting points is provided and wherein the CAM function can be run in real time and - both the path program and the new path program are embodied as a CNC program, wherein the CNC program of the new path program changes and/or replaces the previous CNC program of the path program during processing. - Generating a path program on the basis of a setpoint geometry of generated setpoint parameters for controlling the machine tool, wherein the path program describes at least one path, wherein the path consists of a plurality of supporting points and line elements and each line element connects a pair of the supporting points to one another, - Controlling the machine tool in accordance with the generated path program, - Detection of actual parameters of the processing process by a feedback loop, characterised by: - Iteratively optimising the path program on the basis of detected actual parameters for generating a new path program with corresponding updated new technology parameters, and with a new path which are dynamically supplied in real time during processing by the machine tool and which dynamically change and/or dynamically replace the previous path program, the previous technology parameters and the previous path during processing, wherein the technology parameters comprise tool types, processing-relevant technology parameters and machine-related information, - wherein CAM functionality for changing the order of the supporting points is provided and wherein the CAM function can be run in real time and - both the path program and the new path program are embodied as a CNC program, wherein the CNC program of the new path program changes and/or replaces the previous CNC program of the path program during processing.