A multi-source CAD universal feature extraction method and system
By constructing a face adjacency graph and using a graph neural network to identify feature types, the problem of cross-platform feature extraction for multi-source CAD models was solved, achieving accurate feature reconstruction and unified storage.
Patent Information
- Application Number
- CN202611254468.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-18
- Publication Date
- 2026-11-20
AI Technical Summary
Existing CAD model feature extraction methods are not applicable to multi-source CAD and result in significant feature loss during cross-platform data transfer.
By obtaining the file format identifier of the CAD model file, parsing is performed using parsing-driven methods to construct a face adjacency graph, calculate the initial geometric feature vector, and aggregate and identify the feature type probability distribution using graph neural networks and conditional random fields. Finally, the target manufacturing feature type and geometric parameters are encapsulated into RDF triples for storage.
It achieves cross-platform feature extraction, accurately reconstructs manufacturing features, broadens the scope of application of feature extraction, and ensures the integrity and consistency of features.
Smart Images

Figure CN123138756A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of feature extraction technology, and more specifically, to a method and system for general feature extraction from multi-source CAD. Background Technology
[0002] In the fields of industrial design and intelligent manufacturing, computer-aided design (CAD) software is a core tool for product development. When it is necessary to perform model data analysis on CAD models, it is usually necessary to extract key feature data, including manufacturing features, from the models. However, different CAD systems use their own unique geometric kernels and proprietary feature definition methods to describe 3D models. When different CAD systems perform cross-platform data transfer or data interaction, it is usually necessary to convert the model into a neutral exchange format.
[0003] Most existing feature extraction methods rely heavily on the application programming interfaces (APIs) of specific CAD systems. They are only applicable to specific CAD formats or kernels and obtain modeling operation features by directly accessing their internal parametric feature trees. However, when the CAD format is changed, the existing feature extraction methods that rely on specific APIs will become completely ineffective, requiring adjustments or the development of new feature extraction methods. They are not cross-platform compatible. While some other existing feature extraction methods can handle multi-source CAD model files, they require exporting the CAD model files to a neutral format. However, after exporting to a neutral format, the CAD model becomes a geometric "dead body," losing a large amount of key feature data such as manufacturing features.
[0004] There is currently no effective solution to the problems of existing CAD model feature extraction methods being unsuitable for multi-source CAD and resulting in significant feature loss. Summary of the Invention
[0005] This application provides a method and system for general feature extraction from multi-source CAD models to solve the problems of existing CAD model feature extraction methods being unsuitable for multi-source CAD models and resulting in significant feature loss.
[0006] According to one aspect of the embodiments of this application, a multi-source CAD general feature extraction method is provided, comprising: acquiring a CAD model file and identifying the file format identifier of the CAD model file; loading the parsing driver corresponding to the file format identifier to parse the CAD model file according to the file format identifier to obtain boundary representation data; constructing a face adjacency graph based on the boundary representation data, calculating the initial geometric feature vector corresponding to each node in the face adjacency graph, and embedding the initial geometric feature vector as the node feature of the corresponding node into the face adjacency graph; inputting the face adjacency graph into a preset node classification model, outputting the feature type probability distribution corresponding to each node in the face adjacency graph, and aggregating each node according to the feature type probability distribution to obtain multiple feature regions; determining the target manufacturing feature type corresponding to each feature region, and extracting the geometric parameters corresponding to each target manufacturing feature type from the multiple feature regions; and encapsulating the target manufacturing feature type and the corresponding geometric parameters into RDF triples conforming to preset rules for storage.
[0007] According to another aspect of the embodiments of this application, a multi-source CAD general feature extraction system is also provided, comprising: an acquisition unit for acquiring CAD model files and identifying the file format identifier of the CAD model files; a parsing unit for parsing the CAD model files according to the file format identifier by loading the parsing driver corresponding to the file format identifier to obtain boundary representation data; a construction unit for constructing a face adjacency graph based on the boundary representation data, calculating the initial geometric feature vector corresponding to each node in the face adjacency graph, and embedding the initial geometric feature vector as the node feature of the corresponding node into the face adjacency graph; an aggregation unit for inputting the face adjacency graph into a preset node classification model, outputting the feature type probability distribution corresponding to each node in the face adjacency graph, and aggregating each node according to the feature type probability distribution to obtain multiple feature regions; an extraction unit for determining the target manufacturing feature type corresponding to each feature region, and extracting the geometric parameters corresponding to each target manufacturing feature type from the multiple feature regions; and an encapsulation unit for encapsulating the target manufacturing feature type and the corresponding geometric parameters into RDF triples conforming to preset rules for storage.
[0008] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, which stores computer instructions for causing a computer to perform the multi-source CAD general feature extraction method described above.
[0009] According to another aspect of the embodiments of this application, an electronic device is also provided, the electronic device including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to cause the at least one processor to perform a multi-source CAD general feature extraction method.
[0010] The above-mentioned general feature extraction method for multi-source CAD solves the problems of existing CAD model feature extraction methods being unsuitable for multi-source CAD and resulting in significant feature loss. It broadens the applicability of feature extraction methods and extracts / reconstructs accurate and comprehensive manufacturing features. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0012] Figure 1 This is a flowchart of an optional multi-source CAD general feature extraction method provided according to an embodiment of this application. Detailed Implementation
[0013] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0014] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in sequences other than those illustrated or described herein.
[0015] In industrial design, different CAD software (such as CATIA, NX, Creo) employ their own geometric kernels (CGM, Parasolid, ACIS, etc.) and proprietary feature definitions. When feature recognition is required across CAD formats, existing technologies suffer from problems such as strong format dependence, processing only geometric "dead bodies," low feature recognition accuracy, and a lack of unified feature representation. To address these issues, this application provides a multi-source CAD universal feature extraction method and system that is independent of CAD kernels. It can automatically identify design features (holes, slots, bosses, chamfers, arrays, etc.) from B-Rep geometric models of any source, reconstruct parametric information, and uniformly map it to standard feature classes in the PDV semantic model, achieving "format-independent, semantically unified" feature extraction. This application combines geometric topological signatures and graph neural networks (GNNs) to perform feature recognition and parameter reconstruction on the boundary representation (B-Rep) of the CAD model, outputting RDF semantic feature instances that conform to the constraints of the PDV standard product data pattern. As an optional implementation method, please refer to... Figure 1 This document illustrates a flowchart of a multi-source CAD general feature extraction method provided in an embodiment of this application. The execution entity for each step of this method can be a terminal device and a server, or it can be a general feature extraction engine. The method may include at least one of the following steps (S101 to S106):
[0016] S101. Obtain the CAD model file and identify its file format identifier. S102. Load the parsing driver corresponding to the file format identifier to parse the CAD model file and obtain boundary representation data. S103. Construct a face adjacency graph based on the boundary representation data, calculate the initial geometric feature vector corresponding to each node in the face adjacency graph, and embed the initial geometric feature vector as the node feature of the corresponding node into the face adjacency graph. S104. Input the face adjacency graph into a preset node classification model, output the feature type probability distribution corresponding to each node in the face adjacency graph, and aggregate each node according to the feature type probability distribution to obtain multiple feature regions. S105. Determine the target manufacturing feature type corresponding to each feature region and extract the geometric parameters corresponding to each target manufacturing feature type from the multiple feature regions. S106. Encapsulate the target manufacturing feature type and the corresponding geometric parameters into RDF triples conforming to preset rules for storage.
[0017] It should be noted that in the multi-source CAD universal feature extraction method provided in this application, "multi-source" means that the sources of CAD model files can be diverse and are not limited to a specific CAD software or platform. "Universal" means that the feature extraction method in this application does not depend on the proprietary kernel or API of any CAD software or platform and has cross-platform processing capabilities. For example, the feature extraction method provided in this application can consistently extract manufacturing features such as holes and slots from CATIA's .CATPart files, NX's .prt files, and standard neutral format .step files.
[0018] The CAD model file mentioned in S101 above can be a 3D model file from any CAD system or platform. A CAD model file refers to an electronic file containing a 3D product geometric model. The file format identifier is a code or string used to uniquely identify the CAD model file format type. Different format types differ in data encoding methods, topology information storage structures, and geometric representation methods. For example, the STEP format (ISO 10303 AP214) uses Express language to describe data, and the data is stored in a "header information + data segment" structure; the IGES format uses a fixed-width ASCII format; and each native CAD format uses its own proprietary binary or text encoding scheme. Common formats include: neutral formats (STEP / IGES / .stp / .igs), where the STEP format is based on the ISO 10303 standard and describes product geometry in B-Rep format; and native formats of various CAD software (such as CATIA's .CATPart, Siemens NX's .prt, PTC Creo's .prt, Dassault SolidWorks' .SLDPRT, etc.). The aforementioned identification refers to the process of automatically determining the format category of an input file based on its file extension, header byte sequence (e.g., STEP files begin with "ISO-10303"), or internal data markers. For example, upon receiving a file named engine_block.stp, parsing the .stp file extension reveals that the file is in STEP format.
[0019] In S102, the parser driver refers to a dedicated parser module written for specific file format identifiers, also known as a B-Rep parser, supporting STEP / IGES and mainstream CAD native geometry export formats. Each parser driver contains data reading logic for the corresponding file format, including data segment parsing, geometric parameter extraction, and topological entity (face, edge, vertex) reconstruction. For example, the STEP parser driver needs to parse the Express mode definition, read geometric entity data (PLANE, CYLINDRICAL_SURFACE, B_SPLINE_SURFACE, etc.), and reconstruct topological relationships; the CATPart parser driver needs to parse CATIA-specific cache structures and geometric kernel call interfaces. Boundary representation data (B-Rep Data): B-Rep is one of the two mainstream methods for describing 3D geometric entities. In B-Rep, an entity is fully defined by the topological relationships and geometric information of its boundaries (faces, edges, vertices). Specifically, a B-Rep model contains topological entities: vertices, edges (between two vertices), wireframes (closed sequences of edges), faces (bounded surfaces enclosed by one or more wireframes), shells (closed sets of faces), and solids (spatial regions enclosed by closed shells); it also includes geometric information: the mathematical geometry supporting each topological entity, such as plane equations, cylindrical surface equations (axis + radius), spherical surface equations (center + radius), B-spline surface control points, and node vectors.
[0020] S102 includes: S201, loading the parsing driver corresponding to the file format identifier from the preset driver mapping table according to the file format identifier, parsing the CAD model file through the parsing driver to obtain the initial boundary representation data; S202, obtaining the geometric topology information of each model face in the initial boundary representation data, wherein the geometric topology information includes at least the boundary edges, vertex coordinates and adjacency relationships between each model face; S203, performing topology repair on the initial boundary representation data based on the geometric topology information to obtain the boundary representation data.
[0021] The driver mapping table refers to a pre-configured data structure that stores the mapping relationship between file format identifiers and corresponding parsing drivers. For example: {“STEP”—>StepDriver,“IGES”—>IGESDriver,“CATIA_V5”—>CatiaDriver}. The existence of the driver mapping table allows for the addition of new format support simply by adding new mapping entries, without modifying the core logic, demonstrating the scalability of the feature extraction method in this application. The initial boundary representation data refers to the original B-Rep structure data parsed by the parsing driver. The geometric topology information refers to the comprehensive data geometry describing the geometric attributes and topological relationships of each model face, including at least boundary edges, vertex coordinates, and face adjacency relationships. Boundary edges are the edges that constitute the outer and inner boundaries (hole boundaries) of each model face, and are the basic data for determining the face shape and calculating the area. Vertex coordinates are the three-dimensional coordinates of the endpoints of the boundary edges, used to determine the spatial position and shape of the face. Face adjacency relationships are used to record which two faces share edges, i.e., which faces are topologically adjacent. Topology repair refers to the operation of detecting and correcting geometric topological defects in CAD models (especially models imported from STEP / IGES neutral format). These defects are caused by differences in the understanding of geometric accuracy and topological rules of different CAD systems during the neutral format export process. Topology repair is a key step in achieving multi-source universality in this application. CAD models from different sources may have different types and degrees of topological defects. Only after unified repair can subsequent consistent feature recognition be performed. If topological defects are not repaired, FAG will incorrectly determine that faces that should be adjacent are not adjacent (the gap is too large), or incorrectly include degenerate faces in feature extraction (the area is too small), which seriously affects the accuracy of feature recognition.
[0022] To ensure the universality of the feature extraction method across different CAD formats, this application adds a universal parsing layer before B-Rep parsing to perform format recognition and adaptation (automatically identifying the input file format and loading the corresponding parsing driver) and topology repair. In addition, after topology repair, this application also performs multi-kernel semantic alignment and format-adaptive node feature operations on the boundary representation data obtained after topology repair. For topology repair, this application performs topology repair operations corresponding to the defect types of common geometric topology defects in STEP / IGES (such as small gaps between faces, overlapping edges, degenerate faces, etc.). The topology repair operations can be as follows: detect the boundary edges of adjacent model faces in the initial boundary representation data whose distance between the boundary edges is less than a first preset distance threshold, merge the boundary edges of adjacent model faces into shared edges, and update the geometric topology information. For example, gap filling: if the distance between the boundary edges of two adjacent faces is <0.001mm, they are automatically merged into shared edges. The first preset distance threshold is a fixed threshold that is pre-set and corresponds to the CAD model file. For example, different CAD model files may correspond to different first preset distance thresholds. Degenerate face removal: if the area of a face is <1e-6 mm², it is considered a degenerate face and removed from the FAG. Normal consistency: unify the normal orientation of adjacent faces to ensure accurate calculation of FAG edge attributes (convex / concave). Multi-kernel semantic alignment can be understood as degenerate surface removal. Specifically, it involves calculating the area of each model surface, marking model surfaces with an area less than a preset area threshold as degenerate surfaces, deleting the model surfaces marked as degenerate surfaces and their associated topological relationships from the initial boundary representation data, and synchronously updating the geometric topology information. Different CAD kernels have different representations of the same geometric type. The preset area threshold is a fixed area threshold set in advance. A kernel semantic mapping table is established to uniformly map the geometric types of each kernel to the standardized geometric types (PLANE, CYLINDER, CONE, SPHERE, TORUS, BSPLINE_SURFACE) predefined in this application. For format-adaptive node features (independent normalization, which can be understood as normal consistency adjustment), specifically, a reference model surface is selected from the model surfaces of the CAD model file. Using the normal vector of the reference model surface as the reference direction, the orientation of the normals of the model surfaces adjacent to the reference model surface is uniformly processed, so that the reference for determining the normal angle between any two adjacent model surfaces at the shared edge is consistent. The adjusted normal information is then updated to the geometric topology information. That is, for models from different format sources, the statistical distribution of node features may be offset (e.g., different CADs have different subdivision accuracies for surfaces). Batch normalization is used to independently normalize the node features of each format, eliminating the distribution differences between formats and enabling the GNN model to have consistent recognition performance across different formats.The initial boundary representation data, which has undergone the above-mentioned topology repair, multi-kernel semantic alignment, independent normalization and other operations and carries the updated geometric topology information, is then determined as the boundary representation data in S203 above.
[0023] In S103, the Face Adjacency Graph (FAG) is a graph-based data structure used to describe the topological adjacency relationships between faces in a CAD model. In an FAG, a node represents a geometric face in the CAD model, and an edge represents a shared boundary (sharing an edge) between two faces. The edge's attributes (edge type) indicate the spatial relationship between the two faces. The FAG serves as an intermediate representation connecting the geometric level (lower-level B-Rep data) and the feature level (higher-level semantic features). A node in the FAG specifically represents a face in the CAD model. Each node carries the geometric feature information (initial geometric feature vector) corresponding to that face. The initial geometric feature vector is a numerical vector obtained by quantizing and encoding each CAD model face, used to characterize the face's geometric attributes. Typical geometric feature vectors have 16 to 64 dimensions and include face geometry type encoding, area, perimeter, curvature features, etc. Node feature embedding refers to using the calculated initial geometric feature vector as the initial input feature of the corresponding graph node in the graph neural network, enabling each node to carry its geometric attribute information and participate in the subsequent forward propagation of the graph neural network. In a face adjacency graph (FAG), the graph edge represents the topological relationship between two faces sharing an edge; the existence of the edge itself encodes the adjacency information between faces. If the initial geometric feature vector is a 64-dimensional feature vector, after embedding, it propagates layer by layer in the GNN, aggregating neighbor information, and ultimately each node obtains a new feature vector that incorporates its local geometric neighborhood context. The aforementioned face adjacency graph can be generated and its node / edge attributes calculated using a face adjacency graph builder.
[0024] S103 includes S301, extracting the source geometric type annotations of each model face from the boundary representation data, as well as the source kernel identifier of the CAD model file; S302, loading the mapping sub-table corresponding to the source kernel identifier from the preset kernel semantic mapping table according to the source kernel identifier, and using the loaded mapping sub-table to convert the source geometric type annotations of each model face into the corresponding standard type annotations; S303, calculating the initial geometric feature vectors for each model face based on each standard type annotation and the geometric topology information of each model face (including the area, boundary, and other data of each model face); S304, constructing a face adjacency graph with the nodes corresponding to each model face as graph nodes and the shared edge adjacency relationship between model faces as graph edges, and embedding each initial geometric feature vector as the node feature of the corresponding node into the face adjacency graph.
[0025] Boundary representation data can be geometric feature data parsed from CAD model files of any source. Source geometry type annotations refer to the original descriptive information given by the CAD kernel for the geometry type of each model face. Different CAD kernels use different type naming systems. Source geometry type annotations are face attributes stored in B-Rep data as type codes or string fields; the source kernel identifier is the code used to identify the original underlying geometry kernel type of the CAD software that generated or exported the CAD model file (indicating the geometry kernel type used when generating the CAD model file). The geometry kernel (GeometricKernel, also known as the geometry engine) is the core underlying component of CAD software, responsible for all 3D geometry calculations. The source kernel identifier is extracted from the file's internal metadata by the parsing driver when reading the CAD model file.
[0026] The aforementioned preset kernel semantic mapping table refers to a pre-constructed multi-dimensional mapping table. This table stores the mapping relationships from source geometric types to standard geometric types under different geometric kernel types. Standard geometric types are predefined, such as planes, cylinders, cones, spheres, etc. The top-level index of the preset kernel semantic mapping table is the source kernel identifier. Each index entry contains the mapping rules from the source geometric type of that kernel to the standardized geometric type within this invention. For example (Parasolid kernel): "plane_primitive" -> PLANE (standardized plane), "cone_cylinder" -> CYLINDER (standardized cylinder), "sphere_primitive" -> SPHERE (standardized sphere); another example (ACIS kernel): "cone_cylinder" -> CYLINDER, "cone_cone" -> CONE (standardized cone). Mapping sub-tables refer to a set of local mapping rules from source types to standard types for a specific kernel (such as Parasolid). Loading mapping sub-tables instead of full table queries is for data organization and query efficiency considerations. Standard type annotation refers to the geometric type classification system pre-defined in this application, which includes at least geometric types such as plane, cylindrical surface, conical surface, spherical surface, torus, and B-spline surface. The same cylindrical surface may be identified as different types by the GNN model in different CAD models (because the source type annotations are different), resulting in unreliable feature recognition results. Through standard type annotation, all cylindrical surfaces, regardless of whether they come from Parasolid or ACIS, have the same geometric type encoding in the feature vector.
[0027] The initial geometric feature vector is the result of multi-dimensional quantization encoding of each model surface. It includes geometric type encoding components generated based on standardized geometric types, geometric attribute components calculated based on the area and perimeter of the model surface, curvature feature vectors calculated based on the Gaussian curvature and planar curvature distribution of the model surface, and neighborhood feature components calculated based on the distribution of the normal angles between the model surface and its adjacent surfaces. The values of each dimension are calculated based on the standard type label and other geometric attributes of the surface. Specific calculations include: performing One-Hot encoding on the standard type label (e.g., 6-dimensional, where the vector [0,1,0,0,0,0] represents a cylindrical surface), normalizing the area, perimeter, and number of boundary edges, calculating the statistical values (mean + variance, 4 dimensions) of the Gaussian curvature and average curvature, calculating the trigonometric function of the angle between the normal vector and the coordinate axis (3-dimensional), and performing histogram statistics on the distribution of the neighborhood normal angles (12-dimensional). Standard type annotations serve as the baseline input for calculating geometric features across various dimensions. While the geometric type encoding dimensions of feature vectors differ for faces of different standard types, the calculation methods for their geometric attribute components (area, curvature, etc.) remain consistent. Graph nodes represent CAD model faces in the FAG. The node's representation (ID) in the graph data structure corresponds one-to-one with the face representation (Face ID) in the CAD model. Shared edge adjacency refers to the topological relationship where two CAD model faces share a completely overlapping boundary edge (two faces share the same edge). In the FAG, if face A and face B share an edge, an undirected edge is established between their corresponding nodes. Shared edge adjacency is the core topological information of the FAG and the data foundation for constructing the graph structure; an edge in the FAG represents the fact that "two faces share an edge." The existence of an edge itself constitutes an adjacency relationship, requiring no additional weight storage. Edge attributes include convex and concave edges. Each face in the face adjacency graph includes a geometry type, a boundary ring (outer boundary + inner boundary), and face attributes (area, normal vector, curvature, etc.). Each model face is a node in the FAG. An edge in the FAG can be understood as follows: if two faces share an edge, then an edge is established between them. The edge type includes convex edges (angle > 180 degrees) or concave edges (angle < 180 degrees). In addition, this application also calculates a geometric signature (such as the curvature distribution histogram of the face, the number of boundary edges, the average normal vector angle between adjacent faces, etc.) for each node in the FAG as an initial feature vector.
[0028] S304 specifically includes: determining the source format category of the CAD model file based on the file format identifier, the source format category being used to distinguish model data exported from different CAD software or neutral standards; loading the format normalization parameter set corresponding to the source format category from a preset normalization parameter library, wherein the preset normalization parameter library stores the correspondence between different source format categories and the format normalization parameter set, the format normalization parameter set being obtained by statistically analyzing the node features of sample models of different source format categories, including scaling factors and translation factors for each feature dimension; using the format normalization parameter set, scaling and translation operations are performed on the feature values of each dimension in the initial geometric feature vector according to the scaling factors and translation factors of the corresponding dimensions to obtain the format-normalized initial geometric feature vector; constructing a face adjacency graph with the nodes corresponding to each model face as graph nodes and the shared edge adjacency relationship between model faces as graph edges; and embedding the format-normalized initial geometric feature vector as the node feature of the corresponding node into the face adjacency graph.
[0029] The preset node classification model in S104 refers to a pre-trained Graph Neural Network (GNN) model used to classify the feature types of each node in the FAG (corresponding to each face in the CAD model). This model takes the topology of the FAG (nodes + edges) and node features (i.e., the face adjacency graph mentioned above) as input, and outputs the probability value of each node belonging to each candidate feature type, i.e., the feature type probability distribution mentioned above. This model is trained using labeled training data (e.g., 5000 labeled models from different CAD formats, each face labeled with its feature type; loss function: cross-entropy loss for node classification, cross-entropy loss for graph classification, and a weighted sum of the two (weight ratio 1:0.3); the optimizer Adam has a learning rate of 0.001, a batch size of 32, and a training period of 200 epochs). The model architecture can use GIN (Graph Isomorphic Network) or GAT (Graph Attention Network); this application uses a 3-layer GIN or GAT, with 128-dimensional node features and 8-dimensional edge features. The aforementioned feature type probability distribution refers to a probability vector output by the output layer of the predefined node classification model, whose dimension is equal to the total number of classes of the feature types to be classified. Suppose there are C candidate feature types (holes, slots, bosses, chamfers, rounded corners, arrays, etc.), then the probability distribution output by each node is a vector of length C. ,in This indicates that the node belongs to the first... The probability of each feature type The sum is 1. For example, a node output [0.82, 0.12, 0.04, 0.02] means that there is an 82% probability that it is a through hole, a 12% probability that it is a blind hole, a 4% probability that it is a slot, and a 2% probability that it is another type.
[0030] Clustering nodes based on feature type probability distribution involves merging nodes in the FAG that belong to the same feature region and are topologically adjacent, according to their classification probability distribution. The basis for clustering is that if two adjacent nodes are classified as the same feature type, they are likely to belong to the same feature region (like multiple sides of a single hole feature). CRF (Conditional Random Field) post-processing further utilizes the geometric relationships between adjacent nodes (such as normal angles and concavity / convexity) to optimize the classification results and eliminate the impact of misclassification by a single node. A feature region refers to the subgraph region in the FAG formed by adjacent nodes classified as the same feature type, representing a complete manufacturing feature instance in the CAD model.
[0031] The process involves inputting a face adjacency graph into a predefined node classification model and outputting the feature type probability distribution for each node in the face adjacency graph. This includes: mapping the initial geometric feature vectors of each node in the face adjacency graph to hidden features of a predefined dimension using the input mapping layer in the predefined node classification model; extracting edge attributes from each edge in the face adjacency graph and encoding these attributes using the edge feature encoding network in the predefined node classification model to obtain the hidden features of each edge; weighting and fusing the message passing between adjacent nodes using the hidden features in each layer of the multi-layer graph convolutional network in the predefined node classification model to obtain the output node features of each layer; concatenating the output node features of the first and last layers of the graph convolutional network using the skip connection layer in the predefined node classification model to obtain the fused features of each node; and inputting the fused features of each node into the node classification output layer of the predefined node classification model to output the feature type probability distribution for each node.
[0032] The pre-defined node classification model includes an input mapping layer, multiple graph convolutional layers, edge feature encoding layers, skip connection layers, and a node classification output layer. The input mapping layer is the first layer of the pre-defined node classification model (GNN model), a fully connected linear layer followed by an activation function (such as ReLU). Its function is to map the original input features of each node in the FAG (i.e., the initial geometric feature vectors in the FAG, 16 to 64 dimensions) to a unified working dimension (such as 128 dimensions) within the network. This mapping encodes feature vectors from different sources into a unified feature space, facilitating unified processing by subsequent graph convolutional layers. The pre-defined hidden layer features refer to the feature representations of each node in each layer within the model, and their dimensions are pre-set by the model architecture (such as 128 dimensions). Hidden layer representations are intermediate layer representations generated during the forward propagation of the model and are not directly output. For example, the pre-defined node feature dimension is 128 dimensions. Edge attributes describe the spatial relationship between two CAD model faces represented by each edge in a Facing Alignment (FAG). Core edge attributes include edge type identifier and shared edge length percentage. The edge type identifier indicates whether the edge is a convex edge (the angle between the normals of the two faces at the shared edge is >180°, meaning the two faces open outwards, such as a convex angle) or a concave edge (the angle between the normals is <180°, meaning the two faces are concave inwards, such as a concave angle). Convex edges typically correspond to the outer contour boundary of a feature, while concave edges typically correspond to the boundary between a feature and the main body. The shared edge length percentage refers to the proportion of the shared edge length relative to the total boundary length of its corresponding face, used to measure the edge's contribution to the overall face shape. An edge feature encoding network refers to a dedicated multilayer perceptron (MLP) used to encode edge attributes (usually low-dimensional raw values) into high-dimensional hidden edge features. For example, an 8-dimensional edge attribute (edge type One-Hot 2D + normalized value of shared edge length percentage, etc.) can be mapped to a 32-dimensional hidden edge feature. Edge hidden layer features enable GNNs to distinguish information from convex and concave edge neighbors during message passing and to give differentiated weighted contributions.
[0033] Multi-layer graph convolutional networks (GCNNs) refer to graph neural network structures with multiple stacked layers, used to aggregate neighborhood information of each node layer by layer. Inner GCNNs are followed by Batch Normalization and ReLU activation. Each GCNN layer propagates node features one hop through the graph. A three-layer network enables each node to perceive information from all nodes within its three-hop neighborhood (i.e., the entire local face neighborhood surrounding that node). Message passing refers to the core computational paradigm of graph neural networks. In each GCNN layer, each node receives "messages" (nearby feature vectors) from its neighbors and weights and fuses these messages based on edge attributes (edge hidden features) to update its own feature representation. Specifically, in each GCNN layer, edge features (convex / concave type, shared edge length ratio) are encoded using independent edge MLPs (8-dimensional to 32-dimensional) and weighted and fused with node messages during aggregation. This allows the network to distinguish the different contributions of "adjacent faces connected by convex edges" and "adjacent faces connected by concave edges" to feature recognition. Weighted fusion assigns higher weights to information from concave neighbors (such as adjacent faces within the same feature region) and lower weights to information from convex neighbors (such as faces at the boundaries of different feature regions). The output node features are: the output of each layer of the graph convolutional network is an updated node feature vector. In the 3-layer network, the output node features maintain a 128-dimensional dimension, but the values of each dimension have incorporated information from multi-hop neighbors. Skip connection layers are used to concatenate or add the feature representations from shallow layers (closer to the input layer) with those from deep layers (closer to the output layer). Shallow features contain more fine-grained geometric details (such as local surface-level information), while deep features contain more abstract semantic information (such as feature type attribution). Skip connections achieve both, avoiding the problem of excessive "smoothing" in deep networks leading to the loss of surface-level details. For example, in this application, a skip connection is added between the first and third layers (the last layer in this example) to concatenate shallow geometric features with deep semantic features, avoiding over-smoothing and preserving fine-grained surface-level information.
[0034] The concatenation of the first and last layers is as follows: the output of layer 1 (rich in geometric details) and the output of layer 3 (high semantic abstraction) are concatenated as vectors to obtain the fused feature (the dimension becomes 256). If the activation function is ReLU, the concatenation result of layer 1 and layer 3 is input into the subsequent fully connected layer for feature integration. The fused feature refers to the comprehensive feature vector formed after concatenation through skip connections, which combines shallow fine-grained geometric information and deep abstract semantic information. The node classification output layer is the last few fully connected layers of the GNN (usually a 3-layer MLP: 256 -> 64 -> C, where C is the total number of feature types), mapping the fused features to the probability distribution of each feature type. The output layer is usually connected to the Softmax activation function to ensure that the sum of all output probabilities is 1. The feature type probability distribution is the final output result in the preset node classification model, indicating the probability of each node belonging to each candidate feature type (such as through-hole, blind hole, slot, boss, etc.). The feature type probability distribution includes both multiple candidate feature types and the probability of each node belonging to each candidate feature type. The pre-defined node classification model contains two output heads: a node classification head (3-layer MLP, 128 -> 64 -> C-class) and a graph classification head (3-layer MLP after global pooling, 128 -> 64 -> F-class). The two tasks share the parameters of the first 3 layers of GIN, and improve generalization ability through joint training. The specific process of inputting the face adjacency graph into the pre-defined node classification model and outputting the feature type probability distribution corresponding to each node in the face adjacency graph reflects the complete forward propagation process inside the pre-defined node classification model, such as: input mapping layer (16 -> 128 dimensions) -> multi-layer GCN (3 layers, 128 -> 128 -> 128 dimensions) -> skip connection (concatenation of the 1st and 3rd layers, 256 dimensions) -> output layer (256 -> 64 -> C-dimensional) -> feature type probability distribution. This architecture ensures that: edge attributes (convex / concave edges) participate in the message passing weighting of each layer of GCN (Graph Convolutional Network); skip connections preserve surface-level geometric information; and the final probability distribution integrates local (1-hop neighborhood) and global (graph-level context) information, thus guaranteeing the accuracy of the feature type probability distribution generation process and the reliability of the model output results.
[0035] In S104 above, nodes are aggregated according to the feature type probability distribution to obtain multiple feature regions, including: using the face adjacency graph as the undirected graph structure of the conditional random field, and taking the initial geometric feature vector of each node as the observed feature; in the conditional random field, using the feature type probability distribution obtained by the observed feature through a preset node classification model, a univariate potential function is constructed for each node in the undirected graph structure, and the univariate potential function is used to characterize the cost of a single node being assigned to a specific feature type; the geometric relationship between the model faces corresponding to adjacent nodes in the undirected graph structure is extracted from the observed feature to construct a binary potential function; under the conditional random field framework, the feature type probability distribution is iteratively optimized using the univariate potential function and the binary potential function to obtain the target type label corresponding to each node; nodes in the face adjacency graph that have the same target type label and are directly connected by edges are aggregated into the same feature region to obtain multiple feature regions.
[0036] Conditional Random Field (CRF): A probabilistic graphical model used to globally optimize the label assignment of nodes in a graph structure given observed features. In this application, CRF serves to smooth the structured node-level classification probabilities output by a GNN, eliminating the influence of single-node classification errors and ensuring that adjacent nodes conform to geometric constraints in label assignment. Specific structured smoothing includes CRF modeling, unary potential functions, binary potential functions, inference optimization, and threshold filtering. CRF modeling involves using the graph structure of the FAG as the undirected graph structure of the CRF—nodes in the graph represent model faces in a CAD model, and edges represent the adjacency relationships of model faces. Given observed features X (initial geometric feature vector, also known as initial geometric signature), the optimization objective is to find the optimal label assignment Y (target manufacturing feature type for each face) that maximizes the conditional probability P(Y|X). The unary potential function can be understood as an independent potential function for each node in the CRF, representing "the cost of assigning a node to a specific label (manufacturing feature type) given observed features." In the unary potential function, the probability distribution of node feature types output by the GNN is transformed into a potential function form: ,in For nodes The initial geometric eigenvectors, To be assigned to a node The tag, This represents the classification probability output by the GNN. The lower the value of the unary potential function, the higher the probability of the label assignment. The binary potential function is a CAD-specific function constructed in this application: a potential function in CRF describing the label consistency relationship between adjacent nodes. Unlike the unary potential function (which only considers a single node), the binary potential function considers whether the label combination of two adjacent nodes is reasonable. Its value depends on whether the labels of adjacent nodes are consistent and their geometric relationship. The binary potential function encourages (or penalizes) adjacent nodes to be assigned the same or different labels. The geometric relationship between the model faces corresponding to adjacent nodes refers to the data extracted from the initial geometric feature vector, describing the spatial relationship between CAD model faces. Based on this geometric relationship, this application constructs three different CAD-specific binary potential functions: Normal Angle Potential: Based on the normal angle between two adjacent faces, when the angle is less than 15°, it encourages the same label (faces are approximately coplanar), i.e., it encourages belonging to the same feature; when the angle is greater than 60°, it encourages different labels (faces belong to different features), i.e., it encourages belonging to different features. The weight coefficient of the normal angle potential... Area ratio potential: When the area ratio of two adjacent faces is greater than 10, the same label is encouraged (large area faces may be the main features, and small area faces may be the detail features, such as the top and side faces of a hole). The weighting coefficient of the area ratio potential. Concavity / convexity potential: If two adjacent faces share a concave edge (inner concave angle), then the same label is encouraged (a concave edge is usually a transition within a feature); if they share a convex edge (outer convex angle), then different labels are encouraged (a convex edge is usually a boundary between different features). The weighting coefficients for concavity / convexity potential... The weighting coefficients for the different potentials described above are merely a preferred example in this application. Specific weighting coefficients can be set as needed, and this application does not impose any limitations on them.
[0037] The iterative optimization of the CRF inference process uses mean-field variational inference for approximate solution. The iterations are as follows: ① Calculate the marginal probability distribution of each node based on the current label estimate; ② Update the objective function using univariate and bivariate potentials; ③ Repeat until convergence (typically 10 iterations). The time complexity of each iteration is O(log n). ,in For the number of categories, , where represents the number of edges in the graph. Threshold filtering can be understood as, after CRF optimization, marking nodes with a probability below 0.6 as "unclassified," awaiting manual review or secondary judgment by the rule engine, to avoid misclassification contaminating downstream parameter extraction. Target type label refers to the optimal feature type label assigned to each node after CRF optimization. The label is the final result after dual processing of GNN probability prediction and CRF global optimization, significantly improving robustness compared to using GNN output alone. The conditions of having the same target type label and being directly connected by edges must be met simultaneously. The same target type label ensures that aggregated nodes belong to the same feature type, and direct edge connection ensures that aggregated nodes are topologically adjacent in the FAG (rather than just having similar probability distributions but spatial separation). The aforementioned feature region can be understood as a FAG subgraph composed of several adjacent and similar-type nodes, representing a complete manufacturing feature instance in the CAD model. For example, a blind hole feature may consist of 3 to 5 adjacent nodes (cylinder side + top surface), which aggregate into a feature region. Aggregating nodes with the same target type label and directly connected by edges in the face adjacency graph into the same feature region to obtain multiple feature regions specifically includes: obtaining the target probability value of each node according to the target type label; comparing each target probability value with a preset confidence threshold to obtain the comparison result; marking nodes whose target probability value is lower than the preset confidence threshold as unclassified nodes and filtering them out from the node set corresponding to the face adjacency graph to obtain a candidate node set; and aggregating nodes with the same target type label and directly connected by edges in the candidate node set into the same feature region to obtain multiple feature regions.
[0038] The target probability value refers to the probability value assigned to each node in the feature type probability distribution corresponding to its target type label after CRF optimization. The target probability value is the probability value corresponding to the target type label, representing the confidence index that the corresponding node is correctly classified. The preset confidence threshold is a manually set lower limit for the probability value used to determine whether the node classification result is acceptable. Nodes below this threshold are considered unreliable classifications and require special handling (such as awaiting manual review). The setting of the preset confidence threshold reflects the system's control over classification quality. Unclassified nodes refer to nodes with classification confidence below the preset confidence threshold, indicating unreliable CRF optimization results. These nodes may be surfaces with blurred edges (such as hole walls or slot walls), degraded surfaces (too small areas), or surfaces affected by residual topological defects. Unclassified nodes are excluded from the feature region aggregation process. The candidate node set refers to the subset of nodes used to participate in feature region aggregation after confidence screening. The candidate node set excludes unclassified nodes, ensuring that all nodes participating in aggregation are high-confidence classification results. The above method ensures that feature region aggregation is performed only on nodes with sufficient confidence, thereby improving the reliability of feature regions.
[0039] The target manufacturing feature type refers to the final manufacturing feature category determined for each feature region after classification and aggregation in S104. Manufacturing features refer to the geometric shapes of parts with specific processing significance, including but not limited to: through holes (cylindrical holes penetrating from one side of a part to the other), blind holes (cylindrical holes not penetrating the part), countersunk holes (stepped holes with enlarged tops), slots (elongated grooves on the surface of a part), bosses (columnar structures protruding from the surface of a part), chamfers (sloping deburring structures on edges), fillets (rounded transition structures on edges), and arrays (feature groups composed of multiple identical features arranged in a regular pattern). Geometric parameters refer to the key dimensional values characterizing the geometric shape of each manufacturing feature. Different feature types correspond to different parameter sets. For example, the geometric parameters of through holes / blind holes include diameter, depth, axial direction, and whether it is a through hole (through hole vs. blind hole is determined by the relationship between depth and part thickness); the geometric parameters of slots include length, width, depth, and bottom surface type (planar / curved surface). Geometric parameters are calculated using the least squares geometric fitting method. For example, a cylindrical surface is used to fit the hole wall, and the radius of the fitted cylindrical surface is taken as the hole diameter and the axis is taken as the hole axis direction. Extraction from multiple feature regions means that the parameter extraction process is performed independently for each feature region without interference.
[0040] S105 includes: S501, for each feature region, constructing spatial attention weights based on the classification confidence of each node within the feature region, labeling nodes with classification confidence higher than a preset regression threshold as high-confidence nodes, and labeling nodes with classification confidence lower than or equal to the preset regression threshold as low-confidence nodes; S502, calling a preset parameter regressor, using the target manufacturing feature type as the fitting target type parameter, and performing least-squares geometric fitting using the model surface geometry data corresponding to the high-confidence nodes to obtain the initial geometric parameters and fitting residuals of the feature region; S503, when the fitting residual exceeds a preset residual threshold, marking the feature region as a classification doubtful region. S504: Extract candidate feature types corresponding to the second highest probability in the feature type probability distribution of low-confidence nodes; S505: Use the candidate feature types as fitting target type parameters, and re-call the preset parameter regressor to perform geometric fitting on the model surface geometric data corresponding to high-confidence nodes and low-confidence nodes; S506: When the fitting residual after refitting exceeds the preset residual threshold, mark the feature region as a region to be reviewed; S507: When the fitting residual after refitting is lower than or equal to the preset residual threshold, determine the candidate feature type as the target manufacturing feature type of the feature region, and use the geometric parameters obtained from refitting as the geometric parameters extracted from the feature region.
[0041] Classification confidence refers to the probability value that each node is assigned to its target type label after CRF optimization. Here, a "high / low" binary partition of classification confidence is introduced to guide spatial attention in the parametric regression process. High-confidence nodes are considered reliable feature regions, while low-confidence nodes are considered surfaces that may be misclassified. Spatial attention weights refer to a mechanism that assigns differentiated participation degrees to different nodes during parametric regression, using the node's classification confidence as weight. Model surface geometry data of high-confidence nodes are given higher weights, while model surface geometry data of low-confidence nodes are given lower weights (until completely excluded in the initial fit). Spatial attention weights ensure that the parametric regression process focuses on regions with reliable classification, avoiding interference from geometric noise from low-confidence surfaces (which may be "non-feature surface" geometry data due to misclassification) in the fitting results. The preset regression threshold is used to distinguish the lower limit of probability values for high / low confidence nodes. Unlike the preset confidence threshold, which is used to determine whether a node participates in feature region aggregation, the preset regression threshold is used to determine whether a node participates in parameter fitting. The preset regression threshold is higher than the preset confidence threshold (i.e., the regression threshold is higher than the aggregation threshold), ensuring that the model surfaces participating in the fitting have higher classification reliability. High-confidence nodes and low-confidence nodes can be understood as two input categories in the parameter regression process. High-confidence nodes are fully used in the first fitting; low-confidence nodes are excluded in the first fitting and are only included in the refit when feedback correction is triggered in a region of doubtful classification (i.e., S504 mentioned above).
[0042] The pre-programmed parameter regressor refers to a pre-written geometric fitting algorithm module that pre-sets corresponding geometric fitting templates for each feature type (hole, slot, boss, etc.). For example, for through-hole / blind-hole features, a cylindrical surface fitting algorithm (least squares fitting of the cylindrical surface equation to obtain the radius and axis) is used; for planar features, a planar fitting algorithm (least squares fitting of the planar equation) is used; for chamfer features, an arc fitting algorithm is used, and so on. The target manufacturing feature type is used as the fitting target type parameter by taking the target type label output by CRF (such as "blind-hole") as one of the input parameters of the parameter regressor. This is used to select the corresponding geometric fitting template (cylindrical surface fitting template) and determine the parameter output format (such as blind-hole output parameters: axial direction + diameter + depth + whether it is a through-hole + bottom corner type). Least squares geometric fitting refers to the method of finding the optimal parameters of the theoretical geometry by minimizing the sum of squared errors of all data points to the theoretical geometry. The fitting residual refers to the root mean square distance of all data points involved in the fitting to the fitted theoretical geometry. The fitting residual is the core indicator for measuring the quality of the fit. The smaller the residual, the closer the fitted geometry is to the actual geometric surface, and the more reliable the fitted parameters are. The initial geometric parameters refer to the candidate parameter results obtained by fitting based on the geometric data of high confidence nodes. In subsequent steps, they may be refitted due to classification correction (resulting in "refitted geometric parameters").
[0043] The preset residual threshold refers to the distance threshold used to determine whether the fitting quality is acceptable, based on the standardized residual. Suspicious classification regions refer to feature regions where the classification result may contain errors. Although the node classification provides a certain feature type (e.g., through hole), the geometric fitting result shows that the classification does not perfectly match the actual geometric shape (e.g., when fitting a blind hole with a cylindrical surface, the residual is too large, possibly because the hole is actually a conical blind hole rather than a simple cylindrical blind hole). The candidate feature type corresponding to the second highest probability refers to the feature type corresponding to the second highest probability value in the probability distribution of a node when the node classification confidence is low (the initial classification cannot be directly used). If the highest probability of a node is "through hole" (0.52) and the second highest probability is "conical blind hole" (0.35), then "conical blind hole" is a candidate feature type. After extracting the candidate feature type, it is used as the new fitting target to re-perform geometric fitting, and the new classification is tested to see if it matches the actual geometry better. The area awaiting review can be understood as a region marked as requiring manual review, where automatic extraction is abandoned and manual intervention is required. This processing mechanism (i.e., both direct acceptance and pending review mechanisms) reflects the feedback constraint of parameter regression confidence on the classification results. Only when the classification type matches the actual geometry (residual meets the standard) is the classification result finally adopted; otherwise, the feature region is marked and unreliable results are not passed downstream. Geometric parameters corresponding to the target manufacturing feature type include: hole features (axial direction, diameter, depth, whether it is a through hole, bottom corner type), groove features (bottom surface, side surface, length, width, depth), chamfer / fillet (associated edge, radius, angle), and array (basic features, array direction, spacing, quantity). In this application, the least squares method is used to fit the geometric elements (e.g., using a cylindrical surface to fit the hole wall) to calculate the geometric parameters.
[0044] S502 includes: performing least-squares geometric fitting using the model surface geometric data corresponding to high-confidence nodes to obtain initial geometric parameters and initial fitting residuals; calculating standard fitting residuals based on the initial fitting residuals; when the standard fitting residuals are less than a first preset grading threshold, using the initial geometric parameters as geometric parameters; when the standard fitting residuals are greater than or equal to the first preset grading threshold and less than a second preset grading threshold, determining the initial geometric parameters as geometric parameters and attaching a preset confidence label, where the first preset grading threshold is less than the second preset grading threshold; when the standard fitting residuals are greater than the second preset grading threshold, marking the feature region as a classification doubtful region and triggering refitting; after obtaining the geometric parameters corresponding to each feature region through geometric fitting, determining the tolerance standard system corresponding to the manufacturing feature type based on the manufacturing feature type; the tolerance standard system includes a first tolerance standard for hole features and a second tolerance standard for planar features, where the first tolerance standard is ISO 286 and the second tolerance standard is GB / T The 1184 standard involves querying the tolerance grade matching the feature size in the tolerance standard system based on the feature size corresponding to the manufacturing feature type. The feature size is the geometric scale of the corresponding feature region. The queried tolerance grade is used as an additional parameter and associated with the geometric parameters obtained through geometric fitting. The associated geometric feature parameters and tolerance grade are then used together as the geometric parameters extracted from the feature region. In S105, extracting the geometric parameters corresponding to each target manufacturing feature type from multiple feature regions can be achieved through a parameter regressor.
[0045] Standard fit residuals refer to the values obtained after normalizing the original fit residuals, used to eliminate dimensional differences between features of different sizes. The calculation formula is: ,in The root mean square distance from the fitting point to the theoretical geometry (which can be understood as the root mean square value of the initial fitting residual) is used. The feature size is the typical geometric scale of the corresponding feature region (such as the diameter of a hole or the length of a groove), and 0.01 is a preset scaling factor. Normalization is used to make the fitting quality assessment of features with different sizes comparable. For example, a fitting residual of 2mm is acceptable for a hole with a diameter of 100mm; however, if the same 2mm fitting residual appears in a hole with a diameter of 5mm, it indicates that the fitting quality is seriously insufficient. The standard fitting residual is calculated... Then, a tiered processing strategy is adopted, specifically when... When the first preset grading threshold is reached, it indicates excellent fitting quality, and the initial geometric parameters are directly used as the aforementioned geometric parameters without labeling (default high confidence); when When the (second preset grading threshold) is reached, it indicates that the fit quality is acceptable, and the initial geometric parameters are determined to be the aforementioned geometric parameters, but with an additional label such as "Confidence: Moderate" (i.e., the aforementioned preset confidence label). When When the fitting quality is poor, a classification suspicion marker is directly triggered, marking the feature region as a classification suspicion region (pending manual review). Simultaneously, an anomaly feedback mechanism is triggered. After marking a region as a classification suspicion region, this application can perform the same refitting operation as described above, or wait for manual review for confirmation. The specific values of the first and second preset classification thresholds mentioned above are preferred examples in this application; specific classification thresholds can be set as needed, and this application does not impose limitations. The preset confidence marker is a metadata label attached to the geometric parameter output, used to indicate the confidence level of the parameter for downstream systems (such as CAPP and CAM). The "Confidence: Medium" marker reminds downstream systems to add a manual review step when using this parameter. The preset residual threshold can be understood as the second preset classification threshold, used to classify whether to mark a suspicion region.
[0046] In this application, feature classification and parameter regression are not independent pipelines, but rather form a closed loop through bidirectional feedback: a) Classification confidence guides regression region selection: The classification confidence map output by the GNN serves as spatial attention weights, guiding the preset parameter regressor to perform geometric fitting only in high-confidence regions (e.g., confidence > 0.7), avoiding the inclusion of low-confidence model surfaces in parameter calculations and introducing noise; b) Regression anomaly feedback corrects classification: When the fitting residual output by the preset parameter regressor exceeds a preset residual threshold (e.g., cylindrical surface fitting residual > 0.05 mm), the triggered feedback includes: marking the feature region as "classification suspicious" (i.e., suspicious region), refitting (re-examining the classification probabilities of each surface within the feature region; if a second-highest class probability exists (e.g., > 0.3), the class corresponding to the second-highest probability is used as the target feature category for refitting); if the fitting residual after refitting still exceeds the threshold, it is marked as awaiting manual review. This application employs a joint loss function during the training phase to simultaneously optimize both classification and regression tasks. The joint loss function is:
[0047] in, Cross-entropy classification loss, The Huber loss for parametric regression. This is called consistency loss (penalizing the inconsistency of "high classification confidence but large regression residuals"). and These are preset weighting coefficient values, which can be set as needed. For example In S106, the RDF triple (Resource Description Framework Triple) is specifically defined as follows: RDF is a framework standard proposed by the W3C for describing network resources, expressing semantic information using a "Subject-Predicate-Object" triple structure. In this application, each manufacturing feature instance is represented as an RDF resource (subject), with its feature type (object) and geometric parameters (object) as the values of its attributes (predicate). The preset rules refer to the RDF semantic classes and their attribute predicate system defined in the PDV standard ontology (Product Data View standard ontology). The PDV ontology, based on the GB / T 45405-2025 standard, defines a set of standardized feature semantic classes and corresponding attribute predicates. Encapsulation can be understood as encapsulating the feature type and geometric parameters into semantic triples conforming to the RDF semantic specification according to the PDV ontology definition. For example, for a feature identified as a via, its RDF triple is as follows: :hole_001 rdf:type pdv:ThroughHole (Subject: hole feature instance, predicate: type, object: through hole semantic class); :hole_001 pdv:hasDiameter "10.0"^^xsd:decimal (diameter parameter, decimal value type); :hole_001 pdv:hasDepth "20.0"^^xsd:decimal (depth parameter); :hole_001 pdv:hasAxisDirection "0,0,1" (axis direction); :hole_001 pdv:isLocatedOn :part_001 (part association).
[0048] This application also associates feature instances with faces (a list of stored face IDs) in the boundary representation data, facilitating subsequent geometric positioning and visualization. S106 includes S601, obtaining a standard feature ontology library, which defines mapping relationships between various manufacturing feature types and standard RDF semantic classes; S602, obtaining the target RDF semantic class identifier corresponding to the target manufacturing feature type from the standard feature ontology library; S603, mapping geometric parameters according to the attribute predicates corresponding to the target RDF semantic class identifier to generate attribute triples; S604, obtaining a list of model face identifiers included in each feature region and generating face association triples, wherein the face association triples are used to establish associations between feature instances and model faces in the boundary representation data; S605, determining the spatial dependency relationships between each feature region according to the spatial relationships indicated by the face adjacency graph and generating feature dependency triples; S606, combining and encapsulating the attribute triples, face association triples, and feature dependency triples corresponding to the target RDF semantic class identifier into an RDF triple and storing it in a preset storage location.
[0049] The standard feature ontology refers to an ontology knowledge base built based on the GB / T 45405-2025 standard (national standard related to product data patterns), which defines the semantic classification system of manufacturing feature types and the mapping rules between them and standard RDF semantic classes. The ontology is encoded in OWL (Web Ontology Language) or a similar formal language, and includes a class hierarchy (e.g., Feature>Hole>ThroughHole / BlindHole), attribute definitions, and constraint rules. Multiple manufacturing feature types refer to the various candidate feature types defined in the ontology, including but not limited to: pdv:ThroughHole (through hole), pdv:CounterboreHole (counterbore hole), etc. Multiple composite features refer to a large number of feature types with a hierarchical structure between categories. The mapping relationship refers to the correspondence from the feature type annotations used in this application (e.g., "through hole," "blind hole") to the standard RDF semantic class identifiers in the PDV ontology (e.g., pdv:ThroughHole). This mapping is the core of semantic alignment, ensuring that heterogeneous feature type names output by different CAD systems are uniformly converted into PDV standard semantic classes. The target RDF semantic class identifier is a unique identifier for a standard feature class in the PDV ontology, in the form of a URI (Uniform Resource Identifier). This target RDF semantic class identifier is the direct basis for generating the subject type in RDF triples, determining the selection range for all subsequent attribute predicates. Attribute predicates are standardized relationships defined in the RDF semantic class to describe feature attributes. For example, the pdv:ThroughHole class might define attribute predicates such as pdv:hasDiameter (hole diameter) and pdv:hasDepth (hole depth). Parameter mapping refers to mapping the original numerical parameters output by geometric fitting to the values of the corresponding attribute predicates, generating RDF attribute triples. Attribute triples are sets of triples with a feature instance as the subject, geometric parameters as objects, and attribute predicates as predicates, describing various parameter attributes of the feature. The model surface identifier list can be understood as a set of identifiers recording which CAD model surfaces constitute each feature region. A feature region is a collection of several adjacent nodes in a FAG, with each node corresponding to a CAD model face (face identifier Face_ID). By recording the mapping relationship between feature regions and faces, downstream systems can directly locate and visualize the geometric position of feature instances in the original B-Rep geometric data. Face association triples are RDF triples that establish the association between feature instances and their constituent faces. Face association triples enable RDF semantic data to trace back to the original geometric faces, serving as a bridge between semantic and geometric data. Spatial dependency relations are a type of geometric dependency tree, referring to the dependency relationships between different feature regions based on spatial location and topological relationships.For example: "Hole A is located on the top surface of boss B" (inclusion relationship), "Array C contains 6 identical through holes D1 to D6" (membership relationship), "Slot E intersects with through hole F" (intersection relationship); Feature dependency triples refer to RDF triples with a feature instance as the subject, dependency relationship as the predicate, and another feature instance as the object. The three types of triples (i.e., attribute triples (geometric parameters), surface association triples (surface representation list), and feature dependency triples (inter-region spatial relationships)) together constitute a complete semantic description of a feature instance. At the same time, this application also obtains the target RDF semantic class identifier corresponding to the target manufacturing feature type from the standard feature ontology library, creates feature instances based on the target RDF semantic class identifier, generates corresponding instance triples, and combines and encapsulates the instance triples with the above three types of triples to form the final RDF triple, which covers four dimensions: type, parameter, geometric association, and spatial dependency. The aforementioned preset storage location refers to a pre-configured graph database or triplet storage system used for persistent storage of RDF data for downstream CAPP, CAM, and PDM applications. In this application, based on the spatial relationships (containment and adjacency) of the face adjacency graph, the spatial and topological dependencies between identified features (target manufacturing feature types and corresponding geometric parameter indicators) are inferred, and a geometric dependency tree is constructed and output in JSON format. The dependency tree constructed in this application is based on spatial relationship inference of geometric features, which is fundamentally different from the parametric feature tree (sketching, extrusion, rotation, Boolean operations, etc.) in the original CAD modeling process. The latter cannot be recovered after being exported to neutral formats such as STEP / IGES, while the focus of this application is to recover geometric features and their dependencies, rather than reconstructing the modeling history. After encapsulating the RDF triples, this application further performs tolerance adaptive parameter extraction (to obtain tolerance information): based on the target manufacturing feature type and the corresponding manufacturing feature size, it automatically matches the applicable tolerance grade. For example, for hole features, according to ISO 286 standard, it automatically recommends tolerance zones (such as H7, H8, etc.) based on the diameter range of the hole feature; for planar features, according to GB / T 1184, it automatically recommends unspecified tolerance grades based on the size range. Then, the tolerance information is encapsulated into the RDF triples. The process of generating RDF triples can be implemented through a semantic mapper.
[0050] This application employs pre-encapsulated parsing drivers in different file formats to parse corresponding CAD parsing files. It constructs a face adjacency graph based on the parsed boundary representation data and "reconstructs" the manufacturing features corresponding to the CAD model file based on this graph. Specifically, this application can identify manufacturing features such as holes, slots, chamfers, and fillets based on B-Rep, and recover repeating structures such as arrays and mirrors through geometric pattern recognition. It is applicable to CAD model files from different sources and ensures the accuracy of the identified target manufacturing feature types and corresponding geometric parameters. Furthermore, this application supports multiple CAD formats and neutral formats, boasts high feature recognition accuracy, requires no original feature tree, can recover parametric features from "dead geometry," and outputs RDF triples conforming to the product data model of GB / T 45405-2025 standard. These data can be associated with PDV visualization models via URIs and directly used for downstream CAPP, simulation, and assembly analysis.
[0051] According to another aspect of the embodiments of this application, a multi-source CAD general feature extraction system is also provided. The system includes: an acquisition unit for implementing the above-described S101; a parsing unit for implementing the above-described S102; a construction unit for implementing the above-described S103; an aggregation unit for implementing the above-described S104; an extraction unit for implementing the above-described S105; and an encapsulation unit for implementing the above-described S106.
[0052] The specific execution methods of each unit in the above system embodiments have been described in detail in the embodiments related to the method, and will not be elaborated further here.
[0053] According to another aspect of the embodiments of this application, an electronic device for implementing the above-described multi-source CAD general feature extraction method is also provided. The electronic device may be a terminal device or a server. The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to cause the at least one processor to perform the steps in any of the above-described embodiments of the multi-source CAD general feature extraction method.
[0054] According to one aspect of this application, a computer-readable storage medium is provided, wherein a processor of a computer device reads computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the above-described multi-source CAD general feature extraction method.
[0055] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A universal feature extraction method for multi-source CAD, characterized in that, include: Obtain the CAD model file and identify the file format identifier of the CAD model file; The CAD model file is parsed according to the file format identifier, and the corresponding parsing driver is loaded to obtain boundary representation data. A face adjacency graph is constructed based on the boundary representation data. An initial geometric feature vector corresponding to each node in the face adjacency graph is calculated, and the initial geometric feature vector is embedded into the face adjacency graph as the node feature of the corresponding node. The face adjacency graph is input into a preset node classification model, which outputs the feature type probability distribution of each node in the face adjacency graph. The nodes are then aggregated according to the feature type probability distribution to obtain multiple feature regions. Determine the target manufacturing feature type corresponding to each of the aforementioned feature regions, and extract the geometric parameters corresponding to each target manufacturing feature type from the multiple feature regions; The target manufacturing feature type and the corresponding geometric parameters are encapsulated into RDF triples that conform to preset rules and stored.
2. The method according to claim 1, characterized in that, The CAD model file is parsed according to the file format identifier, and the corresponding parsing driver is loaded to obtain boundary representation data, including: According to the file format identifier, the parsing driver corresponding to the file format identifier is loaded from the preset driver mapping table, and the CAD model file is parsed by the parsing driver to obtain the initial boundary representation data; Obtain the geometric topology information of each model face in the initial boundary representation data, wherein the geometric topology information includes at least the boundary edges, vertex coordinates and adjacency relationships between each model face; Based on the geometric topology information, the initial boundary representation data is topologically repaired to obtain the boundary representation data.
3. The method according to claim 1, characterized in that, Based on the boundary representation data, a face adjacency graph is constructed. An initial geometric feature vector corresponding to each node in the face adjacency graph is calculated, and the initial geometric feature vector is embedded into the face adjacency graph as the node feature of the corresponding node. This includes: Extract the source geometry type annotations of each model face from the boundary representation data, as well as the source kernel identifier of the CAD model file; Based on the source kernel identifier, load the mapping sub-table corresponding to the source kernel identifier from the preset kernel semantic mapping table, and use the loaded mapping sub-table to convert the source geometry type annotation of each model surface into the corresponding standard type annotation; Based on the standard type annotations and the geometric topology information of each model surface, calculate the initial geometric feature vector for each model surface; Using the nodes corresponding to each model face as graph nodes and the shared edge adjacency relationship between model faces as graph edges, a face adjacency graph is constructed, and each initial geometric feature vector is embedded into the face adjacency graph as the node feature of the corresponding node.
4. The method according to claim 1, characterized in that, The face adjacency graph is input into a preset node classification model, and the feature type probability distribution corresponding to each node in the face adjacency graph is output, including: The initial geometric feature vectors of each node in the face adjacency graph are mapped to hidden features of a preset dimension through the input mapping layer in the preset node classification model. The edge attributes of each edge in the face adjacency graph are extracted, and the edge attributes of each edge are encoded by the edge feature encoding network in the preset node classification model to obtain the edge hidden layer features corresponding to each edge. In each layer of the multi-layer graph convolutional network in the preset node classification model, the edge hidden layer features are used to perform weighted fusion of message passing between adjacent nodes to obtain the output node features of each layer of graph convolutional network. By using the skip connection layer in the preset node classification model, the output node features of the first layer graph convolutional network and the output node features of the last layer graph convolutional network are concatenated to obtain the fused features of each node. The fused features of each node are input into the node classification output layer of the preset node classification model, and the feature type probability distribution corresponding to each node is output.
5. The method according to claim 1, characterized in that, Aggregating each node based on the probability distribution of feature types yields multiple feature regions, including: The face adjacency graph is used as an undirected graph structure of a conditional random field, with the initial geometric feature vector of each node as the observation feature; In the conditional random field, the feature type probability distribution obtained by the observed features through the preset node classification model is used to construct a univariate potential function for each node in the undirected graph structure. The univariate potential function is used to characterize the cost of assigning a single node to a specific feature type. Extract the geometric relationship between the model surfaces corresponding to adjacent nodes in the undirected graph structure from the observed features, and construct a binary potential function; Within the conditional random field framework, the feature type probability distribution is iteratively optimized using the univariate potential function and the binary potential function to obtain the target type label corresponding to each node; Nodes with the same target type label and directly connected by edges in the face adjacency graph are aggregated into the same feature region to obtain the multiple feature regions.
6. The method according to claim 5, characterized in that, Nodes with the same target type label and directly connected by edges in the face adjacency graph are aggregated into the same feature region to obtain the multiple feature regions, including: Based on the target type label corresponding to each node, obtain the target probability value of each node corresponding to the target type label; The target probability values are compared with a preset confidence threshold to obtain the comparison results; The nodes whose target probability value is lower than the preset confidence threshold as indicated by the comparison result are marked as unclassified nodes and filtered out from the node set corresponding to the face adjacency graph to obtain a candidate node set; In the candidate node set, nodes with the same target type label and directly connected by edges are aggregated into the same feature region, resulting in multiple feature regions.
7. The method according to claim 1, characterized in that, Determine the target manufacturing feature type corresponding to each of the aforementioned feature regions, and extract the geometric parameters corresponding to each target manufacturing feature type from the multiple feature regions, including: For each feature region, spatial attention weights are constructed based on the classification confidence of each node within the feature region. Nodes with classification confidence higher than a preset regression threshold are labeled as high-confidence nodes, and nodes with classification confidence lower than or equal to the preset regression threshold are labeled as low-confidence nodes. Call the preset parameter regressor, use the target manufacturing feature type as the fitting target type parameter, and use the model surface geometric data corresponding to the high confidence node to perform least squares geometric fitting to obtain the initial geometric parameters and fitting residuals of the feature region; When the fitting residual exceeds a preset residual threshold, the feature region is marked as a classification doubtful region, and the candidate feature type corresponding to the second highest probability in the feature type probability distribution of the low confidence node is extracted. Using the candidate feature type as the fitting target type parameter, the preset parameter regressor is called again to perform geometric fitting on the model surface geometric data corresponding to the high confidence node and the low confidence node; When the fitting residual after refitting exceeds the preset residual threshold, the feature region is marked as a region to be reviewed. When the fitting residual after refitting is lower than or equal to the preset residual threshold, the candidate feature type is determined as the target manufacturing feature type of the feature region, and the geometric parameters obtained by refitting are used as the geometric parameters extracted from the feature region.
8. The method according to claim 7, characterized in that, A preset parameter regressor is invoked, and least-squares geometric fitting is performed using the model surface geometric data corresponding to the high-confidence nodes to obtain the initial geometric parameters and fitting residuals of the feature region, including: Least square geometric fitting is performed using the model surface geometric data corresponding to the high confidence nodes to obtain the initial geometric parameters and the initial fitting residuals. Calculate the standard fitting residual based on the initial fitting residual; When the standard fitting residual is less than the first preset classification threshold, the initial geometric parameters are used as the geometric parameters; When the standard fitting residual is greater than or equal to the first preset grading threshold and the standard fitting residual is less than the second preset grading threshold, the initial geometric parameter is determined as the geometric parameter and a preset confidence label is attached, wherein the first preset grading threshold is less than the second preset grading threshold; When the standard fitting residual is greater than the second preset classification threshold, the feature region is marked as a classification doubtful region and refitting is triggered.
9. The method according to claim 1, characterized in that, The target manufacturing feature type and the corresponding geometric parameters are encapsulated into RDF triples conforming to preset rules and stored, including: Obtain a standard feature ontology library, wherein the standard feature ontology library defines a mapping relationship between various manufacturing feature types and standard RDF semantic classes; Obtain the target RDF semantic class identifier corresponding to the target manufacturing feature type from the standard feature ontology library; The geometric parameters are mapped according to the attribute predicates corresponding to the target RDF semantic class identifier to generate attribute triples; Obtain a list of model face identifiers included in each of the feature regions, and generate face association triples, wherein the face association triples are used to establish an association between the feature instance and the model face in the boundary representation data; Based on the spatial relationships indicated by the face adjacency graph, determine the spatial dependency relationships between each of the feature regions and generate feature dependency triples; The attribute triples, face association triples, and feature dependency triples corresponding to the target RDF semantic class identifier are combined and encapsulated into the RDF triples and stored in a preset storage location.
10. A multi-source CAD universal feature extraction system, characterized in that, include: The acquisition unit is used to acquire CAD model files and identify the file format identifier of the CAD model files. The parsing unit is used to load the parsing driver corresponding to the file format identifier according to the file format identifier to parse the CAD model file and obtain boundary representation data; The construction unit is used to construct a face adjacency graph based on the boundary representation data, calculate the initial geometric feature vector corresponding to each node in the face adjacency graph, and embed the initial geometric feature vector as the node feature of the corresponding node into the face adjacency graph. The aggregation unit is used to input the face adjacency graph into a preset node classification model, output the feature type probability distribution corresponding to each node in the face adjacency graph, and aggregate each node according to the feature type probability distribution to obtain multiple feature regions. An extraction unit is used to determine the target manufacturing feature type corresponding to each of the feature regions, and to extract the geometric parameters corresponding to each target manufacturing feature type from the multiple feature regions. The encapsulation unit is used to encapsulate the target manufacturing feature type and the corresponding geometric parameters into RDF triples that conform to preset rules for storage.
