Method for generating b-rep model based on single-view image

CN122966863APending Publication Date: 2026-10-23TSINGHUA UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611252985.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-18
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0004]本申请提供一种基于单视图图像的边界表示法(Boundary Representation,B-rep)模型生成方法和装置,用以解决现有技术中二维外观与CAD拓扑之间存在模态差异的缺陷

Benefits of technology

[0019]本申请还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上述任一种所述基于单视图图像的B-rep模型生成方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122966863A_ABST
    Figure CN122966863A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computer-aided design, and provides a B-rep model generation method based on a single-view image. The method comprises the following steps: acquiring a single-view image of a target object; determining a three-dimensional geometric feature of the target object based on the single-view image, encoding a CAD modeling sequence of the target object to obtain a CAD modeling sequence feature, performing cross-modal alignment on the three-dimensional geometric feature and the CAD modeling sequence feature to obtain cross-modal alignment information, and the cross-modal alignment information is used for representing a mapping relationship between the three-dimensional geometric feature and the modeling sequence feature; and generating a B-rep model based on the cross-modal alignment information. The B-rep model generation method based on the single-view image can effectively bridge the modal difference between a two-dimensional appearance and a CAD topology, and can reconstruct an editable industrial standard B-rep model which is geometrically accurate and topologically effective under the condition of single-image input.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer-aided design technology, and in particular to a method for generating B-rep models based on single-view images. Background Technology

[0002] Existing 3D reconstruction methods for Computer-Aided Design (CAD) models typically rely on multi-view scanning, point cloud fitting, manual feature recognition, or long-sequence CAD program prediction. Point cloud fitting methods are susceptible to sensor noise, occlusion, and uneven sampling density, leading to insufficient accuracy or topological errors in reconstructed surfaces with sharp edges, corners, and chamfers. While methods that directly predict CAD modeling sequences can generate editable modeling histories, they face challenges such as excessive sequence length, complex topological constraints, and coupling between global contours and local details, making it difficult for models to maintain both geometric accuracy and topological validity under long sequence conditions. In particular, for scenarios with only a single image as input, there are significant modal differences between the 2D appearance and the CAD B-rep topology. Existing methods are prone to generating missing faces, hanging faces, open-loop sketches, or uncompileable operation sequences, resulting in reconstruction failures or unusable models.

[0003] Therefore, there is a need for a method that can start from a single-view image, effectively overcome the modal differences between two-dimensional appearance and CAD topology, and improve the editability, topological effectiveness, and industrial applicability of single-view CAD reconstruction. Summary of the Invention

[0004] This application provides a method and apparatus for generating boundary representation (B-rep) models based on single-view images, in order to solve the defect in the prior art that there is a modal difference between two-dimensional appearance and CAD topology.

[0005] This application provides a method for generating B-rep models based on single-view images, including the following steps: Obtain a single-view image of the target object; Based on the single-view image, determine the three-dimensional geometric features of the target object; The computer-aided design (CAD) modeling sequence of the target object is encoded to obtain CAD modeling sequence features; Cross-modal alignment is performed between the three-dimensional geometric features and the CAD modeling sequence features to obtain cross-modal alignment information, which is used to characterize the mapping relationship between the three-dimensional geometric features and the modeling sequence features; Based on the cross-modal alignment information, a boundary representation B-rep model is generated.

[0006] According to the B-rep model generation method provided in this application, determining the three-dimensional geometric features of the target object based on the single-view image includes: Based on the single-view image, a coarse-grained point cloud of the target object is extracted, and the coarse-grained point cloud is used to characterize the three-dimensional shape of the target object; The importance of each point in the coarse-grained point cloud is determined, and the importance is used to reflect the degree of influence of each point in the coarse-grained point cloud on the geometric features of the target object; Based on the importance of each point in the coarse-grained point cloud, a fine-grained point cloud is obtained by resampling from the coarse-grained point cloud. The three-dimensional geometric features are determined based on the fine-grained point cloud.

[0007] According to the B-rep model generation method provided in this application, determining the three-dimensional geometric features based on the fine-grained point cloud includes: The fine-grained point cloud is geometrically encoded to obtain the three-dimensional geometric features.

[0008] According to the B-rep model generation method provided in this application, the resampling from the coarse-grained point cloud based on the importance of each point in the coarse-grained point cloud includes: Based on a preset sampling strategy, resampling is performed from the coarse-grained point cloud.

[0009] According to the B-rep model generation method provided in this application, the sampling strategy includes saliency terms and coverage terms; The saliency term is used to indicate sampling based on the importance of each point in the coarse-grained point cloud, and the coverage term is used to indicate sampling based on the spatial distribution of each point in the coarse-grained point cloud.

[0010] According to the B-rep model generation method provided in this application, the step of encoding the computer-aided design (CAD) modeling sequence of the target object to obtain CAD modeling sequence features includes: A pre-constructed hierarchical CAD operation codebook is used to perform hierarchical discrete encoding on the CAD modeling sequence of the target object to obtain the features of the CAD modeling sequence.

[0011] According to a B-rep model generation method provided in this application, the hierarchical CAD operation codebook includes an extruded block layer, a sketch image layer, and a curve cluster layer; The stretched block layer is used to represent the global semantics of modeling the target object, the grass image layer is used to represent the topological layout and encoding order of the closed contour of the target object, and the curve cluster layer is used to represent the contour details of the target object.

[0012] According to the B-rep model generation method provided in this application, the step of performing cross-modal alignment between the three-dimensional geometric features and the CAD modeling sequence features to obtain cross-modal alignment information includes: By employing contrastive learning, the three-dimensional geometric features and the CAD modeling sequence features are cross-modal aligned to obtain the cross-modal alignment information.

[0013] According to the B-rep model generation method provided in this application, the step of generating a boundary representation B-rep model based on the cross-modal alignment information includes: Based on the cross-modal alignment information, a target CAD modeling sequence is generated, which is used to characterize the modeling operation steps of the target object; The target CAD modeling sequence is parsed to generate the B-rep model.

[0014] According to the B-rep model generation method provided in this application, the method further includes: The single-view image is preprocessed; The preprocessing includes at least one of the following: cropping, scale normalization, background suppression, or color normalization of the single-view image.

[0015] This application also provides a B-rep model generation device based on a single-view image, comprising the following modules: The acquisition module is used to acquire a single-view image of the target object; The determination module is used to determine the three-dimensional geometric features of the target object based on the single-view image; The encoding module is used to encode the computer-aided design (CAD) modeling sequence of the target object to obtain CAD modeling sequence features; The processing module is used to perform cross-modal alignment between the three-dimensional geometric features and the CAD modeling sequence features to obtain cross-modal alignment information, which is used to characterize the mapping relationship between the three-dimensional geometric features and the modeling sequence features; The generation module is used to generate a boundary representation B-rep model based on the cross-modal alignment information.

[0016] According to the B-rep model generation apparatus provided in this application, the determining module is specifically used for: Based on the single-view image, a coarse-grained point cloud of the target object is extracted, and the coarse-grained point cloud is used to characterize the three-dimensional shape of the target object; The importance of each point in the coarse-grained point cloud is determined, and the importance is used to reflect the degree of influence of each point in the coarse-grained point cloud on the geometric features of the target object; Based on the importance of each point in the coarse-grained point cloud, a fine-grained point cloud is obtained by resampling from the coarse-grained point cloud. The three-dimensional geometric features are determined based on the fine-grained point cloud.

[0017] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the B-rep model generation method based on a single-view image as described above.

[0018] This application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the B-rep model generation method based on a single-view image as described above.

[0019] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the B-rep model generation method based on a single-view image as described above.

[0020] This application provides a B-rep model generation method based on single-view images. By extracting three-dimensional geometric features from single-view images and encoding the CAD modeling sequence, the features of the two modalities are aligned across modalities to establish a mapping relationship between the three-dimensional geometric structure and parametric modeling operations. Based on this alignment information, a boundary representation model is generated, thereby effectively bridging the modal differences between the two-dimensional appearance and the CAD topology. Under the condition of only a single image input, an editable industry-standard B-rep model with geometric accuracy, topological validity, and a complete modeling history can be reconstructed. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in this application 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 application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart illustrating a B-rep model generation method based on a single-view image provided in this application.

[0023] Figure 2 This is a schematic diagram of a hierarchical CAD operation code provided in this application.

[0024] Figure 3 This is a schematic diagram of the structure of a B-rep model generation device based on a single-view image provided in this application.

[0025] Figure 4 This is a schematic diagram of the structure of an electronic device provided in this application. Detailed Implementation

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

[0027] In the field of CAD, B-rep is a standard data structure for describing the geometry and topological relationships of engineering parts. B-rep models accurately describe the complete boundaries of an object through faces, edges, vertices, and their adjacency relationships. They can be further converted into industry standard formats such as the Standard for the Exchange of Product Model Data (STEP) and are widely used in precision manufacturing processes such as mechanical design, CNC machining, finite element analysis, and product data management.

[0028] In recent years, 3D generation technology based on single-view images has developed rapidly. Methods such as neural radiation fields, 3D Gaussian representation, mesh generation, and point cloud generation can recover consistent 3D shapes from single or small numbers of images. However, the 3D representations generated by these methods are usually triangular meshes or implicit fields, lacking editable parametric modeling history and rigorous topological structures that meet the requirements of CAD software, making it difficult to directly serve precision manufacturing and engineering design.

[0029] Existing 3D reconstruction methods for CAD models typically rely on multi-view scanning, point cloud fitting, manual feature recognition, or prediction of long sequences of CAD programs. Point cloud fitting methods are susceptible to sensor noise, occlusion, and uneven sampling density, leading to insufficient accuracy or topological errors in reconstructed surfaces with sharp edges, corners, and chamfers. While methods that directly predict CAD modeling sequences can generate editable modeling histories, they face challenges such as excessive sequence length, complex topological constraints, and coupling between global contours and local details, making it difficult for models to maintain both geometric accuracy and topological validity under long sequence conditions. In particular, for scenarios with only a single image as input, there are significant modal differences between the 2D appearance and the CAD B-rep topology. Existing methods are prone to generating missing faces, hanging faces, open-loop sketches, or uncompileable operation sequences, resulting in reconstruction failures or unusable models.

[0030] Therefore, there is a need for a method that can start from a single-view image, effectively overcome the modal differences between two-dimensional appearance and CAD topology, and improve the editability, topological effectiveness, and industrial applicability of single-view CAD reconstruction.

[0031] Based on this, embodiments of this application provide a B-rep model generation method based on single-view images. This method can acquire a single-view image of a target object, determine the three-dimensional geometric features of the target object based on the single-view image, encode the CAD modeling sequence of the target object to obtain CAD modeling sequence features, perform cross-modal alignment between the three-dimensional geometric features and the CAD modeling sequence features to obtain cross-modal alignment information, which is used to characterize the mapping relationship between the three-dimensional geometric features and the modeling sequence features; and generate a B-rep model based on the cross-modal alignment information.

[0032] In the above technical solution, by extracting three-dimensional geometric features from a single-view image and encoding the CAD modeling sequence, the features of the two modalities are aligned across modalities to establish a mapping relationship between the three-dimensional geometric structure and parametric modeling operations. Then, based on the alignment information, a boundary representation model is generated, thereby effectively bridging the modal differences between the two-dimensional appearance and the CAD topology. Under the condition of only requiring a single image input, an editable industry standard B-rep model with accurate geometry, valid topology, and a complete modeling history can be reconstructed.

[0033] The following is combined Figures 1 to 4 This application describes the B-rep model generation method based on a single-view image.

[0034] Figure 1 This is a flowchart illustrating a B-rep model generation method based on a single-view image provided in this application, as shown below. Figure 1 As shown, the method includes the following: S101, Obtain a single-view image of the target object.

[0035] The target object can be a mechanical part, an industrial component, a product casing, a structural component, or a building component with regular geometric features. This application does not specifically limit the target object. The following description uses a mechanical part as an example.

[0036] The single-view image of the target object can be a real photograph, a rendered image, a product catalog image, or an appearance drawing from the design stage, etc. This application embodiment does not specifically limit the source of the single-view image.

[0037] In one example, after obtaining a single-view image of the target object, the electronic device can also preprocess the single-view image of the target object to reduce the impact of shooting environment, lighting conditions and background interference on subsequent geometric inference.

[0038] Preprocessing of a single-view image of a target object may include, but is not limited to, at least one of the following: cropping, scale normalization, background suppression, or color normalization of the single-view image of the target object. This application does not limit the specific method of preprocessing in its embodiments.

[0039] S102, Based on a single-view image, determine the three-dimensional geometric features of the target object.

[0040] In one example, S102 can be specifically implemented as steps A to D below.

[0041] Step A: Extract coarse-grained point cloud of the target object based on the single-view image.

[0042] Coarse-grained point clouds are used to characterize the three-dimensional shape of the target object.

[0043] In one example, an image-to-point cloud network can be deployed in an electronic device. The image-to-point cloud network takes a single-view image as input and outputs a coarse-grained point cloud of the target object after forward inference.

[0044] For example, an image-to-point-cloud network can be based on a single view. Figure 3 Dimensional estimation model construction.

[0045] For example, image-to-point cloud networks can be pre-trained on synthetic CAD model rendered images and / or real industrial part photographs, or the pre-trained model can be adapted to the domain using parameter-efficient fine-tuning methods such as Low-Rank Adaptation (LoRA) and Adapter, making the attention mechanism of the image-to-point cloud network more suitable for typical engineering geometric structures such as planes, cylinders, holes, chamfers, and steps of rigid mechanical parts, thereby improving the reconstruction quality of coarse-grained point clouds in edge, ridge, and curved transition regions.

[0046] Step B: Determine the importance of each point in the coarse-grained point cloud.

[0047] A coarse-grained point cloud contains multiple points. After obtaining the coarse-grained point cloud of the target object in the above manner, the importance (also known as geometric importance) of each point in the coarse-grained point cloud can be estimated.

[0048] Importance is used to reflect the degree of influence of each point in a coarse-grained point cloud on the geometric features of a target object. In other words, the importance of each point in a coarse-grained point cloud reflects the degree of influence that point has on the geometric features of the target object. Therefore, the importance of each point can also be called geometric importance.

[0049] It's important to note that higher geometric importance of a point indicates a greater probability that it lies in a high-curvature region, sharp edge, or corner, and a greater influence that point has on the geometric features of the target object; in other words, the point is more crucial for preserving the target object's geometric characteristics. Conversely, lower geometric importance of a point indicates a greater probability that it lies in a flat region or low-curvature surface, and a smaller influence that point has on the target object's geometric features; in other words, the point is less crucial for preserving the target object's geometric characteristics. Therefore, by distinguishing the importance of each point in a coarse-grained point cloud, priority can be given to geometric elements that have a significant impact on the target object's geometric features during subsequent processing.

[0050] In one example, an uncertainty-aware dynamic graph convolutional network can be deployed in an electronic device. This network takes a coarse-grained point cloud as input and, by analyzing the geometric relationships between each point in the coarse-grained point cloud and its local neighborhood, outputs a geometric importance score for each point, characterizing its geometric importance.

[0051] For example, an uncertainty-aware dynamic graph convolutional network can construct a local neighborhood graph (such as a k-nearest neighbor graph or a radius neighborhood graph) based on the spatial location of each point in a coarse-grained point cloud. It then uses edge convolution (EdgeConv) layers to aggregate edge features between points within the neighborhood, extracting geometric descriptors that characterize local surface variations. Subsequently, based on the extracted geometric descriptors, the uncertainty-aware dynamic graph convolutional network can predict and output the geometric importance score of each point using a multilayer perceptron.

[0052] The embodiments of this application do not limit the specific structure of the uncertainty-aware dynamic graph convolutional network. For example, the number of layers of EdgeConv, the construction parameters of the neighborhood graph, and the number of hidden units of the multilayer perceptron can be configured according to actual needs.

[0053] In one example, the uncertainty-aware dynamic graph convolutional network and the image-to-point cloud network can be jointly trained end-to-end. That is, both networks take a single-view image as input and a geometric importance score as output, and update their parameters synchronously using a unified loss function, enabling point cloud generation and geometric importance estimation to be mutually optimized. In another example, the uncertainty-aware dynamic graph convolutional network can also be used as an independent module. It can be pre-trained on synthetic CAD point cloud data, and after convergence, deployed in an electronic device, sequentially connected with the already trained image-to-point cloud network. This reduces dependence on paired training data and improves the flexibility of module deployment.

[0054] Step C: Based on the importance of each point in the coarse-grained point cloud, resample from the coarse-grained point cloud to obtain the fine-grained point cloud.

[0055] In one example, resampling can be performed from a coarse-grained point cloud based on a preset sampling strategy.

[0056] In one example, the preset sampling strategy may include saliency terms and coverage terms; The saliency term is used to indicate the sampling based on the importance of each point in the coarse-grained point cloud. That is, the saliency term primarily uses the importance of each point in the coarse-grained point cloud as the sampling criterion; points with higher importance have a greater probability of being sampled. The role of the saliency term is to prioritize retaining sharp feature regions in the coarse-grained point cloud that significantly affect geometric accuracy, such as edges, corners, hole edges, and chamfered transition surfaces, thereby ensuring the accuracy of the reconstructed model at key features.

[0057] The coverage term is used to indicate sampling based on the spatial distribution of each point in the coarse-grained point cloud. That is, the coverage term is related to the spatial distribution of each point in the coarse-grained point cloud. The role of the coverage term is to maintain a uniform sampling density in planar regions and low-curvature regions in the coarse-grained point cloud, avoiding excessive sparsification of large flat areas due to the dominance of saliency terms, which could lead to problems such as missing faces, hanging surfaces, or incomplete contour closures in the subsequent topology inference stage.

[0058] In one example, the probability of each point in the coarse-grained point cloud being sampled can be determined based on saliency and coverage terms, and the coarse-grained point cloud can be resampled based on the probability of each point in the coarse-grained point cloud being sampled to obtain a fine-grained point cloud.

[0059] For example, the probability of each point in a coarse-grained point cloud being sampled can be determined by weighting the saliency term and the coverage term. Through the weighting mechanism, the saliency term can preferentially retain feature regions that significantly affect the geometric shape, such as edges, corners, hole edges, and chamfered transition surfaces, while the coverage term maintains a uniform sampling density in planar and low-curvature regions. This avoids problems such as missing faces, hanging surfaces, or incomplete contour closures in subsequent topology inference stages due to excessive sparsity in large flat areas.

[0060] It is understandable that the weight ratio between saliency and coverage terms can be adjusted according to the geometric complexity of the target object. For example, for complex mechanical parts containing a large number of chamfers, holes, and steps, the weight of saliency terms can be appropriately increased to prioritize the preservation of boundary features; for structural parts mainly composed of planes and regular curved surfaces, the weight of coverage terms can be appropriately increased to ensure the complete expression of the overall contour.

[0061] The embodiments of this application do not limit the specific implementation of the sampling strategy. For example, the specific mathematical form of the saliency term and the coverage term, the weight setting method of the saliency term and the coverage term (fixed value, adaptive adjustment or obtained through network learning), etc., can all be flexibly configured according to the actual application scenario.

[0062] Step D: Determine the three-dimensional geometric features based on the fine-grained point cloud.

[0063] After obtaining fine-grained point clouds through resampling in the above manner, electronic devices can use a geometric encoder to perform geometric encoding on the fine-grained point clouds to obtain three-dimensional geometric features (also known as point cloud features) for subsequent cross-modal alignment.

[0064] In one example, the geometric encoder may be PointNet, PointNet++, DGCNN or other neural network structures suitable for point clouds. This application does not specifically limit the geometric encoder.

[0065] S103, Encode the CAD modeling sequence of the target object to obtain CAD modeling sequence features.

[0066] In one example, a pre-built hierarchical CAD operation codebook can be used to perform hierarchical discrete encoding on the CAD modeling sequence of the target object to obtain CAD modeling sequence features.

[0067] Hierarchical CAD operation codebooks can be divided into the following categories according to modeling hierarchy: Figure 2 The codebook is divided into three levels: the stretch block layer, the sketch image layer, and the curve cluster layer. Therefore, the CAD operation codebook can also be called a three-level hierarchical CAD operation codebook.

[0068] The extrude block layer is used to represent the global semantics of modeling the target object. The encoded content of the extrude block layer may include, but is not limited to, the sketch plane normal, the sketch plane origin, the extrusion depth, and Boolean operation types (such as union, intersection, and difference), which determine the overall outline and volume increase or decrease of the target object.

[0069] The sketch layer is used to represent the topological layout and coding order of the closed contours of the target object, ensuring that the main contours are coded before local details. For example, during coding, contours can be sorted according to area, diagonal scale, and position penalty, so that main contours with larger areas or central positions are coded before local details such as holes and slots, thus reflecting the designer's modeling habit of moving from the whole to the part.

[0070] Curve cluster layers are used to describe the contour details of a target object, representing the local geometric primitives and their parameters contained in each contour of the target object. For example, during encoding, curve elements such as line segments, arcs, or circles can be encoded in a local coordinate system. Encoding parameters can include chord length, relative tangential deflection, curvature, and residual offset, covering the finest-grained geometric details in the modeling sequence.

[0071] By encoding the CAD modeling sequence of the target object using the hierarchical CAD operation codebook described above, the originally lengthy CAD modeling sequence can be compressed into a stable discrete latent space, while preserving the design intent from the whole to the details in human modeling.

[0072] In the process of constructing a hierarchical CAD operation codebook, vector quantization autoencoders (VQ-VAEs) can be trained for the stretch block layer, the sketch image layer, and the curve cluster layer, so that each layer can compress its corresponding CAD modeling semantics into a finite set of discrete codewords.

[0073] In one example, during the process of training the vector quantization autoencoder for the stretch block layer, the grass image layer, and the curve cluster layer, the training objective can be at least one of the following: geometric parameter reconstruction loss, discrete type classification loss, codebook quantization loss, and loop closure regularization term.

[0074] The geometric parameter reconstruction loss is used to constrain the geometric parameters of the decoder output to be consistent with the original input, ensuring reconstruction accuracy. The discrete type classification loss is used to constrain the accurate classification of operation types, such as correctly distinguishing between line segments and arcs, and between union and difference operations. The codebook quantization loss is used to reduce the distance between the encoder output and the nearest codeword, ensuring a stable quantization process and controllable information loss. The closed-loop regularization term is used to constrain the decoded curve clusters to form closed contours, reducing the occurrence of open loops or misaligned endpoints in the sketch. By introducing the closed-loop regularization term, the topological validity of the sketch contours can be constrained in advance during the training phase, reducing the risk of subsequent B-rep compilation failures due to non-closed contours from the source, and improving the overall reconstruction success rate.

[0075] After the hierarchical CAD operation codebook is constructed, electronic devices can use it to perform hierarchical discrete encoding of the CAD modeling sequence of the target object, and obtain discrete index sequences for each level after quantization. These discrete index sequences, or their encoded feature representations, constitute the CAD modeling sequence features, which are used for subsequent cross-modal alignment.

[0076] S104 performs cross-modal alignment of 3D geometric features and CAD modeling sequence features to obtain cross-modal alignment information.

[0077] 3D geometric features are derived from 3D geometric inferences of single-view images, while CAD modeling sequence features are derived from the structured representation of the target object's CAD modeling sequence. Significant modal differences exist between the two. Directly using point cloud features as conditions to generate CAD modeling sequences can easily lead to semantic inconsistencies and topological mismatches. To address this issue, this step employs cross-modal alignment, mapping point cloud features and CAD modeling sequence features to a shared latent space, establishing a correspondence between them in a unified semantic space. This yields cross-modal alignment information that effectively constrains subsequent sequence generation. This cross-modal alignment information characterizes the mapping relationship between 3D geometric features and modeling sequence features.

[0078] Cross-modal alignment information is used to characterize the mapping relationship between 3D geometric features and modeling sequence features. Cross-modal alignment information refers to the guiding signal carrying CAD modeling semantic information extracted from point cloud features. That is, cross-modal alignment information is the guiding signal carrying CAD modeling semantic information extracted from point cloud features after cross-modal alignment by mapping point cloud features and CAD modeling sequence features to a shared latent space.

[0079] In one example, the electronic device can employ contrastive learning to perform cross-modal alignment of 3D geometric features with CAD modeling sequence features to obtain cross-modal alignment information.

[0080] In one example, an electronic device may be equipped with a cross-modal alignment module for cross-modal alignment of point cloud features and CAD modeling sequence features.

[0081] In one example, the cross-modal alignment module can be trained before it is used.

[0082] For example, point cloud features and CAD modeling sequence features belonging to the same object can be constructed as positive sample pairs, while point cloud features and CAD modeling sequence features belonging to different objects can be constructed as negative sample pairs. By optimizing the contrastive loss function, the representation distance of positive sample pairs in the shared latent space is shortened, while the representation distance of negative sample pairs in the shared latent space is widened. After training convergence, this shared latent space can express the consistent association between 3D geometric features and CAD modeling semantics. Based on this shared latent space, guiding signals carrying CAD modeling semantic information can be extracted from the point cloud features; these guiding signals are the cross-modal alignment information.

[0083] After training the cross-modal alignment module in the above manner, the point cloud features and CAD modeling sequence features can be cross-modally aligned using the cross-modal alignment module to obtain cross-modal alignment information.

[0084] In one example, the contrastive loss function may be InfoNCE loss, Triplet loss, or other loss functions suitable for multimodal alignment, and this application embodiment does not specifically limit this.

[0085] In one example, cross-modal alignment can also be achieved through cross-attention mechanisms, multimodal variational autoencoders, or other modal fusion methods, and this application does not specifically limit this.

[0086] S105, based on cross-modal alignment information, generates a B-rep model.

[0087] In one example, an electronic device can generate a target CAD modeling sequence based on cross-modal alignment information. This target CAD modeling sequence represents the modeling operation steps of the target object. The target CAD modeling sequence can then be parsed to generate a B-rep model.

[0088] After obtaining cross-modal alignment information, an operation sequence that conforms to both the geometric shape of the target object and the CAD topology specifications can be automatically generated under the guidance of the cross-modal alignment information. This is the target CAD modeling sequence (also known as the discrete CAD modeling sequence).

[0089] In one example, an electronic device may be equipped with a sequence generation model that takes cross-modal alignment information as input and outputs a target CAD modeling sequence corresponding to the target object.

[0090] In one example, the Conditional Discrete Diffusion (VQ-Diffusion) model can be used as the sequence generation model. Based on a diffusion probability model framework, the VQ-Diffusion model learns the distribution of discrete data through two stages: forward diffusion and backward denoising, enabling the generation of high-quality discrete sequences under given constraints. The specific workflow is as follows: Quantization stage: The CAD modeling sequences in the training samples are quantized into discrete index sequences using the CAD operation codebook, which serve as the training targets for the diffusion model.

[0091] Forward diffusion stage: In the discrete index sequence, according to the preset diffusion steps and noise scheduling strategy, some indices are randomly selected step by step and replaced with mask states, gradually destroying the structural information of the original sequence.

[0092] Reverse generation stage: Using cross-modal alignment information as a guiding condition, the masked indexes are gradually predicted and recovered from the mask state through a learnable diffusion network, and finally a discrete index sequence that matches the geometric shape of the target object is reconstructed.

[0093] In one example, the conditional discrete diffusion model can adopt a Transformer architecture and receive cross-modal alignment information through a cross-attention mechanism, so that the generated target CAD modeling sequence simultaneously satisfies the visual appearance, 3D geometry and CAD modeling sequence characteristics of the target object.

[0094] This application does not limit the specific type of sequence generation model. In another example, the sequence generation model may also employ an autoregressive Transformer, a non-autoregressive conditional mask language model, or other model architectures suitable for conditional sequence generation.

[0095] After generating the target CAD modeling sequence, it needs to be compiled into a B-rep model with complete topological structure and geometric information before it can be used by downstream CAD software.

[0096] In one example, the electronic device can invoke a geometric kernel to parse and construct a target CAD modeling sequence. Specifically, each sketch curve can be reconstructed based on the curve cluster layer, the curves can be organized into closed contours according to the sketch image hierarchy, and constraint solving can be completed. Based on the extrusion block layer, sketch plane positioning, extrusion operations, and Boolean operations are performed sequentially to generate a B-rep solid model with faces, edges, vertices, and their adjacency relationships.

[0097] In one example, after generating the B-rep model, it can be exported to a standard data exchange format, such as a STEP file, an IGES file, or another CAD system-compatible format. The exported model can be opened, edited, have its parameters modified, used for simulation analysis, or directly used in subsequent processes such as CNC machining in CAD software.

[0098] This application does not limit the specific selection of the geometry kernel. For example, the open-source OpenCASCADE kernel or commercial kernels such as Parasolid and ACIS can be used.

[0099] As can be seen from the above technical solutions, the B-rep model generation method based on single-view images provided in this application embodiment can achieve the following beneficial effects: First, by introducing point clouds as an intermediate representation, the modal gap between the two-dimensional image space and the three-dimensional CAD parameterized space is effectively bridged, enabling the network to explicitly extract 3D structural priors from a single image. This not only reduces the dependence on multi-view input, depth sensors, or precise camera poses, but also enhances the method's robustness to occlusion and lighting changes in real-world scenarios, significantly improving its convenience and generalization ability in practical applications.

[0100] Second, to address the issue of lengthy and highly dependent CAD operation sequences, a three-level hierarchical codebook is employed for progressive compression and reconstruction. This mechanism decomposes the complex global sequence prediction task into sub-tasks at multiple scales, effectively alleviating the gradient vanishing and error accumulation problems in long sequence training and improving model convergence speed. At the same time, the coarse-to-fine generation strategy ensures the overall rationality of the output sequence in terms of macroscopic topological structure, avoiding local distortion.

[0101] Third, considering the characteristics of mechanical parts with high rigidity and weak texture, an uncertainty-aware resampling strategy is introduced. During the point cloud processing stage, sharp edges, corners, and high curvature regions are adaptively weighted and densely sampled. This operation avoids the feature blurring and smoothing issues caused by traditional uniform sampling from the source, enabling the reconstructed B-rep model to have higher positional accuracy and geometric clarity in key engineering features such as edges and corners, significantly improving the model's engineering usability.

[0102] Fourth, by enhancing the model's ability to distinguish between valid and invalid sequences through contrastive learning, and by combining the conditional discrete diffusion generation process with constraints and optimizations to the global sequence distribution, the final generated operation sequences not only statistically conform to the data priors but also strictly satisfy the syntax rules and compilation requirements of the geometric kernel. This mechanism significantly improves the editability and manifold effectiveness of the output B-rep model, ensuring that the generated results can be directly imported into mainstream CAD software for subsequent modification and processing.

[0103] In summary, this solution successfully establishes a complete link from single-view images to compilable B-rep models, achieving a good balance between reducing data acquisition costs, improving reconstruction accuracy, and ensuring output effectiveness. It provides an efficient, accurate, and industry-ready solution for image-based reverse engineering of mechanical parts.

[0104] The B-rep model generation apparatus based on a single-view image provided in this application is described below. The B-rep model generation apparatus based on a single-view image described below can be referred to in correspondence with the B-rep model generation method based on a single-view image described above.

[0105] Figure 3 A schematic diagram of a B-rep model generation device based on a single-view image provided in this application embodiment is shown below. Figure 3 As shown, the device includes: The acquisition module 301 is used to acquire a single-view image of the target object; The determining module 302 is used to determine the three-dimensional geometric features of the target object based on the single-view image; Encoding module 303 is used to encode the computer-aided design (CAD) modeling sequence of the target object to obtain CAD modeling sequence features; Processing module 304 is used to perform cross-modal alignment between the three-dimensional geometric features and the CAD modeling sequence features to obtain cross-modal alignment information, wherein the cross-modal alignment information is used to characterize the mapping relationship between the three-dimensional geometric features and the modeling sequence features; The generation module 305 is used to generate a boundary representation B-rep model based on the cross-modal alignment information.

[0106] Optionally, module 302 is specifically used for: Based on the single-view image, a coarse-grained point cloud of the target object is extracted, and the coarse-grained point cloud is used to characterize the three-dimensional shape of the target object; The importance of each point in the coarse-grained point cloud is determined, and the importance is used to reflect the degree of influence of each point in the coarse-grained point cloud on the geometric features of the target object; Based on the importance of each point in the coarse-grained point cloud, a fine-grained point cloud is obtained by resampling from the coarse-grained point cloud. The three-dimensional geometric features are determined based on the fine-grained point cloud.

[0107] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4As shown, the electronic device may include: a processor 410, a communications interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communications interface 420, and the memory 430 communicate with each other via the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute a B-rep model generation method based on a single-view image, the method including: A single-view image of the target object is acquired; based on the single-view image, the three-dimensional geometric features of the target object are determined; the computer-aided design (CAD) modeling sequence of the target object is encoded to obtain CAD modeling sequence features; the three-dimensional geometric features and the CAD modeling sequence features are cross-modal aligned to obtain cross-modal alignment information, which is used to characterize the mapping relationship between the three-dimensional geometric features and the modeling sequence features; based on the cross-modal alignment information, a boundary representation B-rep model is generated.

[0108] Furthermore, the logical instructions in the aforementioned memory 430 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 this application, in essence, 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 this application. 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.

[0109] On the other hand, this application 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 B-rep model generation method based on a single-view image provided by the above methods, the method including: A single-view image of the target object is acquired; based on the single-view image, the three-dimensional geometric features of the target object are determined; the computer-aided design (CAD) modeling sequence of the target object is encoded to obtain CAD modeling sequence features; the three-dimensional geometric features and the CAD modeling sequence features are cross-modal aligned to obtain cross-modal alignment information, which is used to characterize the mapping relationship between the three-dimensional geometric features and the modeling sequence features; based on the cross-modal alignment information, a boundary representation B-rep model is generated.

[0110] Furthermore, this application also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is implemented to perform the B-rep model generation method based on a single-view image provided by the methods described above, the method comprising: A single-view image of the target object is acquired; based on the single-view image, the three-dimensional geometric features of the target object are determined; the computer-aided design (CAD) modeling sequence of the target object is encoded to obtain CAD modeling sequence features; the three-dimensional geometric features and the CAD modeling sequence features are cross-modal aligned to obtain cross-modal alignment information, which is used to characterize the mapping relationship between the three-dimensional geometric features and the modeling sequence features; based on the cross-modal alignment information, a boundary representation B-rep model is generated.

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

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

[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application 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. Such 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 this application.

Claims

1. A method for generating B-rep models based on single-view images, characterized in that, The method includes: Obtain a single-view image of the target object; Based on the single-view image, determine the three-dimensional geometric features of the target object; The computer-aided design (CAD) modeling sequence of the target object is encoded to obtain CAD modeling sequence features; Cross-modal alignment is performed between the three-dimensional geometric features and the CAD modeling sequence features to obtain cross-modal alignment information, which is used to characterize the mapping relationship between the three-dimensional geometric features and the modeling sequence features; Based on the cross-modal alignment information, a boundary representation B-rep model is generated.

2. The B-rep model generation method according to claim 1, characterized in that, Determining the three-dimensional geometric features of the target object based on the single-view image includes: Based on the single-view image, a coarse-grained point cloud of the target object is extracted, and the coarse-grained point cloud is used to characterize the three-dimensional shape of the target object; The importance of each point in the coarse-grained point cloud is determined, and the importance is used to reflect the degree of influence of each point in the coarse-grained point cloud on the geometric features of the target object; Based on the importance of each point in the coarse-grained point cloud, a fine-grained point cloud is obtained by resampling from the coarse-grained point cloud. The three-dimensional geometric features are determined based on the fine-grained point cloud.

3. The B-rep model generation method according to claim 2, characterized in that, The determination of the three-dimensional geometric features based on the fine-grained point cloud includes: The fine-grained point cloud is geometrically encoded to obtain the three-dimensional geometric features.

4. The B-rep model generation method according to claim 2 or 3, characterized in that, The resampling from the coarse-grained point cloud based on the importance of each point in the coarse-grained point cloud includes: Based on a preset sampling strategy, resampling is performed from the coarse-grained point cloud.

5. The B-rep model generation method according to claim 4, characterized in that, The sampling strategy includes saliency terms and coverage terms; The saliency term is used to indicate sampling based on the importance of each point in the coarse-grained point cloud, and the coverage term is used to indicate sampling based on the spatial distribution of each point in the coarse-grained point cloud.

6. The B-rep model generation method according to any one of claims 1-3, characterized in that, The encoding of the computer-aided design (CAD) modeling sequence of the target object to obtain CAD modeling sequence features includes: A pre-constructed hierarchical CAD operation codebook is used to perform hierarchical discrete encoding on the CAD modeling sequence of the target object to obtain the features of the CAD modeling sequence.

7. The B-rep model generation method according to claim 6, characterized in that, The hierarchical CAD operation codebook includes an extrusion block layer, a sketch image layer, and a curve cluster layer; The stretched block layer is used to represent the global semantics of modeling the target object, the grass image layer is used to represent the topological layout and encoding order of the closed contour of the target object, and the curve cluster layer is used to represent the contour details of the target object.

8. The B-rep model generation method according to any one of claims 1-3, characterized in that, The process of performing cross-modal alignment between the three-dimensional geometric features and the CAD modeling sequence features to obtain cross-modal alignment information includes: By employing contrastive learning, the three-dimensional geometric features and the CAD modeling sequence features are cross-modal aligned to obtain the cross-modal alignment information.

9. The B-rep model generation method according to any one of claims 1-3, characterized in that, The step of generating a boundary representation B-rep model based on the cross-modal alignment information includes: Based on the cross-modal alignment information, a target CAD modeling sequence is generated, which is used to characterize the modeling operation steps of the target object; The target CAD modeling sequence is parsed to generate the B-rep model.

10. The B-rep model generation method according to any one of claims 1-3, characterized in that, The method further includes: The single-view image is preprocessed; The preprocessing includes at least one of the following: cropping, scale normalization, background suppression, or color normalization of the single-view image.