1 Introduction

The CAD/CAM/CNC chain was principally designed to facilitate the successful manufacture of a part and obtain its physical model using a digital CAD file and adhering to different specifications. This chain classically consists of an open-tree of three links. The first is the computer-aided design (CAD), in which the engineering office (designer) creates the geometric model of the mechanical part and attributes to it different specifications and tolerances to ensure its functionality once it is placed in a mechanical system. After this step, the method office creates a workplan to define the sequence of machining operations, machines and cutting tools, clamping, and cutting condition parameters. In the third step, to guarantee numerical control (NC) of the fabrication, a digital machine programmer creates, manually or by using CAM software, the classical G-code, which is the oldest international standard language available under the reference RS-274D (ISO 6983). In modern industry, manufacturers must confront new challenges beyond the study of the feasibility of fabricating a product, because they must prepare it for competition which will arise within the context of Industry 4.0. Then, they must agree to adopt a novel, intelligent numerical chain that can provide fully optimized management and manufacturing of the product, by sweeping and integrating its entire life cycle. From this perspective, the current G-code, developed in the 1960s for NC, is not able to perform this key task, because it breaks the bidirectional communication between links of the numerical chain and limits the tractability, flexibility, and interoperability of manufacturing systems. Thus, over the last decade, many efforts have been devoted to merging the standard for the exchange of product model data (STEP) and STEP-NC into their computer-aided process planning (CAPP) in order to benefit from these advantages. This standard has touched all manufacturing processes, mainly those used in machining. However, in the following, we present only the state of the art related to the manufacturing automatic recognition systems that have specifically used STEP and STEP-NC as processing formats. At the same time, we review the performance and a few points of weakness of the systems mentioned.

Sivakumar and Dhanalakshmi [1] developed a system using a simplified and generalized method for cylindrical parts which allows the extraction of information regarding machining characteristics from STEP files. The extracted data are used to generate NC codes according to the type of controller. The method was validated by machining the cylindrical parts generated by the codes and inspecting the part using a three-dimensional coordinate measuring machine (CMM). However, the processing of cylindrical groove entities is not indicated in this work, and the programming of the NC machine is apparently carried out via the classic G-code and not STEP-NC. The software developed by Malleswaria et al. [2] ensures the recognition of the various character strings in the STEP file and allows their interpretation in terms of turning machining entity. Recognition is reinforced by technical rules. The recognition module proposed by the authors is able to identify cylinders and axis holes located in a plane perpendicular to the axis of revolution (asymmetric parts). This method is based on a character string process requiring considerable processing and does not benefit from the potential data structuring offered by the objects already present in the STEP file. The thesis project [3] “Design by Entities for parts of revolution based on STEP” aims at extracting machining entities from STEP AP224 for parts of revolution. The STEP AP224-generated entities are used as basic entities to draw the part. The technique enables the definition of entities, their classifications, the addition of attributes and geometric constraints. The object-oriented design used in the development of modeler entities ensures improved performance and reusability of these entities. The STEP-XML file of created data can be used in the CAPP/CAM chain without the use of a complex recognition system. Although this system makes it possible to generate STEP AP224 entities, the design-by-entity approach considerably limits system operation. The feature library remains incomplete due to the lack of repetitive, complex machining characteristics for exterior turning and other characteristics for reaming. Also, the interacting entities are not taken into consideration within the framework of this work. In the end, this work, restricted to the recognition phase, does not make it possible to specify the method, the format and the type of the code used to transmit the entities generated to the NC machine. Similarly, Sharma and Gao [4] designed a new-generation process planning system based on the machining characteristics technique and using the international STEP AP224 protocol. The system does not require any intervention from the user for the generation of machining schedules and supporting documents. It consists of decision logic stored in an external database, which makes it generic and compatible with any manufacturing process. Likewise, it is equipped with a feature model editor (FME) used as a design tool by entities, with simple components. The same criticisms as before can be formulated with regard to this system. The generated data are then used in shop floor applications, such as machining schedules, production optimization, machining simulation and manufacturing control, that require access to integrated data from product manufacturing. However, this third-generation system still needs to be improved, and collaboration with the machine manufacturer is thus required. Unlike other research which has generated G&M codes or other CNC machine-specific programs from STEP-NC to bypass CNC machine tool information [5,6,7], Shin et al. [8] proposed an inverse approach which allows the extraction of manufacturing information from the G&M code to generate the STEP-NC program in the case of a turning process. This approach remains very difficult due to the low level or absence of information on the production range in the G&M code. However, according to Suh and Lee [9], this manufacturing STEP roadmap is an essential step to replace G&M codes with STEP-NC for the interoperable manufacturing era. The process planning system (PPS) proposed in [10] presents three interesting features: (i) STEP-NC data can be used to generate standardized data for generic process planning and definition of trajectories of the process tool for turning operations; (ii) with the incorporation of the surface roughness modulus, PPS can be integrated with STEP-NC data to generate production routings with prediction of surface quality; and (iii) this research investigated the timeliness of the optimization process using a manufacturing knowledge base contained in STEP-NC. The authors specify that supplying STEP-NC with sufficient information makes it possible to optimize the manufacturing variables and to move towards intelligent manufacturing. Stimulated by industrial needs for simultaneous engineering, Yusof and Case [11] designed a CAD/CAPP/CAM system called SCSTO (STEP-NC-Compliant System for Turning Operations) based on STEP ISO14649 for the manufacture of asymmetric parts over-milling CNC turning. This system aims to model information in the field of mechanical manufacturing by addressing the problem of capturing and representing data related to resources and processes. The interaction between the different types of models provides a description of the products, the method and the resources that will be needed to ensure their manufacture. The STEP-NC generator code generates a Part 21 file based on the machining characteristics to make iterative the generation of automatic ranges during the entity extraction phase. The designed system adopts a structured methodology for its planning and object-oriented methods for its implementation. Case studies were tested to show the new coding approach (STEP-NC) used can intelligently replace the G-code currently in use while providing some benefits such as elimination of the post-processor. However, the authors specify that there is still some effort to be made to revolutionize certain axes in the system: combination of Parts 11 and 12 for turning/milling operations. The TERMINAL STEP-NC software [12] presented can take into account parts with a geometry composed of cylindrical and conical surfaces and can also be extended to other types of surfaces and to new functionalities. This platform makes it possible to build a complete database of machining and its related information. By using STEP-NC as a potential tool, the authors were able to reduce the time required for programming the CNC by around 35%, decrease the number of drawing files transmitted from design to manufacturing by 75% and achieve savings of 50% on time necessary for the machining of parts on the CNC machine tools for work in small and medium series. The authors qualify STEP-NC as bringing potential future development opportunities for mass manufacturing. In Suh et al. [13], the authors present a turning system called Turn STEP. The data model used was developed by the STEP-NC research team of the POSTECH National Research Laboratory of South Korea in collaboration with ISW University Stuttgart, Germany, and formalized as ISO 14649 Part 12 and Part 121. The architecture behind Turn STEP is based on various considerations of a transparent and intelligent CAD/CAM/CNC chain from the future e-manufacturing paradigm. Although Turn STEP was in the prototype stage, the validity of its data model and the efficiency of its architecture have been proven, and it has been shown that CNC systems based on STEP-NC have enormous potential and power compared to conventional CNC systems based on the old ISO 6983 standard used for over 50 years. The two German institutes, Institute for Machine Tool Control Engineering Manufacturing Units (ISW) in Stuttgart and the Laboratory for Machine Tools and Production Engineering (WZL, RWTH) in Aix, played an important role in the European STEP-NC project. Their research contribution was focused on STEP-compliant development and implementation. The sophisticated Turn STEP turning system is a CAPP for connecting CAD and CAM. It first reads geometric data from a STEP AP-203 Part 21 file, then performs routing planning tasks such as feature recognition and operation sequencing to generate a physical STEP-NC file. [14]. However, this system cannot be used on any other controller other than the Siemen 840. Hardwick [15] developed the third generation of the STEP system which combines data from existing systems to generate new data. This system has been successfully tested on the milling process and on defined turning applications. The first generation of the system uses the Express model as an input and Java as a programming tool, while the second generation is improved by adding tools to visualize and validate the data defined first by the application protocols of STEP. This generation can read, write and exchange the data of the two protocols AP203 and AP214. Finally, the third generation proposed makes it possible to receive various XAO sources. This system is connected to a workshop via the standard STEP AP-238 protocol from data produced. The CAD data and tool trajectories and the manufacturing data from the CAM module are then used to combine STEP and Geometric Dimensioning.and Tolerancing (GD&T) parameters within a direct interface or legacy format.

Table 1 cites the research carried out on STEP-NC with an emphasis on turning and turning/milling processes [16].

Table 1 Research work using STEP-NC carried out on the turning and turning/milling process

2 Review of related works

The process of manufacturing feature recognition (MFR) is the most complex module of any CAPP in the machining sequence. The algorithms developed for MFR for turning process are diverse in terms of techniques adopted (attribute adjacency graph, volume decomposition, hybrid approaches, syntactic pattern recognition, etc.), mathematical model developed, and input CAD used. In the algorithm of machining entities extraction [26], the input CAD model is a three-dimensional (3D) drawing saved in a neutral STEP AP 203 file simplified into two dimensions. The recognition method is based on reasoning rules applied on the two-dimensional (2D) drawing. The proposed system succeeds in extracting the data and characteristics of the part to be turned. Designed to be self-sustaining, the algorithm is programmed in Visual Basic 2008 connected to the EWD raw module. By studying the information contained in the STEP AP203 file, rules for constructing 2D entities from 3D entities are established: for example, in STEP, a simple cylinder consists of two planar and two cylindrical surfaces. For the 2D representation of the cylinder, 12 states are needed. The cylindrical faces contain four curves with line segments and four curves with circular segments, and the two planar faces contain four curves with circular segments. By intelligent selection of the desired lines, the 2D drawing of the cylinder can be represented in two dimensions. In turning entities, there are three main body types: cylindrical, conical and toroidal. The inner entities, in STEP AP203, are often coded by the letter F, and outer entities by the letter T. Horizontal lines are coded by 0, inclined by 1, vertical by 2 and curvilinear by 3. For example, the outer circular groove is coded by 0T0T0T. The principle of the method is given by Fig. 1.

Fig. 1
figure 1

Principle of the method for extracting turning entities [26]

Qin and Li [27] provided an intelligent method of machining in turning based on the recognition of geometric characteristics. Their algorithm is designed to recognize the planar faces, turning contours (cone, trunk and cylinder) and grooves by defining a point of view, a direction and the cylindrical coordinates for true loops and false loops in projection. By creating functions connecting all the loops, the algorithm determines the regions to be machined in turning. According to the authors, the study solves the machining ability problem during the design stage and reduces costs and saves production time. This method of feature recognition is described by Fig. 2 as follows: A point Pi of the part is defined by the cylindrical coordinates P (ri,θ, Zi). The approach consists in identifying the largest contour of each real loop li, its radius ri, and its length (ΔZ) and the function θ(r, z) = f (r, Z) connecting the two variables r and Z. If Δr is zero, then the extent of the real loop is a cylindrical part; if ΔZ is equal to zero and Δr is not zero, then it is about a plane face delimited by two true loops. Otherwise, it is a part to be machined in turning, for example, a cone or a trunk cone. The regions between the part outside each cylinder of the part (conical or trunk-conical) and the inside of the visibility space, defined by the radius R, must be machined.

Fig. 2
figure 2

Method of recognition of the characteristics of machining in turning proposed by Qin and Li [27]

Chung and Peng [28] present an FAR based on the CAD Drawing Interchange Format (DXF). The design of the part is represented by geometric entities such as lines, curves and surfaces. From a DXF data file, the recognition of machining entities begins by obtaining the simple geometric elements used for its construction. Figure 3a briefly represents the steps followed for the conversion of the geometric information contained in the DXF format into geometric entities as defined by this method: a line entity is converted from DXF format (AcDbLine or AcDbPolyline) and stored in a defined entity format (line_type, Point1, Point2). Line_type defines a straight line or a line tangential to a circle. In particular, if a line feature of a DXF file includes the number 42, it will need circular interpolation in the next line, because the DXF format does not provide information about the circular connection of the two lines. The circular entity interpolated here is also stored in a circular entity format defined by Circular_direction, Center_point, Start_angle, End_angle and Radius.

Fig. 3
figure 3

a Steps for converting geometric entities from information represented in the DXF file and (b) decision diagram developed for the definition of the machining entity from the geometric elements obtained

Once the geometric entities are obtained and stored, the next procedure converts these elements into machining entities using the decision-making diagrams. Three types of decision-making diagrams are developed to handle three simple geometric features of cylinder, cone and dome, to which the thread wrapping entity has added.

The extraction of the entity is explained with reference to Fig. 3b: if the entity of the second layer is of the same linear type as that of the first layer, it may be a recess L-void (hole flat bottom) or an E-thread threaded cylinder; it depends on the type of the following entity. Based on these rules, a machining entity can be formed from the geometric elements obtained. In particular, an object-oriented manufacturing feature (OOMF) machining entity strategy based on object-oriented programming (OOP) is introduced to efficiently store and manipulate the defined machining entity. Figure 4 gives an overview of the hierarchical diagram of the OOMF classes.

Fig. 4
figure 4

Hierarchical diagram of the OOMF classes

The Automatic Entity Recognition System [29] comprises three modules: (1) a CAD module for part drawing using Mechanical Desktop; (2) a feature extraction module based on a new low-level algorithm (point coordinates, vector direction and its modulus) using the STEP profile (ISO 10303, Part 21) of the part generated from the previous module; and (3) an automatic entity recognition module, which is a knowledge-based subsystem. In this module, an automatic feature recognition (AFR) algorithm called sweeping primitive rule (SPR) is built based on three recognition techniques (Fig. 5): (a) syntactic model; (b) scanning operation; and (c) logical rules. The SPR algorithm is intended to increase the flexibility of recognizing different types of simple features (cylindrical, grooves and shoulders), in addition to new features of compound types for symmetrical rotational parts.

Fig. 5
figure 5

Principle of the FAR algorithm proposed by Hussein Salem Ketan [29]

The identification method can be described as follows: After extracting all the Cartesian points from the part's STEP file, rules are used to define the line entities in Fig. 5b. A second syntactic form encoding is ensured to convert the entities obtained into new oriented lines (line a, b, c, d, e, f and g), as shown in Fig. 5c and e. Then rules are applied to ensure the automated recognition of entities, as in Fig. 5d.

The study presented by Yildiz [30] describes an AFR system equipped with a CNC code generator (automatic feature recognition and CNC code generation, AFR/ACCG) designed for revolution parts. This system has been programmed using Delphi language. CAD data input to the system is done in DXF available in almost all CAD software. The CNC G-code program of the workpiece is generated automatically, as is the case with entities. By generating the toolpaths and using the part geometry, sample parts were machined with precision. The system can be enriched by new machining entities by making the definitions necessary for their addition. The step of recognizing machining entities begins after importing the DXF format where the drawing entities are identified and are defined in the system. At this point, the coordinates of the two starting and ending points of the arcs, which cannot be accessed by the DXF, are found using trigonometric equations, and all the coordinates found are classified from right to left and from bottom to top.

Following the authors, this classification provides a precise feasibility of the sequencing process to be followed in the next steps. As it is possible to have a drawing positioned anywhere in the CAD environment, according to the Cartesian coordinate system, the latter are then modified to have a quadrant II (x < 0, y > 0) of the coordinate system, because the toolpaths are constructed, generally, with respect to the face of the cylinder to be machined. After this phase, all the coordinates of the geometric entities are sequenced according to their starting points and positioned relative to the origin. Thus, all the basic geometric entities (lines and arcs) which are generated are represented separately for all the turning operations as illustrated in Fig. 6a and b. The system classifies machining characteristics into inner and outer entities based on their machining attributes. These two feature classes are also further subdivided into subgroups such as long turning, grooving, threading, and reaming. Finally, the profile of the work piece is produced by the program. The direction and sequence of recognized machining entities for a test part is shown in Fig. 7.

Fig. 6
figure 6

Methodology of manufacturing feature recognition following [30]

Fig. 7
figure 7

Direction and sequence of recognized machining entities for an example part [30]

3 Methodology of CAPP-Turn elaboration

3.1 Data CAD input for MFR of CAPP-Turn

The key step to begin an automatic feature extraction is the extraction of geometric and topological information from the STEP CAD. For this purpose, we use STEP-AP203 standard CAD as the entry of the system. A detailed description of this standard can be found in [31].

Figure 8 gives the hierarchical structure of the entities defined in STEPAP203 based on the CAD modeling of revolution parts. The highest level in this hierarchy is the CLOSEDSHELL entity that is used to define the solid part. This element is formed by a set of connected advanced faces (ADVANCED_FACEs). At each advanced face one type of geometrical surface is bounded (FACEBOUND) that can be planar, cylindrical, conical, spherical, etc., and one type (FACEOUTERBOUN) (topological definition) that specifies the set of oriented edges/borders of the surface. The description of the part continues until it reaches the vertex/point which is the lowest level of the hierarchy.

Fig. 8
figure 8

Hierarchical structure of the entities defined in STEP AP203 [30]

The basic idea for designing the machining entity recognition system for the turning process is to cover the majority of the operations of this manufacturing process. Turning operations are classified into exterior and interior turning (reaming). In the case of exterior turning, a distinction is made between turning cylinders and cones, dressing, producing shoulders (turning combined with dressing), external grooving, making slits, taking off, profiling and some operations. Dressing includes threading, chamfering, machining of fillets and knurling (Annex 1: Table five). Internal turning comprises cylindrical and conical bores, internal shoulders, recesses, grooves, internal grooves, and naturally some trim entities such as threading, chamfering and making fillets (Annex 1: Table six). It must be noted that the turning operations have been conventionally defined by referring to the trajectory of the tool with respect to the part, and thus the stock removal is defined as the operation consisting in machining a cylinder of a certain diameter by displacement of the cutting tool along an axis parallel to the axis of rotation of the part, but our work is based on the machining entity which is a characteristic of the part (geometric, topological, tolerances, etc.) and which will be machined. The difficulty resides, therefore, firstly in the possibility of capturing this entity regardless of the geometry of the part to be turned and secondly to ensure the machining of the detected entity using the recognized machining operations.

To elaborate a new consistent-fast algorithm that allows the extraction of the machining turning entities for parts with the most efficiency and complex geometry, it becomes necessary to introduce the main machining entities defined within the framework of this standard and to explain the different parameters that are necessary for the unambiguous definition of these entities whether of a geometric, topological or other nature, in order to remedy the shortcoming of ISO 6893 G-code to overcome modern manufacturing demands.

Figure 9 gives the EXPRESS G diagram summarizing the main turning machining entities which are defined by the International Standard STEP ISO14649-12. Table 2 gives the various parameters defining these entities.

Fig. 9
figure 9

Direction and sequence of recognized machining entities for an example part

Table 2 Principales Entités d’Usinage de Tournage définies par STEP ISO14649-12

The turning machining entities defined by the STEP ISO14649-12 standard are, generally, parameterized entities which can represent a set of entities according to the setting of its parameters, as well as the outer diameter entity, defined by its small diameter (diameter_at_placement), its angle (or its large diameter: diameter_taper) and its feature_length height, can represent a cone in the case where the tilt angle is different from zero and a cylinder in the case where this last parameter is zero (or diameter_at_placement = diameter_taper). This entity is described by STEP-NC as follows:

  • ENTITY outer_diameter

  • SUBTYPE OF (outer_round);

  • diameter_at_placement: toleranced_length_measure;

  • feature_length: toleranced_length_measure;

  • reduced_size: OPTIONAL taper_select;

  • END_ENTITY;

Apart from the geometric and topological parameters, the ISO 14649 standard makes it possible to define a local coordinate system for each entity (Table 2).

This coordinate system is used to locate the position and orientation of the entity in relation to the part to be worked. It should be noted that this location remains a determining factor for the starting positioning of the cutting tool in order to ensure the machining of the feature. In addition, all turning machining entities inherit the feature_placement attribute (defined by Part 10 of ISO 14649) from the parent class Two5D_manufacturing_feature This element specifies the current position of the feature relative to the workpiece coordinate system and is defined by translating and/or rotating the origin of the feature's local coordinate system relative to that of the workpiece. The feature_placement attribute is described, according to ISO 10303–238, by the Axis2_placement_3d class which has three attributes: two optional attributes (Axis and Ref_direction), which define the directions of the local x and z axes of the entity and the third Cartesian_point, materializes a point of coordinates x, y and z, coinciding with the origin of the coordinate system of the entity, and located in relation to the origin of the coordinate system of the part. According to ISO 10303–238, we note that the definition of the class Axis2_placement_3d is obviously the same as that of ISO 10303–203. The UML diagram of Fig. 10 gives the class allowing us to completely define the cylinder entity (outer_diameter).

Fig. 10
figure 10

Outer diameter class and its attributes

3.2 Turning feature graph modeling

The process that we are going to put in place for the recognition system is very simple: (1) To be able to discretize the part into elementary geometric/topological entities of revolution present in STEP AP203 such as planes, cylinders, cones, spheres, and B-splines. The hierarchical structure of the STEP AP203 protocol summarizing the different elementary entities used is shown in Fig. 8. (2) Use rules to build basic entities overriding the definition of turning machining entities. This idea is original in the fact that it allows, on the one hand, optimization by the use of the basic entities just necessary for the construction of all the machining entities because a basic entity can participate for the constitution of several machining entities of different types. On the other hand, this concept makes it possible to represent the outer and inner elementary entities by the same entities before proceeding to the stage of differentiation between them. (3) The weaving of basic entities to obtain the desired turning machining entities. 4) The standardized writing of turning entities formed according to ISO STEP-NC.

To extract all the machining entities, the two approaches, in series and parallel, adopted in this work are the same as that of the CAPP of milling previously developed [31, 32]. Given the nature of axial symmetry characterizing the parts worked in turning, all parts can be seen as a series association of elementary geometric entities connected by circular entities (circles in tipped point), as shown in Fig. 11.

Fig. 11
figure 11

Modeling of parts of revolution by series association of elementary entities

In this model, the surface entity detected will be modeled by a vertex, and the border circles represented by the arcs are the connecting junctions (adjacency) with the two neighboring entities. Normally, four types of entities can be distinguished in a part according to the position of the entity in the part and also of its type (Fig. 12). In type I, the axis of revolution of the entity is completely defined by the two centers of the boundary circles. For type II, its axis is identified by the vertex of the center of the surface and the center of the circle shared with the following entity. Types III and IV are characterized by the flat surface nature defining the surface of the entity; their axes of revolution are completely characterized by the center of the plane and its normal pointing towards the outside of the material. Thus, graph models of each entity and its correspondents are given by Fig. 12:

Fig. 12
figure 12

Elementary graphs of different types of entities that can appear in symmetrical cylindrical parts

3.3 Rules for the identification of manufacturing features

In our approach, an elementary feature i is modeled by the following: (1) a numbered vertex i representing the surface entity to be extracted; (2) the bounds of the surface which are either circles Ci and Ci + 1 or a vertex Vi and a circle Ci. The circles Ci and Ci + 1 define the junction profiles (adjacency) of the feature i with feature in upstream i-1 and downstream i + 1 of this surface. The vertex Vi represents the center of the free surface where there is no connection; (3) the axis of revolution of the entity which is defined either by the two centers Ci and Ci + 1 or Vi and Ci + 1 for the surfaces of revolution, or by the center of the circle and the normal resulting from this center on the material-free side for features with a flat surface.

To check that the part is of revolution type, without the presence of asymmetric elementary features, all axes of symmetry of the elementary detected features must be naturally coincident.

To construct a total isomorphism graph of the part, we start with an arbitrary elementary entity of the part, and we take its axis as the axis Z of revolution of the whole part and its end coordinate Z minimum as the provisional origin of local reference to be assigned to the part. The model of the final part is constructed by association in series of elementary features by fusion of the common circles of junction. The final graph model of the 3D part is presented in Fig. 11. For the identification of elementary features, the rules are compiled by first using the topology of the part and, if necessary, we add the geometry criterion. This preference is allowed to ensure more degrees of freedom in terms of the dimensional variability of the entity.

The EXPRESS modeling, Python language and the STEPCode library are the main tools used to map parameters of objects representing manufacturing features obtained by the AFR system to geometric and dimensional attributes of classes representing features of ISO 14649. The established rule for the identification of an elementary cylinder is graphically explained by the flowchart of Fig. 13. The identification of this element consists of four rules obtained from EXPRESS LANGUAGE AP203:

  • Rule 1: The STEP CAD file must contain at least two cylindrical surfaces (Cyl 1 and Cyl 2), each delimited by a loop formed by the entities including a circular segment (Arc Cir), linear segment (Line), circular segment (Arc Cir), and a linear segment (Line): Cyl 1 (Arc Cir 1: C11, Line 11: L11, Arc Cir 12: C12 and Line 12: L12) and Cyl 2 (Arc Cir 21: C21, Line 21: L21, Arc Cir 22: C22 and Line 22: L22).

  • Rule 2: L11 must be the same as L21 or L22.

    If L11 is the same as L21, then

    L12 must be the same as L22; if not,

    L12 must be the same as L21.

  • Rule 3: The two pairs of circular edges that share the same vertices must have identical centers.

  • Rule 4: The two pairs of circular edges which share the same vertices and which have the same centers must be distinct (not confused).

Fig. 13
figure 13

Flowchart for extracting a simple cylinder feature

The algorithms used to scan and detect other types of turning features from the STEP AP203 model are summarized in Table 3 and its continuation in Appendix Table Five.

Table 3 Detection rules for basic external and internal entities

3.4 Consideration of transformation elements and scale

Knowing that a 3D definition drawing of a part may have an offset from the origin of the reference system of the CAD software and any orientation with respect to that system, critically, the drawing of the part can be enlarged or reduced according to the scale of the adopted design. These operations are commonly referred to as affine transformations applied to an object and do not affect the topology of the part. Faced with this situation and in order to facilitate the machining operation of the part, it becomes necessary to translate all the dimensions related to the part to be turned into a local coordinate system identical to that of the three-axis CNC numerical control machine, and taking into account the scale factor (Fig. 14).

Fig. 14
figure 14

Three-axis CNC machine mark (a) and CAD part mark (b)

We define the part’s CAD model coordinate system as the main base. This reference system is completely defined in the CAD STEP file of the part in question: its origin O is of coordinates (0, 0, 0), and its direction vectors, defining its three axes, are \(\overrightarrow{x}\)= (1,O,O), \(\overrightarrow{y}\) = (O,1,O), and \(\overrightarrow{z}\)= (O,O,1).

The local system linked to the part and which, in principle, should be identical to that of the CNC lathe machine is constructed as follows:

The center of the extreme face of the part of revolution will be taken as the local reference center (O1 or O2). By convention, we take the center closest to O, or O1. This center is defined by the vector \(\overrightarrow{O{O}_{1}}\).

The Zp axis of the cylinder is given directly by the part's STEP file. In fact, for each elementary entity of the part, STEP defines this reference mark as follows:

  • The center of the Ocyl cylinder is given by the attribute: # Address = CARTESIAN_POINT ('Axis2P3D Location', (Xcyl, Yyl, Zcyl));

  • The direction of the entity's Zp axis is given by the attribute:

  • # Address = DIRECTION ('Axis2P3D Direction', (Xz, Yz, Zz));

  • The direction of the entity's Xp axis is given by the attribute:

  • # Address = DIRECTION ('Axis2P3D XDirection', (Xx, Yx, Zx)).

The third Yp axis will be defined from the cross product to form a direct orthonormal coordinate system:yp = \({\overrightarrow{z}}_{p}\)^\({\overrightarrow{x}}_{p}\)

Once the local coordinate system linked to the part of revolution is completely defined, each surface point defined in the main coordinate system will be brought back to the local coordinate system using the passage matrix between the two references:

$$\begin{bmatrix}X_1\\Y_1\\Z_1\end{bmatrix}=s\begin{bmatrix}X_XY_XZ_X\\Y_Z,Z_X-Y_X,Z_Z,X_X,Z_Z-X_Z,Z_X,X_Z,Y_X-X_X,Y_Z\\X_Z,Y_Z,Z_Z\end{bmatrix}\cdot\begin{bmatrix}X\\Y\\Z\end{bmatrix}$$

3.5 Dimensionality reduction for the representation of the part

To simplify the processing of the information and the algorithms that will be used for the extraction of the entities and the definition of their machining strategy in a later step, again, we will use the properties of axial symmetry characterizing the parts of revolution to reduce the dimensionality from 3D CAD representation to 2D CAD. This step is facilitated by the existence of loops surrounding each surface and the geometric/topological definition of each edge forming the loop. Thus, in this way, the cylinder and the cone will be represented only by their generator, the circular plane by the radial segment coming from the center of the circle delimiting the plane and the point belonging to the circle, the spherical end piece by its circular arc, and so on. Likewise, the circles of connection between entities will be reduced to points of connection. It should be noted that all 2D entities are arranged so that they are contained in the same representation plane.

From the moment when the entity identification is carried out, we can reduce the 3D dimensionality to two dimensions by fixing the axis of rotation of the part and by retaining, for each elementary entity detected, only the 2D profile from which this entity was generated by revolution. This will, on the one hand, save memory and, on the other hand, facilitate and accelerate the rapid processing of data. The dimensionality reduction operation is carried out directly from the STEP AP203 file using the loop delimiting one of the two surfaces of the elementary entity concerned. In practice, to extract the 2D entity, we will fix a single surface among the two surfaces forming the elementary entity (cylinder case). Knowing that each surface of an entity is surrounded by a loop composed of two circular arcs (sometimes a point and a single arc when the surface is at the end of the entity, e.g., a cone with a pointed vertex) and two parallel 2D curves of the same type characterizing the surface nature of the entity (a line // to the axis in the case of a cylinder), by reason of symmetry, the cylinder can be represented by only one of the two non-circular curves (lines) bounded by two vertices which are the image of its two adjacent starting circular arcs (or else an arc and a point). However, for more structuring, this substitution approach must respect the 2D series association isomorphism graph established from the 3D one described previously. The transition from the 3D graph to the 2D graph is done as follows:

  • For each pair of non-circular profiles of the loop delimiting one of the two fixed surfaces forming the elementary entity, we associate a profile representing among the two profiles of the loop.

  • Knowing that each element of the pair of arcs of a loop is delimited by two Vertex StartArc and FindArc, we associate with each element of the pair of arcs, among StartArc and FindArc, only two vertices: the first represents the adjacency vertex of the arc with the chosen non-circular profile, and the second represents the center of this arc.

Finally, an elementary entity i will be modeled in two dimensions by (1) a numbered vertex i representing the 2D curved entity of the initially extracted entity I and (2) two pairs of vertices (Varci, Vcentrei) and (Varci + 1, Vcentrei + 1). Varci and Varci + 1 define the limits of the 2D curve and are at the same time the images of the two adjacent circular arcs upstream and downstream of this curve, and Vcentrei and Vcentrei + 1 define the axis of revolution from which the elementary entity was generated by revolution of the corresponding 2D curve (Fig. 15). It is important to note that the two vertices Varci and Varci + 1 will be respectively the possible points of adjacency (of connection) of the entity i with its predecessor i − 1 and its successor i + 1.

Fig. 15
figure 15

Elementary graphs of different types of 2D entities that can be present in a revolved part

For the construction of the total isomorphism graph of the part in 2D mode from 3D, (1) we replace each surface entity i by its profile i from which this entity was generated, and (2) we replace each circle Ci of junction between the entity i and i + 1 by the pair of vertices (Varci + 1, Vcentrei + 1). Finally, the modeling of the final part is a series association of elementary 2D entities connected by fusion of the common vertices as shown by the isomorphism graph of Fig. 16 below:

Fig. 16
figure 16

Graph model obtained by series association of the different elementary features of the turned part

For the construction of the total isomorphism graph of the part in 2D mode from 3D, (1) we replace each surface entity i by its profile i from which this entity was generated, and (2) we replace each circle Ci of the junction between the entity i and i + 1 by the pair of vertices (Varci + 1, Vcentrei + 1). Finally, the modeling of the final part is a series association of elementary 2D entities connected by fusion of the common vertices as shown by the isomorphism graph of Fig. 17 below:

Fig. 17
figure 17

Diagram for determining the linear curve for the generation by revolution of a simple cylinder

3.6 Differentiation between interior and exterior entities by dressing the graph

3.6.1 Situation

The differentiation between external and internal entity is a decisive stage for the constitution of internal and external turning entities since their method of machining can be distinguished between the two types. Much research has dealt with their CAPP systems only with exterior turning and have neglected interior turning despite the need for complete machining of parts [10, 11, 29, 33, 34]. The algorithms used to classify a machining entity as an interior entity (depression) are few in number and are the basis of rules [35,36,37], image processing [38], ridge orientation [30] and the concavity of the edge shared between the entity and its bearing surface [39].

To isolate the interior entities from the exterior entities, we will rely on a careful reading of the CAD file STEP AP203 of the part. It is recognized that STEP AP203 largely preserves the information of the initial B-Rep model (geometry and topology). Recalling that a massive part is modeled, within the framework of this format, by the entity shell which is delimited by its border surfaces, the difficulty in identifying protrusions and depressions for a given room is the existence of great similarity between the two in terms of type of surfaces and topology. Thus, a protrusion formed by a cylinder and a depression formed by a hole (Figs. 18, 19) are both defined by the same type of cylinder surface and are both surrounded by two circular loops, BInt and BExt. Without the use of other attributes of these two entities, such as concavity, identification becomes very difficult.

Fig. 18
figure 18

Comparison of a cylindrical protrusion and a cylindrical depression on the basis of their geometric and topological definitions

Fig. 19
figure 19

Categories of turned parts and their isomorphism graphs

In what follows, the term depression designates, for us, a cavity which has an entrance (or an exit for the emerging cavities) and which can be formed by several types of surfaces of revolution chained in series (like a cave) from the entry of the cavity to its end. On the other hand, all the surfaces in series forming the cavity necessarily have the same axis of symmetry.

In the previous work developed by our PhD student Oussama Jaider, a system called CAPP-Turn was designed taking advantage of the performance of the two standards STEP and STEP-NC. This system is made up of four modules:

  • Module 1: This module translates the geometric and topological information contained in the part's STEP AP203 CAD file, written in the EXPRESS language, into Python entity classes. In a second step, it maps entity instance parameters to Python class attributes. Mapping scripts are developed for each class in order to establish a link between its parameters and its attributes.

  • Module 2: This module is an autonomous system of automatic recognition of turning entities which consists in analyzing the objects created (surfaces: geometry and topology) and applying rules (rule-based approach) to construct machining entities based on a library of predefined feature classes.

  • Module 3: In the third module, an entity combination generator (ECG) is developed. This system analyzes the boundary surfaces of entities to decide whether the extracted entity is simple or interacting. The interacting entities are transformed into simple entities by extrapolation from their material surfaces to the stock surface. The elaborate system allows multiple interpretations of entities to be generated, leading to a range of part machining sequencing choices.

  • Module 4: In the fourth module, two systems are designed, one called entity eliminator (EE) and the other shoulder generator (GE). The first system consists in excluding a few unwanted ranges, generated by the GCE module, based on the manufacturing rules and the principles of material removal. This considerably reduces the number of entity interpretations. The second system presents a new approach to remedy the drawbacks of the method of extrapolation of module 3, in particular in the presence of the shoulders interacting at a non-right angle. This previous work was focused on the case study of parts with simple basic entities or in the best case with shoulders in mutual interaction, in order to give more interest to the implementation of the new STEP-NC standard and facilitate its integration. Also, the algorithms used in the entity recognition step (core of the system) have been restricted to exterior filming. From this perspective, these algorithms deserve to be reviewed to bring more structure to the system and also to deal with the cases of turning parts presenting internal entities and complex profiles.

3.7 Differentiation between interior and exterior entities by dressing the graph

The turning part is expressed by the following model:

$$\mathrm{Turning}\;\mathrm{part}=\mathrm{External}\;\mathrm{features}+\mathrm{Internal}\;\mathrm{features}$$
  • Exterior Features of a Part = A series association of surfaces that includes exterior side surfaces, exterior front surfaces, exterior radial depressions and exterior frontal cavities.

  • Interior Features of a Part = A series association of surfaces that includes interior side surfaces, interior front surfaces, interior radial depressions and interior frontal cavities.

It should be noted that the two interior and exterior parts of the room are linearly independent and are connected on the left by the adjacency circle located at the extreme bottom left of the room. Similarly, on the right, these two parts share the adjacency circle located at the extreme bottom right of the same room.

a. First reading of the isomorphism graph of a turning part

Figure 20 a–d present the main machining features which may appear on a turning part: the exterior surfaces, the interior bores, terminals and outlets executed along the axis, the front exterior and interior depressions.

Fig. 20
figure 20

Encapsulation criterion between two adjacent surfaces of a turning part

The representation of this category of cylindrical parts by the graph method, described previously, makes it possible to highlight two types: the first type is an open graph made up of a series association of surfaces linked by circles of adjacency (Fig. 19a and b).

The second type is described by a closed graph (Fig. 20c and d) composed of a continuous sequence of surfaces in a loop formed.

Our methodology consists of first identifying the cavities of a frontal nature that exist on the part and then eliminating them, as these cavities complicate the process of recognizing features of the part. Without the presence of these cavities, we will only have the cases of parts presented in Fig. 20a–c.

b. Mathematical concepts, definitions and terminologies

Before approaching the analysis for the differentiation of the external entities from the internal entities, it will be interesting to introduce some definitions and terminologies which will be used to describe the method we are going to adopt:

  • b.1 Definition of the tree of a graph

    A tree is a continuous path extracted from the graph of the part, such that by traversing it, we do not encounter the same vertex twice: in our case, it is an open chain of surfaces connected two-by-two by circles of adjacencies

Principle of surface encapsulation

Given two adjacent surfaces F and G of a turning part and their associated curves of revolution f and g, the function f is defined on the interval [\({z}_{1}^{1}\),\({z}_{2}^{1}\)] and g on [\({z}_{1}^{2}\),\({z}_{2}^{2}\)] and they share the adjacency point of abscissa \({z}_{2}^{1}\)\({z}_{1}^{2}\). The entity f/F can encapsulate g/G (and vice versa) only if the two functions are of different monotony, i.e. one is increasing and the other is decreasing. Thus, in the case of Fig. 20a, f/F cannot encapsulate g/G because the two functions f and g are strictly increasing. On the other hand, in the case of Fig. 20b, f covers g because f is strictly increasing and g is strictly decreasing. The same reasoning remains valid if F and G consist of a set of n surfaces, arranged in series and with the same monotony: F = {F1 + F2 + … + Fn} and G = {G1 + 2 + … + Gm} Fig. 20c and d.

The encapsulation of surfaces can be full or partial, simple or multiples. Figure 21a and b show a partial encapsulation where the functions 1 + 2 + 3 partly encapsulate 4 + 5. The encapsulation in Figs. 22, 23a is simple because it is made only once per f, while this encapsulation, Fig. 21b, is multiple (double) because entity 5 is covered twice: firstly, by entity 4 and secondly by entities 2 + 3. In the same way, Fig. 21c presents a type of full-simple encapsulation, and Fig. 21d a full- multiple encapsulation.

Fig. 21
figure 21

Different types of encapsulations of surfaces of revolution

Fig. 22
figure 22

Different types of graph trees for a cylindrical part

Fig. 23
figure 23

Differentiation between exterior and interior features

  • b.2 Classification of the different trees of a graph

    Different trees can coexist in the total graph of the part, as shown in Fig. 22:

    • AEEL lateral exterior entity tree: formed by a series chaining of lateral exterior surfaces which are not encapsulated by any other surface (Tree 1, Tree 41, Tree 34, Tree 302, and Tree 24–25-26).

    • AEEF frontal external entities made up of a series association of frontal external entities which may or may not include external frontal depressions (Tree 23, Tree 2–31, Tree 42–43-44–45, Tree 35–361, Shaft 37–38-39–40, Shaft 303–31-32–33 and Shaft 27–28-29–301).

    • AEILA axial lateral interior entity that consists of a series chaining of axial lateral interior surfaces. These constituent surfaces do not encapsulate any other surface (Tree 41, Tree 8–9, 102, Tree 14, Tree 16 and 222).

    • AEIF frontal interior entity tree: formed by a chain of frontal interior entities which may or may not include interior frontal depressions (Tree 15, Tree 42–5-6–7, Tree 101–11-12–13 and the Tree 17–18-19–20-21–221).

    • AEID breakthrough internal entity tree: formed by a series of AEILA and AEIF series which opens out on both sides of the room.

AEIB terminal inner entity tree: formed by a series chaining of AEILA and AEIF which emerge from one side of the room.

AEE: external entities formed by a serial association of AEEL and AEEF (example: Tree 23–24-25–26).

  • b.3 Differentiation between internal and external turning entities

    Identification of an internal entity tree AEIB terminals:

    When the graph of the part is open and there is only one entity at the end of the graph that coincides with one of the two entities at the end of the part, we will have the presence of an AEIB. If the two coincide, there are two AEIBs. It is necessary to specify that in the case of an open graph of parts with terminal axial cavities, the start of the cavity and its end are fully identified when the end of the graph is associated with its axial position in the part.

    Identification of an AEID entering internal entity tree:

    Unlike solid parts or solid parts that have one or two AEIBs, axially open cavity parts are identified by a closed loop graph. Although for this category of parts the two ends of the through axial cavity can be given from their position, the shaft corresponding to this depression cannot be identified because the end corresponds to a point of adjacency shared between this shaft (interior nature) and another exterior type tree. To solve this problem, we are going to proceed to a section, well chosen, offset axially with respect to each end. Indeed, in Fig. 23, the two entities 1 and 2 share the circle of adjacency C1-2.

In case 1, since the abscissa \({z}_{2}^{1}\) of the end circle of entity 1 is less than the abscissa \({z}_{2}^{2}\) of entity 2, for simplicity, the radius comparison section is chosen at this position. For the same reason, this comparison is maintained at the position for case 2. For case 1 where \({z}_{2}^{1}\)\({z}_{1}^{1}\)  < \({z}_{2}^{2}\)\({z}_{1}^{1}\), if the radius of entity 1 corresponding to the axial position \({z}_{2}^{1}\) is greater than the radius of the section of 2 executed at the same position, we conclude that the entity 1 is the strictly encapsulating surface of exterior nature, and 2 is the interior surface encapsulating of interior type. Otherwise, 2, the same procedure is to be applied only the section will be executed this time to element 1 at position \({z}_{2}^{2}\).

The calculation of the radii, at the section chosen, depends on the nature of the envisaged surface. Table 4 summarizes the different necessary mathematical formulations established to approach this calculation. Since the B-spline curves used in the revolution operation are specific parameterized curves, we use the approach presented in Appendix Table Six for the calculation of the radius of the entity chosen at the specified section, and this in relation to the data provided by the STEP file for this type of curve. The established algorithm has been programmed and tested using Maple V 11 software.

Table 4 Determination of the abscissa z of any section for specific features
  • b.4 Detection of interacting frontal depressions

    Frontal depressions can be exterior or interior in nature, as previously indicated in both Figs. 20d and 24. Exterior frontal depressions are part of the AEE outer entity trees, while interior frontal depressions are a subclass of AEIB/AEID. These entities, when interacting with other entities of a different type, greatly complicate their identification and the sequencing of their machining. Thus, it will be important to draw up a method allowing one to analyze these overlapping entities with a view to sharing them into simple entities easily recognizable by applying the rules formulated previously.

    Fig. 24
    figure 24

    Criterion for the existence of a frontal depression between two adjacent surfaces of revolution

  • b.4.1 Mathematical formalism

Given a surface F of any type of a part of revolution and G its adjacent surface (Fig. 24 below).

Let f = f (z) and g = g (z) be the two curves used respectively for the generation by revolution of the two surfaces F and G. The function f is defined on the interval [and g on [. Knowing that f = f (z) and g = g (z) are two monotonic functions (increasing or decreasing), if the two functions f (z) and g (z) have the same monotony (Figs. 25, 26a), then the two surfaces F and G cannot present a frontal depression (protrusion) at their junction point z2. Otherwise, a depression (protrusion) necessarily exists as indicated in Fig. 26b. In the same way as before, this reasoning can be extrapolated if we substitute F by = F1 + F2 + … + Fn and G by = G1 + 2 + … + Gm.

  • b.4.2 Adaptation of the formalism in the detection of frontal depressions

Fig. 25
figure 25

Basic indicator to test for the presence of a depression/protrusion

Fig. 26
figure 26

Processing of frontal interacting entities of the external type

Recalling that in our case a part is modeled by a graph of entities arranged in series. The mathematical formalism introduced can be applied without modification when all the generating functions by revolution associated with the different entities of the graph are monotonic. However, in the real case, a function associated with a surface is any function and can have parts of various monotonies. We proceed, in this case, to a discretization of the domain of definition of the associated function in intervals within which this function f keeps the same monotony. Each interval will be associated in the total graph of the part with a new sub-entity whose associated function is monotonic. Because of the assurance in advance of the monotony of all the functions associated with the polygon entities participating in the construction of the total graph of the part and to simplify the setting evidence of the change of direction in z direction characteristic of the presence of a depression/protrusion, we are going to traverse the graph entity by entity from a specific entity until its entire traversal. We will assign, for each entity i, an indicator of change in monotony quantified by the difference D between the abscissa \(\overrightarrow{{z}_{1}^{i}}\) of its beginning and \(\overrightarrow{{z}_{2}^{i}}\) the abscissa of its end (Fig. 25):

Next, we dress the top of each entity on the part graph with a + sign if d is positive, a − sign if d is negative and 0 if this indicator is zero.

  • Treatments for interacting frontal depressions:

This treatment is carried out for all linearly independent tree AEEFs identified from the part. The first tree identified is given by Fig. 26b.

The processing of external interacting front-end entities begins with entity 1 which is located at the extreme top left of the room, i.e., from the vertex materialized by the circle of adjacency C1-2 (Fig. 26a). The general study of interacting frontal entities is established from Figs. 27, 28 above. We assume that for any entity i, the process of dealing with interacting entities is already established for all entities above it. Locally, the vertex i is seen as a point of connection of two entities of different nature: exterior i located above and interior i + 1 located below. The polygon entity i + 1 encapsulates all the polygon entities positioned below and to the right of vertex Ci−i + 1. Only the entity j whose vertex is located on the left is partially encapsulated. This last entity marks, in fact, the end of the encapsulated surface chain and forms the second wall of the frontal depression. Therefore, the entity j will be separated into two zones: the portion jd on the right side of Ci−i + 1 which is entirely encapsulated and the other free part on the left jg which remains not covered by any surface. The latter will be declared as a surface sub-entity of an external nature. The separation between the two entities is practically achieved by constructing the vertical plane surface (a matter of simplification which is in accordance with machining practices) lost by interaction during the machining of the two entities. This new reconstituted frontal surface is delimited by the two circular loops Ci−i+1 and Cjd−jg.

Fig. 27
figure 27

Decomposition of the compound depression into simple elements

Fig. 28
figure 28

Possibilities for the sequencing of the machining of a compound frontal depression containing two peaks

Finally, the desired frontal depression is given by the tree given in Fig. 26c. This depression is bounded by the two entities i and jd.

This algorithm is repeated for the second branch (AEEF) connected on the left side of 1. Once the two front branches linked to 1 are processed, we go directly to the next AEELEG tree. This operation is ensured by removing from the total graph of the part the starting AEELEG and the treated front branch. The process ends just after processing the last front branch connected to the right of the AEELED tree.

  • Interacting frontal depression of the interior type:

The same reasoning is applied except that it is necessary to start with the first domain bounded by the strictly encapsulated interior surface located at the extreme top-left of the part (AEIAG) and the first entity found by following the graph which is of the same nature. The scanning process is also carried out from left to right up to the front branch located just before the last AEILAD tree in the part.

  • Filtration of simple frontal depressions of compound frontal entities:

Definition: A frontal depression is said to be simple if:

  1. a.

    it does not include any vertex between its two border vertices Ci−i + 1 and Cj;

  2. b.

    the two vertices Ci−i + 1 and Cj are located at the same axial position.

In case the depression includes several peaks like the depression treated above (Fig. 26), it is isolated to address its decomposition (Fig. 27):

This depression is given by the following tree:

figure e

Several ways of approaching its machining can be envisioned, and therefore its decomposition or not remains dependent on the method to be applied. In terms of productivity, it is advantageous to start a mass machining; in this case the shape machining using a tool with the desired profile is preferable. However, tool wear is one of the decisive factors in determining the choice. Casing machining can also be used when accessibility of the tool and a smooth and desirable surface condition are ensured. However, without privileging one method, we will be interested, in the following paragraph, in the generation of these different ways of executing this frontal groove and of its decomposition and its discretization into elementary elements as described in the figure above.

To begin machining by part of the front groove studied, the first material removal is carried out frontally up to the first ridge located just to the right of the vertex Ci−i+1 (Figs. 28, 29). This will allow us to simplify the machining strategy and the profile of the tool to be used in case of form machining. This volume of matter is obtained by projecting radially the vertex just to the right of Ci−i+1 onto the above faces i + 1 and top face jd (radial tangent to this vertex). This projection allows the subdivision of the entity i + 1 into two segments: one on the left i + 1 g and the other on the right i + 1d. In the same way the entity jd is divided into two portions jdd and jdg, two new separation planes are created which are delimited respectively by the circle of adjacent Ci + 1 g−i + 1d and Cjdd−jdg and the one relative to the first projected vertex. Three volumes of material are therefore generated by the sectioning of this initial frontal depression: the first (1) consists of the loop section Ci−i+1 − Ci+1 g−i+1d − Cjdd−jdg − Ci+1 g−i+1d, the second (2) corresponds to the tree given by traversing the tree of the graph of the frontal pressure from Ci+1 g−i+1d until Cjuste_droite_Ci−i+1 (opposite direction of the path leading to Ci−i+1) and the third is given by the remaining section which is defined by traversing the tree of the graph of the frontal pressure from Cjdd−jdg to Cjuste_droite_Ci−i+1 (opposite direction of the path leading to Cjd−jg). Depression 1 is a simple depression and is subsequently removed from the subgraph of this entity.

Fig. 29
figure 29

Dressed isomorphism graph of the example part considered

The algorithm is repeated for the two depressions 2 and 3 defined by their new graphs until there are only depressions of a simple nature. Figure 28 illustrates the different possibilities of interpretating the sequencing of the frontal depression studied by application of the developed method.

3.8 Summary of recognition procedure for different feature trees

The synthesis of the developed method to recognize the different types of trees existing in turning the part is given as follows:

  1. 1.

    Identification of the simple surface entities of the part.

  2. 2.

    Drawing of the part isomorphism graph (Fig. 29).

  3. 3.

    Study of the generating function by revolution of each non-standard surface entity and division into parts of curves which are monotonic.

  4. 4.

    Identification of the tree of the lateral exterior entity located at the extreme top left of the room: AEELEG.

  5. 5.

    Dressing of each surface entity of the graph by a + sign if its generating function by revolution is increasing, 0 if the entity is a vertical plane and − if it is decreasing. This skin is established by continuously scanning the graph (adjacent by adjacent) from the right end of the AEELEG to the end of the graph (Fig. 30).

  6. 6.

    Identification of terminal or through-axial depressions with the algorithms established for this object.

  7. 7.

    Elimination of the trees of these depressions to facilitate the identification of the exterior frontal depressions and addition of two vertical planes delimited respectively by the adjacency circle located at the extreme left and at the extreme right of the room (Fig. 31). Finally, the general flowchart for the recognition of the different entities is given in Fig. 33.

Fig. 30
figure 30

New dressed isomorphism graph of the example part considered after elimination of the trees of the interior entities

Fig. 31
figure 31

Organizational chart of recognition of filming entities

4 Conclusion

Based on the hybrid graphs/rules AMFR approach, we propose in this paper a novel compliant CAPP-STEP-NC system for machining rotational parts. The AMFR firstly decodes the basic geometrical and topological entities from the part’s ISO AP203 CAD STEP file and reconstitutes them as machining features by applying established rules which are stored in the internal library of the system. Secondly, these detected features are converted into normalized entities according to the ISO 14649 standard. After defining the manufacturing parameters, the machining strategies and the cutting tools, and their mapping to the attributes of the classes of the same ISO standard 14,649, the writing of the final STEP-NC file for machining the part is generated.

This AMFR algorithm, powered and structured using tree modeling, is capable of the following:

  1. 1.

    Recognizing and differentiating between external and internal features by giving their graph/tree replacing the classic method of individual feature recognition

  2. 2.

    Identifying frontal and axial features for each external and internal identified graph-tree

  3. 3.

    Selecting interacting features from simple features and allowing suitable treatments to give alternative sequencing to ensure their machining.

The AMFR algorithm was developed and validated using a practical case of a turning part containing diverse features: external/internal, simple/interacting and axial/frontal.

The purpose of this work was to implement the new standard STEP-NC in a CAPP turning process and remedy the shortcomings of ISO 6893 G-code to overcome modern manufacturing demands. To that end, a new consistent-fast algorithm that allows the extraction of a part’s machining turning entities with improved efficiency and complex geometry was elaborated. Further, this work introduced the main machining entities defined within the framework of this standard and explained the different parameters necessary for unambiguous definition of these entities whether of a geometric, topological or other nature.

As mentioned, the AMFR of the elaborated CAPP-Turn is based on a smart algorithm that can handle the common turning features, thus ensuring machining of rotational parts with complex geometry. In addition, the algorithm includes detection and treatment of the frontal turning features, because we believe that these features have not received sufficient attention by researchers despite their functional aspects in mechanical systems that justify their presence in numerous designed parts (labyrinth seals, seal positioning, thrust bearing, etc.).