A boundary representation generation method and system based on graph diffusion and a storage medium

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

CN120724508BActive Publication Date: 2025-11-21HANGZHOU DIANZI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing B-rep generation methods are inefficient, computationally intensive, and have poor topological consistency when generating complex geometries, easily resulting in disconnected or self-intersecting surfaces, which affects model quality.

Method used

A graph diffusion-based B-rep generation method is adopted, which represents the B-rep model as a graph structure. The geometric features of the face and edge are generated by the graph diffusion model, and the consistency of the topological structure is maintained by the continuous topological decoupling model, thereby reducing redundant calculations.

Benefits of technology

It significantly improves generation efficiency, ensures the geometric accuracy and topological validity of B-rep models, and solves the problems of low computational efficiency and poor topological consistency in existing methods. It is suitable for the automated generation of complex geometries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120724508B_ABST
    Figure CN120724508B_ABST
Patent Text Reader

Abstract

The application discloses a kind of boundary representation generation methods based on graph diffusion, comprising the following steps: step 1, construct industrial parts dataset and pretreatment;Step 2, based on the self-built dataset and two open source datasets after pretreatment, Brep-GD model is constructed and trained;The Brep-GD model includes variational autoencoder, graph diffusion model, continuous topological decoupling model and post-processing module;Step 3, the trained Brep-GD model is used with the test set of dataset to infer and evaluate, to verify the distribution measure, CAD measure and the multi-type index of efficiency measure of model;Step 4, after the application completes the evaluation of Brep-GD model, the generation of simplified B-rep model is carried out, which can significantly reduce redundant calculation, improve generation efficiency, while ensuring that the generated B-rep model has higher geometric accuracy and topological effectiveness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of CAD drafting technology, specifically a boundary representation generation method, system, and storage medium based on graph diffusion. Background Technology

[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 3D models. B-rep uses basic geometric elements such as vertices, edges, and faces to represent the geometry and topology of 3D objects. Its core advantage lies in its ability to accurately describe complex 3D geometries, playing an irreplaceable role, especially in free-form surface modeling and modeling 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 in handling 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 main categories: template-based generation methods and model-based generation 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 cubes, cylinders, and other common geometric shapes. However, when encountering complex free-form surfaces or designs with complex topologies, the limitations of this method become particularly apparent. The generated geometries are often too simple, lack flexibility, and require a lot of manual intervention when facing complex design requirements, making it unable to adapt to diverse design needs.

[0004] With the development of deep learning technology, B-rep generation methods based on generative models have gradually become a new solution. Deep learning methods learn the geometric and topological features of large-scale B-rep datasets through neural networks, enabling them to automatically generate complete B-rep models given input conditions. For example, sequence-based generation models such as SolidGen use recurrent neural networks (RNNs) or Transformer networks to progressively generate the vertices, edges, and faces of the B-rep. These methods, by learning the geometric features and topological relationships of the B-rep model, can generate various types of geometric shapes and can, to some extent, solve the complexity and diversity problems existing in traditional methods. Although deep learning methods have made some progress in generating B-rep models, they still face many challenges in practical applications. First, the generation process of these methods is usually stepwise, especially when generating complex geometric shapes, requiring multiple stages of inference and computation, resulting in low generation efficiency. Second, because deep learning models often have local dependencies when handling geometry and topology, the generated B-rep models often fail to guarantee topological consistency, easily resulting in disconnected or self-intersecting faces, which has a significant impact on practical design work.

[0005] In addition, some graph model-based methods have attempted to achieve breakthroughs in B-rep generation in recent years. Graph model methods treat the B-rep model as a graph structure, where nodes represent face elements and edges represent the connections between faces. They capture the complex relationships between geometry and topology through graph convolutional networks (GCNs) or graph diffusion models. For example, BrepGen proposed a B-rep generation method based on a hierarchical tree structure, which builds the B-rep model by progressively refining the generation process of vertices, edges, and faces. Although graph model methods have certain advantages in topology modeling, existing graph model methods still face several significant technical problems. First, many graph model methods rely on tree structures for hierarchical generation, which leads to lengthy and computationally intensive generation processes and low efficiency when dealing with complex geometries. Second, existing graph diffusion models often fail to fully utilize the inherent graph structure characteristics of the B-rep model, especially when dealing with high-dimensional complex topologies. It is still difficult to ensure the topological consistency of the generated results, especially when generating polyhedra or freeform surfaces, which can easily lead to topological instability.

[0006] In summary, while existing technologies have made some progress in B-rep generation, the following technical problems still exist: First, existing methods are inefficient when generating complex geometries, especially when dealing with B-rep models with complex topological relationships, resulting in high computational costs and difficulty in achieving efficient generation; second, B-rep models generated by existing methods often suffer from poor topological consistency, particularly the emergence of disconnected or self-intersecting surfaces during the generation process, affecting the quality of the final generated model; third, most existing methods rely on hierarchical structures or step-by-step generation processes, leading to redundant computations and high computational complexity. To address these problems, this invention proposes a graph diffusion-based B-rep generation model, Brep-GD, which aims to effectively solve the problems of low computational efficiency, poor topological consistency, and redundant computations in existing technologies through graph structure representation and topological decoupling. Summary of the Invention

[0007] The purpose of this invention is to overcome the shortcomings of existing technologies and propose a boundary representation generation method based on graph diffusion, aiming to solve the problems of efficiency and topological consistency in existing B-rep generation methods. Unlike existing methods based on tree structures or sequential generation, this invention represents the B-rep model as a graph structure, effectively generating the geometric features of faces and edges using a graph diffusion model while simultaneously maintaining topological consistency. Unlike existing tree-based hierarchical methods, this invention can significantly reduce redundant computation, improve generation efficiency, and ensure that the generated B-rep model has higher geometric accuracy and topological validity.

[0008] To achieve the above objectives, the technical solution specifically adopted by the present invention is as follows:

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

[0010] Step 1: Construct and preprocess an 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 topology decoupling model, and a post-processing module.

[0013] The training method for the Brep-GD model is as follows:

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

[0015] The low-dimensional latent vector is denoised to obtain pure noise, and the features of the denoised surface and edge are gradually diffused in four stages through a graph diffusion model. At the same time, a continuous topological decoupling model is used to decouple the diffusion structure of the edge in the third and fourth stages to aggregate the feature output prediction noise of the connecting nodes during the propagation of model information, so as to refine the edge features.

[0016] A noise prediction loss function is established, and the post-processing module is used to refine the features. Finally, the simplified B-rep model is generated by combining the features.

[0017] Step 3: Perform inference and evaluation on the test set of the dataset using the trained Brep-GD model to verify the model's distribution metrics, CAD metrics, and efficiency metrics.

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

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

[0020] Preferably, the preprocessing method includes data partitioning, face / edge number filtering, and geometric orientation standardization.

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

[0022] Preferably, in step 2, the surface features of the real B-rep model are compressed to a dimension of 4. 4 A low-dimensional latent vector of dimension 3 is compressed into a 4-dimensional vector by edge features. 3. Low-dimensional latent vectors.

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

[0024] Preferably, the initial state is the global position of the surface obtained after decomposition. Potential geometric features of surfaces Global position of edges latent geometric features of edges All are Gaussian noise.

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

[0026] Phase 1: Initialize the global position features of the face. As input, after the embedding time step, the input is fed into the surface diffusion model for iterative denoising to obtain the refined global position features of the surface. The surface diffusion model uses a Transformer backbone network;

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

[0028] Phase Three: With and Global position features of the initial edge conditions After the embedding time step, the input is fed into the edge diffusion model for iterative denoising to obtain the refined global position features of the edges. The edge diffusion model uses a continuous topological decoupling model (CGTD).

[0029] Phase Four: With , and Potential geometric features and vertex features of the initial edges conditions After the embedding time step, the input to the edge diffusion model is used for iterative denoising to obtain the refined latent geometric features of the edges and vertex features. The edge diffusion model uses the continuous topological decoupling model (CGTD).

[0030] Preferably, the continuous topology decoupling model includes a local topology information aggregation module and a global error suppression module. The local topology information aggregation module includes a graph isomorphic convolutional layer and a face-edge attention message passing layer. The global error suppression module stacks several layers based on the standard TransformerEncoder architecture and uses an average pooling layer to optimize the suppression of outliers.

[0031] Preferably, the post-processing method for the refined features is as follows: constructing a vertex-edge topology based on the method of forming closed loops from points on the identified surface, discarding irrelevant surface connection relationships based on edge feature values, 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, for performing a boundary representation generation method based on graph diffusion.

[0033] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements a boundary representation generation method based on graph diffusion.

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

[0035] This invention significantly improves generation efficiency and model quality by employing a graph diffusion-based B-rep generation method. Compared to traditional tree-structured methods, this invention avoids computational redundancy by transforming the B-rep model into a graph structure representation and effectively reduces topological errors through continuous topological decoupling, ensuring geometric and topological consistency of the generated model. This method not only greatly improves computational efficiency during the generation process but also reduces common topological inconsistencies in traditional methods, ensuring that the generated B-rep model meets the requirements for effectiveness and geometric accuracy in industrial design. Through graph diffusion technology, the model can effectively generate complex geometries without relying on global attention computation, while guaranteeing the stability and accuracy of the topological structure. Therefore, it provides a reliable solution for the automated generation of complex geometries in practical applications and has broad application prospects. Attached Figure Description

[0036] Figure 1 This is a flowchart illustrating the specific steps of the present invention.

[0037] Figure 2 This describes the generation process of the B-rep model in this embodiment of the invention.

[0038] Figure 3 This is the graph representation structure of the B-rep model in this embodiment.

[0039] Figure 4 This refers to the statistical information of the dataset in this embodiment of the invention. Detailed Implementation

[0040] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.

[0041] Example 1

[0042] This embodiment discloses a boundary representation generation method based on graph diffusion, such as... Figure 2 and Figure 3 As shown, it includes the following steps:

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

[0044] In this embodiment, 11,142 real industrial part models, encompassing 40 categories such as bearing housings, forged yokes, and end wrenches, were collected from actual industrial production environments. First, all models were uniformly converted to the standard STEP format to ensure data format consistency and universality, supporting the processing needs of different CAD software. Then, the collected data underwent rigorous geometric accuracy verification and quality control. Automated tools were used to remove duplicate and overlapping models, and geometric orientation standardization was performed to ensure the uniqueness and consistency of the dataset. Furthermore, under the guidance of experts in relevant industrial fields, meticulous classification and labeling were carried out, clearly recording the number of data points in each category. Finally, detailed statistical analysis was performed on the processed data, recording the distribution of the number of entities, faces, and edges in the models. Data visualization technology was used to visually present the overall structure and distribution characteristics of the dataset, resulting in a new industrial parts dataset, CADNet40v2. Figure 4 As shown.

[0045] Furthermore, this embodiment systematically used three datasets for model training, validation, and testing: CADNet40v2, DeepCAD, and the Furniture B-rep dataset. For the DeepCAD dataset, this invention used its original training, validation, and testing partitioning and removed duplicate models from the training set according to the method proposed by Willis et al. For closed surfaces, such as cylinders, this invention split them along the seams according to the method in SolidGen. B-rep models containing more than 50 faces, each face having more than 50 edges, or multiple edges between faces, and composed of multiple parts, were filtered out. After filtering, a total of 87,815 B-rep models were used to train the VAE and diffusion models. When using the CADNet40v2 and Furniture B-rep datasets, they were randomly partitioned into 90% for training, 5% for validation, and 5% for testing. In training the graph diffusion model, a total of 43,561 DeepCAD B-rep, 837 Furniture B-rep, and 2,136 CADNet40v2 B-rep models were used. Furthermore, after further filtering, eight categories from the CADNet40v2 dataset were retained for both training and testing. The raw data underwent preprocessing to ensure consistency and usability. This included validating the geometric accuracy of the models, removing duplicates, and standardizing their orientations. Additionally, all part models were converted to standard formats, 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 topology decoupling model, and a post-processing module.

[0047] like Figure 2 As shown, the specific steps include the following:

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

[0049] Brep-GD uses a similar setup to BrepGen to compress the shape features of faces and edges. It utilizes two variational autoencoders to encode the geometric features of faces and edges from real B-rep models in the dataset into low-dimensional latent vectors. Specifically, the latent vectors for faces and edges are represented as follows: and .

[0050] These latent representations can be understood as making subsequent processing more efficient while preserving important geometric information. The variational autoencoder is trained using reconstruction loss and KL regularization to ensure high-quality latent encoding, balancing feature compression and fidelity.

[0051] Step 2-2: Add noise to the low-dimensional latent vector to obtain pure noise, and then gradually remove the features of the diffusion surface and edges through the graph diffusion model in four stages. At the same time, use the continuous topology decoupling model in stages 3 and 4 to decouple the diffusion structure of the edges into the feature output prediction noise of the connection nodes during the propagation of model information, 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 B-rep features through DDPM. This iterative process gradually removes noise from the latent features, ensuring that the generated geometry and topology are accurate and consistent. By progressively refining the latent features, Brep-GD ensures that the final representation effectively captures both local and global features.

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

[0054] The latent characteristics of noise can also be expressed as:

[0055] here ,and ,in Noise Dispatch The scheduling method is determined by variance, with linear scheduling used by default. The low-dimensional latent vector output from step three is then used. Injected noise Subsequently, the encoded geometric and topological features are perturbed, causing the latent representation to lose its accurate structural relationships. This perturbation ensures that the model can effectively denoise and reconstruct the topological structure during the reverse process.

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

[0057] Therefore, this invention decomposes the distribution of the entire graph into the product of the conditional probability distributions of nodes and edges. Figure 3This decomposition step is illustrated. 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 in the B-rep model, and the edges of the graph structure represent the geometric distribution of the edges in the B-rep model. Furthermore, the geometric distribution of the nodes (corresponding to the faces in B-rep) is decomposed into... and The product of conditional probability distributions, while the geometric distribution of edges (corresponding to edges in B-rep) is decomposed into... and The product of conditional probability distributions. The above decomposition process can be expressed as:

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

[0059] Step 2-2-3, four-stage denoising, includes node-level (surface) diffusion and edge diffusion, implemented as follows:

[0060] Stages 1 and 2 focus on generating surface features (including global surface location features and latent surface geometric features). Both stages use a Transformer backbone network to iteratively denoise and generate clean latent surface representations.

[0061] Phase 1 focuses on (Face position) generation. The initial state is Gaussian noise, that is The refinement is achieved through iterative denoising. This serves as a condition for subsequent generation steps. Specifically, the input shape of the model is... ,in Represents the number of faces, with some faces embedded. Defined as:

[0062]

[0063] in yes An embedding matrix of dimension 1. The MLP is a fully connected layer that uses the SiLU activation function. It is a time step embedding. It is determined by the global positional features of the surface. It means that by The stages in the denoising process are determined, and the tokens are used as input to the Transformer module for noise prediction at each generation. This is achieved by... After removing noise predicted in each generation, this stage finally yields the refined global position of the surface. '.

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

[0065]

[0066] in yes A dimensional embedding matrix. Surface embedding. Incorporating geometric features of surfaces and topological features Generate comprehensive and integrated surface embedding representations, and by Determine the stages in the noise reduction process. Primarily serving as a condition for subsequent generation steps, it provides detailed geometric and topological features of two adjacent faces when generating potential edges in later stages, similar to the features used in Stage 1. Iterative denoising.

[0067] Focusing on Phases 3 and 4 (edge ​​position) and (Latent geometric features of edges and vertex features), the initialization and iterative denoising processes 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 the goal is to recover a globally strict topological structure with no 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.

[0068] To address these challenges, this invention proposes a Continuous Graph Topological Decoupling Model (CGTD). The core idea of ​​CGTD is to decouple the diffuse structure of edges (containing continuous topological information) into features that aggregate connecting nodes during model information propagation, thereby efficiently utilizing model information. The model consists of two branches: a Local Topological Information Aggregation (LTIA) module and a Global Error Suppression (GES) module.

[0069] Phase 3 focuses on (Edge position) generation. The initialization is similar to that of stages 1 and 2, still using Gaussian noise, and is generated in stages 1 and 2. , As the conditional iterative denoising and restoration in this stage The model's input includes fully faceted embeddings. Its shape is and some edge embedding Its shape is ,in The number of faces, including time step embedding. Partial edge embedding. Defined as:

[0070] in yes dimensional embedding matrix, and This indicates the embedding of two faces connected by an edge. Incorporating edge position features The information of the two faces adjacent to the edge is used, and the embeddings of the two faces are simultaneously used to encode the edge's position information. Similar to the Transformer modules in stages 1 and 2, the CGTD module uses... The token is used as input for noise prediction in each generation.

[0071] Phase 4 focuses on The generation of . The initialization is similar to the previous stage, still using Gaussian noise, and based on the noise generated in the previous stage. , , As the conditional iterative denoising and restoration in this stage The model's input includes surface embeddings. and fully edge-embedded Its shape is ,in The number of faces represented, including time step embedding. Full edge embedding. Defined as:

[0072]

[0073] Full edge embedding Incorporating the geometric features of edges Topological features of edges and vertex features The information of the two faces adjacent to the edge is used, and the embeddings of the two faces are simultaneously used to encode the edge's position information. Similar to stage 3, The token, which is used as input to the CGTD module, is used to predict noise for each generation.

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

[0075] The CGTD module's submodule, the LTIA module, contains a standard message-passing layer, GINE, which aggregates local neighborhood nodes and corresponding edge features based on the decoded discrete graph structure. Furthermore, it incorporates 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 within the model. Layer, of which, the first The message passing and update operations of a layer are defined as follows:

[0076]

[0077]

[0078] Here, FFN stands for feedforward neural network. and They represent the first The characteristics of two nodes connected by an edge in a layer. For and They correspond to and In FEATT, nodes The message passing and updating process is represented as follows:

[0079]

[0080]

[0081] in, This represents the sigmoid function. , and from Obtained by projection.

[0082] Considering the dual nature of edge features—the diversity and correlation of edge features across different faces—the GES module guides correct connections by requiring nodes to self-attention to focus on global features. It suppresses locally anomalous edges in nodes through max pooling. The architecture is based on the standard TransformerEncoder, stacked with 12 layers and 12 heads, pre-normalized layers, with a hidden dimension of 1024, a feature dimension of 768, and a dropout rate of 0.1.

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

[0084]

[0085]

[0086] in, and It is the output of the GES module, a submodule of the CGTD module. , and These represent the LTIA module in the first... The output of the layer, Indicates the first and the Each node. Unlike directly applying global attention to all edges, this decoupled edge generation method reduces computational complexity by an order of magnitude.

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

[0088] Steps 2-3: Establish the noise prediction loss function and perform post-processing of the refined features through the post-processing module, and generate the final simplified B-rep model by combination.

[0089] Specifically, the Brep-GD model uses L2 regression loss to accurately predict the noise added at each forward diffusion step. This objective 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:

[0090]

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

[0092] Brep-GD generates sufficiently clean surface features. , Sum of edge features , Then, we can begin constructing the graph structure of the Brep model. For the faces of the Brep model, we utilize... The UV samples in a unit space are decoded and reconstructed using a variational autoencoder, thereby obtaining the local geometric information of the surface, and based on... The local geometry of a face is placed in its correct global position. The same process is applied to edge features, determining the position and shape of each edge in 3D space using appropriate feature parameters. Based on this, Brep-GD initially creates a fully connected graph, where each vertex represents a face, and each edge represents a connection between two faces. This means that at this point, any two faces are assumed to be related and thus connected by an edge. However, such a fully connected graph may contain many edges that do not actually exist or are invalid.

[0093] To optimize the fully connected graph structure obtained above, Brep-GD requires post-processing to analyze the information of all edges. If the eigenvalue of an edge is extremely small, it is considered invalid, meaning that the corresponding two faces do not actually have a direct connection or association. These invalid edges are identified and removed from the graph to simplify the graph structure and ensure that the edges that are ultimately retained are meaningful connections.

[0094] Specifically, the post-processing workflow consists of three stages, and a valid model can only be built if all three stages are error-free. First, the vertex-edge topology for each face must be accurately constructed. Brep-GD employs a heuristic method from BrepGen, which establishes the vertex-edge topology by identifying the nearest points on a face to form a closed loop. Once the initial associations are determined, further refinement is performed based on the generated topology. Vertex positions are consistent by averaging related copies to obtain correctly aligned vertices. For subsequent face-edge topology construction, Brep-GD differs from BrepGen's nearest edge search and deduplication methods. Instead, it directly utilizes the vertex-edge topology generated in stage 3. Topological information within. For Value below preset threshold Edges that exceed a threshold are classified as degenerate edges, while edges exceeding a threshold are considered valid edges. This classification method forms the basis for constructing face-edge topologies, minimizing the need for duplicate data removal. This is achieved by pruning early in topology generation (rather than during generation). Following topology derivation, redundant computations are effectively eliminated. This strategy simplifies the post-processing workflow and ensures the integrity of the generated model. Next, the geometric points of the edges are scaled and transformed to align with their associated start and end vertices, ensuring seamless edge matching in the generated topology. If an edge is found to be flipped relative to its vertices, it will be adjusted accordingly. Finally, the geometric points of the faces are scaled and transformed to closely fit all associated edges, thereby minimizing the Chamfer distance and improving the geometric fidelity of the generated CAD model.

[0095] In this embodiment 2, the entire training process of Brep-GD in step 2 is implemented in PyTorch 2.5.1, using two V100 GPUs (each with 32GB of memory) for training, and employing a mixed precision algorithm to accelerate training. The AdamW optimizer is used, and the learning rate is set to... For variational autoencoder optimization, gradient clipping is set to 5, and KL regularization weights are set to... The potential diffusion module uses 1000 diffusion steps, employing linear beta scheduling, with a range from... Up to 0.02.

[0096] The variational autoencoders for faces and edges were trained for 400 epochs (200 epochs for Furniture B-rep and CADNet40v2) with a batch size of 512. An additional 200 epochs of fine-tuning were then performed on Furniture B-rep and CADNet40v2. The latent diffusion module contains two face denoisers and two edge denoisers, trained for 3000 epochs and 300 epochs respectively, with a batch size of 512 for the face denoisers and 32 for the edge denoisers.

[0097] To reduce the discrepancy between training and inference, Brep-GD applies cross-model augmentation, randomly augmenting the input to the conditional denoiser. Unlike BrepGen, all bounding boxes are normalized to... Within this range, it 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 and CADNet40v2 datasets.

[0098] Step 3: Perform inference and evaluation on the test set of the dataset using the trained Brep-GD model to verify the model's distribution metrics, CAD metrics, and efficiency metrics.

[0099] In this embodiment, a progressive noise diffusion model (PNDM) with 200 forward channels is used for efficient sampling. For some denoisers (e.g., denoisers at face and edge locations), from arrive Switch to the slower Denoising Diffusion Probability Model (DDPM) because this coarse-to-fine denoising method has empirically improved accuracy in bounding box location.

[0100] 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 and edge curves of the faces. Closed loops are used to connect the surfaces, and the trimmed faces are stitched together to form the final B-rep entity.

[0101] On a Tesla V100-SXM2-32GB GPU, Brep-GD takes an average of 0.67 to 1.17 hours to generate 1,000 B-rep, while BrepGen takes 4.57 to 9.80 hours, achieving approximately 9 times the speedup.

[0102] To evaluate the quality of the generated model, this invention employs three types of metrics: distribution metrics, CAD metrics, and efficiency metrics. For distribution metrics, this invention randomly samples 3,000 B-rep from the generated model and compares them with 1,000 B-rep sampled from a reference test set. For each B-rep, 2,000 points are sampled from the solid surface, and the following metrics are calculated:

[0103] Coverage (COV): This metric quantifies the proportion of the reference models that have at least one matching model appearing in the generated set. Matching is determined by finding the nearest neighbors in the reference set based on the Chamfer distance.

[0104] 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.

[0105] Jensen-Shannon Divergence (JSD): JSD measures the similarity between the distributions of the reference model and the generative model. It is achieved by transforming the sampled point cloud into... The discrete voxels are calculated, and their distribution differences are determined.

[0106] For CAD metrics, 3,000 B-rep samples were randomly sampled from the generated model, and the following metrics were calculated:

[0107] Novelty (NOV): This metric represents the proportion of generative models that do not appear in the training dataset, reflecting the diversity of generative models.

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

[0109] Validity (VAL): This metric represents the percentage of generated B-rep models that can be successfully built, ensuring the topological correctness of the generated models.

[0110] Vertex Detection Failed Rate (VDF): This metric applies only to BrepGen and Brep-GD, measuring the failure rate in the first-stage post-processing. The first stage attempts to construct valid loop closures between faces based on distances. Significant deviations in the generated edge and vertex positions lead to most failures.

[0111] Edge Detection Failed (EDF): This metric applies only to BrepGen and Brep-GD and measures the proportion of failures in the second-stage post-processing. The second stage attempts to construct the correct face-edge topology. Failures occur because isolated faces and edges are generated.

[0112] For efficiency metrics, efficiency is evaluated through generation time:

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

[0114] This invention evaluates the performance of Brep-GD in the B-rep generation task by comparing it with several leading benchmark methods, including DeepCAD and BrepGen. These methods were chosen because they represent leading open-source approaches capable of generating B-reps, whether unconditional or category-based conditional generation. Specifically, DeepCAD evaluates B-rep generation by reconstructing B-reps from generated sketches and stretch sequences, while BrepGen and Brep-GD directly evaluate their ability to generate B-reps. This comparison allows for benchmarking of Brep-GD as a leading method in this field.

[0115] The quantitative evaluation results are summarized in Table 1, which reports the average metrics from 10 independent runs on each dataset. Overall, Brep-GD performs comparably to, and even surpasses, all benchmark methods.

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

[0117]

[0118] From a distribution metric perspective, Brep-GD demonstrates competitive generation quality, producing results that more closely approximate the true distribution of the reference data. Due to the small test sets of the Furniture B-rep and CADNet40v2 datasets (each containing fewer than 1,000 samples), their reference data is randomly sampled from the training set. It can be observed that the metrics values ​​of the Furniture B-rep and CADNet40v2 datasets are significantly lower than those of DeepCAD, primarily due to the smaller sample size, especially in the Furniture B-rep dataset, which has only 837 models in its training set. Nevertheless, the data distribution generated by Brep-GD is closer to the reference distribution than that of BrepGen.

[0119] In terms of CAD metrics, Brep-GD and BrepGen achieved 100% UNI and NOV scores across all datasets, while DeepCAD approached 100%. This indicates that these models possess a strong ability to generate new samples and exhibit strong generalization performance. For the VALID metric, Brep-GD achieved state-of-the-art performance on the Furniture B-rep dataset, outperforming BrepGen by 5%, and on the CADNet40v2 dataset by 11.3%. This progress is primarily attributed to the graph diffusion model architecture, which effectively avoids constructing invalid face-edge topologies, thus significantly reducing the EDF (edge ​​detection failure) rate. Particularly on the CADNet40v2 dataset, Brep-GD reduced the EDF rate by 7%. This dataset contains small surfaces and complex boundaries, increasing the difficulty of constructing face-edge topologies, but these challenges were less pronounced for Brep-GD.

[0120] Furthermore, Brep-GD exhibits a lower VD rate than the baseline method, further highlighting its advantage in accurately capturing vertex-edge associations.

[0121] This invention also compares the efficiency of each model by the time required to generate 1,000 B-reps. Experiments show that Brep-GD exhibits significantly higher efficiency compared to BrepGen, achieving a speedup of nearly 9 times. While its generation speed is slower than DeepCAD, this is to be expected because DeepCAD has limited capabilities in generating complex models (e.g., it cannot generate freeform surfaces or models involving rotational operations). Therefore, an efficiency comparison with BrepGen is fairer, as both have similar capabilities in generating complex models.

[0122] In summary, this invention proposes Brep-GD, a novel graph diffusion model aimed at addressing the issues of topological validity and generation efficiency in B-rep generation. The proposed continuous topological graph representation method resolves the incompatibility issues of existing graph diffusion techniques in B-rep generation, while effectively mitigating data discreteness. Furthermore, the proposed continuous topological decoupling model, through a bi-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 demonstrate that Brep-GD surpasses existing methods in terms of generation efficiency and topological validity, thus validating the advantages of the proposed method.

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

[0124] Example 2

[0125] This embodiment also provides a boundary representation generation system based on graph diffusion, used to execute a boundary representation generation method based on graph diffusion disclosed in Embodiment 1.

[0126] Example 3

[0127] This embodiment also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements a boundary representation generation method based on graph diffusion disclosed in Embodiment 1.

[0128] The foregoing has shown and described 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 embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of 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, Includes the following steps: Step 1: Construct and preprocess an industrial parts dataset; Step 2: Construct 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 topology decoupling model, and a post-processing module. The training method for the Brep-GD model is as follows: The preprocessed industrial parts dataset was used as the training set, and the surface and edge features of the graph structure of the real B-rep model in the training set were compressed into low-dimensional latent vectors using a variational autoencoder. The low-dimensional latent vector is denoised to obtain pure noise, and the features of the denoised surface and edges are gradually diffused in four stages through a graph diffusion model. The four-stage denoising method is as follows: Phase 1: Initialize the global position features of the face. As input, after the embedding time step, the input is fed into the surface diffusion model for iterative denoising to obtain the refined global position features of the surface. The surface diffusion model uses a Transformer backbone network; Phase Two: Potential geometric features of the initial surface The conditions are set, and after the embedding time step, the input is fed into the surface diffusion model for iterative denoising to obtain the refined latent geometric features of the surface. The surface diffusion model uses a Transformer backbone network; Phase Three: With and Global position features of the initial edge conditions After the embedding time step, the input is fed into the edge diffusion model for iterative denoising to obtain the refined global position features of the edges. The edge diffusion model uses a continuous topological decoupling model; Phase Four: With , and Potential geometric features and vertex features of the initial edges conditions After the embedding time step, the input to the edge diffusion model is used for iterative denoising to obtain the refined latent geometric features of the edges and vertex features. The edge diffusion model uses a continuous topological decoupling model; Simultaneously, a continuous topological decoupling model is used in the third and fourth stages to decouple the edge diffusion structure into feature output prediction noise that aggregates the connection nodes during the model information propagation process, so as to refine the edge features. A noise prediction loss function is established, and the post-processing module is used to refine the features. Finally, the simplified B-rep model is generated by combining the features. Step 3: Perform inference and evaluation on the test set of the dataset using the trained Brep-GD model to verify the model's distribution metrics, CAD metrics, and efficiency metrics. Step 4: Apply the evaluated Brep-GD model to generate a simplified B-rep model.

2. The boundary representation generation method 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, geometric verification, and classification labeling.

3. The boundary representation generation method based on graph diffusion according to claim 1, characterized in that, The preprocessing method includes data partitioning, face / edge number filtering, and geometric orientation standardization.

4. The boundary representation generation method 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 boundary representation generation method based on graph diffusion according to claim 1, characterized in that, In step 2, the surface features of the real B-rep model are compressed into a dimension of . The low-dimensional latent vector, with edge features compressed into a dimension of The low-dimensional latent vector.

6. The boundary representation generation method based on graph diffusion according to claim 1, characterized in that, Step 2 further includes decomposing the graph structure of the loaded B-rep model into probability distributions of face features and edge features using a probability distribution method. The face features of the graph structure of the B-rep model include the global position of the face. Potential geometric features of the surface The edge features of the graph structure in the B-rep model include the global position of the edges. Potential geometric features of edges and vertex features Among them, the latent geometric features of edges and vertex features The probability distribution is decomposed into the global position of a given edge. The probability distribution of the surface features and the conditional probability under the probability distribution of the surface features, and the global position of the edge. The probability distribution is decomposed into conditional probabilities under the probability distribution of given surface features, and the latent geometric features of the surface. The probability distribution is decomposed into the global position of a given surface. Conditional probability under a probability distribution, global position of the surface The probability distribution is the prior probability.

7. The boundary representation generation method based on graph diffusion according to claim 6, characterized in that, Initial state, global position of the face obtained after decomposition Potential geometric features of surfaces Global position of edges Potential geometric features of edges and vertex features All are Gaussian noise.

8. The boundary representation generation method based on graph diffusion according to claim 7, characterized in that, The continuous topology decoupling model includes a local topology information aggregation module and a global error suppression module. The local topology information aggregation module includes a graph isomorphic convolutional layer and a face-edge attention message passing layer. The global error suppression module is based on the standard TransformerEncoder architecture with stacked layers, and uses an average pooling layer to optimize the suppression of outliers.

9. The boundary representation generation method based on graph diffusion according to claim 1, characterized in that, The post-processing method for the refined features is as follows: constructing a vertex-edge topology based on the method of forming closed loops from points on the identified surface, discarding irrelevant surface connection relationships based on edge feature values, and correcting the geometric position based on vertex-edge-surface.

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

11. A computer-readable storage medium storing a computer program, characterized in that, When the program is executed by the processor, it implements the method of any one of claims 1-9.

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