Method and device for generating a three-dimensional cad boundary representation model

CN122906259APending Publication Date: 2026-10-13JIANGSU UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611182444.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-05
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0006]本发明提供一种三维CAD边界表示模型生成方法及装置,用以解决现有技术中三维CAD边界表示模型生成过程中难以有效协调多个模型面之间的几何关系和结构依赖,导致生成的模型面难以支持边、顶点及拓扑关系恢复的缺陷

Benefits of technology

[0017]本发明提供的三维CAD边界表示模型生成方法及装置,通过扩散去噪网络在面级特征表示空间中生成多个目标面级特征表示。其中,动态特征变换模块对不同扩散时间步下的输入特征进行非线性压缩和通道重标定,以减小特征分布变化对后续结构依赖建模的影响;结构耦合注意力模块采用查询头数大于键值头数的注意力结构,并通过跨头混合矩阵对不同查询头的注意力权重进行重组,从而在控制计算开销的同时加强不同注意力头之间的信息交互,建模多个模型面之间的结构依赖关系。进一步地,将生成的面级特征表示恢复为包含三维坐标信息和可见性掩码信息的模型面,并根据各模型面之间的交线和交点恢复边、顶点及拓扑关系,由此生成三维CAD边界表示模型。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122906259A_ABST
    Figure CN122906259A_ABST
Patent Text Reader

Abstract

The application provides a three-dimensional CAD boundary representation model generation method and device, including obtaining initial noise representation and diffusion time step information adaptive to a surface-level feature representation space; inputting the initial noise representation and diffusion time step information into a pre-trained diffusion denoising network to generate a plurality of target surface-level feature representations through reverse denoising; wherein the diffusion denoising network includes a linear mapping layer, a time step embedding layer, a plurality of dynamic geometric topology coupling modules and an output layer; the structure coupling attention module adopts an attention structure with a query head number greater than a key-value head number, and reorganizes attention weights through a cross-head mixing matrix; each target surface-level feature representation is restored to a mask grid representation of a corresponding target model surface, the mask grid representation includes three-dimensional coordinate information and visibility mask information; edges, vertices and topological relationships between surfaces, edges and vertices are restored according to intersection lines and intersection points between each target model surface to generate a target three-dimensional CAD boundary representation model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer-aided industrial design technology, and in particular to a method and apparatus for generating a three-dimensional CAD boundary representation model. Background Technology

[0002] Boundary representation (B-rep) is one of the most commonly used 3D solid representations in industrial CAD systems. This model describes 3D solids using geometric elements such as faces, edges, and vertices, along with their topological relationships. It can not only express the geometric shape of an object but also depict the topological adjacency relationships between different geometric entities. Therefore, it is widely used in mechanical design, computer-aided manufacturing, industrial product modeling, and engineering simulation.

[0003] With the development of intelligent manufacturing and generative design, how to automatically generate high-quality 3D CAD models has become a research hotspot. Unlike point clouds or triangular meshes, B-rep models impose stricter constraints on the generated results: not only must the geometry be reasonable, but the topological consistency and geometric continuity between faces, edges, and vertices must also be satisfied. Therefore, how to simultaneously characterize geometric structures and topological relationships within a unified modeling framework has become a key issue in the automatic generation of B-rep models.

[0004] In existing technologies, the generation of 3D CAD boundary representation models usually adopts the latent feature generation method, which encodes the geometric information of the model faces and the topological relationships between faces and edges into a unified feature space, obtains the target feature representation by generating the model, and then uses a decoder to reconstruct the geometric information and explicit topological relationships of the model.

[0005] However, in the above generation process, the geometric information and topological relationships of the model usually need to be jointly expressed and synchronously reconstructed by the decoder. For 3D CAD boundary representation models with model faces as the basic generation unit, there are complex spatial positional relationships and structural dependencies between multiple model faces in a model. The shape, position, and effective surface regions of each model face need to be coordinated with each other to form effective intersection lines and intersection points in subsequent processing. At the same time, the noise level and feature distribution of surface-level features differ at different time steps of diffusion generation, which also increases the difficulty of modeling the structural dependencies between multiple model faces. Summary of the Invention

[0006] This invention provides a method and apparatus for generating a 3D CAD boundary representation model, which solves the problem in the prior art that it is difficult to effectively coordinate the geometric relationships and structural dependencies between multiple model surfaces during the generation of a 3D CAD boundary representation model, resulting in the generated model surfaces being unable to support the restoration of edges, vertices and topological relationships.

[0007] This invention provides a method for generating a 3D CAD boundary representation model, comprising: acquiring an initial noise representation and diffusion time step information adapted to a surface-level feature representation space; inputting the initial noise representation and diffusion time step information into a pre-trained diffusion denoising network, and generating multiple target surface-level feature representations through inverse denoising; wherein, the diffusion denoising network includes a linear mapping layer, a time step embedding layer, multiple dynamic geometric topology coupling modules, and an output layer; each of the dynamic geometric topology coupling modules includes a dynamic feature transformation module and a structural coupling attention module, the dynamic feature transformation module being used to perform nonlinear compression and channel recalibration on the input features, and the structural coupling attention module adopting an attention structure with a query head number greater than the key head number, and reorganizing the attention weights through a cross-head mixing matrix; restoring each of the target surface-level feature representations into a masked mesh representation of the corresponding target model surface, the masked mesh representation including 3D coordinate information and visibility mask information; and restoring the edges, vertices, and topological relationships between surfaces, edges, and vertices based on the intersection lines and intersection points between each of the target model surfaces, thereby generating a target 3D CAD boundary representation model.

[0008] According to the three-dimensional CAD boundary representation model generation method provided by the present invention, the training process of the diffusion denoising network includes: decomposing multiple sample three-dimensional CAD boundary representation models into multiple sample model surfaces; performing regular sampling on the two-dimensional parameter domain of each sample model surface; and constructing a sample mask mesh representation based on the three-dimensional coordinate information and visibility mask information of each sampling point; flattening each sample mask mesh representation into a sample surface-level feature representation of fixed length; progressively adding Gaussian noise to the sample surface-level feature representation according to a preset diffusion time step to obtain a noisy surface-level feature representation; inputting the noisy surface-level feature representation and the diffusion time step into the diffusion denoising network to obtain predicted noise; and updating the network parameters of the diffusion denoising network according to the mean square error between the added Gaussian noise and the predicted noise.

[0009] According to the three-dimensional CAD boundary representation model generation method provided by the present invention, the step of constructing a sample mask mesh representation based on the three-dimensional coordinate information and visibility mask information of each sampling point includes: determining whether the sampling point is located in the effective surface region of the corresponding sample model surface; if the sampling point is located in the effective surface region, setting the corresponding visibility mask value to a first mask value; if the sampling point is located in a hole, clipping boundary, or local invalid region, setting the corresponding visibility mask value to a second mask value; and combining the three-dimensional coordinate information of each sampling point with the corresponding visibility mask value to obtain the sample mask mesh representation.

[0010] According to the three-dimensional CAD boundary representation model generation method provided by the present invention, the dynamic geometric topology coupling module includes a first dynamic feature transformation module, a structural coupling attention module, a second dynamic feature transformation module, and a feedforward network module; the first dynamic feature transformation module is used to process the input features of the dynamic geometric topology coupling module and input the processed input features into the structural coupling attention module; the structural coupling attention module is used to model the structural dependencies between multiple surface-level feature representations; the second dynamic feature transformation module is used to process the features output by the structural coupling attention module and input the processed features into the feedforward network module for nonlinear feature transformation.

[0011] According to the three-dimensional CAD boundary representation model generation method provided by the present invention, the first dynamic feature transformation module and the second dynamic feature transformation module respectively process their respective input features using the following dynamic feature transformation methods: scaling the input features according to a learnable dynamic scaling factor; nonlinearly compressing the scaled input features using a hyperbolic tangent function; and recalibrating the nonlinearly compressed input features according to learnable channel scaling parameters and channel offset parameters to obtain dynamic transformed features.

[0012] According to the three-dimensional CAD boundary representation model generation method provided by the present invention, the structural coupling attention module is used to: map input features to query features, key features, and value features respectively, wherein the query features include a first number of query headers, and the key features and value features each include a second number of key-value headers, the first number being greater than the second number; copy the key features and value features corresponding to each key-value header, such that the number of headers of the copied key features and value features is the same as the number of query headers; and calculate the initial attention weight corresponding to each query header based on the query features corresponding to each query header and the copied key features.

[0013] According to the three-dimensional CAD boundary representation model generation method provided by the present invention, the structure-coupled attention module is further configured to: linearly recombine the initial attention weights corresponding to different query heads using a learnable cross-head mixing matrix to obtain recombined attention weights; perform weighted aggregation on the copied value features according to the recombined attention weights to obtain aggregated features corresponding to each query head; and concatenate and linearly map the aggregated features corresponding to each query head to obtain attention output features.

[0014] According to the three-dimensional CAD boundary representation model generation method provided by the present invention, the step of inputting the initial noise representation and diffusion time step information into a diffusion denoising network and generating multiple target surface-level feature representations through inverse denoising includes: obtaining known surface-level feature representations corresponding to known local surfaces of the three-dimensional CAD boundary representation model to be completed; inputting the known surface-level feature representations as conditional constraints into the diffusion denoising network, retaining the known surface-level feature representations during the inverse denoising process, and generating missing surface-level feature representations corresponding to the missing regions of the three-dimensional CAD boundary representation model to be completed; and obtaining the multiple target surface-level feature representations based on the known surface-level feature representations and the missing surface-level feature representations.

[0015] According to the three-dimensional CAD boundary representation model generation method provided by the present invention, in the diffusion denoising network, the surface-level feature representations corresponding to each model surface are respectively used as surface-level tokens for feature processing, and diffusion modeling is performed in the surface-level token representation space.

[0016] This invention also provides a three-dimensional CAD boundary representation model generation device, comprising: a noise acquisition module for acquiring an initial noise representation and diffusion time step information adapted to the surface-level feature representation space; a denoising module for inputting the initial noise representation and diffusion time step information into a pre-trained diffusion denoising network, and generating multiple target surface-level feature representations through reverse denoising; wherein the diffusion denoising network includes a linear mapping layer, a time step embedding layer, multiple dynamic geometric topology coupling modules, and an output layer; each of the dynamic geometric topology coupling modules includes a dynamic feature transformation module and a structural coupling attention module, the dynamic feature transformation module is used to perform nonlinear compression and channel recalibration on the input features, and the structural coupling attention module adopts an attention structure with a query head number greater than the key head number, and reorganizes the attention weights through a cross-head mixing matrix; a recovery module for recovering each of the target surface-level feature representations into a masked mesh representation of the corresponding target model surface, the masked mesh representation including three-dimensional coordinate information and visibility mask information; and a model generation module for recovering edges, vertices, and topological relationships between surfaces, edges, and vertices based on the intersection lines and intersection points between each of the target model surfaces, and generating a target three-dimensional CAD boundary representation model.

[0017] The present invention provides a method and apparatus for generating 3D CAD boundary representation models. This method generates multiple target surface-level feature representations in a surface-level feature representation space using a diffusion denoising network. Specifically, a dynamic feature transformation module performs nonlinear compression and channel recalibration on the input features at different diffusion time steps to reduce the impact of feature distribution variations on subsequent structural dependency modeling. A structural coupling attention module employs an attention structure with a greater number of query heads than key heads, and reorganizes the attention weights of different query heads using a cross-head mixing matrix. This strengthens information interaction between different attention heads while controlling computational overhead, thus modeling the structural dependencies between multiple model surfaces. Furthermore, the generated surface-level feature representations are restored to model surfaces containing 3D coordinate information and visibility mask information. Edges, vertices, and topological relationships are recovered based on the intersection lines and points between each model surface, thereby generating a 3D CAD boundary representation model. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0019] Figure 1 A flowchart of the three-dimensional CAD boundary representation model generation method of the present invention is shown; Figure 2 A schematic diagram illustrating the overall flow of a three-dimensional CAD boundary representation model generation method according to an illustrative embodiment of the present invention is shown. Figure 3 A schematic diagram of an example of a face-level mask mesh representation of the present invention is shown; Figure 4 A schematic diagram of a diffusion denoising network according to an example of the present invention is shown; Figure 5 A structural diagram of a dynamic geometric topology coupling module according to an example of the present invention is shown; Figure 6 This diagram illustrates an example of how a structurally coupled attention module processes processed input features according to an embodiment of the present invention. Figure 7 A schematic diagram of the auto-completion result of an example of the present invention is shown; Figure 8 A schematic diagram of an interpolation task according to an example of the present invention is shown; Figure 9 This diagram illustrates a visual comparison of the generation results of this invention with those of other methods on a DeepCAD dataset, representing an example of the present invention. Figure 10This diagram illustrates a visual comparison of the generation results of this invention with those of other methods on the ABC dataset, representing an example of the present invention. Figure 11 A structural block diagram of a 3D CAD boundary representation model generation device is shown. Figure 12 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0021] An embodiment of the present invention provides a method for generating a three-dimensional CAD boundary representation model.

[0022] Figure 1 A flowchart of the three-dimensional CAD boundary representation model generation method of the present invention is shown; Figure 2 A schematic diagram of the overall process of a three-dimensional CAD boundary representation model generation method according to an illustrative embodiment of the present invention is shown.

[0023] like Figure 1 As shown, the method includes operations S110~S140.

[0024] In operation S110, an initial noise representation and diffusion time step information adapted to the surface-level feature representation space are obtained.

[0025] According to an embodiment of the present invention, the method for obtaining the initial noise representation can be determined based on the currently executed 3D CAD boundary representation model generation task.

[0026] In one example, where automatic model generation is required, the initial noise representation data size can be determined based on the preset number of model faces and the feature length of each face-level feature representation. A corresponding number of noise data points are then randomly sampled according to a standard Gaussian distribution, organizing the noise data into an initial noise representation that fits the face-level feature representation space.

[0027] In another example, when the current task is to complete the 3D CAD boundary representation model to be completed, the known local faces of the 3D CAD boundary representation model to be completed can be obtained, the mask mesh representation of each known local face can be converted into a known face-level feature representation, and the data scale of the initial noise representation can be determined according to the number of candidate missing faces corresponding to the region to be completed and the feature length of the face-level feature representation. Then, a corresponding number of noise data are randomly sampled from the standard Gaussian distribution to form the initial noise representation corresponding to the region to be completed.

[0028] According to an embodiment of the present invention, the diffusion time step information can be determined based on a preset total number of diffusion time steps and the current inverse denoising stage. For example, when inverse denoising begins, the current diffusion time step can be set to a preset maximum time step; after each noise prediction and denoising update is completed, the current diffusion time step is updated to the next time step according to a preset time step sequence until the termination time step is reached.

[0029] In operation S120, the initial noise representation and diffusion time step information are input into the pre-trained diffusion denoising network, and multiple target surface-level feature representations are generated through reverse denoising.

[0030] The diffusion denoising network includes a linear mapping layer, a time-step embedding layer, multiple dynamic geometric topology coupling modules, and an output layer. Each dynamic geometric topology coupling module includes a dynamic feature transformation module and a structural coupling attention module. The dynamic feature transformation module is used to perform nonlinear compression and channel recalibration on the input features. The structural coupling attention module adopts an attention structure with a query head number greater than the key head number and reorganizes the attention weights through a cross-head mixing matrix.

[0031] According to an embodiment of the present invention, the initial noise representation is first converted into a preset feature dimension by a linear mapping layer, and the diffusion time step information is converted into time step features by a time step embedding layer. The mapped noise features and time step features are input into multiple dynamic geometric topology coupling modules to jointly process the features corresponding to multiple model surfaces to be generated.

[0032] In each dynamic geometric topology coupling module, the dynamic feature transformation module performs nonlinear compression and channel adjustment on the input features, and the structural coupling attention module calculates the correlation between different facet-level features and fuses the correlation information obtained by different attention heads through a cross-head mixing matrix, thereby updating the facet-level features corresponding to each model facet.

[0033] After processing by multiple dynamic geometric topology coupling modules, the output layer outputs the predicted noise corresponding to the current diffusion time step, and updates the current surface-level representation based on the predicted noise. The above processing is repeated according to the preset diffusion time step until reverse denoising is completed, resulting in multiple target surface-level feature representations.

[0034] Figure 3 A schematic diagram of a face-level mask mesh representation according to an example of the present invention is shown. Here, UV space refers to the two-dimensional parametric coordinate space of the model face, used to determine the sampling position of the model face on a two-dimensional plane. F For a face-level mask mesh representation, including (Coordinate components) and (Mask components), all of which are matrices in form.

[0035] In operation S130, the feature representation of each target surface is restored to the mask mesh representation of the corresponding target model surface. The mask mesh representation includes three-dimensional coordinate information and visibility mask information.

[0036] Specifically, based on a preset grid resolution and the number of feature channels, the dimensionality of each target surface-level feature representation can be reorganized to obtain a two-dimensional regular grid for the corresponding target model surface. Each grid position includes a three-dimensional coordinate component and a visibility mask component. The three-dimensional coordinate component represents the position of the corresponding sampling point in three-dimensional space, while the visibility mask component indicates whether the corresponding sampling point belongs to the effective surface region of the target model surface.

[0037] In operation S140, the topological relationships between edges, vertices, and faces, edges, and vertices are recovered based on the intersection lines and intersection points between the surfaces of each target model, thereby generating a target 3D CAD boundary representation model.

[0038] Specifically, the boundary of each target model surface is extended and the surface is divided; then the intersection lines and intersection points between different facets are calculated; then the edges and vertices are recovered based on the intersection lines and intersection points; finally, the topological connection relationship between the facets, edges and vertices is established to generate the target 3D CAD boundary representation model.

[0039] In this manner, multiple target surface-level feature representations are generated in the surface-level feature representation space using a diffusion denoising network. A dynamic geometric topology coupling module is then used to jointly model the relationships between these multiple surface-level feature representations, ensuring geometric consistency among different model surfaces during generation. Compared to methods that directly predict explicit edges, vertices, and topological relationships, this embodiment first generates target model surfaces containing 3D geometric information. Then, it recovers edges, vertices, and topological relationships based on the intersections and points between the target model surfaces. This reduces the modeling difficulty of complex structural relationships during explicit topology prediction and improves the completeness and topological consistency of the generated 3D CAD boundary representation model.

[0040] In one illustrative embodiment, the training process of the diffusion denoising network includes operations S210~S250: In operation S210, the three-dimensional CAD boundary representation model of multiple samples is decomposed into multiple sample model surfaces. The two-dimensional parameter domain of each sample model surface is sampled regularly, and a sample mask mesh representation is constructed based on the three-dimensional coordinate information and visibility mask information of each sampling point.

[0041] For example, for the first The surface of each sample model, whose parametric surface is determined by the predefined surface type in the CAD system, can be represented as:

[0042] in, Indicates the first Two-dimensional parameter domain of each face, , R is a parameter variable. 3 It represents three-dimensional Euclidean space.

[0043] Furthermore, in the two-dimensional parameter domain Upward Rule-based sampling yields coordinate components:

[0044] Simultaneously define the visibility mask component:

[0045] Therefore, the sample mask mesh of the i-th sample model surface is represented as:

[0046] Among them, the three-dimensional coordinate components are used to express geometric information, and the visibility mask is used to implicitly express the local topology.

[0047] In operation S220, the mask grid representation of each sample is flattened into a fixed-length sample surface-level feature representation.

[0048] In some examples, facet-level feature representations can be facet-level tokens.

[0049] According to an embodiment of the present invention, each sample mask mesh representation is flattened into a sample face-level feature representation of fixed length. For a sample 3D CAD boundary representation model containing M sample model faces, it can be represented as an unordered set of M face-level tokens, thereby adapting to CAD models of different topological scales.

[0050] In operation S230, Gaussian noise is gradually added to the sample surface-level feature representation according to the preset diffusion time step to obtain a noisy surface-level feature representation.

[0051] For example, Gaussian noise can be gradually added to the sample surface-level feature representation so that the data gradually degenerates into a standard Gaussian distribution. By weighting and combining the sample surface-level feature representation and the Gaussian noise, a noisy surface-level feature representation can be obtained.

[0052] In operation S240, the noisy surface-level feature representation and diffusion time step are input into the diffusion denoising network to obtain the predicted noise.

[0053] For example, the diffusion denoising network can be a diffusion denoising network based on the Transformer architecture, used to predict the noise corresponding to the current diffusion time step based on the input noisy surface-level feature representation and the corresponding diffusion time step information.

[0054] Figure 4 A schematic diagram of an example diffusion denoising network of the present invention is shown. Figure 4 As shown, the diffusion denoising network includes a linear projection layer, a time-step embedding layer, multiple dynamic geometric topology coupling modules (DGT Blocks), and a final output layer. Specifically, noisy surface-level tokens are mapped to a preset feature space through the linear projection layer, and diffusion occurs over time steps. The features are converted into temporal conditional features through a time-step embedding layer. The surface token features and temporal conditional features are input together into multiple cascaded dynamic geometric topology coupling modules for feature interaction and updating. Finally, the output layer predicts the prediction noise corresponding to the current diffusion time step based on the updated features.

[0055] In operation S250, the network parameters of the diffusion denoising network are updated based on the mean square error between the added Gaussian noise and the predicted noise.

[0056] According to an embodiment of the present invention, the network parameters in the diffusion denoising network can be updated with the goal of minimizing the mean square error between Gaussian noise and predicted noise.

[0057] Through the training method described above, the network can predict noise in the noisy surface-level feature representation under different time step conditions, so as to recover the true surface-level feature representation, enabling the model to learn the ability to recover the 3D CAD boundary representation model from the noise distribution.

[0058] In one illustrative embodiment, operation S210 specifically includes: Determine whether the sampling point is located in the effective surface region of the corresponding sample model surface.

[0059] According to an embodiment of the present invention, for any face Its mask grid representation is composed of coordinate components and mask components Composition. Among them, Used to record the three-dimensional coordinates of sampling points. Used to mark whether the sampling point is located in the valid surface area.

[0060] When the sampling point is located in an effective surface region, the corresponding visibility mask value is set to the first mask value. When the sampling point is located in a hole, clipping boundary, or local invalid region, the corresponding visibility mask value is set to the second mask value.

[0061] For example, if the sampling point is located in the valid surface region, the corresponding mask value is 1; if the sampling point is located in the invalid surface region, the corresponding mask value is 0.

[0062] The three-dimensional coordinate information of each sampling point is combined with the corresponding visibility mask value to obtain the sample mask grid representation.

[0063] By using the above settings, structural information such as holes, clipping boundaries, or local invalid areas can be expressed, thereby alleviating the problem of blurred boundary information when only coordinate information is used.

[0064] Figure 5 The diagram illustrates the structure of a dynamic geometric topology coupling module according to an example of the present invention. Here, input tokens represent input features, DyT represents the dynamic feature transformation module, and SCEA is the structural coupling attention module.

[0065] like Figure 5 As shown, the dynamic geometric topology coupling module includes a first dynamic feature transformation module, a structural coupling attention module, a second dynamic feature transformation module, and a feedforward network module. The input features to the dynamic geometric topology coupling module undergo distribution stabilization processing by the first dynamic feature transformation module. Then, the processed input features are input to the structural coupling attention module, where the structural dependencies between multiple surface-level feature representations are modeled. Finally, the input features pass through the second dynamic feature transformation module into the feedforward network, where the nonlinear expressive power is enhanced.

[0066] According to an embodiment of the present invention, the first dynamic feature transformation module is used to perform initial feature normalization on the input features to alleviate the problem of unstable feature distribution at different diffusion time steps, and the second dynamic feature transformation module is used for dynamic adjustment of the input features of the feedforward network.

[0067] In one illustrative embodiment, the first dynamic feature transformation module and the second dynamic feature transformation module process their respective input features using the following dynamic feature transformation methods: scaling the input features according to a learnable dynamic scaling factor; nonlinearly compressing the scaled input features using a hyperbolic tangent function; and recalibrating the nonlinearly compressed input features according to learnable channel scaling parameters and channel offset parameters to obtain dynamic transformed features.

[0068] Specifically, the dynamic feature transformation module compresses the input features using the tanh nonlinear function and combines it with learnable parameters to complete channel-level recalibration:

[0069] in, As input features, These are intermediate features after nonlinear compression. For dynamic transformation features, α represents a learnable dynamic scaling factor, and γ and β represent learnable channel-level scaling and offset parameters, respectively.

[0070] Figure 6 This diagram illustrates an example of how the structure-coupled attention module of the present invention processes the processed input features.

[0071] like Figure 6 The specific process of using the structurally coupled attention module is as follows: The input features are mapped to query features, key features, and value features, respectively. The query features include a first number of query headers, and the key features and value features each include a second number of key-value headers. The first number is greater than the second number.

[0072] According to an embodiment of the present invention, for the input features input to the structurally coupled attention module, given:

[0073] Where B represents the batch size, N represents the number of facet-level feature representations, and C represents the feature dimension. The input features are first linearly mapped to obtain the query Q, key K, and value V, represented as:

[0074] in, , , These represent the linear mapping parameters corresponding to the query, key, and value, respectively.

[0075] The query Q uses H1 query headers, and the key K and value V use H2 key-value headers, where H2 < H1.

[0076] Its multi-head form is represented as:

[0077] in, Let represent the feature dimension of a single attention head, and satisfy:

[0078] Subsequently, the keys K and V corresponding to each key header are copied to obtain the expanded keys K′ and V′, represented as:

[0079] Calculate the initial attention weight for each query header based on the query features corresponding to each query header and the copied key features.

[0080] Specifically, the scaled dot product attention is calculated based on the query Q and the expanded key K′, thus obtaining the attention weight matrix A:

[0081] Furthermore, the initial attention weights corresponding to different query heads can be linearly recombined using a learnable cross-head mixing matrix to obtain recombined attention weights.

[0082] Specifically, to enhance information interaction between different attention heads, a learnable cross-head blending matrix is ​​introduced. Linearly reorganize the attention weights:

[0083] in, This represents the initial attention weight distribution of the g-th original attention head. This represents the reorganized attention weight distribution of the h-th attention head after mixing. Indicates the first The first original head pair The contribution of each hybrid head.

[0084] Based on the reorganized attention weights, the copied value features are weighted and aggregated to obtain the aggregated features corresponding to each query header.

[0085] Specifically, the recombined attention weights after mixing Perform weighted aggregation with the expanded value V′:

[0086] in, For the first The output features of the attention head.

[0087] The aggregated features corresponding to each query header are concatenated and linearly mapped to obtain the attention output features. The specific process can be represented as follows:

[0088] Where Y represents the attention output feature.

[0089] Figure 7 A schematic diagram of the auto-completion result of an example of the present invention is shown.

[0090] like Figure 7As shown, the above method can be used to restore a complete 3D model. The specific process is as follows: Obtain the known surface-level feature representations corresponding to the known local surfaces of the 3D CAD boundary representation model to be completed.

[0091] The known surface-level feature representation is used as a conditional constraint input to the diffusion denoising network. During the reverse denoising process, the known surface-level feature representation is retained, and the missing surface-level feature representation corresponding to the missing region of the 3D CAD boundary representation model to be completed is generated.

[0092] Based on the known and missing surface-level feature representations, multiple target surface-level feature representations are obtained.

[0093] Figure 8 A schematic diagram of an interpolation task according to an example of the present invention is shown.

[0094] In another illustrative embodiment, the above method can also be used for CAD model interpolation tasks, such as... Figure 8 As shown, given two endpoint B-rep models, the surface-level correspondence between them is first established, then interpolation is performed in the diffuse implicit representation space, and finally an intermediate model is generated through inverse denoising and geometric post-processing.

[0095] Specifically, the two endpoint B-rep models are represented as corresponding surface-level feature representations. A matching method is used to establish the correspondence between the surface-level feature representations of the two endpoint models. Interpolation is performed on the surface-level token representations corresponding to the two endpoint models, and diffusion denoising is used to generate intermediate surface-level feature representations. An intermediate B-rep model is generated through geometric post-processing, achieving continuous changes in geometry and topology.

[0096] The technical effects of the present invention will be explained below based on experimental results. It should be noted that the following experiments are only used to verify the beneficial effects that the technical solution of the present invention can achieve, and do not constitute a limitation on the scope of protection of the present invention.

[0097] The experiments used two representative CAD datasets, DeepCAD and ABC, for validation. Evaluation metrics included FID, 1-NNA, COV, MMD, and Watertight Ratio. FID measures the difference between the generated result and the true distribution; 1-NNA evaluates the consistency between the generated and true distributions; COV measures sample coverage; MMD measures the geometric distance between generated and true samples; and Watertight Ratio measures the proportion of valid closed entities formed by the generated model.

[0098] To verify the generation quality of the present invention compared with existing methods, the method of the present invention was compared with DeepCAD, BrepDiff and other methods. The results are shown in Table 1.

[0099] Table 1. Comparison of B-rep model generation quality using different methods

[0100] As shown in Table 1, on the DeepCAD and ABC datasets, the model generation method provided by this invention improves upon the BrepDiff method in all metrics, indicating that the model generation method provided by this invention can improve the generation quality, geometric consistency, and entity closure effectiveness in the B-rep diffusion generation process. Figure 9 and Figure 10 Visual comparisons of the generation results of this invention with other methods on the DeepCAD and ABC datasets are presented respectively. It can be seen that the B-rep model generated by this invention performs better in terms of overall shape integrity, local geometric continuity, and solid closure, and can reduce problems such as structural missingness, geometric breaks, and topological inconsistencies in the generated results.

[0101] The following describes the three-dimensional CAD boundary representation model generation device provided by the present invention. The three-dimensional CAD boundary representation model generation device described below and the three-dimensional CAD boundary representation model generation method described above can be referred to in correspondence with each other.

[0102] Figure 11 A structural block diagram of a 3D CAD boundary representation model generation device is shown.

[0103] like Figure 11 As shown, the 3D CAD boundary representation model generation device 1100 includes a noise acquisition module 1110, a noise reduction module 1120, a restoration module 1130, and a model generation module 1140.

[0104] The noise acquisition module 1110 is used to acquire the initial noise representation and diffusion time step information that is adapted to the surface-level feature representation space.

[0105] The denoising module 1120 is used to input the initial noise representation and diffusion time step information into the pre-trained diffusion denoising network, and generate multiple target surface-level feature representations through reverse denoising.

[0106] The diffusion denoising network includes a linear mapping layer, a time-step embedding layer, multiple dynamic geometric topology coupling modules, and an output layer. Each dynamic geometric topology coupling module includes a dynamic feature transformation module and a structural coupling attention module. The dynamic feature transformation module is used to perform nonlinear compression and channel recalibration on the input features. The structural coupling attention module adopts an attention structure with a query head number greater than the key head number and reorganizes the attention weights through a cross-head mixing matrix. The recovery module 1130 is used to restore the feature representation of each target surface to the mask mesh representation of the corresponding target model surface. The mask mesh representation includes three-dimensional coordinate information and visibility mask information.

[0107] The model generation module 1140 is used to recover the edges, vertices, and topological relationships between faces, edges, and vertices based on the intersection lines and intersection points between the surfaces of each target model, and generate a target 3D CAD boundary representation model.

[0108] Figure 12 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 12 As shown, the electronic device may include a processor 1210, a communications interface 1220, a memory 1230, and a communication bus 1240. The processor 1210, communications interface 1220, and memory 1230 communicate with each other via the communication bus 1240. The processor 1210 can call logical instructions from the memory 1230 to execute a three-dimensional CAD boundary representation model generation method.

[0109] Furthermore, the logical instructions in the aforementioned memory 1230 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0110] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the three-dimensional CAD boundary representation model generation method provided by the above methods.

[0111] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the three-dimensional CAD boundary representation model generation method provided by the above methods.

[0112] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0113] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating a 3D CAD boundary representation model, characterized in that, include: Obtain initial noise representation and diffusion time step information that are compatible with the surface-level feature representation space; The initial noise representation and diffusion time step information are input into a pre-trained diffusion denoising network, and multiple target surface-level feature representations are generated through reverse denoising. The diffusion denoising network includes a linear mapping layer, a time-step embedding layer, multiple dynamic geometric topology coupling modules, and an output layer. Each dynamic geometric topology coupling module includes a dynamic feature transformation module and a structural coupling attention module. The dynamic feature transformation module is used to perform nonlinear compression and channel recalibration on the input features. The structural coupling attention module adopts an attention structure with a query head number greater than the key head number and reorganizes the attention weights through a cross-head mixing matrix. Each of the target surface-level feature representations is restored to a mask mesh representation of the corresponding target model surface, wherein the mask mesh representation includes three-dimensional coordinate information and visibility mask information; Based on the intersection lines and intersection points between the target model faces, the edges, vertices, and topological relationships between faces, edges, and vertices are recovered to generate the target 3D CAD boundary representation model.

2. The method for generating a three-dimensional CAD boundary representation model according to claim 1, characterized in that, The training process of the diffusion denoising network includes: The three-dimensional CAD boundary representation model of multiple samples is decomposed into multiple sample model surfaces. The two-dimensional parameter domain of each sample model surface is sampled regularly, and a sample mask mesh representation is constructed based on the three-dimensional coordinate information and visibility mask information of each sampling point. Each of the sample mask mesh representations is flattened into a fixed-length sample surface-level feature representation; According to the preset diffusion time step, Gaussian noise is gradually added to the sample surface feature representation to obtain a noisy surface feature representation; The noisy surface-level feature representation and the diffusion time step are input into the diffusion denoising network to obtain the predicted noise; The network parameters of the diffusion denoising network are updated based on the mean square error between the added Gaussian noise and the predicted noise.

3. The method for generating a three-dimensional CAD boundary representation model according to claim 2, characterized in that, The construction of the sample mask grid representation based on the three-dimensional coordinate information and visibility mask information of each sampling point includes: Determine whether the sampling point is located in the effective surface region of the corresponding sample model surface; When the sampling point is located in the effective surface region, the corresponding visibility mask value is set to the first mask value; when the sampling point is located in a hole, clipping boundary, or local invalid region, the corresponding visibility mask value is set to the second mask value. The three-dimensional coordinate information of each sampling point is combined with the corresponding visibility mask value to obtain the sample mask grid representation.

4. The method for generating a three-dimensional CAD boundary representation model according to claim 1, characterized in that, The dynamic geometric topology coupling module includes a first dynamic feature transformation module, a structural coupling attention module, a second dynamic feature transformation module, and a feedforward network module; The first dynamic feature transformation module is used to process the input features of the dynamic geometric topology coupling module and input the processed input features into the structural coupling attention module; The structure-coupled attention module is used to model the structural dependencies between multiple surface-level feature representations; The second dynamic feature transformation module is used to process the features output by the structure-coupled attention module and input the processed features into the feedforward network module for nonlinear feature transformation.

5. The method for generating a three-dimensional CAD boundary representation model according to claim 4, characterized in that, The first dynamic feature transformation module and the second dynamic feature transformation module respectively process their respective input features using the following dynamic feature transformation methods: The input features are scaled based on a learnable dynamic scaling factor; The hyperbolic tangent function is used to perform nonlinear compression on the scaled input features; Based on the learnable channel scaling and channel offset parameters, the input features after nonlinear compression are recalibrated to obtain dynamic transformation features.

6. The method for generating a three-dimensional CAD boundary representation model according to claim 4, characterized in that, The structurally coupled attention module is used for: The input features are mapped to query features, key features, and value features, respectively. The query features include a first number of query headers, and the key features and value features each include a second number of key-value headers. The first number is greater than the second number. The key features and value features corresponding to each of the key-value headers are copied so that the number of copied key features and value features is the same as the number of query headers. Calculate the initial attention weight for each query head based on the query features corresponding to each query head and the copied key features.

7. The method for generating a three-dimensional CAD boundary representation model according to claim 6, characterized in that, The structurally coupled attention module is also used for: By using a learnable cross-head mixing matrix, the initial attention weights corresponding to different query heads are linearly recombined to obtain recombined attention weights; Based on the reorganized attention weights, the copied value features are weighted and aggregated to obtain the aggregated features corresponding to each query header; The aggregated features corresponding to each query header are concatenated and linearly mapped to obtain the attention output features.

8. The method for generating a three-dimensional CAD boundary representation model according to claim 1, characterized in that, The initial noise representation and diffusion time step information are input into the diffusion denoising network, and multiple target surface-level feature representations are generated through inverse denoising, including: Obtain the known surface-level feature representations corresponding to the known local surfaces of the 3D CAD boundary representation model to be completed; The known surface-level feature representation is input as a conditional constraint into the diffusion denoising network. During the reverse denoising process, the known surface-level feature representation is retained, and a missing surface-level feature representation corresponding to the missing region of the 3D CAD boundary representation model to be completed is generated. Based on the known surface-level feature representation and the missing surface-level feature representation, the multiple target surface-level feature representations are obtained.

9. The method for generating a three-dimensional CAD boundary representation model according to claim 1, characterized in that, In the diffusion denoising network, the surface-level feature representations corresponding to each model surface are respectively used as surface-level tokens for feature processing, and diffusion modeling is performed in the surface-level token representation space.

10. A three-dimensional CAD boundary representation model generation device, characterized in that, include: The noise acquisition module is used to acquire the initial noise representation and diffusion time step information that are adapted to the surface-level feature representation space; The denoising module is used to input the initial noise representation and diffusion time step information into a pre-trained diffusion denoising network, and generate multiple target surface-level feature representations through reverse denoising; The diffusion denoising network includes a linear mapping layer, a time-step embedding layer, multiple dynamic geometric topology coupling modules, and an output layer. Each dynamic geometric topology coupling module includes a dynamic feature transformation module and a structural coupling attention module. The dynamic feature transformation module is used to perform nonlinear compression and channel recalibration on the input features. The structural coupling attention module adopts an attention structure with a query head number greater than the key head number and reorganizes the attention weights through a cross-head mixing matrix. The recovery module is used to recover the target surface-level feature representations of each target surface into the mask mesh representation of the corresponding target model surface, wherein the mask mesh representation includes three-dimensional coordinate information and visibility mask information; The model generation module is used to recover the edges, vertices, and topological relationships between faces, edges, and vertices based on the intersection lines and intersection points between the target model faces, and generate a target 3D CAD boundary representation model.