Three-dimensional reconstruction method, device and equipment of two-dimensional drawing and medium
By constructing the target graph structure, updating and clustering nodes, and using a preset model for 3D reconstruction, the problems of low efficiency and large error in converting 2D drawings into 3D models are solved, and automated 3D mesh model construction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN HETAO TECH CO LTD
- Filing Date
- 2026-02-04
- Publication Date
- 2026-04-21
AI Technical Summary
In existing technologies, the conversion of two-dimensional drawings into three-dimensional digital models during the design and manufacturing process of footwear products relies on manual operation, which is time-consuming, prone to errors, and cannot be processed in batches, making it difficult to meet the needs of large-scale customized production.
By acquiring feature points and geometric information from two-dimensional drawings, the target graph structure is constructed, nodes are updated and clustered, and three-dimensional reconstruction is performed using preset inference and alignment models. Three-dimensional spatial data is extracted to complete the construction of a three-dimensional mesh model.
It achieves automated view recognition and 3D alignment of 2D drawings, efficiently completes the construction of 3D mesh models, reduces human error, and adapts to large-scale customized production.
Smart Images

Figure CN121661295B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of 3D modeling technology, and in particular to a method, apparatus, device and medium for 3D reconstruction of 2D drawings. Background Technology
[0002] In the field of footwear product design and manufacturing, computer-aided software is typically used in the initial design phase to create two-dimensional drawings containing multiple views (such as front view, rear view, and sectional views) to express the design intent. However, for CNC machining, mold design, virtual display, or 3D printing, these two-dimensional drawings need to be converted into accurate three-dimensional digital models.
[0003] Currently, the conversion process of this 3D digital model mainly relies on manual operation. Drafting engineers need to use specialized computer-aided software to perform tasks such as view recognition and separation, view alignment, contour extraction and surface construction, 3D modeling, detail refinement, and verification. In other words, engineers must manually identify the geometric elements of each view from complex 2D drawing files. Based on engineering drawing principles (such as length alignment, height alignment, and width equality), each view is manually rotated and moved in 3D space to align it in the correct spatial position. Based on the aligned views, the contour lines representing the shape and internal structure of the shoe sole are extracted. Using modeling commands such as extrusion, rotation, lofting, and sweeping, the 2D contours are constructed into 3D solid surfaces and solids. Details such as chamfers and fillets are added, and the model is continuously checked from different perspectives to ensure it matches the original 2D view. Figure 1 This method is time-consuming in converting a complex shoe sole drawing into a 3D digital model, resulting in a waste of human resources. Furthermore, manual operation is prone to subjective errors; different engineers, or even the same engineer converting the same drawing at different times, may produce different results, affecting product quality. This method also cannot process drawings in batches, making it difficult to meet the needs of large-scale customized production.
[0004] Therefore, how to automatically and accurately identify and align the views of two-dimensional drawings in three dimensions, thereby efficiently completing three-dimensional mesh models, has become an urgent problem to be solved. Summary of the Invention
[0005] In view of this, embodiments of this application provide a method, apparatus, device, and medium for three-dimensional reconstruction of two-dimensional drawings, in order to solve the problem of how to automatically and accurately identify and align three-dimensional views of two-dimensional drawings, thereby efficiently completing a three-dimensional mesh model.
[0006] In a first aspect, embodiments of this application provide a method for three-dimensional reconstruction of a two-dimensional drawing, including:
[0007] A two-dimensional drawing to be reconstructed is obtained, and features are acquired from the two-dimensional drawing to obtain N feature points representing geometric elements and the geometric information corresponding to the feature points. The two-dimensional drawing is at least two views in the engineering view of the target object.
[0008] The feature points and their corresponding geometric information are used as information nodes. The geometric information is analyzed to determine the positional relationships between geometric elements. The positional relationships are used as edges. Based on the information nodes and the edges, the target graph structure is constructed.
[0009] Based on the target graph structure, determine the neighboring nodes of any information node, update the information node based on the neighboring nodes to obtain the updated node, cluster the updated node to obtain the view type of any updated node, and take all the updated nodes corresponding to each view type as the overall view of the corresponding view type.
[0010] The overall view is vectorized to obtain view feature vectors. The view feature vectors are then input into a preset inference model for processing to obtain pose transformation parameters of the overall view. The pose transformation parameters are then input into a preset trained alignment model for calculation to obtain a three-dimensional contour.
[0011] Extract the three-dimensional spatial data from the three-dimensional contour, perform shape processing operations on the three-dimensional spatial data, and complete the construction of the three-dimensional mesh model.
[0012] Secondly, according to an embodiment of this application, a three-dimensional reconstruction device for a two-dimensional drawing includes:
[0013] The information acquisition module is used to acquire the two-dimensional drawing to be reconstructed, perform feature acquisition on the two-dimensional drawing, and obtain N feature points representing geometric elements and the geometric information corresponding to the feature points. The two-dimensional drawing is at least two views in the engineering view of the target object.
[0014] The structure construction module is used to take the feature points and the corresponding geometric information of the feature points as information nodes, analyze the geometric information, determine the positional relationship between geometric elements, take the positional relationship as edges, and construct the target graph structure based on the information nodes and the edges;
[0015] The node update module is used to determine the neighboring nodes of any information node according to the target graph structure, update the information node according to the neighboring nodes to obtain the updated node, cluster the updated nodes to obtain the view type of any updated node, and take all the updated nodes corresponding to each view type as the overall view of the corresponding view type.
[0016] The contour determination module is used to perform vector transformation on the overall view to obtain view feature vectors, input the view feature vectors into a preset inference model for processing to obtain pose transformation parameters of the overall view, and input the pose transformation parameters into a preset trained alignment model for calculation to obtain a three-dimensional contour.
[0017] The 3D model construction module is used to extract the 3D spatial data from the 3D contour, perform shape processing operations on the 3D spatial data, and complete the construction of the 3D mesh model.
[0018] Thirdly, embodiments of this application provide a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the three-dimensional reconstruction method of two-dimensional drawings as described in the first aspect.
[0019] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the three-dimensional reconstruction method of two-dimensional drawings as described in the first aspect.
[0020] The beneficial effects of the embodiments in this application compared with the prior art are:
[0021] This application obtains a two-dimensional drawing to be reconstructed, performs feature acquisition on the two-dimensional drawing to obtain N feature points representing geometric elements and corresponding geometric information of the feature points. The two-dimensional drawing is at least two views in the engineering view of the target object. The feature points and the corresponding geometric information of the feature points are used as information nodes. The geometric information is analyzed to determine the positional relationship between geometric elements. The positional relationship is used as edges. Based on the information nodes and the edges, a target graph structure is constructed. Based on the target graph structure, the neighbor nodes of any information node are determined. Based on the neighbor nodes, the information nodes are updated to obtain updated nodes. The updated nodes are clustered to obtain the view type of any updated node. All updated nodes corresponding to each view type are used as the overall view of the corresponding view type. The overall view is vector-transformed to obtain view feature vectors. The view feature vectors are input into a preset inference model for processing to obtain the pose transformation parameters of the overall view. The pose transformation parameters are input into a preset trained alignment model for calculation to obtain a three-dimensional contour. The three-dimensional spatial data in the three-dimensional contour is extracted. The three-dimensional spatial data is subjected to shape processing operations to complete the construction of the three-dimensional mesh model. By first acquiring at least two views of the target object's engineering drawing and collecting features to obtain feature points and geometric information, the target drawing structure is constructed. Then, nodes are updated and clustered to obtain the overall view, which is converted into a view feature vector. Through inference and alignment model calculations, the 3D contour is derived. Finally, 3D spatial data is extracted and shape processed to construct a 3D mesh model. This automatically and accurately identifies and aligns the views of the 2D drawing in 3D, thus efficiently completing the 3D mesh model. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a schematic diagram of an application environment for a three-dimensional reconstruction method of a two-dimensional drawing provided in Embodiment 1 of this application;
[0024] Figure 2 This is a flowchart illustrating a three-dimensional reconstruction method for a two-dimensional drawing provided in Embodiment 2 of this application;
[0025] Figure 3 This is a flowchart illustrating a three-dimensional reconstruction method for a two-dimensional drawing provided in Embodiment 3 of this application;
[0026] Figure 4This is a flowchart illustrating a three-dimensional reconstruction method for a two-dimensional drawing provided in Embodiment 4 of this application;
[0027] Figure 5 This is a flowchart illustrating a three-dimensional reconstruction method for a two-dimensional drawing provided in Embodiment 5 of this application;
[0028] Figure 6 This is a schematic diagram of the structure of a three-dimensional reconstruction device for two-dimensional drawings provided in Embodiment Six of this application;
[0029] Figure 7 This is a schematic diagram of the structure of a computer device provided in Embodiment 7 of this application. Detailed Implementation
[0030] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0031] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0032] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0033] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0034] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0035] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0036] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0037] To illustrate the technical solution of this application, specific embodiments are described below.
[0038] The method for three-dimensional reconstruction of two-dimensional drawings provided in Embodiment 1 of this application can be applied to, for example... Figure 1 In this application environment, the client and server connect and communicate. Users can provide the conditions, requirements and operation instructions for the 3D reconstruction of 2D drawings through the client. The server is used to control the 3D reconstruction method based on the 2D drawings sent by the client.
[0039] The client side includes, but is not limited to, PDAs, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud terminal devices, and personal digital assistants (PDAs). The server side can be a standalone server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0040] See Figure 2 This is a flowchart illustrating a three-dimensional reconstruction method for a two-dimensional drawing provided in Embodiment 2 of this application. The aforementioned three-dimensional reconstruction method for two-dimensional drawings can be applied to... Figure 1 The server-side component.
[0041] like Figure 2As shown, the method for reconstructing the three-dimensional drawing from the two-dimensional drawing may include the following steps:
[0042] Step S201: Obtain the two-dimensional drawing to be reconstructed, perform feature acquisition on the two-dimensional drawing, and obtain N feature points representing geometric elements and the geometric information corresponding to the feature points. The two-dimensional drawing is at least two views in the engineering view of the target object.
[0043] The 2D drawing to be reconstructed here refers to the 2D drawing that will be reconstructed into a 3D mesh model. 2D drawings are used in fields such as footwear product design, engineering design, and mechanical drawing to depict a target object. A 2D drawing contains at least two views from the engineering views (front view, top view, left view, right view, bottom view, rear view, sectional view, etc.) of the target object. A combination of the front view and top view, or a combination of more views, is available to provide more comprehensive information about the target object.
[0044] Extract N feature points representing geometric elements from a 2D drawing. These N feature points describe the shape and position of the geometric element. For example, for a straight line, its endpoints are feature points; for an arc, the start point, end point, and center are feature points; and for a spline curve, the control points are feature points. These feature points concisely describe the shape and position of the geometric element.
[0045] While extracting feature points, the geometric information corresponding to these feature points is also obtained. This geometric information includes the coordinates of the feature points, the type of the geometric element they belong to (e.g., line, arc, spline curve), and some geometrically related attributes, such as curvature. This information will be used for embedding the feature vectors of nodes when constructing the graph structure later.
[0046] Step S202: The feature points and their corresponding geometric information are used as information nodes. The geometric information is analyzed to determine the positional relationships between geometric elements. The positional relationships are used as edges. Based on the information nodes and the edges, the target graph structure is constructed.
[0047] By combining each feature point and its corresponding geometric information, an information node is formed, which is the information node in the graph structure. Each information node can be regarded as a data set, which not only records the position of the feature point, but also contains the relevant attributes of the geometric element to which the point belongs. These relevant attributes are embedded in the node in the form of feature vectors.
[0048] By analyzing the geometric information contained in the information nodes, the positional relationships between them are determined using the basic properties and spatial relationship rules of geometric elements. For example, whether geometric elements are concurrent can be determined by whether the coordinates of feature points are the same, and whether they are tangent, parallel, or perpendicular can be determined by calculating the slope of a straight line or the slope of the tangent line to a curve. These positional relationships reflect the interrelationships of geometric elements in space and serve as the basis for constructing edges in the graph structure; that is, positional relationships embody the topological connections between geometric elements in the drawing.
[0049] In graph structures, edges are used to represent the relationships between nodes. Here, the positional relationships between geometric elements are abstracted as edges, meaning that edges represent the spatial relationships between geometric elements. For example, if a straight line and an arc are connected at their endpoints (shared points), then an edge is established between the two information nodes representing the endpoints of the line and the arc. Different positional relationships can correspond to different types of edges, and the existence of these edges allows the graph structure to accurately reflect the spatial layout and interactions of geometric elements in the drawing.
[0050] By combining all the information nodes and their corresponding edges, the target graph structure is formed. The target graph structure can be represented as G = (V, E), where G is the target graph structure, V is the set of information nodes, and E is the set of edges. The target graph structure completely describes the characteristics of the geometric elements in a 2D drawing and the spatial relationships between them. The constructed target graph structure can serve as a unified model for various subsequent analysis and processing tasks, such as view classification and labeling, drawing reconstruction, and error detection.
[0051] Step S203: Based on the target graph structure, determine the neighbor nodes of any information node; update the information node based on the neighbor nodes to obtain updated nodes; cluster the updated nodes to obtain the view type of any updated node; and take all updated nodes corresponding to each view type as the overall view of the corresponding view type.
[0052] Optionally, clustering the updated nodes to obtain the view type of any updated node, and taking all updated nodes corresponding to each view type as the overall view of the corresponding view type, may include the following steps:
[0053] The update nodes are processed according to a preset clustering algorithm to obtain clustered update nodes, and any one of the clustered update nodes is used as a clustering view.
[0054] The clustered views are classified to obtain the view type of any updated node, and all updated nodes corresponding to each view type are taken as the overall view of the corresponding view type.
[0055] In the target graph structure, a neighbor node refers to another node that is connected to the current information node through an edge. Therefore, a neighbor node reflects the feature points of other geometric elements that are spatially related to the geometric element represented by the current information node.
[0056] By traversing the edges in the target graph structure, for any information node, find all the other nodes corresponding to the edges connected to it; these nodes are the neighbor nodes of that information node. For example, in a graph structure composed of lines and arcs, if an information node represents the endpoint of a line and that endpoint is connected to the starting point of an arc, then the information node representing the starting point of the arc is the neighbor node of the line endpoint information node.
[0057] The information node is updated based on its neighboring nodes to obtain the updated node. This step employs the message-passing concept from graph neural networks, similar to the workings of multilayer graph convolutional networks (GCN) or graph attention networks (GAT). Each information node aggregates information from its neighboring nodes to update its own feature representation. Specifically, the feature vector of each information node incorporates the feature information from its neighboring nodes in each update, thereby making the feature vector of the information node contain more local and global structural information.
[0058] After updating the information nodes, the updated nodes are obtained. Through clustering algorithms, updated nodes with similar characteristics can be grouped into the same category. These categories correspond to different view types. View types can be front view, top view, left view, etc. The clustering results help to distinguish and identify different views in two-dimensional drawings.
[0059] Clustering algorithms, such as K-means clustering and hierarchical clustering, can be used. Clustering is performed based on the similarity between the feature vectors of the updated nodes (such as Euclidean distance, cosine similarity, etc.), grouping updated nodes with high similarity into the same class, with each class corresponding to a view type.
[0060] For each view type, combining all update nodes under that view type forms the overall view for that view type. These overall views can completely represent all views in a 2D drawing, providing clear view division results for subsequent analysis and processing. The obtained overall views can be used for further drawing analysis, such as view annotation, dimension measurement, and 3D reconstruction.
[0061] The purpose of clustering is to group update nodes with similar characteristics together. Because geometric elements in the same view are similar in spatial layout and structure, these nodes will also exhibit similar characteristics in the feature space. Through clustering, update nodes belonging to the same view can be classified into one category.
[0062] Density-based clustering algorithms (such as DBSCAN) can be used to process updated nodes. The advantage of this algorithm is that it does not require pre-specifying the number of clusters, but rather clusters data points based on their spatial density distribution. Nodes in the same view will form high-density regions in the embedding space due to their spatial proximity and structural similarity. Density-based clustering algorithms can identify these high-density regions and classify them into different clusters.
[0063] After clustering is completed, the updated nodes in each cluster constitute a cluster view. Each cluster view can be viewed as a potential view area in a two-dimensional drawing, containing information nodes corresponding to all geometric elements involved in that view.
[0064] Clustering only groups the updated nodes, but it doesn't yet know the specific view type corresponding to each cluster. The purpose of classification is to determine the view type of each cluster view, such as "front view," "section view," "top view," etc., so as to more accurately understand the content of the two-dimensional drawing.
[0065] For each subgraph generated by a cluster (i.e., a cluster view), it needs to be converted into a fixed-size feature vector for subsequent classification. This conversion can be achieved using graph-level readout functions (such as global average pooling). Global average pooling averages the feature vectors of all nodes in the cluster view, resulting in a fixed-size vector representing the overall features of the cluster view.
[0066] The feature vectors obtained through the graph-level readout function are fed into the Softmax classifier. The Softmax classifier processes these vectors and outputs the probability for each view type. Based on the probability values, the view type with the highest probability is selected as the classification result for that cluster. For each view type, all updated nodes under that view type are combined to form the overall view for that view type. These overall views can completely represent all views in the 2D drawing, providing clear view segmentation results for subsequent drawing analysis and processing.
[0067] Step S204: Perform vector transformation on the overall view to obtain view feature vectors, input the view feature vectors into a preset inference model for processing to obtain the pose transformation parameters of the overall view, and input the pose transformation parameters into a preset trained alignment model for calculation to obtain the three-dimensional contour.
[0068] Optionally, the step of performing vector transformation on the overall view to obtain the view feature vector may include the following steps:
[0069] The overall view is rasterized according to a preset format to obtain a rasterized view;
[0070] A preset neural network model is invoked to extract features from the rasterized view, resulting in a view feature vector.
[0071] Optionally, the step of inputting the view feature vector into a preset inference model for processing to obtain the pose transformation parameters of the overall view may include the following steps:
[0072] Obtain a preset multi-view encoder, input the view feature vector into the multi-view encoder for association calculation, and obtain the encoded view features;
[0073] The preset regression head is invoked to process the view features to obtain the pose transformation parameters of the overall view.
[0074] The pose transformation parameters describe the position and orientation of an object in three-dimensional space. The inference model is a trained model that predicts the pose transformation parameters of the object corresponding to the overall view based on the input view feature vector. The pose transformation parameters can include translation vectors (describing the object's positional movement in three-dimensional space) and rotation matrices (describing the object's rotational orientation).
[0075] Deep learning-based regression models, such as multilayer perceptrons (MLPs) and regression variants of convolutional neural networks (CNNs), can be used. These models learn the mapping relationship between a large number of view feature vectors and their corresponding pose transformation parameters to predict parameters from feature vectors. During the training phase, a large amount of image data with pose annotations is required. After vectorization, these images are used as input data, and the corresponding pose transformation parameters are used as labels to train the inference model, enabling it to accurately predict pose parameters based on view feature vectors. The alignment model is also a trained model; its main function is to convert the two-dimensional view information of an object into a three-dimensional contour based on the input pose transformation parameters.
[0076] Optionally, the overall view is rasterized according to a preset format to obtain a rasterized view. The overall view is a two-dimensional graphic composed of multiple geometric elements. The purpose of rasterization is to discretize the continuous graphic into a regular pixel grid and convert it into an image form that can be processed by a computer.
[0077] The preset format specifies a fixed size for the rasterized image. This fixed size is designed to allow different overall views to be input into a unified neural network model for processing, as neural networks generally require input data to have a fixed size.
[0078] In practice, the view is mapped to a pixel grid of a specified size based on the boundaries and internal structure of the overall view. Each element in the view is assigned a corresponding pixel value in the pixel grid.
[0079] A preset neural network model is invoked to extract features from the rasterized view, resulting in a view feature vector. The preset neural network model can be a weighted convolutional neural network, such as ResNet. Convolutional neural networks have powerful feature extraction capabilities; they can automatically learn various features in an image, from simple low-level features such as edges and textures to complex high-level features such as shapes and structures.
[0080] When a rasterized view is input into a convolutional neural network, the network processes the image through convolutional layers, pooling layers, and activation functions. Convolutional layers extract local features from the image using convolutional kernels, pooling layers downsample the image to reduce data volume while preserving important features, and activation functions introduce non-linearity to enhance the model's expressive power. After multiple layers of processing, the network outputs a high-dimensional feature vector Vi∈Rd, which contains crucial feature information about the view.
[0081] The primary function of a multi-view encoder is to process feature vectors from multiple views, each from a different perspective. When observing the same object or scene from different angles, each view contains partial information. The role of a multi-view encoder is to integrate this scattered information to form a more comprehensive and accurate representation of the whole. The inference model focuses on the correlation between feature vectors from different views through a self-attention mechanism. Specifically, the self-attention mechanism calculates the correlation weights between each view feature vector and all other view feature vectors. These weights reflect the importance of each vector to the current vector. In this way, the inference model can adaptively allocate attention, focusing on information closely related to the current vector.
[0082] The view feature vectors are input into the multi-view encoder for association calculation to obtain the encoded view features. The multi-view encoder can be a Transformer encoder. The Transformer's self-attention mechanism calculates the association weights between each view feature vector and all other view feature vectors.
[0083] There are certain relationships between different views. For example, the front view and the top view may share common width dimension information, and the self-attention mechanism can capture these relationships. By calculating the relationship weights, the multi-view encoder can understand and integrate the global context of the view features, thereby obtaining the encoded view features, which contain information about the relative relationships between the views.
[0084] A pre-defined regression head is invoked to process the view features, obtaining the pose transformation parameters of the overall view. This regression head can be a multilayer perceptron (MLP). The regression head's function is to directly output the 6-DOF pose parameters of the view based on the encoded view features, with three parameters describing rotation and three describing translation. These pose transformation parameters determine the specific position and orientation of the view in 3D space, providing crucial information for reconstructing a 3D model from a 2D view. These pose transformation parameters are then input into a pre-trained alignment model for calculation, yielding a 3D contour. This model, trained on a large amount of training data, accurately aligns and combines various views in 3D space based on the input pose transformation parameters. Different 2D views have different positions and orientations in 3D space; the pose transformation parameters allow them to be placed in the correct positions. The alignment model then comprehensively considers the information from each view to reconstruct the contour of the 3D object. This 3D contour is the final 3D model reconstructed from the 2D overall view.
[0085] Step S205: Extract the three-dimensional spatial data from the three-dimensional contour, perform shape processing operations on the three-dimensional spatial data, and complete the construction of the three-dimensional mesh model.
[0086] The extraction of 3D spatial data from the 3D contour involves a series of operations, such as view feature encoding, pose calculation, and alignment model calculation, to obtain the 3D contour. This 3D contour represents the approximate shape information of the 3D object reconstructed from the 2D view, but it is not yet concrete 3D spatial data that can be directly used for graphics processing. The 3D spatial data here is actually related to the Conditional Variational Autoencoder (VAE) and the Signed Distance Function (SDF). The decoder takes the latent variable z and the spatial point coordinate x as input and outputs the SDF value of that point. These SDF values and the corresponding spatial point coordinates x constitute the 3D spatial data we want to extract. For each point in the space covered by the 3D contour, there is a corresponding SDF value, which represents the nearest distance from that point to the object's surface, and the sign indicates whether the point is inside or outside the object.
[0087] Using the extracted 3D spatial data, we actually obtained the SDF field of the entire 3D space. As an implicit surface representation method, SDF naturally describes complex surfaces with arbitrary topologies and is continuous, unaffected by mesh resolution. This means we can precisely define the shape of an object using SDF values. Shape processing operations are mainly based on the SDF field to further clarify the surface positions of the object. Since the surface of an object is the set of points with an SDF value of 0, we need to find these points that satisfy the condition of an SDF value of 0.
[0088] To transform isosurfaces (object surfaces) into 3D mesh models commonly used in computer graphics, the Marching Cubes algorithm is employed. The algorithm involves dividing the 3D space into a uniform cubic mesh. Each cube contains eight vertices, and the corresponding SDF value is looked up at each vertex. Based on the sign combination of the SDF values of the eight vertices, the intersection points of the isosurface (SDF=0) and the cube edges are calculated through interpolation. Different sign combinations correspond to different intersection situations between the isosurface and the cube edges; the location of the intersection points can be quickly determined using a predefined lookup table. The calculated intersection points are then connected to form triangular facets. Each cube may generate a different number of triangular facets, depending on the sign combination of its vertex SDF values.
[0089] By iterating through all the cubes and repeating the process of calculating intersection points and generating triangular faces, we can eventually combine all the triangular faces to obtain a complete triangular mesh model. This 3D mesh model is the final result we aim to build, which can be easily displayed, rendered, and analyzed in a computer graphics system.
[0090] This application acquires a two-dimensional drawing to be reconstructed, performs feature acquisition on the two-dimensional drawing to obtain N feature points representing geometric elements and their corresponding geometric information. The two-dimensional drawing consists of at least two views in an engineering view of the target object. The feature points and their corresponding geometric information are used as information nodes. The geometric information is analyzed to determine the positional relationships between geometric elements, which are then used as edges. Based on the information nodes and the edges, a target graph structure is constructed. Based on the target graph structure, the neighboring nodes of any information node are determined. The information nodes are updated based on the neighboring nodes to obtain updated nodes. The updated nodes are clustered to obtain the view type of any updated node. All updated nodes corresponding to each view type are used as the overall view of that view type. The overall view is vector-transformed to obtain view feature vectors. The view feature vectors are input into a preset inference model for processing to obtain the pose transformation parameters of the overall view. The pose transformation parameters are input into a preset trained alignment model for calculation to obtain a three-dimensional contour. Three-dimensional spatial data is extracted from the three-dimensional contour, and shape processing operations are performed on the three-dimensional spatial data to complete the construction of a three-dimensional mesh model. By first acquiring at least two views of the target object's engineering drawing and collecting features to obtain feature points and geometric information, the target drawing structure is constructed. Then, nodes are updated and clustered to obtain the overall view, which is converted into a view feature vector. Through inference and alignment model calculations, the 3D contour is derived. Finally, 3D spatial data is extracted and shape processed to construct a 3D mesh model. This automatically and accurately identifies and aligns the views of the 2D drawing in 3D, thus efficiently completing the 3D mesh model.
[0091] See Figure 3 This is a flowchart illustrating a method for three-dimensional reconstruction of a two-dimensional drawing provided in Embodiment 3 of this application. Figure 3 As shown, step S203 above, which involves determining the neighboring nodes of any information node based on the target graph structure and updating the information node based on the neighboring nodes to obtain the updated node, may include the following steps:
[0092] Step S301: According to a preset message passing mechanism, the information node and its corresponding neighboring nodes are aggregated to obtain an aggregation feature;
[0093] Step S302: The aggregated features are linearly transformed to obtain transformed features. The transformed features are then input into a preset activation function for processing to obtain updated nodes.
[0094] The message passing mechanism refers to the message passing mechanism in a graph neural network model, which is a neural network used to process graph-structured data. The purpose of the message passing mechanism is to allow nodes to obtain information from their neighbors, thereby updating their own feature representations. In graph-structured data, a node's features are related to the features of its neighbors. By aggregating the features of a node and its neighbors, information about the node itself and its surrounding environment can be comprehensively considered, thus better representing the node's role and position in the graph.
[0095] According to the formula ,in, The information node {v} is in the th... Features of the layer It is a neighboring node. It is a learnable weight matrix. It is an activation function. Here, {u} is the normalization constant, u is the update node, and {v} is the information node. Is the update node u at the th Layer characteristics. In the actual update process, through multiple iterations (propagating through L layers), the feature vector of each information node will contain structural information within its L-hop neighborhood. For example, after multiple updates, the feature vector of an information node not only contains its own geometric information, but also information about its neighboring nodes and their neighboring nodes.
[0096] The purpose of linear transformation is to transform the feature space of aggregated features, enabling graph neural network models to learn the complex relationships between different features. This is achieved through learnable weight matrices. Multiplying with aggregated features can adjust the dimensionality and representation of the features, thereby enhancing the expressive power of the graph neural network model. The activation function introduces non-linearity, enabling the graph neural network model to learn more complex patterns and relationships. The transformed features are then processed to output updated node features. Through multiple iterations (propagating through L layers), the feature vector of each information node will contain structural information within its L-hop neighborhood. For example, during the first layer update, the feature of an information node mainly aggregates information from its one-hop neighborhood (direct neighbor nodes). During the second layer update, since the features of neighbor nodes already contain their own one-hop neighborhood information, the feature of the information node will contain information from its two-hop neighborhood (neighbor's neighbor nodes), and so on. After multiple layers of updates, the feature vector of an information node not only contains its own geometric information but also rich structural information from its neighborhoods of different hop numbers, thus providing a more comprehensive representation of the node's features and role in the graph.
[0097] In this embodiment, the features of information nodes and their neighboring nodes are aggregated, and then linear transformation and activation function processing are performed to gradually update the features of information nodes. This allows the feature vector of each information node to contain structural information within its neighborhood of different hop counts. After multi-layer propagation, a wider range of graph structure information can be obtained.
[0098] See Figure 4 This is a flowchart illustrating a method for three-dimensional reconstruction of a two-dimensional drawing provided in Embodiment 4 of this application. Figure 4 As shown, the training process of the alignment model in step S204 may include the following steps:
[0099] Step S401: Obtain a training set, the training set including image information of at least one target object, the image information including an overall view of the target object and a three-dimensional contour corresponding to the overall view of the target object;
[0100] Step S402: Transform the three-dimensional contour according to the preset transformation matrix to obtain the two-dimensional projection corresponding to the three-dimensional contour;
[0101] Step S403: Calculate the intersection-union ratio (IUGR) of the two-dimensional projection and the overall view to obtain the IUGR calculation result. Sum all the IUGR calculation results to obtain the projection consistency loss. Update the parameters of the alignment model based on the projection consistency loss.
[0102] Step S404: Return to the step of transforming the three-dimensional contour according to the preset transformation matrix to obtain the two-dimensional projection corresponding to the three-dimensional contour, until the projection consistency loss meets the preset condition, and obtain the updated alignment model as the preset trained alignment model.
[0103] The training set contains image information of at least one target object, specifically including the overall view of the target object (i.e., the original 2D view outline) and the corresponding 3D outline of the overall view. This data forms the basis for model training, allowing the model to learn the geometric relationship between the target object in 2D view and 3D space.
[0104] The overall view serves as a reference standard for subsequent comparison with the model's predicted 2D projection. The 3D contour is the object that the model needs to process and transform, and then project it back onto the 2D plane through transformation.
[0105] Based on a preset transformation matrix, the 3D contour is transformed to obtain the corresponding 2D projection of the 3D contour. The function of the transformation matrix and the preset transformation matrix are explained. It is used to project contour information in three-dimensional space onto a two-dimensional image plane. Among them, Represents the transformation matrix. This represents a rotation matrix used to adjust the orientation of a 3D contour. This represents a translation matrix, used to adjust the position of a three-dimensional contour on a two-dimensional plane.
[0106] The 3D contour is converted into a 2D projection by performing mathematical operations on the transformation matrix. This 2D projection is the result predicted by the alignment model and will be compared with the original 2D view contour. The intersection-over-union (IoU) ratio of the 2D projection and the overall view is calculated. All IoU results are then summed to obtain the projection consistency loss, a metric used to quantify the differences between different projections. In a 3D scene, the same object projected from different viewpoints will produce different 2D images. The goal of the projection consistency loss is to ensure that these different projection results maintain consistency in certain key features or attributes. In other words, the projection consistency loss ensures that the different projections generated by the alignment model can reflect the true structure of the 3D object as accurately as possible, making the different projections logically coherent and consistent. The parameters of the alignment model are updated based on the projection consistency loss. The IoU ratio is a metric that measures the degree of overlap between two regions. The IoU value between the 2D projection and the original 2D view contour (overall view) is calculated. A higher IoU value indicates a higher degree of overlap. For each view, its corresponding IoU value is calculated, and then the IoU values of all views are summed to obtain the projection consistency loss.
[0107] Through loss function This calculation process is reflected, in which, It is an estimated three-dimensional profile. It is the overall view of the i-th view, and IoU is the intersection-union ratio. Let be the transformation matrix, denoted as , This indicates that the estimated 3D contour is transformed using a transformation matrix. The 2D projection is obtained by projecting onto the i-th 2D view plane. Based on the calculated projection consistency loss, the parameters of the alignment model are updated using an optimization algorithm (such as stochastic gradient descent). The projection consistency loss reflects the difference between the alignment model's predictions and the actual situation. By continuously adjusting the alignment model parameters, the projection consistency loss gradually decreases, allowing the alignment model to learn the correct geometric relationships. This represents the overall view of the i-th view, i.e., the 2D contour information of the target object extracted from the actual image from the i-th viewpoint. This is the real reference data used to compare with the 2D projection predicted by the alignment model. By comparing the degree of overlap between the predicted 2D projection and the original 2D contour (overall view), it can be determined whether the model has learned the correct 3D contour.
[0108] The projection consistency loss is obtained by summing the intersection-union ratios of all views. This loss function can be used as the objective function for training the alignment model. During training, the projection consistency loss is minimized by adjusting the parameters so that the predicted 3D contour is projected onto the 2D plane and coincides with the original 2D view (overall view) as much as possible, thereby learning the correct 3D geometric relationship.
[0109] Repeat steps S402 and S403, continuously projecting the 3D contour, calculating the intersection-over-union ratio (IoU), and updating the model parameters. Each iteration makes the model's predictions closer to reality, and the projection consistency loss gradually decreases. When the projection consistency loss meets a preset condition (such as reaching a preset threshold or no longer decreasing significantly), stop iterative training. The updated alignment model obtained at this point is the trained model, which can be used for subsequent predictions and applications.
[0110] Further explanation of symmetry constraints: For objects that are often symmetrical, such as shoe soles, symmetry constraints can be introduced during training. By defining a symmetry loss, asymmetrical reconstruction results are penalized, further forcing the model to learn the correct geometric relationships. The symmetry loss can be used together with the projection consistency loss as the total loss function to jointly guide the model's training.
[0111] In this embodiment, the model parameters are iteratively updated until the projection consistency loss meets the preset conditions, thereby obtaining a trained alignment model.
[0112] See Figure 5 This is a flowchart illustrating a method for three-dimensional reconstruction of a two-dimensional drawing provided in Embodiment 5 of this application. Figure 5As shown, after extracting the three-dimensional spatial data from the three-dimensional contour, performing shape processing operations on the three-dimensional spatial data, and completing the construction of the three-dimensional mesh model in step S205, the following steps may also be included:
[0113] Step S501: Perform mesh post-processing on the three-dimensional mesh model to obtain a processed three-dimensional mesh model, and render the processed three-dimensional mesh model to obtain an optimized model;
[0114] Step S502: Convert the optimized model to a new format to complete the rendering of the 3D mesh model.
[0115] The three-dimensional mesh model is extracted using the moving cube method based on the signed distance function field. The three-dimensional mesh model is then subjected to mesh post-processing to obtain a processed three-dimensional mesh model. The processed three-dimensional mesh model is then rendered to obtain an optimized model. The rendering includes generating multi-view two-dimensional preview images based on the three-dimensional mesh model using a neural network-based rendering model.
[0116] The signed distance function field (SDF) is a scalar field in three-dimensional space. For each point in the space, the SDF gives the signed distance from that point to the surface of an object. If the point is inside the object, the distance is negative; if the point is outside the object, the distance is positive; and if the point is on the surface of the object, the distance is zero. The SDF can implicitly and accurately describe the shape and boundaries of an object.
[0117] The moving cube method extracts a 3D mesh model from the SDF (Surface Derivative Function). It divides the 3D space into many small cube units and then determines the intersection between the cube and the object's surface based on the SDF value at each cube's vertex. For each cube, there are 256 possible intersections based on the combination of its eight vertices' SDF values (positive or negative). Using a predefined lookup table, the intersection lines between the cube's interior and the object's surface are determined, and connecting these lines forms triangular facets. This process is repeated for all cube units, and finally, by combining all the triangular facets, a 3D mesh model representing the object's surface is obtained.
[0118] Since the mesh generated by the moving cube method may contain some noise or unevenness, mesh smoothing algorithms (such as Laplacian smoothing, Taubin smoothing, etc.) can reduce these irregularities and make the mesh surface smoother and more natural.
[0119] Post-processing operations for meshes include smoothing filtering, mesh simplification, and hole repair. Smoothing filtering addresses the issue of surface noise in 3D mesh models during construction, which can affect model quality and appearance. Laplacian smoothing or bilateral filtering algorithms can remove this surface noise. Laplacian smoothing achieves smoothing by adjusting vertex positions to be closer to the average of surrounding vertices, while bilateral filtering better preserves feature edges while smoothing, avoiding the loss of important model details. Mesh simplification reduces the number of mesh faces to lower storage and rendering costs while maintaining basic shape accuracy. Algorithms like edge collapse achieve this. Edge collapse merges adjacent edges, combining multiple faces into one, thus reducing the total number of faces. This significantly reduces the model's data size without substantially affecting its shape, improving storage and rendering efficiency. Hole repair addresses the issue of holes in 3D mesh models due to incomplete contour information. Hole repair aims to detect and fill these holes, making the model surface more complete. Through a specific algorithm, new facets can be generated reasonably to fill the holes based on the mesh information around them, thus ensuring the integrity of the model.
[0120] After post-processing the mesh, the processed 3D mesh model is rendered. Neural rendering technology is used here, training a small network to directly generate high-quality 2D images with multi-angle lighting effects from the 3D mesh. The neural network-based rendering model learns the mapping relationship from the 3D model to the 2D image. These rendering models are trained on a large amount of 3D model and corresponding 2D image data, enabling them to quickly and accurately generate high-quality rendered images. Neural rendering technology can generate highly realistic images, far surpassing the effects of traditional rasterization rendering. Through rendering, lighting, materials, and other effects can be added to the model, making it more realistic and resulting in an optimized model.
[0121] Exporting optimized models to industry-standard formats, such as STL for 3D printing and OBJ for animation and rendering, is crucial. Different applications require different file formats, and converting models to standard formats facilitates their use in various software and devices. STL is a common 3D printing file format that describes the model's surface using triangular facets, making it suitable for 3D printers to read and print. OBJ, on the other hand, is widely used in animation and rendering software, supporting the storage of material and texture information, thus better meeting the needs of animation production and rendering.
[0122] After format conversion, the optimized model and preview images are packaged and returned to the client. The preview images are high-quality 2D images with lighting effects from multiple angles, generated using neural rendering technology, allowing users to quickly preview the model's appearance. This allows client users to intuitively see the final result of the model and use the standard format model file for subsequent applications, such as 3D printing or animation.
[0123] In this application, the quality of the 3D mesh model is improved by completing the subsequent processing flow after the 3D mesh model is constructed, making it more efficient and practical in terms of storage, rendering and application, while providing users with high-quality previews and model output that meets industry standards.
[0124] The three-dimensional reconstruction method corresponding to the two-dimensional drawings in the above embodiment, Figure 6 A structural block diagram of a three-dimensional reconstruction device based on two-dimensional drawings provided in Embodiment Six of this application is shown. For ease of explanation, only the parts related to the embodiments of this application are shown.
[0125] See Figure 6 The three-dimensional reconstruction device for the two-dimensional drawing includes:
[0126] The information acquisition module 61 is used to acquire the two-dimensional drawing to be reconstructed, perform feature acquisition on the two-dimensional drawing, and obtain N feature points representing geometric elements and the geometric information corresponding to the feature points. The two-dimensional drawing is at least two views in the engineering view of the target object.
[0127] The structure construction module 62 is used to take the feature points and the corresponding geometric information of the feature points as information nodes, analyze the geometric information, determine the positional relationship between geometric elements, take the positional relationship as edges, and construct the target graph structure based on the information nodes and the edges;
[0128] The node update module 63 is used to determine the neighboring nodes of any information node according to the target graph structure, update the information node according to the neighboring nodes to obtain the updated node, cluster the updated nodes to obtain the view type of any updated node, and take all the updated nodes corresponding to each view type as the overall view of the corresponding view type.
[0129] The contour determination module 64 is used to perform vector transformation on the overall view to obtain view feature vectors, input the view feature vectors into a preset inference model for processing to obtain pose transformation parameters of the overall view, and input the pose transformation parameters into a preset trained alignment model for calculation to obtain a three-dimensional contour.
[0130] The 3D model construction module 65 is used to extract the 3D spatial data from the 3D contour, perform shape processing operations on the 3D spatial data, and complete the construction of the 3D mesh model.
[0131] Optionally, the node update module 63 includes:
[0132] The node aggregation unit is used to aggregate the information node and its corresponding neighboring nodes according to a preset message passing mechanism to obtain aggregation features;
[0133] The transformation unit is used to linearly transform the aggregated features to obtain transformed features, and input the transformed features into a preset activation function for processing to obtain updated nodes.
[0134] Optionally, the node update module 63 includes:
[0135] The view determination unit is used to process the update node according to a preset clustering algorithm to obtain the clustered update node, and to take any of the clustered update nodes as a clustered view.
[0136] The overall view determination unit is used to classify the clustered views, obtain the view type of any updated node, and take all updated nodes corresponding to each view type as the overall view of the corresponding view type.
[0137] Optionally, the contour determination module 64 includes:
[0138] A raster processing unit is used to rasterize the overall view according to a preset format to obtain a rasterized view.
[0139] The feature extraction unit is used to call a preset neural network model to extract features from the rasterized view and obtain the view feature vector.
[0140] Optionally, the contour determination module 64 includes:
[0141] The association calculation unit is used to obtain a preset multi-view encoder, input the view feature vector into the multi-view encoder for association calculation, and obtain the encoded view features.
[0142] The feature processing unit is used to call a preset regression head to process the view features and obtain the pose transformation parameters of the overall view.
[0143] Optionally, the contour determination module 64 includes:
[0144] A training set acquisition unit is used to acquire a training set, the training set including image information of at least one target object, the image information including an overall view of the target object and a three-dimensional contour corresponding to the overall view of the target object;
[0145] The contour transformation unit is used to transform the three-dimensional contour according to a preset transformation matrix to obtain a two-dimensional projection of the corresponding three-dimensional contour.
[0146] The intersection-union ratio (IUGR) calculation unit is used to calculate the IUGR based on the two-dimensional projection and the overall view, obtain the IUGR calculation result, sum all the IUGR calculation results to obtain the projection consistency loss, and update the parameters of the alignment model based on the projection consistency loss.
[0147] The model update unit is used to return to the step of transforming the three-dimensional contour according to the preset transformation matrix to obtain the two-dimensional projection corresponding to the three-dimensional contour, until the projection consistency loss meets the preset condition, and the updated alignment model is obtained as the preset trained alignment model.
[0148] Optionally, the three-dimensional reconstruction device for the two-dimensional drawing includes:
[0149] The model rendering module is used to perform mesh post-processing operations on the 3D mesh model to obtain a processed 3D mesh model, and to render the processed 3D mesh model to obtain an optimized model.
[0150] The format conversion module is used to convert the optimized model into a different format to complete the rendering of the 3D mesh model.
[0151] It should be noted that the information interaction and execution process between the above modules, units, and sub-units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0152] Figure 7 This is a schematic diagram of the structure of a computer device provided in Embodiment Seven of this application. Figure 7 As shown, the computer device of this embodiment includes: at least one processor ( Figure 7 The diagram shows only one of the following: a memory and a computer program stored in the memory and executable on at least one processor. When the processor executes the computer program, it implements the steps in the embodiments of the three-dimensional reconstruction method of any of the two-dimensional drawings or the three-dimensional reconstruction method of the two-dimensional drawings.
[0153] This computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 7The examples of computer devices are merely examples and do not constitute a limitation on computer devices. Computer devices may include more or fewer components than shown in the illustration, or combinations of certain components, or different components, such as network interfaces, displays, and input devices.
[0154] The processor referred to can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0155] Memory includes readable storage media, internal memory, etc., wherein internal memory can be the RAM of a computer device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of a computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory can include both internal storage units and external storage devices of the computer device. Memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. Memory can also be used to temporarily store data that has been output or will be output.
[0156] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0157] The implementation of all or part of the processes in the methods of the above embodiments can also be accomplished by a computer program product. When the computer program product is run on a computer device, it enables the computer device to execute the steps in the above method embodiments.
[0158] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0159] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0160] In the embodiments provided in this application, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0161] 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 units can be selected to achieve the purpose of this embodiment according to actual needs.
[0162] 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, and should all be included within the protection scope of this application.
Claims
1. A method for three-dimensional reconstruction of a two-dimensional drawing, characterized in that, include: A two-dimensional drawing to be reconstructed is obtained, and features are acquired from the two-dimensional drawing to obtain N feature points representing geometric elements and the geometric information corresponding to the feature points. The two-dimensional drawing is at least two views in the engineering view of the target object. The feature points and their corresponding geometric information are used as information nodes. The geometric information is analyzed to determine the positional relationships between geometric elements. The positional relationships are used as edges. Based on the information nodes and the edges, the target graph structure is constructed. Based on the target graph structure, determine the neighboring nodes of any information node, update the information node based on the neighboring nodes to obtain the updated node, cluster the updated node to obtain the view type of any updated node, and take all the updated nodes corresponding to each view type as the overall view of the corresponding view type. The overall view is vectorized to obtain view feature vectors. The view feature vectors are then input into a preset inference model for processing to obtain pose transformation parameters of the overall view. The pose transformation parameters are then input into a preset trained alignment model for calculation to obtain a three-dimensional contour. The preset inference model uses the vectorized image as input data and the corresponding pose transformation parameters as labels to train the inference model so that it can predict pose parameters based on view feature vectors. The alignment model is a trained model whose function is to convert the two-dimensional view information of an object into a three-dimensional contour based on the input pose transformation parameters. Extract the three-dimensional spatial data from the three-dimensional contour, perform shape processing operations on the three-dimensional spatial data, and complete the construction of the three-dimensional mesh model.
2. The method for three-dimensional reconstruction of two-dimensional drawings according to claim 1, characterized in that, The step of determining the neighboring nodes of any information node based on the target graph structure, and updating the information node based on the neighboring nodes to obtain the updated node, includes: According to a preset message passing mechanism, the information node and its corresponding neighboring nodes are aggregated to obtain an aggregation feature; The aggregated features are linearly transformed to obtain transformed features. The transformed features are then input into a preset activation function for processing to obtain updated nodes.
3. The method for three-dimensional reconstruction of two-dimensional drawings according to claim 1, characterized in that, The step of clustering the updated nodes to obtain the view type of any updated node, and taking all updated nodes corresponding to each view type as the overall view of the corresponding view type, includes: The update nodes are processed according to a preset clustering algorithm to obtain clustered update nodes, and any one of the clustered update nodes is used as a clustering view. The clustered views are classified to obtain the view type of any updated node, and all updated nodes corresponding to each view type are taken as the overall view of the corresponding view type.
4. The method for three-dimensional reconstruction of two-dimensional drawings according to claim 1, characterized in that, The step of performing vector transformation on the overall view to obtain the view feature vector includes: The overall view is rasterized according to a preset format to obtain a rasterized view; A preset neural network model is invoked to extract features from the rasterized view, resulting in a view feature vector.
5. The method for three-dimensional reconstruction of two-dimensional drawings according to claim 1, characterized in that, The step of inputting the view feature vector into a preset inference model for processing to obtain the pose transformation parameters of the overall view includes: Obtain a preset multi-view encoder, input the view feature vector into the multi-view encoder for association calculation, and obtain the encoded view features; The preset regression head is invoked to process the view features to obtain the pose transformation parameters of the overall view.
6. The method for three-dimensional reconstruction of two-dimensional drawings according to claim 1, characterized in that, The training process of the alignment model includes: Obtain a training set, the training set including image information of at least one target object, the image information including an overall view of the target object and a three-dimensional contour corresponding to the overall view of the target object; The three-dimensional contour is transformed according to a preset transformation matrix to obtain a two-dimensional projection of the corresponding three-dimensional contour. The intersection-union ratio (IUGR) is calculated based on the two-dimensional projection and the overall view to obtain the IUGR calculation result. All IUGR calculation results are summed to obtain the projection consistency loss. The parameters of the alignment model are updated based on the projection consistency loss. Return to the step of transforming the three-dimensional contour according to the preset transformation matrix to obtain the two-dimensional projection corresponding to the three-dimensional contour, until the projection consistency loss meets the preset condition, and obtain the updated alignment model as the preset trained alignment model.
7. The method for three-dimensional reconstruction of two-dimensional drawings according to claim 1, characterized in that, After extracting the three-dimensional spatial data from the three-dimensional contour, performing shape processing operations on the three-dimensional spatial data, and completing the construction of the three-dimensional mesh model, the method further includes: Perform mesh post-processing on the 3D mesh model to obtain a processed 3D mesh model, and render the processed 3D mesh model to obtain an optimized model; The optimized model is then converted to a new format to complete the rendering of the 3D mesh model.
8. A three-dimensional reconstruction device for two-dimensional drawings, characterized in that, include: The information acquisition module is used to acquire the two-dimensional drawing to be reconstructed, perform feature acquisition on the two-dimensional drawing, and obtain N feature points representing geometric elements and the geometric information corresponding to the feature points. The two-dimensional drawing is at least two views in the engineering view of the target object. The structure construction module is used to take the feature points and the corresponding geometric information of the feature points as information nodes, analyze the geometric information, determine the positional relationship between geometric elements, take the positional relationship as edges, and construct the target graph structure based on the information nodes and the edges; The node update module is used to determine the neighboring nodes of any information node according to the target graph structure, update the information node according to the neighboring nodes to obtain the updated node, cluster the updated nodes to obtain the view type of any updated node, and take all the updated nodes corresponding to each view type as the overall view of the corresponding view type. The contour determination module is used to perform vector transformation on the overall view to obtain view feature vectors, input the view feature vectors into a preset inference model for processing to obtain pose transformation parameters of the overall view, and input the pose transformation parameters into a preset trained alignment model for calculation to obtain a three-dimensional contour. The preset inference model is trained by using the vector transformation of the image as input data and the corresponding pose transformation parameters as labels to predict pose parameters based on the view feature vectors. The alignment model is a trained model whose function is to convert the two-dimensional view information of the object into a three-dimensional contour based on the input pose transformation parameters. The 3D model construction module is used to extract the 3D spatial data from the 3D contour, perform shape processing operations on the 3D spatial data, and complete the construction of the 3D mesh model.
9. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the three-dimensional reconstruction method of the two-dimensional drawing as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the three-dimensional reconstruction method of the two-dimensional drawing as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Architectural drawing geometric feature extraction and visual modeling method and system
CN120931840A
System and Method for Engineering Drawing Extrapolation and Feature Automation
US20230084639A1