A features subtraction system for rotational parts based on manufacturing and metal removing concepts

Automatic feature recognition (AFR) techniques represent an essential tool that links computer-aided design (CAD) and computer-aided process planning (CAPP) systems. This is by converting low-level geometric entities of part design models created in CAD systems to manufacturing features which are used in CAPP. Whilst different AFR systems have been developed for the purpose of recognising final manufacturing features of a part, most of them do not solve features intersecting issues. The features intersecting is an unavoidable matter that occurs during the rough cutting cycle and forms intermediate manufacturing features. This paper presents a “features subtraction” methodology for solving manufacturing features intersection issues of rotational parts. The system takes the recognised external and internal manufacturing features from a smart interactive AFR (SI-AFR) system as an input. After seven steps of processing, it provides geometrical and topological information of intermediate and final features that can be used to automatically generate CAPP outputs, such as selecting machining process, sequence of operations, cutting tools and cutting conditions, and generating the G-code for machining the part. This has been written using C# coding, and several examples have been processed for this paper to validate the system.


Introduction
Sharing design information among different computeraided design (CAD) systems and with downstream applications, such as computer-aided process planning (CAPP), is a challenging task [1]. This is because each CAD system uses a different database structure to store information of geometric features of a part, and there is not a unified standard that has been developed to be used by all the systems [2]. Also, CAD and CAPP systems are different in nature since the former is geometry-based, whereas the latter is manufacturing feature-based. Therefore, different product data exchange (PDE) standards, such as drawing exchange format (DXF), initial graphic exchange specification (IGES), and standard for the exchange of product model to declare, analyse, and extract information; give names; and add new rotational features to the system database, as well as solving simple features intersecting issues. However, more investigation is required for solving complex cases of manufacturing features intersections. This paper explains the issue in detail and presents a solution for the intersections of recognised manufacturing features from the SI-AFR system. Also, it comes as a follow-up to reference [7], which provides a whole vision regarding the SI-AFR system and is considered the first part and an entrance to the current work.
Defining the problem As mentioned above, the SI-AFR system is able to recognise new features in addition to the predefined ones; meanwhile, it solves simple features intersecting issues. The square groove with two rounded corners at the base in Fig. 1 demonstrates the case of solving a simple features intersecting issue. This is by defining the entities that form the square groove as one feature, instead of five individual ones (facing, concave, cylindrical, concave, and facing), in one step during the feature recognition procedure. However, extra analysis and processing are required with complex cases of features intersecting. For example, the SI-AFR system analyses the part in Fig. 2a as eight rotational features: F 1 facing, F 2 cylindrical, F 3 left step (shoulder), F 4 square groove with two rounded corners, F 5 right step (shoulder), F 6 right taper, F 7 cylindrical, and F 8 facing. Although it appears as an ideal recognition of the part's features and reflects its functionality, this might not be practical when it comes to machining. The reason behind this is related to the Fig. 1 A square groove with two rounded corners at the base fact that this shape is machined from a bulk cylindrical workpiece (Fig. 2b). In order to achieve the rough cutting cycle, which includes removing most of the material from the original stock, this workpiece should not be split as five individual volumes (A, B, C, D, and E) based on the part's features (Fig. 2c). This is because machining each feature before moving to another one consumes time and cost, and might cause technical issues, such as damaging a surface of a feature and interrupting the cutting tool movement. Thus, a deep vision and specific processing are required to consider all features' intersections of a part, in a way that considers all the possibilities of regenerating intermediate features, which are a result from intersections of original features, and chooses the ideal possibility. Figure 2d gives an example of an intermediate feature (zone B), which is a square groove that is formed from the intersection of original features F 3 , F 4 , and F 5 . However, it takes merely a glance at this suggestion to evaluate it as a sub-optimal solution. This is because the intermediate square groove feature at zone B intersects with two other volumes A and C; hence, this solution reduces the issue but is not an optimal solution. Another material removing strategy is shown in Fig. 2e where the removed volume is divided into three parts (A, B, and C). Zone A directly effects in forming F 2 and F 6 , as well as in F 3 , F 4 , and F 5 in an indirect way; whereas the intermediate feature B is composed of F 3 and F 5 , and reduces the extra material above F 4 . Finally, zone C is now ready to be machined, and F 4 will be produced with all its five entities.
From a manufacturer point of view, the machining of the part based on the last dividing strategy of volumes is considered reasonable. This is because the cutting tool path is decreased in an efficient manner that assists forming one or more feature in a direct and indirect way, and the cutting conditions will be closer to optimal than if adopted in any other way of machining. However, this is a simple case of features interacting with one another, and has few possibilities of volume divisions which produce intermediate features. More prospects are generated from complex parts with many features; hence, an efficient methodology should be developed in such cases.
In this paper, a "features subtraction" system has been developed to solve manufacturing features intersection issues of rotational parts. The system accepts the recognised features from the SI-AFR as an input since it is considered as continuation of the latter. Furthermore, this work is a part of a bigger project being carried out, which aims to take CAPP systems to the next level in the form of Automatic CAPP (ACAPP). The proposed features subtraction system consists of seven steps. In the first, the system scans all the recognised features to find which of them have the maximum X value. The second step includes grouping the features if the system captured more than one in step one. Regardless the number of the captured features from the previous steps, each of them is used as a reference with an observed X value in step three in order to scan the features at its right and left sides and put them in bundle(s). In the fourth step, the system analyses the features in each bundle to find the second highest X value that can be at any position based on the design. Each bundle of features with the observed highest and second highest X values is then delivered to the fifth step to specify faces of an intermediate feature, which is a volume that should be subtracted from the original workpiece. The sixth step includes continuing the previous steps (steps [1][2][3][4][5] in a loop until all the final features are covered. The last step is for avoiding repetition of the detected intermediate features. Whilst these seven steps are used to solve features intersecting issues for external shapes of rotational parts, they are valid for internal shapes after minor adjustments. Finally, the proposed system provides information of the design that can be used to automatically generate CAPP outputs, such as process(es) and tools selection, sequence of operations, and generating G-code.

Previous work
Whilst most CAD systems provide geometrical and topological information via PDE files, such as STEP APs 203, 214, and recent 242, they do not deliver part feature information. Since CAPP is feature-based, different AFR systems have been developed to ensure an efficient interface between CAD and CAPP systems. However, the majority of AFR systems can recognise only predefined and isolated features, whilst handling intersecting features often has a wide range of consequences and effects on a feature model. An example of this issue is how the intersecting features are interpreted and utilised to achieve CAPP since they have effects on different design's attributes such as GD&T, or might lead to the suppression of some feature's surfaces [8]. These cases reveal the need for further investigation in solving features intersecting issues. Some of previous techniques and approaches are presented in this section.
Tseng and Joshi [9] presented a machining volume generation method for recognising rotational and prismatic features of mill-turn parts. In order to generate feature volumes, the boundary faces of a part are swept along a direction determined based on the type of machining operation. The proposed method includes four main steps. Firstly, the part's faces are classified according to their geometric shapes and topological relationships as cylindrical, planar, or other types of faces. Then, several rotational machining zones, which represent cylindrical portions of the part that can be produced in turning processes, are determined. Rotational and prismatic machining volumes are generated using rotational sweeping operations for the former and volume decomposition, maximal volume sweeping, and reconstruction for the latter. Finally, two approaches are used to recognise different types of features; these are 2D profile patterns for rotational features and 3D face adjacency relationship for prismatic features. Although many types of rotational and prismatic features can be recognised following this method, it has several limitations. For example, a complex geometry can be recognised as rotational or prismatic features, which is unreliable in such cases and requires extra work.
Sormaz and Khoshnevis [10] proposed a method that analyses intersected volumes of manufacturing features, and developed a three-phase algorithm for handling such issues in CAPP. The basic idea of this methodology is the use of required and optional volumes for machining features as they are defined during the feature recognition stage. The proposed feature object model represents individual and alternative features, along with the features intersections, and these are used in the three phases of the algorithm. An AND-OR graph of alternative feature representations is created in the first phase of the algorithm. In the second phase, a feature precedence network for a given part is built as a set of machining sequence constraints. Finally, a features intersecting is analysed for geometric updating of machining features during the process sequencing stage.
Yip-Hoi et al. [11] utilised a 2D area decomposition method for recognising both intersecting and nonintersecting turned features from axisymmetric parts. It starts with identifying the machining axis and determining the maximum turn-able state (MTS) of the part, which is the state of the part in which moving more material will gouge surfaces of the final part. The maximum turn-able volume (MTV) is the material that can be removed by turning, and it is found by subtracting the MTS from the stock workpiece. The system consists a set of predefined features with a unique combination of elements for each feature. A pattern recognition algorithm is used to search for matches between the MTVS decomposition and each predefined feature pattern. After finishing the features recognition, three steps of precedence generation are included: determining the features ordering, mapping volume-to-operations, and mapping operation-to-resource. This is to be used as a part of a CAPP system. However, the implementation of this method was limited for the 2D patterns that contain only straight-line segments. Based on the claims of the authors, it is possible to extend it to include arcs or other curved segments.
Jaider et al. [8] described a method for excluding undesirable interpretations of features which occur due to the features intersecting in rotational parts. Both manufacturing rules and metal removal principals were utilised in establishing this approach. Also, a features suppression system, which adds or removes material rings to some volumetric features of the part, was presented. This methodology reduces the number of combinations generated by the features generator (FG) system. The FG system analyses the modified stock and workpiece, as well as the remaining features, and then generates new features from material surfaces of intersecting features. All the added, removed, and new features generated by the FG system are stored in a database and given a sequence for the purpose of process planning according to their confident factors.
Based on the literature review of features intersecting, the majority of researchers followed different strategies that implement the volume decomposition concept. However, there are still drawbacks in this matter since most of these methods offer more than one possibility, and hence require human intervention to select reasonable choices. This paper proposes a methodology for solving features intersecting issues for rotational parts. As a result, comprehensive information of a part will be generated automatically and provided to CAPP systems. This includes recognised manufacturing features, in terms of geometrical and topological information, and machining precedence of feature.

A methodology of subtracting
The recognised manufacturing features from the SI-AFR system are considered "final features". These describe the final shape of the product and should be produced in an accurate way. However, during the manufacturing process, one or more interactions occur between the final features and produce intermediate or "intersecting features". This is an inevitable matter in most, if not all, of the cases of rotational parts, since the stock is a blank cylinder and demands several cutting paths to reach the final features and consequently the required shape of the product. In contrast with the final features, the intersecting ones can take many shapes and possibilities depending on the vision of the process planner. Hence, the analysis of the final features can take multiple combinations of intersecting features to be removed from the initial workpiece. As mentioned with the example in Fig. 2, these combinations vary between unreliable, acceptable, and optimum solutions. For the purpose of getting an optimal option for each features intersecting case, a "features subtraction" system has been developed. The proposed system scans all the final features in both X and Z axes, divides the part into areas based on developed rules, and in some cases updates the geometrical data of the final features. This section explains the methodology of the features subtraction step by step. Different examples are used in each step to illustrate various cases.
However, before analysing the final features and concluding the intersecting ones, the system starts with calculating the minimum required blank size. This is done by scanning all the start, end, and tangent points of each feature, which the SI-AFR system has extracted in terms of the X and Z coordinate points. Since the adopted coordinate system is the same for turning machines, the maximum X value represents the radius of the stock and Z represents its length. Figure 3 shows an example of which points are taken as maximum X and Z, and consequently the blank workpiece is the shaded area.
The SI-AFR system describes any 3D model as one external shape and one or more internal shapes if it has holes or internal features. Since the external and internal shapes

Features subtraction of external shapes
Step one: finding features with max. X The first step of the features subtraction system is scanning all the faces of each final feature in the part design. This is to check X values of all the start, end, and tangent points, and find which features have an X value that is equal to the observed X value. The observed X value at this point is the same of the blank radius; however, it can take another value, which will be explained later. Depending on the design, there might be one or more features that have the same observed X value. For example, the part in Fig. 3 has only one feature that shares the same X value with the blank, which is the tangent point of the convex. Whereas, three of the final features of the part in Fig. 4 have the same X value of the blank: (i) the end point of the convex, (ii) the start and end points of the cylindrical surface, and (iii) the start point of the first face in the left step feature.
Step two: grouping the features As mentioned in step one, there might be more than one feature that have the same X value of the observed one. However, these features must be checked to determine if they are connected to each other. The part design in Fig. 4 shows that all the features, which include the X value of the blank at their end or start points, are connected to each other in one point. A different case is shown in Fig. 5, where the total number of the features with the same X value of the blank is eight. The first three features (convex corner, cylindrical surface, and left taper) are connected to each other as the red points show. The other five are separated from the first group and connected to each other at the  green points. Regardless the design of the part, the proposed system gathers the features that include the same X value of the blank, checks the connection between them, and puts them in groups as a preparation for the next step.
Step three: scanning features based on a reference one and observed X value In this step, the system takes the prepared groups of features one by one. Then, a procedure is applied to each feature in a group. Firstly, the system scans the final features on the right side of the observed one, starting from the first neighbour and so on. The scanning is stopped if one of two conditions is realised. The first condition to be checked is if a feature includes the same or bigger observed X value, and second is if the scanning reaches the far-right side of the blank. Figure 5 shows an example for each of these possibilities. Firstly, by scanning the final features on the right side of the convex round feature in the first group, the process lasts until the right end of the blank because it does not find a feature that contains the observed X value. Hence, the system considers four features including the reference (convex round, right taper, cylindrical face, and facing). The second example is when the system takes the right taper feature in the second group and scans its right side. After four final features, the system declares the existence of a feature that includes the observed X value, and stops the scanning process. Consequently, only five features are recorded in this case (right taper, cylindrical face, square groove, cylindrical face, and left taper). Regardless of which conditions are achieved, the system applies the same procedure for all the reference features. This is by scanning the right side of the reference feature first and records the result, then scans the left side of it and records the result as well, before moving to the next feature. All the recorded results, which are bundles of final features, are exported to the next step. It is important to clarify that the process of scanning the left side of a feature has the same logic as the right side.
In some cases, the scanning process directly stops when the right and left neighbours of a referenced feature are checked. This is because both of them have the observed X value in at least one of their points. Such a referenced feature is classified as an independent final feature. The square groove feature in the second group (Fig. 5) shows an example of the described case. It is surrounded by cylindrical faces, which include the observed X value, on both sides. Hence, the square groove here is an independent final feature, and is not exported to the next step.
Step four: analysing each bundle of features As mentioned in step three, the system records a bundle of features after every scanning process on the right or left side of a referenced feature. Each bundle contains the referenced feature itself in addition to others depending on the case. Obviously, one of the referenced feature's points has the observed X value that the system specified in step one, which should be the highest X value in comparison with other X values of all the features points in this bundle. The system searches all the features in the bundle to find the second highest X value. This can be in any position depending on the case. In order to illustrate possibilities where the second highest X value can be in a bundle of features, Fig. 6 shows two different examples. In these examples, all the observed X points are marked using red circles; whereas, the green circles are used to refer to the second highest X values. Regarding Fig. 6a, the convex rounded corner includes the observed X value at its endpoint, and it is one of three features that share this value (convex corner, cylindrical surface, left taper). By scanning its right side, the system records a bundle of features; these are from left to right: convex corner, right taper, cylindrical surface, square groove, cylindrical surface, In this case, the second highest X value belongs to the referenced feature itself "convex corner" as its start point and the end point of the right taper as well. Whereas, by scanning the right side of the convex corner in Fig. 6b as a referenced feature, the system records the following bundle of features: convex corner, right taper, left shoulder cylindrical surface, right shoulder, and facing. The second highest X value in this bundle exists at three features (left shoulder cylindrical surface, and right shoulder). These two cases would affect the decision of the system in terms of which volume should be removed first from the blank and consequently which features take the priority in the manufacturing.
Step five: specifying faces of intermediate features The purpose of this section is solving issues of features intersections, following the concept of removing volumes from a blank in a reasonable sequence. Each volume means either an independent final feature or an intermediate one.    Fig. 6a and as mentioned in step four, the right side of the convex corner is scanned: convex corner, right taper, cylindrical surface, square groove, cylindrical surface, and facing. The system calculates the first face data of the intermediate feature by checking the feature in the far-right side of the bundle, which is in this case the facing. This is to compare all its X values with the extracted second highest X value and specify its topology. Since all the X values of the facing feature are lower than the extracted second highest X value, the first face data will be calculated as follows: -F 1 is a vertical line; -F 1 start point X = the observed X value from step one; -F 1 start point Z = maximum Z value of the feature at the far-right side of the bundle; -F 1 end point X = the second highest X value; -F 1 end point Z = maximum Z value of the feature at the far-right side of the bundle.
In order to facilitate the calculation of the second face of the intermediate feature, the third face is found first. Whilst the system considers the feature on the far-right side in the bundle to find the first face data, the feature on the far-left is used to find the third face. The same logic of checking and comparing the X values of the feature with the second highest X value is applied. In this case, the feature is the convex corner and its X end point is equal to the observed X value, whilst its X start point is equal the second highest X. Hence, the third face will take exactly the same geometrical and topological data of that shape. The third face data in this example will be: -F 3 is a convex curve; -F 3 start point X = the start point X value of the convex corner; -F 3 start point Z = the start point Z value of the convex corner; -F 3 end point X = the end point X value of the convex corner; -F 3 end point Z = the end point Z value of the convex corner; -F 3 centre point X = the centre point X value of the convex corner; -F 3 centre point Z = the centre point Z value of the convex corner; -F 3 direction = CCW.
Regardless the shape and data of the first and third faces of an intermediate feature, the following relation is always true: F 1 end point X = F 3 start point X This has only one meaning "the second face that links the first and third ones is always a horizontal line". The second face data can be concluded as: -F 2 is a horizontal line; -F 2 start point X = F 1 end point X; -F 2 start point Z = F 1 end point Z; -F 2 end point X = F 3 start point X; -F 2 end point Z =F 3 start point Z. Figure 7 shows an example of an intermediate feature with its three faces. The volume of this feature, which is shaded in light green, will be the first to be removed from the original blank that is shaded with light purple.
The part design in Fig. 6b can be utilised to show a different example of calculating an intermediate feature.
Whilst all the three faces follow the same logic in finding their data, the third face does not take all the original data of the convex corner as in the previous example. This is because the second highest X value is higher than start point X value of the convex corner feature; hence, the start point X and Z of the third face is calculated based on a perpendicular line that passes the point with the second highest X value and intersects the convex corner feature. The third face data in this case will be calculated as follows: -F 3 is a convex curve; -F 3 start point X = the second highest X value; -F 3 start point Z = is calculated using a circle equation; -F 3 end point X = the end point X value of the convex corner; -F 3 end point Z = the end point Z value of the convex corner; -F 3 centre point X = the centre point X value of the convex corner; -F 3 centre point Z = the centre point Z value of the convex corner; -F 3 direction = CCW. Figure 8 shows how the third face of the intermediate feature is considered. However, it should be noted that the intermediate feature does not cover the whole shape of the original convex corner feature. The system updates the data of this feature in which the start point X and Z of the updated convex will be the same as the original one, but the end point X and Z will take the values of the F 3 start point X and Z. Then, the updated convex will be considered in the next loop of features intersections. This can be noticed in Fig. 9 where only a part of the convex has been removed with the Step six: continuing the loop The same process as that described above is carried out in a loop, for each step determining the intermediate features to be removed from the blank, until all the final features are covered. For example, after defining the faces of the intermediate feature in Fig. 9, the same bundle of features (updated convex corner, right taper, left shoulder cylindrical surface, right shoulder, and facing) will be reassessed according to step one. This time the observed X value will be the maximum X value in this bundle. In this manner, steps 1-6 are repeated, and Fig. 10a, b, c, and d show an example of this process for this particular design.
Step seven: avoiding repetition In order to avoid the same intermediate features, those that have already been determined are stored in temporary memory of the system. In Fig. 11, the scanning process to the left side of the left taper feature would give features: left taper, facing, concave corner, cylindrical surface, square groove, cylindrical surface, facing, and convex corner. Also, the scanning process to the right side of the convex corner feature would give features: convex corner, facing, cylindrical surface, square groove, cylindrical surface, concave corner, facing, and left taper. Although these bundles are in reversed order, the same intermediate features will be detected. The system can check these instances of duplication, to ensure that there is no repetition of work.
In contrast to the final features that can be formed from one to five faces, and take any shape, the intermediate features will only have certain types of 16 shapes. This is because each is always formed from three faces and the second face is always a horizontal line. Figure 12 shows all the possibilities that an intermediate feature can take.

Features subtraction of internal shapes
Internal and external features are described in a different way, and the requirements to manufacture them are different. However, for solving features interesting issues, they both follow the same logic, with minor adjustments. In the case of internal shapes, the blank size is not considered. Instead, the minimum X value of the features of an internal shape is deducted. The minimum X value is observed, rather than the maximum that is used in step one. Also, instead of then using the second highest X value, the second lowest X value is used. In Fig. 13, the sequence of creating intermediate features for internal shapes is shown.

Case study
The proposed features subtraction system is built using C# language, and is considered as a continuation of the SI-AFR system. In order to evaluate its ability, the same case study from the latter (see Fig. 14) has been tested. The part has been designed using SOLIDWORKS and saved as a STEP AP 203. The result from the SI-AFR system shows that the external shape of the part design has 15 final features (Table 1), and the through, front, and back internal shapes have four, two, and two final features, respectively ( Table 2). Using such a design model shows that the proposed features intersection methodology can adequately deal with both external and different internal shapes. The following sections provide detail about both the external and internal shapes in terms of solving features intersection.

External shape
The SI-AFR system recognises fifteen external final features of the part design and puts them in order from right to left based on the Z axis. The first step of scanning the final features declares that the convex (F 9 ) has the maximum X value (87.5mm) at its apex, which is the same as the blank radius. Since there is only one feature with the maximum X value at this point, step two is overridden directly moving to the third step, which is scanning the final features on the right side of the observed feature. As a result of step three, nine final features are considered on the right side of the convex feature (facing, right convex corner, cylindrical face, radial square groove, cylindrical face, right taper, facing, cylindrical face, and the right half of the observed convex feature). The system then reads the data of these nine features to find the second maximum X value, which is in this case the joint point between the cylindrical face and the convex (F 8 and F 9 ) with an X value of 80mm. Hence, the three faces of the first intermediate feature will be:     Table 2 The details of the three internal shapes Internal shapes Feature no. As appears in Fig. 15, the first intermediate feature not only removes part of the blank but also covers the machining of the cylindrical face (F 8 ) and the right half of the convex (F 9 ). Although the system scans the left side of the observed convex feature at this point, it is preferable to the reader to continue the loops on the right side of the convex until all the final features are covered. The bundle of nine features is updated to be eight by subtracting the convex (F 9 ) because its right half was totally covered by the first intermediate feature.
Repeating the five steps of the system will give the following result: 1. The facing and cylindrical faces (F 7 and F 8 ) have the same maximum X value (80mm); 2. Scanning the right and left sides of the cylindrical face (F 8 ) will stop directly because the two neighbours have -Scanning the left side of the facing (F 7 ) will stop directly because the next neighbour has the same maximum X value (80mm).
Removing the second intermediate feature covers the machining of the facing (F 7 ), as shown in Fig. 16. The loop continues, and this time the bundle of the seven final features is updated by subtracting the facing feature and keeping the other six. Applying the first five steps and considering the updated bundle gives the following result: 1. Only the right taper (F 6 ) has the maximum X value (43mm); 2. Scanning the left side of the right taper will stop directly; 3. Scanning the right side of the right taper gives a bundle of six final features including the observed feature; 4. The second highest X value is the joint point between the right taper and cylindrical face features (40mm); 5. The three faces of the second intermediate feature will be:  Figure 17 shows that the third intermediate feature covers the machining of three final features: the right taper and two cylindrical faces (F 6 , F 5 , and F 3 ). There are three remaining features: (i) radial square groove, (ii) right convex corner, and (iii) facing (F 4 , F 2 , and F 1 , respectively). Scanning the right and left side of each remaining feature will stop directly; hence, it is declared as a final independent feature  (Table 1). Figure 18a and b show the machining of the right convex corner and radial square groove, respectively. At this point, all the features on the right side of the convex (F 9 ) are covered.
Back to the left side of the convex (F 9 ), the scanning process considers seven final features: left half of the convex, cylindrical face, radial groove with two rounded corners, cylindrical face, two sides tapered groove, cylindrical face, and facing (F 9 , F 10 , F 11 , F 12 , F 13 , F 14 , and F 15 , respectively). As mentioned, the maximum X value of this bundle is (87.5mm) at the apex of the convex feature, whereas the second highest X value is (80mm), which is the meeting   Figure 19 shows that machining the fourth intermediate feature covers the left half of the convex and three cylindrical faces (F 9 , F 10 , F 12 , and F 14 ). The three remaining features are (i) radial groove with two rounded corners, (ii) two sides tapered groove, and (iii) facing. Scanning the right and left side of each remaining feature will stop directly, and the feature is declared as a final independent feature. Figure 20a and b show the machining of the radial groove with two rounded corners and the two sides tapered groove, respectively. This is the end of the external shape when all the initial 15 features are covered in 10 intermediate and independent features, as it is shown in Table 3.

Internal shape
The SI-AFR system recognises three internal shapes of the part design with different positions and numbers of features: (i) through internal shape (four final features), (ii) front internal shape (two final features), and (iii) back internal shape (two final features), see Table 2. Despite the position of the internal shape, the same logic is followed in solving features intersecting. As mentioned, only the through internal shape requires an additional step as a preparation before starting the expected procedure.
Through internal shape The first step of scanning the final features of this internal shape declares that the minimum X value is (12mm), which is the minimum radius value between the axis of the shape and any of its faces. Before moving to the second step of grouping the features, the observed X value is used to find the data of the first intermediate feature that forms the main hole of the shape. The length of this intermediate feature is calculated from the Fig. 20 (a) Machining of the radial groove with two rounded corners and (b) machining of the two sides tapered groove Table 3 Intermediate and independent features of the external shape External shape Feature no. -F 2 radius end point z = 12; -The movement from start to end point is linear; -F 2 X centre = 0; -F 2 Y centre = 0. Figure 21 shows that the machining of the first intermediate feature covers two cylindrical faces (F 2 and F 4 ). The two remaining features are the right axial groove and the two sides tapered groove. Scanning the right and left sides of each remaining feature will stop directly and the feature is declared as a final independent feature. Figure 22a and b show the machining of the two remaining features.

Front internal shape
The expression of Front internal shape has one meaning; "this internal shape has a closed end, and the centre of this closed end, which is always zero, represents the first observed minimum X value". Such a case means skipping step two of grouping features based on the observed X value because there will always be one feature holding this value, and in this example, it is the right axial groove (F 2 ). At this point, the scanning process is only required to be on the right side of the feature; hence, the bundle includes two features: (i) right axial groove (F 1 ) and (ii) right axial groove (F 2 ). The second minimum X value is the connecting point between the first and second features.
Machining the first intermediate feature covers the right axial groove (F 2 ), and the remaining right axial groove is declared as a final independent feature. Figure 23a and b show the machining of these two features, respectively.

Back internal shape
The same logic of finding the minimum X value in a front internal shape is followed at a back internal shape. However, instead of scanning the right side of the observed feature, the left side is scanned here. In this example, an intermediate and final feature (left axial groove 2) are declared as is shown in Fig. 24a and b, respectively. Table 4 shows intermediate and independent features of the through, front, and back internal shapes.  Figure 25 shows the resulting window after applying the proposed features subtraction system. Regarding the external shape, the fifteen recognised features from the SI-AFR system are formed by machining ten intermediate and final dependent features resulting from the features subtraction system. Whilst the through internal shape has four initial features that are formed by three intermediate and final dependent features, each of the front and back internal shapes has two initial features, and is formed by two intermediate and final dependent features.

Methodology evaluation
Using the proposed features subtraction concept in developing an ACAPP system has many advantages. These can be clarified and evaluated via a comparison with different CAM software. There is no doubt that CAM software has been providing significant services to the manufacturing industry; however, they have limited capabilities and many constraints. In almost all CAM software, the user follows the same steps in analysing designs to generate G&M code files. This starts by reading the input design using CAM software, which is then predicts the stock shape and size, and asks the user to confirm the speculation. Regarding the rotational parts, the default analysis of CAM software for any design shows its profile as a connected sequence of segments created as a single planar object. Such an analysis requires a user that is highly experienced in order to select specific segments; hence, divide the design into machining areas. The model design in Fig. 26a shows a simple example. The part profile of the design is coloured in red, and it covers the part as a continuous segment without any consideration of its features. Since it is very difficult to select  a single appropriate tool to machine the whole profile at once, the user should divide the machining area into subareas (intermediate and final features) manually, based on the experience. This is by selecting specific start and end points at the profile segment and connecting them. Next, the user analyses each sub-area in order to select an appropriate tool for its shape. For example, an insert shape with 80 • of point angle and 95 • of approach angle can be selected to machine the pink area (Fig. 26b); whereas, the blue area requires an insert of a square shape (Fig. 26c). After selecting a set of cutting tools, the user needs to provide the CAM software with information that includes the depth of cut, spindle speed, feed rate, and a start point of machining for each area. Whilst a CAM software can detect the machining strategy for the pink area after specifying the start and end points, the machining strategy for the blue area is selected manually. This is because CAM software does not recognise such an area as a square groove without interference. The user selects a machining strategy for each type of groove based on its geometry, the selected tool, the specified start point, and experience level of the individual. Meanwhile, both the process selection and the sequence of operations require the user's interference. For instance, it must be delivered to the CAM software that the pink area is machined before the blue one. This is also the case with the internal shapes when a drilling process should be achieved before the boring.
In contrast with a CAM software, the features subtraction system analyses the part design and provides its topological and geometrical information in terms of intermediate and final manufacturing features to the ACAPP system. Hence, the ACAPP system does not require any experience from the user because all the tasks are achieved automatically. For example, the rich topological and geometrical data of the features and knowing the location, depth, and width of each one facilitates automatic determination of information: (i) cutting tools, (ii) cutting conditions, (iii) process selection, (iv) sequence of operations, and (v) G-code. All these Fig. 26 (a) A part profile as a connected sequence of segments in CAM software. (b) and (c) Dividing the machining area into sub-areas and selecting cutting tools based on the user's experience expected process planning outputs, and more, are included in the future work. This will reduce the time and cost required, as well as human intervention, in generating process planning.

Discussion and conclusion
The SI-AFR system can recognise predefined and new features, as well as solving simple features intersecting issues. However, complex cases of manufacturing features intersections require more investigation. This is to reduce the machining time and cost, and avoid technical issues, such as damaging a feature and/or interrupting the cutting tool movement. Depending on the part design and the process planner vision, different strategies can be suggested to solve a case of features intersecting. These solutions might vary between unreliable, acceptable, and optimal.
In this work, a "features subtraction" system has been developed to present an optimal solution for each features intersecting case. The recognised features from the SI-AFR system, which are final manufacturing features, are used as an input of the proposed system. The system has seven steps of analysing, processing, and calculating. The first step scans all the part's features to find those that have maximum X value. Then, the system checks if the observed features are linked to each other and puts them in groups. The third step includes scanning the final features on the right and left side of each observed feature and putting them in bundles. However, if the scanning process on both sides is directly stopped, then the feature is declared as a final independent one. Each bundle of features is then analysed to find a second X value besides the initial one. This is to be used in the fifth step that determines data of an intermediate feature. Each intermediate feature removes a part from the blank and covers the machining of one or more final features. In some cases, the intermediate feature covers a part of a final feature; therefore, the system considers the uncovered part of that final feature in the next loop.
Step six is for checking the rest of features from each processed bundle and sending them again through the whole process from steps 1-6. Finally, the system examines all the determined intermediate features in order to avoid machining the repeated ones. The feature subtracting system follows the same logic in determining intermediate features of external and internal shapes. However, this requires one adjustment which is calculating an intermediate feature based on minimum and second minimum X values in a features bundle of an internal shape; whereas, maximum and second maximum X values are used in external shapes. The system has been evaluated using a case study that includes an external shape and three different cases of internal shapes.
Whilst the result provides an optimal solution for features intersecting problems, it can be utilised in generating the expected process planning outputs. This will be a part of the future work when the rich topological and geometrical information of the intermediate and final manufacturing features is used for automatic selection: (i) cutting tools, (ii) cutting conditions, (iii) process selection, and (iv) sequence of operations, as well as generating the G-code for machining the part.
Funding information This study was financially supported by the Republic of Iraq Ministry of Higher Education and Scientific Research and the University of Technology, Baghdad.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons. org/licenses/by/4.0/.