Abstract The process of converting a given design into the form of a rawstock minus a series of machining features is known as machining-features extraction. One step towards automatic machining-features extraction is the extraction of machining regions. The paper is concerned with the extraction of machining regions from the constructive-solid-geometry representation of a given object. The proposed method for the extraction of machining regions is based on manipulating the original CSG tree, representing the object, evaluating the various machining regions by using octrees, and pruning the CSG tree accordingly. If necessary, an additional stage of compacting follows. As a result, each machining region is represented by a compact CSG tree offering the following advantages. The CSG tree to be analysed is reduced in size, and thus the problem of machining-features extraction is simplified. The information is compact and concise. Moreover, no information is lost (CSG representation is kept rather than boundary representation), and the designer's intensions are conveyed to the process planner more clearly. In the special case in which the machining regions are identical to machining features, the method does offer the automatic extraction of machining features. In addition, the nesting level of the various machining regions is determined when needed.