Boundary representation generation method and system based on graph diffusion and storage medium

By representing the B-rep model as a graph structure and using the graph diffusion model to generate the geometric features of faces and edges, combined with the continuous topological decoupling model, the low efficiency and poor topological consistency problems of existing B-rep generation methods are solved, and efficient and accurate generation of complex geometric shapes is achieved.

CN120724508AActive Publication Date: 2025-09-30HANGZHOU DIANZI UNIV

Patent Information

Application Number
CN202511240368.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-02
Publication Date
2025-09-30
Estimated Expiration
2045-09-02

AI Technical Summary

Technical Problem

Existing B-rep generation methods are inefficient and computationally intensive when generating complex geometries, and have poor topological consistency. Disconnected or self-intersecting surfaces are prone to occur, which affects the model quality.

Method used

A B-rep generation method based on graph diffusion is adopted to represent the B-rep model as a graph structure. The geometric features of faces and edges are generated using the graph diffusion model, and the consistency of the topological structure is maintained through the continuous topological decoupling model to reduce redundant calculations.

Benefits of technology

Significantly improve generation efficiency, ensure the geometric accuracy and topological validity of the model, reduce topological inconsistencies, and adapt to complex design requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120724508A_ABST
    Figure CN120724508A_ABST
Patent Text Reader

Abstract

The invention discloses a boundary representation generation method based on graph diffusion. The method comprises the following steps: step 1, constructing an industrial part data set and preprocessing the industrial part data set; step 2, constructing and training a Brep-GD model based on the preprocessed self-built data set and the two open source data sets; the Brep-GD model comprises a variational auto-encoder, a graph diffusion model, a continuous topology decoupling model and a post-processing module; 3, reasoning and evaluating the trained Brep-GD model by using a test set of a data set so as to verify multiple types of indexes of distribution measurement, CAD measurement and efficiency measurement of the model; and step 4, applying the evaluated Brep-GD model to generate a simplified B-rep model, the method can significantly reduce redundancy calculation, improve generation efficiency, and ensure that the generated B-rep model has higher geometric accuracy and topology effectiveness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of CAD drawing, and in particular to a method, system and storage medium for generating boundary representation based on graph diffusion. Background Art

[0002] In computer-aided design (CAD), B-rep (Boundary Representation) is a standard geometric modeling method widely used in engineering design, manufacturing, and the representation of three-dimensional models. B-rep represents the geometric shape and topological structure of three-dimensional objects using basic geometric elements such as vertices, edges, and faces. Its core advantage lies in its ability to accurately describe complex three-dimensional geometries, playing an irreplaceable role in the modeling of free-form surfaces and various complex geometric shapes. However, despite the widespread application of B-rep technology in various industrial fields, existing B-rep generation methods still face significant technical challenges when dealing with complex geometric and topological relationships, particularly in terms of generation efficiency and topological consistency.

[0003] Existing B-rep generation methods can generally be divided into two categories: template-based generation methods and generative model-based methods. Template-based methods mainly rely on predefined geometric shapes and Boolean operations to generate new B-rep models by modifying and combining these geometric prototypes. This method is very effective when dealing with simple or regular geometries, such as common geometric shapes such as cubes and cylinders. However, when encountering complex free-form surfaces or designs with complex topology, the limitations of this method become particularly apparent. The generated geometries are often too simple and lack flexibility, and when faced with complex design requirements, they require a lot of manual intervention and cannot adapt to diverse design needs.

[0004] With the development of deep learning technology, B-rep generation methods based on generative models have gradually emerged as a new solution. Deep learning methods use neural networks to learn the geometric and topological features of large-scale B-rep datasets, thereby automatically generating complete B-rep models given input conditions. For example, sequence-based generation models such as SolidGen employ recurrent neural networks (RNNs) or Transformer networks to gradually generate B-rep vertices, edges, and faces. By learning the geometric features and topological relationships of B-rep models, these methods can generate a wide variety of geometric shapes and, to a certain extent, address the complexity and diversity issues inherent in traditional methods. Although deep learning methods have made some progress in generating B-rep models, they still face numerous challenges in practical applications. First, the generation process of such methods is typically step-by-step, requiring multiple stages of reasoning and computation, especially when generating complex geometric shapes. This results in low generation efficiency. Second, because deep learning models often have local dependencies when processing geometry and topology, the generated B-rep models often struggle to maintain topological consistency and are prone to the occurrence of disconnected or self-intersecting faces, significantly impacting practical design work.

[0005] In recent years, several methods based on graphical models have attempted to achieve breakthroughs in B-rep generation. These methods treat the B-rep model as a graph structure, with nodes representing face elements and edges representing connections between faces. They use graph convolutional networks (GCNs) or graph diffusion models to capture the complex relationships between geometry and topology. For example, BrepGen proposes a B-rep generation method based on a hierarchical tree structure, building a B-rep model by gradually refining the generation process of vertices, edges, and faces. While graphical model methods offer certain advantages in topological modeling, existing methods still face several significant technical challenges. First, many graphical model methods rely on a tree structure for hierarchical generation, which results in a lengthy and computationally intensive generation process and low efficiency when dealing with complex geometries. Second, existing graph diffusion models often fail to fully exploit the inherent graph structure of the B-rep model. In particular, when dealing with high-dimensional complex topologies, they still struggle to ensure the topological consistency of the generated results. This is particularly true when generating polyhedra or free-form surfaces, which can lead to topological instability.

[0006] In summary, although the existing technology has made certain progress in B-rep generation, the following technical problems still exist: First, the existing methods are inefficient in generating complex geometries, especially when processing B-rep models with complex topological relationships, the amount of calculation is large, and it is difficult to achieve efficient generation; Second, the B-rep models generated by the existing methods often face the problem of poor topological consistency, especially in the generation process, disconnected or self-intersecting faces are prone to appear, affecting the quality of the final generated model; Third, most of the existing methods rely on hierarchical structures or step-by-step generation processes, which leads to redundant calculations and high computational complexity in the generation process. In response to these problems, the present invention proposes a B-rep generation model Brep-GD based on graph diffusion, which aims to effectively solve the problems of low computational efficiency, poor topological consistency and redundant calculations in the existing technology through the representation of graph structure and the method of topological decoupling. Summary of the Invention

[0007] The purpose of the present invention is to overcome the shortcomings of the existing technology and propose a boundary representation generation method based on graph diffusion, which aims to solve the problems of efficiency and topological consistency of existing B-rep generation methods. Unlike existing methods based on tree structure or sequential generation, the present invention represents the B-rep model as a graph structure, uses the graph diffusion model to effectively generate the geometric features of faces and edges, and simultaneously maintains the consistency of the topological structure. Unlike the existing tree-hierarchical structure method, the present invention can significantly reduce redundant calculations, improve generation efficiency, and ensure that the generated B-rep model has higher geometric accuracy and topological validity.

[0008] In order to achieve the above object, the technical solutions specifically adopted by the present invention are as follows:

[0009] A method for generating boundary representation based on graph diffusion includes the following steps:

[0010] Step 1: Build and preprocess the industrial parts dataset;

[0011] Step 2: Build and train the Brep-GD model based on the preprocessed self-built dataset and two open source datasets;

[0012] The Brep-GD model includes a variational autoencoder, a graph diffusion model, a continuous topological decoupling model and a post-processing module;

[0013] The training method of the Brep-GD model is:

[0014] The preprocessed self-built dataset and two open source datasets are used as training sets, and the face and edge features of the real B-rep model of the training set are compressed into low-dimensional latent vectors using a variational autoencoder.

[0015] The low-dimensional latent vector is denoised to obtain pure noise, and the denoised face and edge features are gradually diffused in four stages using a graph diffusion model. A continuous topological decoupling model is used to decouple the edge diffusion structure into a prediction noise output by aggregating the features of connected nodes during the model information propagation process in three and four stages to refine the edge features.

[0016] Establish a noise prediction loss function and perform post-processing of refined features through the post-processing module, and generate the final streamlined B-rep model through combination;

[0017] Step 3: The trained Brep-GD model is used to perform inference and evaluation on the test set of the dataset to verify the model's distribution metric, CAD metric, and efficiency metric.

[0018] Step 4: Apply the evaluated Brep-GD model to generate a streamlined B-rep model.

[0019] Preferably, the method for constructing the industrial parts dataset in step 1 includes data collection, format standardization, geometry verification and classification annotation.

[0020] Preferably, the pre-processing method includes data partitioning, face / edge number filtering and geometric direction standardization.

[0021] Preferably, in step 2, during training, the variational autoencoder is trained by reconstruction loss and KL regularization.

[0022] Preferably, in step 2, the face features of the real B-rep model are compressed to a dimension of 4 4 3 low-dimensional latent vector, the edge features are compressed to a dimension of 4 3 low-dimensional latent vector.

[0023] Preferably, the step 2 further includes decomposing the graph structure of the B-rep model into probability distributions of face features and edge features by a probability distribution method, wherein the face features include the global position of the face. Latent geometric features of the surface , edge features include the global position of the edge and the potential geometric features of edges and vertex features .in, The probability distribution of is decomposed into the given The conditional probability under the probability distribution of and the probability distribution of face features, The probability distribution of is decomposed into the conditional probability under the probability distribution of given face features, The probability distribution of is decomposed into the given The conditional probability under the probability distribution of The probability distribution of is the prior probability.

[0024] As a preference, the initial state, the global position of the decomposed surface , potential geometric features of the surface , the global position of the edge and the potential geometric features of edges All are Gaussian noise.

[0025] Preferably, in step 2, the four-stage denoising is implemented as follows:

[0026] The first stage: the global position features of the initial surface As input, after the embedding time step, it is input into the surface diffusion model for iterative denoising to obtain the refined global position features of the surface , the surface diffusion model uses the Transformer backbone network;

[0027] The second stage: The initial latent geometric features of the surface conditions After the embedding time step, the input is fed into the surface diffusion model for iterative denoising to obtain the potential geometric features of the refined surface. , the surface diffusion model uses the Transformer backbone network

[0028] The third stage: and As the initial global position feature of the edge conditions After the embedding time step, the edge diffusion model is input for iterative denoising to obtain the refined edge global position features. , the edge diffusion model uses the continuous topological decoupling model (CGTD)

[0029] The fourth stage: 、 and As the initial potential geometric features of edges and vertex features conditions After embedding the time step, the edge diffusion model is input and the latent geometric features and vertex features of the refined edge are obtained through iterative denoising. , the edge diffusion model uses the continuous topological decoupling model (CGTD).

[0030] Preferably, the continuous topological decoupling model includes a local topological information aggregation module and a global error suppression module, wherein the local topological information aggregation module includes a graph isomorphism convolution layer and a face-edge attention message passing layer; the global error suppression module is based on a standard TransformerEncoder architecture stacking several layers, and uses an average pooling layer to optimize and suppress outliers.

[0031] Preferably, the post-processing method of the refined features is: constructing vertex-edge topology based on the method of identifying closed loops formed by points on the surface, discarding irrelevant surface connection relationships based on edge eigenvalues, and correcting the geometric position based on vertex-edge-surface.

[0032] The present invention also provides a boundary representation generation system based on graph diffusion, which is used to execute a boundary representation generation method based on graph diffusion.

[0033] The present invention also provides a computer-readable storage medium storing a computer program, wherein when the program is executed by a processor, a method for generating a boundary representation based on graph diffusion is implemented.

[0034] The present invention has the following characteristics and beneficial effects:

[0035] The present invention significantly improves the generation efficiency and model quality by adopting a B-rep generation method based on graph diffusion. Compared with the traditional tree structure method, the present invention avoids computational redundancy by converting the B-rep model into a graph structure representation, and effectively reduces the topological structure error through the continuous topological decoupling method, ensuring the geometric and topological consistency of the generated model. This method not only greatly improves the computational efficiency in the generation process, but also reduces the topological inconsistency problems common in traditional methods, ensuring that the generated B-rep model can meet the requirements of effectiveness and geometric accuracy in industrial design. Through graph diffusion technology, the model can effectively generate complex geometric shapes without relying on global attention calculations, and ensures the stability and accuracy of the topological structure, thereby providing a reliable solution for the automatic generation of complex geometric shapes in practical applications, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 Flow chart of the specific steps of the present invention.

[0037] Figure 2 This is the generation process of the B-rep model in an embodiment of the present invention.

[0038] Figure 3 This is a diagram showing the structure of the B-rep model in this embodiment.

[0039] Figure 4 This is the statistical information of the data set in the embodiment of the present invention. DETAILED DESCRIPTION

[0040] The present invention is described in detail below in conjunction with specific embodiments. The following examples will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other.

[0041] Example 1

[0042] This embodiment discloses a method for generating boundary representation based on graph diffusion, such as Figure 2 and Figure 3 As shown, the following steps are included:

[0043] Step 1: Build and preprocess the industrial parts dataset.

[0044] In this embodiment, 11,142 real industrial part models in 40 categories including bearing seats, forging shackles, end wrenches, etc. were widely collected from actual industrial production environments. First, all models were uniformly converted into the standard STEP format to ensure the consistency and versatility of the data format and support the subsequent processing requirements of different CAD software. Then, the collected data were strictly verified for geometric accuracy and quality control, and automated tools were used to remove duplicate and overlapping models, and the geometric direction was standardized to ensure the uniqueness and consistency of the data set. In addition, under the guidance of experts in the relevant industrial fields, the classification and labeling were carried out meticulously, and the number of data in each category was clearly recorded. Finally, a detailed statistical analysis was performed on the processed data to record the distribution of the number of entities, faces, and edges in the model, and the overall structure and distribution characteristics of the data set were intuitively presented through data visualization technology to obtain a new industrial parts data set CADNet40v2, as shown in the figure. Figure 4 shown.

[0045] Furthermore, this embodiment systematically uses three data sets for model training, verification and testing, namely CADNet40v2, DeepCAD and Furniture B-rep data sets. For the DeepCAD data set, the present invention uses its original training, verification and testing divisions, and removes duplicate models from the training set according to the method proposed by Willis et al. For closed surfaces, such as cylinders, the present invention splits them along the seams according to the method in SolidGen. B-rep models will be filtered out if they contain more than 50 faces, more than 50 edges per face, or there are multiple edges between faces and they are composed of multiple parts. After filtering, a total of 87,815 B-rep models were used to train VAE and diffusion models. When using the CADNet40v2 and Furniture B-rep data sets, they were randomly divided into 90% for training, 5% for verification, and 5% for testing. A total of 43,561 DeepCAD B-rep, 837 Furniture B-rep, and 2,136 CADNet40v2 B-rep models were used to train the graph diffusion model. Furthermore, after further filtering, eight categories from the CADNet40v2 dataset were retained for training and testing. The raw data was preprocessed to ensure consistency and usability. This included verifying the geometric accuracy of the models, removing duplicates, and standardizing their orientation. Furthermore, all part models were converted to a standard format, enabling seamless conversion between different CAD representations, including the STEP format, thereby enhancing the dataset's versatility across various CAD applications.

[0046] Step 2: Build and train the Brep-GD model based on the preprocessed self-built dataset and two open source datasets. The Brep-GD model includes a variational autoencoder, a graph diffusion model, a continuous topological decoupling model, and a post-processing module.

[0047] like Figure 2 As shown, it specifically includes the following sub-steps:

[0048] Step 2-1: Use the preprocessed self-built dataset and two open source datasets as training sets, and use the variational autoencoder to compress the face and edge features of the real B-rep model of the training set into low-dimensional latent vectors.

[0049] Brep-GD uses a similar setting to BrepGen to compress the shape features of faces and edges. Two variational autoencoders are used to encode the geometric features of the face and edge features of the real B-rep model in the dataset into low-dimensional latent vectors. Specifically, the latent vectors of faces and edges are represented as and .

[0050] It can be understood that these latent representations make subsequent processing more efficient while preserving important geometric information. The variational autoencoder is trained using reconstruction loss and KL regularization to ensure high quality of the latent encoding, balancing feature compression and fidelity.

[0051] Step 2-2: Noise the low-dimensional latent vector to obtain pure noise, and then use the graph diffusion model in four stages to gradually denoise the features of the diffusion surface and edges. At the same time, use the continuous topological decoupling model in stages 3 and 4 to decouple the diffusion structure of the edge into the feature output prediction noise of the aggregated connected nodes during the model information propagation process, so as to refine the edge features.

[0052] Step 2-2-1. In Brep-GD, the goal of the graph diffusion process is to iteratively refine the latent representation of the B-rep features through DDPM. This iterative process gradually removes noise from the latent features, ensuring that the resulting geometric and topological structures are accurate and consistent. By gradually refining the latent features, Brep-GD ensures that the final representation effectively captures both local and global features.

[0053] For a diffusion process, given the latent characteristics , the forward diffusion process will be Gaussian noise is added to all features at each time step. Noise potential characteristics of the step The following sampling:

[0054] Among them, the noise potential characteristics can also be expressed as:

[0055] here ,and ,in . Noise Dispatch Determined by variance scheduling, linear scheduling is used by default. The low-dimensional latent vector output to step 3 Injecting noise to obtain Afterwards, the encoded geometric and topological features are perturbed, causing the latent representation to lose accurate structural relationships. This perturbation ensures that the model can effectively denoise and reconstruct the topological structure in the reverse process.

[0056] Step 2-2-2: It should be noted that it is very difficult to generate a complete B-rep model in a single step because the search space of the dynamic graph is very large.

[0057] Therefore, the present invention decomposes the distribution of the entire graph into the product of the conditional probability distribution of nodes and edges. Figure 3This decomposition step shows that the B-rep model can be represented as a graph structure, where the nodes of the graph structure represent the geometric distribution of the faces of the B-rep model, and the edges of the graph structure represent the geometric distribution of the edges of the B-rep model. In addition, the geometric distribution of the nodes (corresponding to the faces in the B-rep) is decomposed into and The product of the conditional probability distributions of , and the geometric distribution of the edges (corresponding to the edges in B-rep) is decomposed into and The above decomposition process can be expressed as:

[0058] in represents the complete graph of the B-rep model, Represents the global position of the face, represents the underlying geometry of the surface, represents the global position of the edge, Represents the potential geometric features of edges and vertex features. This decomposition reflects the decoupling of the generation of nodes and adjacent edges in graph data, and the process of generating potential geometry based on positional geometry information. The overall architecture of the graph diffusion module is as follows: Figure 2 shown.

[0059] Step 2-2-3, four-stage denoising, includes node-level (face) diffusion and edge diffusion, and the implementation method is as follows:

[0060] Phases 1 and 2 focus on generating face features (including face global position features and face latent geometric features). Both phases use a Transformer backbone network to iteratively denoise and generate clean face latent representations.

[0061] Phase 1 focuses on (surface position) generation. The initial state is Gaussian noise, that is , which is refined after iterative denoising as a condition for subsequent generation steps. Specifically, the input shape of the model is ,in Represents the number of faces, some of which are embedded Defined as:

[0062]

[0063] in yes dimensional embedding matrix. MLP is a fully connected layer using SiLU activation function. is the time step embedding. The global position characteristics of the surface Indicated by Determine the stage in the denoising process and use the Token as the input to the Transformer module to predict each generation of noise. Remove the noise predicted by each generation, and finally get the refined global position of the surface in this stage '.

[0064] Phase 2 focuses on generating (The underlying geometric features of the surface). Similar to , The initial state is still Gaussian noise, generated in stage 1 As the conditional iterative denoising in this stage, The input shape of the model is ,in Represents the number of faces, fully embedded Defined as:

[0065] in yes dimensional embedding matrix. Face embedding Integrates the geometric features of the surface and topological features Generates a comprehensive and integrated face embedding representation and Determines the stage in the denoising process. It is mainly used as a condition for subsequent generation steps to provide detailed geometric and topological features of the two adjacent faces when generating potential edges in subsequent stages, similar to the one used in stage 1. Iterative denoising.

[0066] In Phases 3 and 4, focus on (edge ​​position) and (latent geometric features of edges and vertex features), the initialization and iterative denoising process for both are similar to those in stages 1 and 2. However, due to the unique complexity of learning the distribution of B-rep graphs, directly applying standard graph neural networks to the task is not suitable for edge diffusion. The model must emphasize the dependencies between local faces and edges in the B-rep graph and aim to restore the global strict topological structure without open edges or faces. Furthermore, the model should be able to distinguish between valid and invalid topologies while efficiently handling the quadratic complexity of all possible topological connections relative to the number of nodes.

[0067] To address these challenges, we propose the Continuous Graph Topology Decoupling (CGTD) model. The core idea of ​​CGTD is to decouple the diffusion structure of edges (which contains continuous topological information) into features that aggregate connected nodes during model information propagation, thereby efficiently utilizing model information. This model consists of two branches: the Local Topology Information Aggregation (LTIA) module and the Global Error Suppression (GES) module.

[0068] Phase 3 focuses on Generation of (edge ​​positions). The initialization is similar to that of stage 1 and stage 2, which is still Gaussian noise and generated by stage 1 and stage 2. 、 As the conditional iterative denoising in this stage, The input of the model consists of the full face embedding , whose shape is , and some edge embeddings , whose shape is ,in Represents the number of faces, including time step embedding. Partial edge embedding Defined as:

[0069] in yes dimensional embedding matrix, and Represents the embedding of two faces connecting an edge. Incorporating edge position features and the information of the two faces adjacent to the edge, the embedding of the two faces is used as the edge position information encoding. Similar to the Transformer modules in stage 1 and stage 2, the CGTD module is based on The token used as input is used to predict the noise of each generation.

[0070] Phase 4 focuses on Generation. The initialization is similar to the previous stage, still Gaussian noise, and the noise generated in the previous stage 、 、 As the conditional iterative denoising in this stage, The input of the model consists of face embeddings , and full edge embedding , whose shape is ,in Represents the number of faces, including time step embedding. Full edge embedding Defined as:

[0071] Full edge embedding Incorporates the geometric features of edges , topological features of edges and vertex features And the information of the two faces adjacent to the edge, the embedding of the two faces is also used as the position information encoding of the edge. Similar to stage 3, The token used as the input of the CGTD module is used to predict the noise of each generation.

[0072] The edge embeddings obtained in the above stages 3 and 4 and It is mainly used as the input of the CGTD module for feature aggregation and optimization, thereby improving the performance of the entire model.

[0073] The LTIA module, a submodule of the CGTD module, contains a standard message passing layer GINE, which aggregates local neighborhood node and corresponding edge features based on the decoded discrete graph structure. In addition, it is combined with a fully connected face-edge attention (FEATT) message passing layer, which focuses on the local information of all edges connected to the same node. This module is stacked in the model Layer, among which the The message passing and update operations of a layer are defined as:

[0074]

[0075]

[0076] Here, FFN stands for Feedforward Neural Network, and Respectively represent The features of two nodes in a layer connected by an edge. and , which correspond to and In FEATT, nodes The message passing and update process is expressed as:

[0077]

[0078]

[0079] in, represents the sigmoid function, 、 and from Projection obtained.

[0080] Taking into account the dual nature of edge features, their diversity and relevance across different facets, the GES module guides correct connections by requiring nodes to self-attentionally focus on global features. It also suppresses local outliers within nodes through max pooling. The architecture is based on the standard TransformerEncoder and consists of 12 stacked layers with 12 heads, pre-layer normalization, a hidden dimension of 1024, a feature dimension of 768, and a dropout rate of 0.1.

[0081] Finally, the CGTD module outputs prediction noise by decoupling edge feature aggregation, which is expressed as:

[0082]

[0083]

[0084] in, and It is the output of the GES module, a submodule of the CGTD module. 、 and Respectively represent the LTIA modules in The output of the layer, Indicates the Hedi Different from directly applying global attention to all edges, this decoupled edge generation method reduces the computational complexity by an order of magnitude.

[0085] In conditional generation, category information is not explicitly embedded in the representation of edges, but is only incorporated when generating faces. This decision is based on the observation that when face geometry is known, the generation of edge geometry and topology depends primarily on face geometry. Excluding category information also enhances the robustness of the generative model by reducing its reliance on category-specific features and improves its generalization ability when encountering different input types, especially on datasets with imbalanced class samples.

[0086] Step 2-3: Establish a noise prediction loss function and perform post-processing of refined features through the post-processing module, and generate the final streamlined B-rep model through combination.

[0087] Specifically, the Brep-GD model uses L2 regression loss to accurately predict the noise added in each forward diffusion step. This goal follows the DDPM framework, where the model learns to estimate the added noise, thereby improving the quality of the generated features. The noise prediction loss function is defined as:

[0088]

[0089] in In the forward diffusion process, Gaussian noise added in the first step, represents the corrupted data after noise injection, as shown in Equation 2. In Brep-GD, Corresponding to clean node features, including 、 、 and ,and Represents the noise features after forward diffusion. By minimizing this loss, the model can effectively learn to predict and remove noise, thereby improving the quality of the potential representation.

[0090] Brep-GD generates sufficiently clean surface features 、 and edge features 、 After that, we can start to build the graph structure of the Brep model. After decoding by the variational autoencoder, the UV sampling in the unit space is restored to obtain the local geometric information of the surface, and then the The local geometric information of the face is placed in the correct global position. The same process is applied to edge features, that is, the position and shape of each edge in three-dimensional space are determined by the corresponding feature parameters. On this basis, Brep-GD initially creates a fully connected graph, in which each point in the graph structure represents a face, and each edge represents the connection relationship between two faces. This means that at this time, any two faces are assumed to be associated and thus connected by an edge. However, this fully connected graph may contain many edge connections that do not actually exist or are invalid.

[0091] To optimize the fully connected graph structure obtained above, Brep-GD performs post-processing to analyze the information of all edges. If an edge's eigenvalue is extremely small, it is considered invalid, indicating that the two corresponding faces are not directly connected or associated. These invalid edges are identified and removed from the graph to streamline the graph structure, ensuring that the edges that remain are meaningful connections.

[0092] Specifically, the post-processing workflow consists of three stages, and a valid model can only be built when all three stages are error-free. First, the vertex-edge topology of each face must be accurately constructed. Brep-GD uses the heuristic method in BrepGen, which forms a closed loop by identifying the nearest points on the face to establish the vertex-edge topology. Once the preliminary association is determined, further refinement is performed based on the generated topology. The vertex positions are ensured to be consistent by averaging the relevant copies to obtain correctly aligned vertices; for the subsequent face-edge topology construction, Brep-GD is different from BrepGen's nearest edge search and deduplication method. Instead, it directly utilizes the nearest edge search and deduplication method generated in stage 3. For the topology information in The value is lower than the preset threshold Edges that exceed a threshold are classified as degenerate edges, while edges that exceed a threshold are considered valid edges. This classification method is the basis for constructing face-edge topology, minimizing the need for deduplication. By pruning early in the topology generation (rather than at the beginning), Topology inference is performed after the face is generated), effectively eliminating redundant calculations. This strategy simplifies the post-processing workflow and ensures the integrity of the generated model. Next, the edge geometry is scaled and transformed to align with their associated start and end vertices, ensuring seamless matching of edges in the generated topology. If an edge is found to be flipped relative to its vertex, it is adjusted appropriately. Finally, the face geometry is scaled and transformed to closely fit all associated edges, minimizing the Chamfer distance and improving the geometric fidelity of the generated CAD model.

[0093] In this Example 2, the entire training process of Step 2, Brep-GD was implemented in PyTorch 2.5.1, using two V100 GPUs (32GB memory each) for training, and using a mixed precision algorithm to accelerate training. The AdamW optimizer was used, and the learning rate was set to For the variational autoencoder optimization, the gradient clipping is set to 5 and the KL regularization weight is set to The latent diffusion module uses 1000 diffusion steps with a linear beta schedule ranging from to 0.02.

[0094] The face and edge variational autoencoders were trained for 400 epochs (200 epochs for Furniture B-rep and CADNet40v2) with a batch size of 512. They were then fine-tuned for an additional 200 epochs on Furniture B-rep and CADNet40v2. The latent diffusion module, consisting of two face denoisers and two edge denoisers, was trained for 3000 epochs and 300 epochs, respectively, with a batch size of 512 for the face denoiser and 32 for the edge denoiser.

[0095] To reduce the discrepancy between training and inference, Brep-GD applies cross-model augmentation, which randomly augments the input to the conditional denoiser. Unlike BrepGen, all bounding boxes are normalized to This is consistent with typical diffusion model settings. The maximum number of faces per model is limited to 30 on the DeepCAD dataset and 50 on the Furniture B-rep dataset and CADNet40v2 dataset.

[0096] Step 3: The trained Brep-GD model is used to perform inference and evaluation on the test set of the dataset to verify the model's distribution metrics, CAD metrics, and efficiency metrics.

[0097] In this example, a progressive noise diffusion model (PNDM) with 200 forward passes is used for efficient sampling. arrive Switch to the slower denoising diffusion probabilistic model (DDPM), as this coarse-to-fine denoising approach shows empirical improvements in the accuracy of bounding box locations.

[0098] For the DeepCAD dataset, a maximum of 40 faces (including duplicate faces) are generated. For the Furniture B-rep dataset and the CADNet40v2 dataset, a maximum of 60 faces are generated. After denoising, the OpenCascade function is used to approximate the geometric points of the faces and the curves of the edges. Connected closed loops are used to connect the surfaces, and the trimmed faces are stitched together to form the final B-rep entity.

[0099] On a Tesla V100-SXM2-32GB GPU, Brep-GD takes an average of 0.67 to 1.17 hours to generate 1,000 B-reps, while BrepGen takes 4.57 to 9.80 hours, achieving about a 9x speedup.

[0100] To evaluate the quality of the generated models, we use three types of metrics: distribution metrics, CAD metrics, and efficiency metrics. For the distribution metrics, we randomly sample 3,000 B-reps from the generated models and compare them with 1,000 B-reps sampled from the reference test set. For each B-rep, we sample 2,000 points from the solid surface and calculate the following metrics:

[0101] Coverage (COV): This metric quantifies the proportion of reference models that have at least one matching model in the generated set. Matches are determined by finding the nearest neighbor in the reference set based on Chamfer distance.

[0102] Minimum Matching Distance (MMD): This metric calculates the average Chamfer distance between each model in the reference set and its nearest neighbor in the generated set.

[0103] Jensen-Shannon Divergence (JSD): JSD measures the similarity between the reference model and the generated model distribution by converting the sampled point cloud into and calculate their distribution differences.

[0104] For the CAD metric, 3,000 B-reps are randomly sampled from the generated model, and the following metrics are calculated:

[0105] Novelty (NOV): This metric indicates the proportion of models in the generated model that do not appear in the training dataset, reflecting the diversity of the generated model.

[0106] Uniqueness (UNI): This metric indicates the proportion of models that appear only once in the generated model, reflecting the diversity and redundancy of the generated results.

[0107] Validity (VAL): This indicator indicates the proportion of the generated B-rep model that can be successfully constructed, ensuring the topological correctness of the generated model.

[0108] Vertex Detection Failed (VDF): This metric is only available for BrepGen and Brep-GD and measures the proportion of failures in the first stage of post-processing. The first stage attempts to construct valid closed loops between faces based on distance. Significant deviations in the generated edge and vertex positions will cause most failures.

[0109] Edge Detection Failed (EDF): This metric applies only to BrepGen and Brep-GD and measures the proportion of failures in the second stage of post-processing. The second stage attempts to build a correct face-edge topology. Failures can occur due to the generation of isolated faces and edges.

[0110] For efficiency metrics, efficiency is evaluated by generation time:

[0111] Average Generation Time (Time): This metric records the average time required to generate 1,000 B-reps, reflecting the computational efficiency of the generation process.

[0112] This paper evaluates Brep-GD's performance on the B-rep generation task by comparing it with several leading baseline methods, including DeepCAD and BrepGen. These methods were chosen because they represent leading open-source methods capable of generating B-reps, either unconditionally or conditionally based on categories. Specifically, DeepCAD evaluates B-rep generation by reconstructing B-reps from generated sketches and extrusion sequences, while BrepGen and Brep-GD are directly evaluated on their ability to generate B-reps. This comparison enables us to benchmark Brep-GD against leading methods in this field.

[0113] The quantitative evaluation results are summarized in Table 1, reporting the average metrics of 10 independent runs on each dataset. Overall, Brep-GD performs on par with or even outperforms all baseline methods.

[0114] Table 1: Quantitative results generated by B-rep

[0115]

[0116] Brep-GD demonstrates competitive generation quality in terms of distribution metrics, generating results that are closer to the true distribution of the reference data. Since the test sets for the Furniture B-rep and CADNet40v2 datasets are small (each containing fewer than 1,000 examples), their reference data is randomly sampled from the training set. It can be observed that the metric values ​​for the Furniture B-rep and CADNet40v2 datasets differ significantly from those of DeepCAD, primarily due to the smaller number of data samples, particularly for the Furniture B-rep dataset, which has a training set of only 837 models. Despite this, the data distribution generated by Brep-GD is closer to the reference distribution than BrepGen.

[0117] In terms of CAD metrics, Brep-GD and BrepGen achieved 100% for both UNI and NOV on all datasets, while DeepCAD approached 100%. This demonstrates the robustness of these models in generating novel samples and their strong generalization performance. Regarding the VALID metric, Brep-GD achieved state-of-the-art performance on the Furniture B-rep dataset, improving by 5% over BrepGen and by 11.3% on the CADNet40v2 dataset. This progress is primarily attributed to Brep-GD's graph diffusion model architecture, which effectively avoids constructing invalid face-edge topologies, significantly reducing the EDF (edge ​​detection failure) rate. In particular, on the CADNet40v2 dataset, Brep-GD reduced the EDF rate by 7%. This dataset contains small surfaces and complex boundaries, which complicates constructing face-edge topology, but these challenges are less severe for Brep-GD.

[0118] In addition, Brep-GD exhibits lower VD rate than baseline methods, further highlighting its advantage in accurately capturing vertex-edge associations.

[0119] We also compared the efficiency of each model by measuring the time required to generate 1,000 B-reps. Experiments showed that Brep-GD exhibited significantly higher efficiency than BrepGen, achieving a nearly 9x speedup. While its generation speed was slower than DeepCAD, this was expected given DeepCAD's limited ability to generate complex models (for example, it cannot generate free-form surfaces or models involving rotational operations). Therefore, a more fair efficiency comparison with BrepGen is more accurate, as both have similar capabilities for generating complex models.

[0120] In summary, the present invention proposes Brep-GD, a novel graph diffusion model, which aims to solve the problems of topological validity and generation efficiency in B-rep generation. The continuous topological graph representation method proposed in the present invention solves the incompatibility problem of existing graph diffusion techniques in B-rep generation, while effectively alleviating the problem of data discreteness. In addition, the proposed continuous topological decoupling model, through the dual-branch structure of local and global modules, achieves accurate capture of geometric and topological features in B-rep, significantly improving the effectiveness and stability of the generation process. Experimental results show that Brep-GD surpasses existing methods in terms of generation efficiency and topological validity, thus verifying the advantages of the proposed method.

[0121] Step 4: Apply the evaluated Brep-GD model to generate a streamlined B-rep model.

[0122] Example 2

[0123] This embodiment also provides a boundary representation generation system based on graph diffusion, which is used to execute the boundary representation generation method based on graph diffusion disclosed in Example 1.

[0124] Example 3

[0125] This embodiment further provides a computer-readable storage medium storing a computer program. When the program is executed by a processor, the method for generating a boundary representation based on graph diffusion disclosed in embodiment 1 is implemented.

[0126] The above shows and describes the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely preferred examples of the present invention and are not intended to limit the present invention. Various changes and improvements may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and improvements fall within the scope of the present invention. The scope of protection claimed in the present invention is defined by the appended claims and their equivalents.

Claims

1. A boundary representation generation method based on graph diffusion, characterized in that: The steps include: Step 1: Build and preprocess the industrial parts dataset; Step 2: Build and train the Brep-GD model based on the preprocessed industrial parts dataset; The Brep-GD model includes a variational autoencoder, a graph diffusion model, a continuous topological decoupling model and a post-processing module; The training method of the Brep-GD model is: The preprocessed industrial parts dataset is used as a training set, and a variational autoencoder is used to compress the face and edge features of the graph structure of the real B-rep model of the training set into a low-dimensional latent vector. The low-dimensional latent vector is denoised to obtain pure noise, and the denoised face and edge features are gradually diffused in four stages using a graph diffusion model. Simultaneously, a continuous topological decoupling model is used in stages 3 and 4 to decouple the edge diffusion structure into a prediction noise output by aggregating the features of connected nodes during model information propagation, thereby refining edge features. Establish a noise prediction loss function and perform post-processing of refined features through the post-processing module, and generate the final streamlined B-rep model through combination; Step 3: The trained Brep-GD model is used to perform inference and evaluation on the test set of the dataset to verify the model's distribution metric, CAD metric, and efficiency metric. Step 4: Apply the evaluated Brep-GD model to generate a streamlined B-rep model.

2. A method for generating boundary representation based on graph diffusion according to claim 1, characterized in that: The method for constructing the industrial parts dataset in step 1 includes data collection, format standardization, geometry verification and classification annotation.

3. The method for generating boundary representation based on graph diffusion according to claim 1, characterized in that: The pre-processing method includes data partitioning, face / edge number filtering and geometric direction normalization.

4. The method for generating boundary representation based on graph diffusion according to claim 1, characterized in that: In step 2, during training, the variational autoencoder is trained using reconstruction loss and KL regularization.

5. The method for generating boundary representation based on graph diffusion according to claim 1, characterized in that: In step 2, the face features of the real B-rep model are compressed to a dimension of The low-dimensional potential vector of edge features is compressed to a dimension of The low-dimensional latent vector of .

6. The method for generating boundary representation based on graph diffusion according to claim 1, characterized in that: The step 2 also includes decomposing the graph structure of the loaded B-rep model by a probability distribution method to obtain the probability distribution of face features and edge features. The face features of the graph structure of the B-rep model include the global position of the face Latent geometric features of the surface , the edge features of the graph structure of the B-rep model include the global position of the edge and the potential geometric features of edges and vertex features , where the potential geometric features of the edge and the vertex features The probability distribution of is decomposed into the global position of a given edge The conditional probability under the probability distribution of the probability distribution of the surface features, the global position of the edge The probability distribution of is decomposed into the conditional probability under the probability distribution of given surface features, the potential geometric features of the surface The probability distribution of is decomposed into the global position of a given face The conditional probability under the probability distribution of the global position of the face The probability distribution of is the prior probability.

7. The method for generating boundary representation based on graph diffusion according to claim 6, characterized in that: Initial state, global position of the decomposed face , potential geometric features of the surface , the global position of the edge and the potential geometric features of edges and vertex features All are Gaussian noise.

8. The method for generating boundary representation based on graph diffusion according to claim 7, characterized in that: In step 2, the four-stage denoising is implemented as follows: The first stage: the global position features of the initial surface As input, after the embedding time step, it is input into the surface diffusion model for iterative denoising to obtain the refined global position features of the surface , the surface diffusion model uses the Transformer backbone network; The second stage: As the initial latent geometric features of the surface Under the condition of embedding time step, the latent geometric features of the surface after refinement are obtained by iterative denoising of the surface diffusion model. , the surface diffusion model uses the Transformer backbone network; The third stage: and As the initial global position feature of the edge conditions After the embedding time step, the edge diffusion model is input for iterative denoising to obtain the refined edge global position features. , the edge diffusion model uses a continuous topological decoupling model; The fourth stage: 、 and As the initial potential geometric features of edges and vertex features conditions After embedding the time step, the edge diffusion model is input and the latent geometric features and vertex features of the refined edge are obtained through iterative denoising. , the edge diffusion model uses a continuous topological decoupling model.

9. The method for generating boundary representation based on graph diffusion according to claim 8, characterized in that: The continuous topological decoupling model includes a local topological information aggregation module and a global error suppression module. The local topological information aggregation module includes a graph isomorphism convolution layer and a face-edge attention message passing layer; the global error suppression module is based on a standard TransformerEncoder architecture stacking several layers, and uses an average pooling layer to optimize and suppress outliers.

10. The method for generating boundary representation based on graph diffusion according to claim 1, characterized in that: The post-processing method of the refined features is: constructing vertex-edge topology based on a method of identifying closed loops formed by points on a surface, discarding irrelevant surface connection relationships based on edge eigenvalues, and correcting geometric positions based on vertex-edge-surface.

11. A boundary representation generation system based on graph diffusion, characterized in that: Used to execute the boundary representation generation method based on graph diffusion as described in any one of claims 1-10.

12. A computer-readable storage medium storing a computer program, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Three-dimensional CAD model classification method fusing boundary representation and graph attention mechanism

    CN119006879A

  • Nickel-based superalloy microstructure image diffusion generation method, system, equipment, medium and product

    CN119251337A

  • SAR (Synthetic Aperture Radar) image target detection method and device based on combination of Mangbar and diffusion models

    CN119339052A

  • Feature pyramid edge weighted diffusion segmentation method for ultrasonic thyroid nodule

    CN119850569A

  • Boundary representation model generation method and system based on structured hidden space, and medium

    CN120493324A

Cited By

  • Machining feature recognition method of CAD model

    CN121524606A