MBD Based 3D CAD Model Automatic Feature Recognition and Similarity Evaluation

Automatic Feature Recognition (AFR) is considered as the key connection technique of the integration of Computer Aided Design (CAD) and Computer Aided Process Planning (CAPP). At present, there is a lack of a systematic method to identify and evaluate the local features of 3D CAD models. The process information such as topological structure, shape and size, tolerance and surface roughness should be considered. Therefore, a novel Model Based Definition (MBD) based on 3D CAD model AFR and similarity evaluation are proposed in this paper. A Multi-Dimensional Attributed Adjacency Matrix (MDAAM) based on MBD is established based on the fully consideration of the topological structure, shape and size, surface roughness, tolerance and other process information of the B-rep model. Based on the MDAAM, a two-stage model local feature similarity evaluation method is proposed, which combines the methods of optimal matching and adjacency judgment. First, the faces of source feature and target model are used as independent sets to construct a bipartite graph. Secondly, supplement the vertices in the independent set of source feature to make the number of vertices in two independent sets equal. Thirdly, based on MDAAM data, the weighted complete bipartite graph is constructed with the face similarity between two independent sets as the weight. Fourthly, Kuhn-Munkres algorithm is used to calculate the optimal matching between the faces of source feature and target model. Fifthly, the adjacency between matching faces in target model is judged. Finally, the similarity between matching faces of the two models is calculated, which is used as the similarity evaluation result. The effectiveness of this method is verified by three applications.


I. INTRODUCTION
Automatic Feature Recognition (AFR) refers to the extraction of feature information with specific engineering semantics from part models. Computer Aided Design (CAD) model of part is composed of low-level graphic elements such as faces, lines, points and etc., while Computer Aided Process Planning (CAPP) information is generated based on high-level features with engineering semantics, such as holes. There is a lack of an intelligent interface for feature recognition between CAD and CAPP. AFR can identify the corresponding structural features according to specific process requirements, which is the basis of process design and the most important step to transform design information into manufacturing The associate editor coordinating the review of this manuscript and approving it for publication was Donato Impedovo . process information. With the help of AFR, structure features can be identified according to specific process information, which is considered the most crucial technique to turn design information into manufacturing process [1].
In recent years, research in feature recognition has received significant attention, but the traditional research on feature recognition mainly focuses on the topological structure and face geometry of the model, without considering its process information. If the surface roughness and tolerance level of two models with identical topological structure and geometric dimension have a significance difference, their machining process may be completely different. Therefore, in the process of feature recognition and similarity evaluation of work pieces, it is necessary to consider their process information such as surface roughness and tolerance of the main faces in addition to topological structure and shape size. The traditional CAD model only records the topological structure, shape and geometry information, but cannot obtain the process information. Model Based Definition (MBD) is a model-based method for defining product data. Based on the topological structure and geometric data of the model itself, process information such as surface roughness, tolerances and annotations are added. Therefore, MBD based 3D CAD model similarity evaluation can not only solve the problem of model appearance similarity evaluation, but also can compare the process information of models, which expands the scope of information comparison and makes the model comparison result more accurate.
Based on the similarity of appearance and process, this paper proposes to address the problems of identifying similar local feature in target model and evaluating the similarity with source feature. The model from which local feature is searched is called target model, the model used for comparison is called source model, and the local feature used for comparison in source model is called source feature. First, the information set of the B-rep representation of source feature and target model is extracted, and then the MBD based Multi-Dimensional Attributed Adjacency Matrix (MDAAM) is constructed. Secondly, the faces of source feature and target model are taken as independent sets respectively, and the similarity between the faces of above two independent sets is taken as the weight to establish weighted complete bipartite graph. Thirdly, Kuhn-Munkres algorithm is used to find the optimal matching between two independent sets, and the adjacency between faces retrieved from the target model is determined. Finally, the similarity of matching faces between source feature and target model is evaluated.
The issues discussed in this article can be concisely described as follows. A face group is selected from source model as the source feature, and then the feature which is the most similar to the source feature is found from the target model as the local feature to be retrieved. At last, the similarity between source feature and local feature retrieved from the target model is calculated.
The remainder of the paper is organized as follows. Section 2 reviews the literature relating to feature recognition. In Section 3, method of information extraction from MBD based B-rep representative is introduced. In Section 4, MBD based MDAAM is constructed. In Section 5, MDAAM based AFR method and similarity evaluation method are proposed. The proposed methods are validated through a case study in Section 6, followed by conclusions in Section 7.

II. LITERATURE REVIEW
In order to identify the characteristics of different kinds of CAD models automatically, active research in the field of AFR has developed numerous techniques and systems, such as syntactic pattern recognition [2], artificial neural network [3], shape signatures [4], graph-based, rule-based, hybrid approach, etc. But some of the techniques have not been fully developed because of their limitations. For example, syntactic pattern recognition approach uses string based pattern recognition and natural language processing, with which it is difficult to express complex topological and geometrical structure of 3D models.

A. GRAPH-BASED FEATURE RECOGNITION
Graph-based feature recognition is one of the most studied methods [5]. It is difficult to identify features directly from the raw form elements directly extracted from the model. It is necessary to construct high-level semantic information as the basis of feature recognition by using the adjacency relationship between the faces in model and the attributes of each component element. So, in order to facilitate the recognition process, the concept of Attributed Adjacency Graph (AAG) built on the underlying B-rep is proposed by Joshi and Chang [6]. AAG is constructed by mapping model faces with vertices and mapping intersection lines between faces with edges, which is used to represent the topological structure and basic shape properties of the model. AAG is defined as a graph G = (N, A, T), where N is the set of nodes, A is the set of arcs and T is the set of attributes to arcs and the relationship between faces. The representation of AAG in computer can be a matrix, which is Attributed Adjacency Matrix (AAM) [7]. AAM is expressed as M = (C, R, A[C,R]), where C is the set of columns, R is the set of rows, and A[C, R] is the set of predicates of joint element in the matrix. C and R are mapped to faces and A[C, R] is mapped to joint element, which is used to express the relationship between faces.
Later, with the help of AAG and AAM, scholars have done a lot of work on feature recognition and similarity comparison. For example, Liu et al. [8] proposed a method to address the problem of extracting the Maximum Turnable State (MTS) with a AAG decomposition strategy. The feature recognition problem is handled by matching the feature shape descriptors with the descriptors of local element combinations out of the delta volume mesh. El-Mehalawi and Allen Miller [9], [10] proposed a kind of attributed graph to represent STEP format model, in which the nodes correspond to the surfaces of component, the links correspond to the edge and the attributes represent some primitive attributes of faces or edges. On the base of attributed graph, a method of retrieval and matching models is introduced by, which describes the topology of the model with nodes and arc, and depicts some limited shape information with attributes. Comparison between models is accomplished based on comparing the nodes' surface type, the nodes' number of edges, and on the edge compatibility.
In the aspect of model local identification and similarity evaluation, Zhang et al. [11] proposed a typical structure mining and similarity evaluation method of 3D model based on simulated annealing. By extracting the type of model edge, the angle between faces and the convexity of the edge, AAG and its association graph are constructed. The simulated annealing algorithm is used to detect the maximum clique in the association graph, so as to realize the mining and similarity comparison of typical structures. Liu et al. [12] proposed a hybrid feature recognition method based on graph decomposition and feature factor clustering. By decomposing AAG into Minimum Attributed Adjacency Graph (MAAG), the difficulty of cross feature recognition is avoided. By matching MAAG with pre-defined feature elements, feature factors are obtained, and the feature factors satisfying certain rules are clustered into composite features, thus the machining features of cylinder parts can be effectively recognized. However, the pre-defined feature elements in this method are mainly for rotary features, so the recognition range is limited.
In the aspect of overall similarity comparison, Wang et al. [13] used weighted bipartite graph optimal matching method to evaluate the overall similarity of 3D CAD model. The model surfaces to be compared are divided into different classes, and each type of face is matched respectively. And then, the model similarity value is obtained by adding the optimal matching values of various types of faces. When calculating the similarity between faces, only basic parameters, such as face area, shape, side length, are considered, and the model cannot be evaluated comprehensively.

B. RULE-BASED FEATURE RECOGNITION
Rule-based feature recognition is another most studied method. According to the predefined rules that are characteristic to the feature, rule-based system uses algorithms to recognize features from models. Scholars have done a lot of work on it. For example, Oussama et al. [14] proposed a rule-based method to recognize rotational features. In order to development an automatic classification of product shape information, Zehtaban and Roller [15] utilized AFR approach to retrieve design models. A rule-based feature recognition method based on Opitz coding system was proposed for the automatic classification, and the final result of this model implies a predefined group of features. Campana and Mele [16] represented one rule-based approach of feature recognition for Design for Additive Manufacturing (DfAM). Geometrical entities are defined as graph-based representation, which is used for comparison with rules of DfAM to find the possible critical issues for manufacturability.
But for rule-based feature recognition method, it is necessary to formulate predefined rules for each class of features to be identified, and the definition of feature rules is not unique, and traditional rule-based feature recognition methods are computationally expensive. In addition, it is quite challenging for intersecting features [17].

C. HYBRID APPROACH FOR FEATURE RECOGNITION
Combining the advantages of single conventional feature recognition method, such as graph-based, rule-based, hintbased, schema, grammar, knowledge-based and so on, hybrid approach can overcome the limitations of single recognition method and there are many examples of successful applications.
For example, Guo et al. [18] and Sunil et al. [19] independently proposed the graph and rule-based hybrid 3D feature recognition for recognizing machining features. Based on graph-based feature recognition method, Li et al. [20], Gao et al. [21], Rameshbabu and Shunmugam [22] combined the methods of heuristic rules, hint-based and volume subtraction techniques respectively to propose hybrid approach for complex features.
Fougères and Ostrosi [23] adopted a hybrid schema, grammar and graph, to represent a feature. A grammar is defined by a 4-tuple to express knowledge and intelligence, and a topological and geometric entity graph is used to represent the topological and geometric relation of a feature. Feature recognition is carried out by multi-agent system and performs three stages: regioning, virtual extension and feature identification. Borkar and Puri [24] proposed a system of Feature Extraction (FE) for 3D components, which is a hybridization of volume decomposition and knowledge-based approach based on artificial intelligence planning. Li et al. [25] proposed a hybrid AFR method to recognize intersecting features with planar faces and quadric surfaces, which is a combination of hint-based, AAG and ANN.

D. OTHER FEATURE RECOGNITION METHODS
In addition to the above traditional feature recognition methods, many scholars have made other attempts and achieved satisfactory results.
For example, Zhang et al. [26] and Shi et al. [27] proposed the deep learning framework of feature recognition respectively. The former uses Deep 3D Convolutional Neural Networks (3D-CNNs) termed FeatureNet to learn machining feature from CAD models of mechanical parts, and the latter adopts Multiple Sectional View (MSV) representation for feature recognition. Gao et al. [28] and Wang [29] employed optimization algorithm, such as ant colony searching algorithm and wavelet transform of surface boundary, to search the optimal face matching sequence between the two models. Kim et al. [30] and Bespalov et al. [31] suggested volume decomposition methods for feature recognition. Kim et al. employed non-overlapping volume decomposition to overcomes the problem of overlap of decomposed volumes and Bespalov et al. proposed a Scale-Space decomposition method to decompose 3D model into k sub-features to support matching and content-based retrieval of solid models.
Shi et al. [32] presented a feature recognition method using Heat Kernel Signature (HKS) for manufacturability analysis in Additive Manufacturing (AM). The proposed approach can identify geometric features and manufacturing constrains of different shapes. Al-wswasi and Ivanov [33] proposed a smart interactive automatic feature recognition methodology for recognizing the features of rotational parts, based on the extraction of the features' geometrical and topological information. Woo and Kim [34] introduced one approach of protrusion feature recognition using a quantitative measure of orthogonal bounding factor (OBF). Yeo et al. [35] suggested a method of feature recognition to generate a measurement path for 5-axis On-machine measurement (OMM). Based on the surface to generate an optimal measurement path, the coordinates are input at the position where the user desires to measure and the features are recognized.

E. DISCUSSION
The core of the above AFR method is to compare the predefined features or rules with target model to obtain the similar local features in target model. However, there is not one library of predefined features that can include all the possibilities of features, which could exist in a model. So, those methods are limited to the recognition of only a specific set of predefined features [1].
When compared with the predefined features in feature library, AAG only needs to express the adjacency relationship between faces and the angle relationship between faces, such as the convex or concave angle between two faces. According to the connection relationship between model faces, AAM is constructed and some graph theory related algorithms, such as subgraph isomorphism and optimal matching of complete bipartite graph, can be employed to compare the defined models in the model base and identify local features in target model. Different from the above, in order to identify local feature from target model, it is necessary to define the face adjacency relationship of models, as well as other data such as shape, size, process information, etc. In traditional AAM, only topological information and primitive attribute information is recorded. When comparing source feature with target model, due to the lack of information, especially the process information such as tolerance and surface roughness, it is impossible to judge the process similarity of models. So, it is difficult to accurately identify the local features similar to the source features from target model and evaluate their similarity.
If there is not enough basic information, the model recognition will cause a deviation. As shown in Fig.1, the topological structures of the two hexahedrons in (a) and (b) are the same, but their shapes are quite different. However, according to the above method, when the traditional AAM is used to evaluate their similarity, their AAG and AAM are the same, as shown in (c) and Formula (28). So, the similarity of the two models is 1, but this is obviously not the case. Therefore, it is necessary to make a further comparison based on the more detailed model information to evaluate the similarity accurately.
The main purpose of AFR between two models is to compare their manufacturability and provide data basis and premise for Automatic Computer Aided Process Planning (ACAPP). The machining method is determined by the process information such as tolerance and surface roughness, which is also an important factor to be considered in the process of feature recognition. Even if the topological structure and geometric shape of models are identical, there may be significant differences in processing technology due to different surface machining accuracy. It can be seen that there is no systematic and complete method to accurately retrieve model feature, especially in the aspect of process similarity. Based on the above research, a new feature recognition and similarity evaluation method is established by considering the topological structure of model, the type and shape of elements such as face and edge, as well as the process information such as tolerance and surface roughness.

III. MBD BASED B-REP MODEL INFORMATION EXTRACTION
Automatic extraction of model information is not only the data basis of feature recognition, but also the key of accurate model similarity evaluation. The previous research on automatic feature recognition and model similarity inspection has done a lot of work in the extraction of key information such as model topological structure and element shape, but details such as dimension, tolerance and surface roughness of model faces cannot be extracted. The expression of model is the basis of data extraction. In this paper, MBD based model is used as the data basis of feature extraction and similarity judgment. As a modelbased method for product lifecycle data definition, MBD adds tolerance, annotation and other process information on the basis of model topology and geometric data [36]. Therefore, the comparison and evaluation of process information can be added to feature recognition, which can improve the accuracy of feature recognition. At present, MBD has become a common model definition method. As early digital product definition standard, the definition rules of digital product were defined in ASME Y14.41, and then MBD product definition method was also defined in ISO 16792. In order to facilitate the standardized storage and reading of MBD data, STEP product digital standard is defined in ISO 10303 AP242 to manage model-based 3D engineering. According to the above product definition rules and product expression methods, most 3D software corporations have established data conversion interface for neutral format STEP, and also developed corresponding customized development tools, such as Creo toolkit of Creo software, UG Open provided by UG software, CATIA CAA of CATIA software, etc.
The extraction of model information in MBD is the foundation and key of automatic feature recognition. However, the existing 3D models are completed by different commercial CAD modelers. In terms of modeling method and data storage format, each type of software has its own proprietary data formats, which leads to the interoperability and CAD/CAM integration problems [37]. Therefore, it is difficult to find a general direct extraction method of 3D model information.
Although different kinds of models have different data structures, their expression schema is basically stable, mainly including CSG and B-rep [38]. Model is expressed with many small cubes in CSG schema, with which it is not easy to express the model with complex shape, so CSG is less used in the current 3D model system [39]. B-rep schema has been dominant because it uniquely defines the faces and their patterns in a solid, which represents topological structure of models in the form of a relational model.
At present, most modeling software supports B-rep schema representation. In B-rep schema, models are represented with faces, which are bounded by sets of edges. A group of adjacent bounded surface elements is applied to express the boundary of models.
There are two methods to extract the information of MBD based B-rep model. The first is to extract information by reading the STEP neutral format file of the model [40], [41], and the second is to utilize customized development tools provided by commercial CAD modeler [42]. Here we use the latter to establish the method of automatic model data extraction, which is used to construct the data basis of model feature recognition and similarity comparison. In this paper, taking Creo as an example, through its customized development tool Creo Toolkit, we extract the information of topology, geometry, tolerance and surface roughness from model to provide data basis for feature recognition and similarity evaluation.

A. EXTRACTION OF MODEL TOPOLOGICAL STRUCTURE INFORMATION
Topological structure is a graph that represents the relationship between faces and lines. The topological structure information of a model represents the connection between the faces and edges, which expresses its basic shape. It is the primary content of feature recognition and similarity evaluation. The main functions involved in Creo Toolkit are shown in Table 1.

B. EXTRACTION OF MODEL GEOMETRIC INFORMATION
The geometric information of MBD model mainly refers to the geometric shape, face area and line length of model. Here, the geometrical shape and area of faces, the shape and length of lines are extracted. The main functions involved in Creo Toolkit are shown in Table 2.

C. EXTRACTION OF TOLERANCE AND SURFACE ROUGHNESS
MBD model records the process information such as tolerance and surface roughness, which represents the process characteristics of the model. Here, size tolerance, form tolerance and surface roughness are extracted and processed. The main functions in Creo Toolkit are shown in Table 3.

IV. CONSTRUCTION OF MBD BASED MODEL REPRESENTING METHOD
MBD model contains not only topology and shape information, but also process information such as dimension, tolerance, annotation and etc. It is the premise of AFR and similarity evaluation to extract and express this information VOLUME 9, 2021  in multidimensional and multi-level form. In order to express the MBD based information set comprehensively and clearly, based on AAG and AAM, MDAAM is proposed to represent MBD based model, which describes the topology, geometry, process and other information of the model with multiple matrices. The MDAAM provides data basis for later AFR and similarity evaluation, as shown in Fig. 2.
In the preceding MDAAM, TM is the geometric carrier of the model, and its diagonal elements express faces and non diagonal elements express the lines between surfaces. On the base of TM, SM and GDM represents the shape of faces and lines. Their diagonal elements stand for the shape and area of the corresponding face in TM, and the non diagonal elements express the shape and length of the model lines. SRM and FTM express the face roughness and shape tolerance, and the corresponding tolerance values are expressed by its diagonal elements.
Before feature recognition, first extract the model information of faces and lines to construct TM, and then, according to the ID in TM, traverse their shape parameters, roughness and shape tolerance to construct MDAAM, which provide data basis for later AFR and similarity evaluation.

A. ESTABLISHMENT OF TM
The topological structure of model represents the connection relationship between faces and their intersection lines, which is the most important reference for model AFR and similarity evaluation. B-rep schema of a model records its detailed information about topological structure, so model topology can be established by extracting the information from its B-rep schema. With the help of graph theory, model faces are represented by vertices of the graph, and the intersection lines between faces are represented by connecting edges between vertices. Together with the attribute value reflecting the shape of face or line, AAG is constructed to represent the topological structure of model. In order to facilitate the use of model data, AAM is established by taking the vertices in AAG as diagonal elements and the edges between vertices as non diagonal elements. In the process of constructing AAG, the connection edges between model faces should be processed first. The faces of industrial products mainly include planar plane, revolving surface, cylindrical surface and other types of surfaces. In the B-rep schema of a model, a revolution or cylinder is composed of two parts, as shown in Fig. 3 (a) and (b). When extracting its information, it will be dealt as two faces [43]. According to the preceding information reading method from B-rep schema model, the AAG of the above two models is shown in Fig. 3 (c). However, the vertices connected by edges | and } in the graph are both C and D, so the AAM cannot be established directly because of the multiple edges.
In terms of the surface formation method, for the revolving surface shown in Fig. (a) and the ruled surface shown in Fig. (b), the intersection lines of the two half surfaces in B-rep schema are its generatrix on model surface. Therefore, the shape and size of two intersection lines in the surface of revolution or cylinder are exactly the same. For the convenience of representation and operation, the two intersection lines are simplified to one edge. The simplified AAG is shown in Fig. 3(d). After the preceding simplification, the AAG of the model with cylinder or revolution will no longer include multiple edges, which ensures the uniqueness of intersection lines of the two surfaces. The AAM established from Fig. 3 is shown in Formula (29), which is an upper triangular matrix.
According to the preceding method of establishing AAM, the first dimension matrix of MDAAM is established as shown in Formula (13), which is used to represent the topological structure of the model.
where, the diagonal elements in the matrix FT ii (i = 1, 2, . . . , n) represent the ID of model faces. Other elements ET ij (i, j = 1, 2, . . . , n) represent the ID of intersection lines between faces. When faces do not intersect, the value is assigned to zero. The above TM can be completed by traversing the faces and edges of model, and then retrieving the adjacent faces of model edges. Its pseudo code is as shown Algorithm 1.

B. ESTABLISHMENT OF SM
The elements in SM and those in the same position in TM represent the same element, which represents the shapes of the faces and edges in model. SM is the second dimension matrix of MDAAM, which is also an n-order square matrix. n represents the number of faces in the model. SM is as follows, where, the diagonal elements in the matrix SS ii (i = 1, 2, . . . , n) represent the faces of the model, and different values are assigned according to different types of faces. The definition is shown in Formula (5). Other elements represent the intersection lines between faces. When faces do not intersect, the value is assigned to zero. When face intersects with other one, different values are assigned according to the type of intersection line, as shown in Formula (6).
For the MBD model created by Creo, the two functions of ProSurfaceTypeGet( ) and ProEdgeTypeGet( ) are used to obtain the types of faces and edges respectively, and then the formulas (5) and (6) are used to convert them into integer. At last, write the integer to SM in the same position as TM.

C. ESTABLISHMENT OF GDM
The area of faces and length of intersection lines are the important factors to express the appearance of the model. They are also one of the details that need to be considered in the process of AFR, and important reference for similarity evaluation. It is the third dimension of MDAAM to use GDM to express the parameters of faces and lines of the model. Its definition is shown as follows, where, the diagonal elements in the matrix SGD ii (i = 1, 2, . . . , n) represent the area of the faces, which can be obtained by using the customized development function of software. For example, for a model created by Creo, the area of a face can be obtained with the help of ProEdgeLengthEval ( ) function. Non diagonal elements EGD ij (i, j = 1, 2, . . . , n) represent the length of intersection lines between faces. If two faces do not intersect, the element value is 0. For the model created by Creo, the length of a line can be obtained with the help of ProEdgeLengthEval ( ) function.

D. ESTABLISHMENT OF SRM
The roughness of machined face reflects the machining quality of mechanical parts, which is an important symbol of its quality grade. For the faces with different roughness, their processing technology are different, and different machine tools and processing methods will be used in process planning. SRX records the roughness of the mating faces and other important surfaces, so the non diagonal elements are zero, and it is a diagonal matrix, shown as follows, where, the matrix diagonal elements represent roughness of faces. For a face, if the surface roughness is obtained, its value is the roughness value; if the roughness cannot be retrieved, its value is zero. For the model created by Creo, surface roughness array is retrieved with the help of ProSolidSurffin-ishVisit ( ) function, and then obtain the value of roughness using ProSurffinishValueGet ( ) function and get the face reference where the roughness lies by ProSurffinishRefer-encesGet ( ) function.

E. ESTABLISHMENT OF STM
Size tolerance reflects the machining accuracy of parts and the matching properties of assemblies. For parts with different tolerance grades, the processing complexity and cost are also different. Therefore, size tolerance is also a factor to be considered in the process of AFR and similarity evaluation. For most models, the assembly tolerance between hole and shaft is the key factor, so here we mainly consider the tolerance grade and deviation of hole and shaft. Such tolerance only exists on rotary surface, so STM is a diagonal matrix, which is defined as follows, where, elements ST ii (i = 1, 2, . . . , n) represent the size tolerance of revolving surface, which are character data and consist of four characters. The first two are letters, indicating fundamental deviation, and the last two are numbers, indicating tolerance grade. Its value is generally between 05-12, which is consistent with the tolerance grade of common hole and shaft fit. For example, the size tolerance of ϕ100H7 is expressed as 0H07. If there is no tolerance requirement on the surface, the value is 0000.

F. ESTABLISHMENT OF FTMG
Form tolerance determines the main machining methods of part surface, and it is also one of the references for AFR and similarity evaluation. Here six types of form tolerance is utilized: straightness, flatness, circularity, cylindricity, Profile of a line and profile of a surface. All of these tolerances are applied to model faces, so the matrix is diagonal. In the actual modeling process, some faces may have more than one kind of shape tolerance based on process requirements. Therefore, each element of the shape tolerance matrix is defined by a six-dimensional array, which is called FTMG. Its definition is as follows, (6) . . .
where, the elements FT ii (6) (i = 1, 2, . . . , n) represent the form tolerance array of model face, and 6 is the dimension of the array. Array elements consist of form tolerance types and their values, which are defined as follows, ST * * straightness FL * * flatness CI * * circularity CY * * cylindricity PL * * profile of a line PS * * profile of a surface 0 no form tolerance (j = 1, 2 . . . , 6) (11) where, ST, FL, CI, CY, PL and PS stand for tolerance types, and * * are tolerance values.

V. MDAAM BASED MODEL LOCAL FEATURE RECOGNITION AND SIMILARITY EVALUATION
On the basis of the above mentioned MDAAM information set, a two-stage local feature recognition and similarity evaluation method combining optimal matching and adjacency judgment is proposed. Bipartite graph is constructed based on the independent sets formed from the faces of source feature and target model. And then, based on MDAAM, the similarity of each pair of vertices between source feature and target model is calculated, which is used as the weight of the connecting edge of bipartite. With the preceding independent sets and weight, weighted bipartite graph is constructed. The Kuhn-Munkres algorithm is utilized to find the optimal matching between source feature and a local feature of the target model, in which the sum of matching degree is the highest among all matching schemes. Then, adjacency judgment is made for the optimal matching local face set of target model, so as to exclude isolated faces and ensure the continuity of the retrieved faces. Finally, the similarity of the optimal matching faces between the local feature of target model and the source feature is calculated to complete the similarity evaluation. In this paper, the following rules are formulated for the evaluation of face similarity between models: Rule 1: The similarity evaluation between models includes appearance evaluation and manufacturability evaluation. The former refers to the evaluation of the similarity of topological structure, shape of face and edge, and all kinds of sizes between models. The latter refers to the evaluation of the similarity of process information such as machining tolerance, surface roughness and etc.
Rule 2: If the types of the matching faces are different, the similarity between the two faces is considered to be zero. Only faces of the same type have non-zero similarity coefficients.

A. CONSTRUCTION OF WEIGHTED COMPLETE BIPARTITE GRAPH
In order to express the similarity between the faces of source feature and target model, a bipartite graph G is established VOLUME 9, 2021 with the faces of the two models as independent sets and the path from the face of source feature to the face of target model as edge, which is shown as follows, where, V S is the independent set established with the source feature faces as vertices, V T is the independent set established with the target model faces as vertices, and E is the edge set between V S , and V T . In general, the number of vertices in source feature is less than that in target model. Therefore, it is necessary to add supplementary faces to the independent set of source feature, so that the number of vertices in the two independent sets is equal.
Complete bipartite graph is constructed by adding connecting edges established from each face in the independent set of source feature to all the faces in independent set of target model. If the number of supplementary faces added is h, then there is, where, |V S | is the number of vertices in the independent set of source feature, that is, the number of source feature faces.
|V T | is the number of vertices in the independent set of target model. The weight of each edge in the bipartite graph is calculated based on the face similarity between source feature independent set and target model independent set. When doing this, the main factors considered include the type similarity TY, shape similarity SH, surface roughness similarity SR, size tolerance similarity ST and form tolerance similarity FT between source feature and target model. In order to ensure the practical application significance of similarity matching, the type similarity between matching faces is the first factor to be considered. According to preceding rule 2, if the types of faces do not match, the similarity between matching faces is regarded as zero.
According to the preceding rules, the similarity weight between faces is divided into two parts: type weight and similarity weight. The calculation formula is as follows, where, ω (S,T ) is the weight of a path from a face of source feature to a face of target model. ω TY is type weight, which represents the type weight of the matching faces, and its value is shown in formula (15). ω Sim is the similarity weight, which represents the similarity weight of the matching surface, and its definition is shown in Formula (16) ω TY = 1 When face type is the same 0 When face type is different (15) (16) where, ω SH , ω SR , ω ST and ω FT represent shape similarity, surface roughness similarity, size tolerance similarity and form tolerance similarity between matching surfaces, and constants A, B, C and D represent the weight coefficients of the above four similarities respectively. According to the different research purposes, the weight coefficients take different values. As shown in Table 4, when evaluating the similarity of local features of the model, if only appearance evaluation is carried out, the weight of A is taken as 1, and the weights of B, C and D are taken as zero, which indicates that the similarity is only affected by appearance. When process similarity evaluation is conducted, each weight is taken as the average value, which indicates that appearance, surface roughness, size tolerance and form tolerance play an equally important role in similarity evaluation. Literature [44] introduces a normalized measure to detect the difference between two values. The difference between two variables A and B is shown as follows, where, the result of d (A, B) is a value between 0 and 1, indicating the difference between A and B. In order to measure the similarity between the two elements, based on the preceding Formula (17), construct the following formula, where, s(A, B) represents the degree of similarity between A and B, with values between 0-1. The more similar A is to B, the closer the value is to 1. When A is equal to B, its value is 1. According to the above elements similarity evaluation method, based on the attribute information extracted from model, the appearance similarity ω SH between models is constructed as follows, where, A S and A T , C S and C T , N S and N T represent the area, perimeter, and number of edges of the matching surface between source feature and target model, respectively. The area of each surface is read directly from the diagonal elements of GDM SGD ii (i = 1, 2, . . . , n) shown in Formula (4).  of model processing technology, which directly determines the machining equipment such as machine tools, fixtures and other processing equipment used in the product processing process. The similarity calculation of surface roughness and size tolerance are shown in Formula (20) -(21) respectively.
Both faces have roughness 1 None of the faces has roughness 0 One of the faces has roughness (20) Both faces have sizetolerance 1 None of the faces has size tolerance 0 One of the faces has size tolerance (21) In Formula (20), ω SR is the similarity value of surface roughness between faces. SR S and SR T are the surface roughness of matching faces in source feature and target model respectively. In Formula (21), ω ST is the similarity value of size tolerance between faces. ST S and ST T are the size tolerance of matching faces in two models respectively.
Form tolerance is another important manufacturability parameter of a part, and a face may contain several form tolerances. According to the six kinds of form tolerances commonly used in the process of mechanical part design, its similarity calculation formula is constructed as follows, where, ω FT represents the value of form tolerance similarity between two faces, h represents the number of form tolerance contained in the matching face, h ≤ 6, and i represents the serial number of form tolerance. d i (FT Si , FT Ti ) represents the difference between the two values of the No. i form tolerance, and its definition is (23), as shown at the bottom of the page, where, FT Si and FT Ti stand for the value of the No. i form tolerance in source feature and target model respectively.
According to the definition of bipartite graph in Formula (29), as well as the preceding definition of edge weights on model faces, a weighted complete bipartite graph is established, as shown in Fig. 4. In the figure, the source feature contains m faces and the target model contains n faces. In order to ensure the equal number of the two model faces, h supplementary faces are added to the source feature. Taking the faces of source feature and target model as independent sets, connecting edges are established between each pair of vertices in the above two independent. And then the similarity of the two faces connected by the edges is taken as the weight, and weighted complete bipartite graph is finally constructed.

B. THE OPTIMAL MATCHING BETWEEN THE FACES OF SOURCE FEATURE AND TARGET MODEL
On the basis of the above-mentioned weighted complete bipartite graph, Kuhn-Munkres algorithm [45] is used to search the optimal matching M between the independent sets of bipartite graph. After removing the matching of supplementary faces with zero weight, the local feature most similar to source feature in the target model is obtained. Using Kuhn-Munkres algorithm to solve the optimal matching problem of bipartite graph is completed by introducing the method of feasible vertex labeling (f. v. l.), which transforms the optimal matching problem of bipartite graph into the maximum weighted matching under the perfect matching of bipartite graph. The steps of solving the optimal matching of weighted complete bipartite graph G=(V S , V T , E (s, t)) are as follows.
(1) The f. v. l. of each vertex is determined. Here the initial values are as follows, where, s and t represent one face in source feature and target model respectively, which are represented by a vertex in both independent sets. l (s) and l (t) are the initial values of f. v. l. of s and t, respectively. V S and V T are the two independent sets of bipartite graphs, respectively. ω (s,t) is the weight of s and t. l (s) and l (t) satisfy the condition: l (s) + l (t) ≥ω (s,t) , (2) Determine the equality subgraph G l , and take any matching M in G l as the initial matching. The equal subgraph is a spanning subgraph of G with edge set E l , which satisfies the condition:  (3) Judgment: if M saturates each vertex of V S , then M is the optimal matching, and the optimal matching result is output; Otherwise, any unsaturated vertex u of M is selected in V S , and the vertex set S is made, which is the set of vertex u. The vertex set W is established: W ← ∅.
(4) If N G l (S)=W, update the f. v. l. of the two independent sets VS and VT, and their values are shown in Formulas (26) - (27). After updating, replace l with l and G l with G l .
where, s ∈ S, t / ∈ W indicates that s is the matched point of independent set V S , and t is the unmatched point of independent set V T .  where, only the f. v. l. of the matched points of independent set V S and V T are updated. (5) Select t ∈ N G l (S)\W , that is, the selected s belongs to set N G l (S) but not to set W . If t is M-saturated, then t has been matched. Let the match of t in M be (t, s), add this t to set W, add s matching t to set s, and go to (4). If t is M-unsaturated, then t can be used as the starting point of the augmenting path. Let P be the M-augmenting (u, t) path M ← M E (P) in G l , then turn to (3).
Through the preceding algorithm, the matching M is obtained and its weight ω(M ) = e∈M ω (e) is maximum, which is the correspondence between the faces of target model and source feature.
The pseudo code of Kuhn-Munkres algorithm is as shown Algorithm 2.

C. ADJACENCY JUDGMENT OF LOCAL OPTIMAL MATCHING FACES OF TARGET MODEL AND SOLVING STRATEGY OF ISOLATED FACE
The optimal matching M between the faces of source feature and target model obtained by Kuhn-Munkres algorithm is a perfect matching between the faces of the two models, which also includes the matching with zero weight between the supplementary faces of source feature and the faces of target model. It is necessary to remove these matching between the virtual faces and the target model faces at first, and only keeps the matching relationship between the actual faces, so as to evaluate the similarity between the two models. After removing the faces that match the virtual faces, the matching face set in target model is named T. In practical operation, due to the difference of the shape between model faces, it is possible that not all faces searched in set T belong to the same feature. As shown in Fig. 5, source feature I in (a) has the most similarity with feature II in target model shown in (b). But because torus B in (b) and torus A in (a) have higher similarity in area and perimeter, a pair of isolated faces A-B will appear when Kuhn-Munkres algorithm is used for optimal matching. Therefore, it is necessary to judge the continuity and adjacency of the optimal matching  face set, so as to exclude the isolated faces and ensure that the obtained faces have continuity and belong to the same feature.
The criterion for judging whether a group of faces on a solid model belongs to the same feature: in the B-rep schema of solid model, if a group of faces belong to the same feature, there must be continuity between the faces. One necessary VOLUME 9, 2021   (but not sufficient) condition is that any one of its faces is adjacent to at least one other face, that is, in AAG of solid continuous face group, the degree of any vertex is greater than or equal to 1.
Use the method of proof to the contrary to prove the preceding criteria. If face A belongs to a solid and is not adjacent to other faces in face group, then face A is an isolated surface on the boundary of this solid. In this case, the solid model cannot be closed and the solid cannot be generated in B-rep schema. Therefore, it can be concluded that the face on a face set is adjacent to at least one face in this face set.
Therefore, if a face is not adjacent to other optimal matching faces in target model face set T, it does not belong to   this set and is an isolated face, and the optimal matching is not the most similar local feature of target model. Here, the detection of isolated face is realized by the method of retrieving whether one face contains the edge shared with other faces in the set. Its flow chart is shown in Fig. 6, and its pseudo code is shown Algorithm 3.  For the isolated surface in optimal matching, we propose a method of rematch by reducing the weight between the isolated face and the face in source feature. Its procedure is as follows.

1) REDUCE WEIGHT
Reduce the weight between the isolated face in target model and the surface in source feature. The new weights are shown below, where, ω (S(i),T (isosurf )) is the new weight between the isolated face in target model and the faces in source feature. ω (S(i),T (isosurf )) is the original weight. i is the serial number of source feature, i = 1, 2 . . . , m. α is the ratio of weight reduction each time, and the default value is 10%.

2) RECALCULATE THE OPTIMAL MATCHING
After the above weight reduction, ω (S(i),T (isosurf )) is used to replace ω (S(i),T (isosurf )) to recalculate the weight matrix shown in Formula (23), and the optimal matching is recalculated according to Kuhn-Munkres algorithm in 5.2.

3) REMOVE SUPPLEMENTARY SURFACE
Remove the matching faces with supplementary faces of source feature in target model. Face set T is obtained.

4) ADJACENCY JUDGMENT
According to the preceding method in this section, the adjacency judgment of the local optimal matching face of target model is conducted again, and the isolated face is processed until all the faces are adjacent faces. According to the above algorithm, the pseudo code of the optimal matching face adjacency judgment and isolated face processing flow is as shown Algorithm 4.

D. LOCAL FEATURE SIMILARITY EVALUATION
By judging the adjacency between the matching faces, isolated face which do not belong to the local features are excluded, and the face set matching source features in target model is obtained. According to the different matching weights, the matching face pairs can be divided into three cases.

1) THE MATCHING WEIGHT IS 1
In this kind of face pair, the matching face is completely the same as the source feature face in every aspect of shape and manufacturability, such as type, size, tolerance, surface roughness, and the similarity between them is 1.
2) THE MATCHING WEIGHT IS 0 < ω < 1 In this kind of face pair, the type of matching face is the same as the corresponding face in source feature, but there are differences in the aspect of size or manufacturability.

3) THE MATCHING WEIGHT IS 0
In this condition, the type of matching face is not the same as its corresponding face in source feature. According to the Rule 1, its weight is 0.
Based on the preceding three kinds of face matching, the average value of the weight between every matching face pair is used as the similarity between source feature and the local feature of target model, and the formula is as follows, where, Sim S,T is the similarity evaluation value between source feature and the local feature of target model. ω Si,Ti is the weight between the No. i pair of matching faces. m is the number of matching face pairs between the two models after excluding supplementary faces.

VI. CASE STUDY
To validate the proposed feature recognition and similarity evaluation algorithm, case studies are performed in collaboration with a machinery enterprise. This enterprise is specialized in mechanical product design and manufacturing. After years of accumulation, a database of product models and production processes has been formed. Due to the requirements of design, processing and assembly, it is often necessary to retrieve local features similar to the current design, such as the appearance and manufacturability of models in the existing model, so as to find similar production processes. It is necessary to find a model retrieval method, which is utilized to traverse the existing model in the database to search the local features similar to the selected features in current source model. By evaluating the similarity, we can find the model which reaches the specific similarity threshold. Based on the preceding application background, the recognition and evaluation of features are taken as example to verify the proposed methods in this paper.
A. CASE 1 In this case, the model shown in Fig.7 is taken as source model, and the stepped shaft feature, shown in the circle of source model, is taken as source feature. The model shown in Fig.8 is taken as target model, and the local feature similar to the source feature are searched from the target model and their similarity is evaluated.
Select source feature in Creo, and then start feature recognition and similarity evaluation program. The basic information of source feature and target model is identified, as shown in Fig.9-Fig.12. MDAAM of the source feature are established as shown in supporting materials as Formulas (S1) -(S6), and MDAAM of the target model are shown in supporting materials as Formulas (S7) -(S12).
In this example, the source feature has 16 faces and the target model has 31 faces. So, 15 supplementary faces are added to the source feature. Weighted complete bipartite graph is constructed by using the faces of source feature and target model as independent sets and the weight matrix of the graph is obtained, shown in Formula (30), as shown at the bottom of the page.
Kuhn-Munkres algorithm is used to retrieve the optimal matching in the bipartite graph. After removing supplementary faces, the matching relationship between the faces of source feature and target model is obtained as shown in Fig. 13. At the same time, the figure shows the source feature and its matching local feature found in the target model. According to the adjacency judgment, the face with ID 536 in target model is an isolated face, which corresponds to No.27 column of the weight matrix. Therefore, the weights of the No.27 column matrix elements shown in Formula (30) are reduced to obtain a new weight matrix as shown in Formula (31), as shown at the bottom of the previous page.
The reduced weight matrix, shown in Formula (31), is used to perform the optimal matching again. After removing the supplementary faces, the corresponding relationship between the faces of source feature and target model in optimal matching is shown in Fig.14. Through adjacency judgment, there is no isolated face in the target model faces set, which meets the requirements of feature recognition.
According to Formula (29), the similarity between the source feature and the local feature retrieved from target model is 0.81, and the feature recognition and similarity evaluation are finished.

B. CASE 2
In this case, a complex product with multiple heavily intersecting features is used to test the proposed method. The highlighted surfaces in Fig.15 are taken as source feature, and the model shown in Fig.16 is taken as target model.
The basic model topological information is extracted as shown in Fig.17-Fig.20, and the database is established  according to the information of source features and target model faces and edges, as shown in Fig.21-Fig.24. According to the proposed method of feature recognition, MDAAM and weight matrix of weighted complete bipartite graph is constructed, and the optimal matching of bipartite graph is calculated by KM algorithm.
After removing the supplementary faces, the corresponding relationship between the faces of source feature and target model in optimal matching is shown in Fig.25. According to the adjacency judgment, the face with ID 87 in target model is an isolated face. Reduce its weight and match again.
The corresponding relationship is shown in Fig.26 and there is no isolated face in the target model faces set, which meets the requirements of feature recognition. The similarity between the source feature and the local feature retrieved from target model is 0.970.

C. CASE 3
In order to verify the performance of the proposed algorithm, it is compared with the method proposed in [13] to evaluate the similarity of the model. Using the workstation Intel (R) Xeon (R) CPU E5-2630 V3 @ 2.40GHz as the experimental platform, 200 Creo models are selected as test model library, one of which is selected as the source model, and the similarity between the other models in the model library and the source model is calculated by the similarity evaluation method mentioned above.
In terms of time-consuming, the proposed algorithm is divided into two parts: model information preprocessing time-consuming and similarity computing timeconsuming. Among them, the preprocessing of model information includes reading model data, establishing information database, and the building of MDAAM, which takes a large amount of time.
In this paper, we first preprocess the model, and then reuse it. Due to the lack of information storage, the method described in [13] needs to re extract the model information every time the model is used. Table 5 shows the comparison of the time consumption of different algorithms. It can be seen that the time consumption of the proposed algorithm is larger when the model information is not preprocessed, but the time consumption is significantly reduced after the model preprocessing is completed.

VII. CONCLUSION
In summary, a novel method of feature identification and similarity evaluation based on MDAAM is proposed. On the basis of extracting B-rep model information, MBD based MDAAM is constructed, which contains source feature and target model. A weighted complete bipartite graph is constructed by taking the face sets of source feature and target model as independent sets and the similarity between faces as weights. Kuhn-Munkres algorithm is used to calculate the optimal matching between the two independent set to identify the matching degree between local features and source features in target model. Finally, the adjacency of the matching faces is judged and the similarity of matching faces is evaluated. Taking stepped shaft parts as example, the recognition of local feature in target model is realized. Then the similarity between local feature and source feature is calculated accurately from the aspects of topology, shape and size, manufacturability, etc., which verifies the effectiveness of the proposed method.
Position tolerance is a kind of multi-element annotation, which cannot be read and used directly through the information of a face or an edge. In the future, we will focus on the position tolerance between surfaces. Based on this, the similarity of process information and its evaluation method will be further studied. Since 2012, he has been working as an Associate Professor with the Mechanical Manufacturing Department, Shandong University of Science and Technology. Since 2020, he has also been a Visiting Scholar with the Department of Mechanical Engineering, University of California at Berkeley. He is the author of eight books, five inventions, and more than ten articles. His research interests include digital design, mechanical CAD, cloud manufacturing, intelligent manufacturing, and industrial robot integrated systems.
QIANG FENG was born in Shandong, China, in 1996. He is currently pursuing the master's degree in mechanical engineering with the College of Mechanical and Electronic Engineering, Shandong University of Science and Technology, China.
His research interests include digital design, computer graphics, and model feature recognition.
ZHAOYANG SUN received the B.Eng. and M.Eng. degrees from the Shandong University of Science and Technology, Qingdao, China, and the Ph.D. degree from Beihang University, Beijing, China. Since September 2009, she has been with the School of Electrical and Electronic Engineering, Nanyang Technological University, Singapore, as a Research Fellow. Since July 2013, she has also been with the China National Institute of Standardization, Beijing, as an Associate Professor. Her main research interests include design rationale, data mining, and e-commerce.