Programatically milling profiles. Looking at: Geometry generation of profiles, which consist of arcs and lines. An offsetting algorithm for transforming the profiles. Generating G-code and rendering it to SVG.
Programatically milling holes. Takes a look at generating hole geometry and converting it to G-code for milling. This method uses helical ramping and a spiralling motion.