This paper presents two algorithms for NC (Numerical Control) machining of engineering parts defined as a CSG (Constructive Solid Geometry) (1) model. The algorithms are respectively for automatically roughing out the approximate shape using octree and quadtree encoding techniques and for machining the final shape with fine cuts. In this paper, the two algorithms are referred to as rough machining and fine machining and form the Hong Kong University’s NC module for the PADL-2 solid modelling system developed by the Production Automation Project of Rochester University. The NC module with its own command language is embedded into PADL-2. Parts defined with the PADL-2 system can be machined using this module on a 3-axis machining centre via a hardwired link. Examples of the parts machined with this set-up are also illustrated in this paper.