Check out the CNC code Generator

http://cnccodegen.sourceforge.net/