Using programming and simulation to develop optimized processes for AFP CNC machining