Method and system for automatic 3d modeling from 2d engineering drawings

By parsing 2D engineering drawings and combining them with an engineering knowledge base and goal-oriented search, an enhanced structured feature list is generated. A 3D model is constructed using a sequence of Python source code, which solves the problems of low reconstruction accuracy and inability to edit and reuse 2D engineering drawings. This enables high-precision, modular 3D model generation and rapid editing.

CN122176204APending Publication Date: 2026-06-09AUTOCORE INTELLIGENT TECH (NANJING) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
AUTOCORE INTELLIGENT TECH (NANJING) CO LTD
Filing Date
2026-05-13
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In existing technologies, when 2D engineering drawings are reconstructed into 3D models, the accuracy is low and they cannot be edited and reused. They cannot be directly applied to engineering design and manufacturing. Traditional methods cannot handle complex scenarios and the output models cannot be modularly reused.

Method used

By parsing 2D engineering drawings, the project background and feature to-do list are obtained. Combined with a pre-set engineering knowledge base and goal-oriented search, an enhanced structured feature list is generated. A 3D model is built using Python source code sequences, and the modularization and parameterization of features are realized through an instruction compiler. A feature dependency topology tree with a parent-child hierarchical structure is constructed to achieve high-resolution resampling and error correction.

Benefits of technology

It significantly improves the accuracy and editability of 3D reconstruction models, enables the rapid generation of similar series of products, reduces the ineffective use of computing resources, enhances the concurrent processing capability and response speed of large batches of drawings, and has industry-wide applicability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122176204A_ABST
    Figure CN122176204A_ABST
Patent Text Reader

Abstract

This invention relates to the field of computer vision and image processing, and proposes a method and system for automatic 3D modeling of 2D engineering drawings. The method includes the following steps: inputting 2D engineering drawings; parsing the context, generating a feature to-do list, and establishing a cross-view spatial mapping coordinate system; extracting the component types from the feature to-do list; obtaining parameterized topological constraint rules for the component types from a preset knowledge base; adopting goal-oriented active probing to search for geometric contours matching the features in the three views, obtaining the geometric primitives and their spatial poses corresponding to each feature; reading the dimension annotations, attaching the dimension values ​​as logical variables to the corresponding geometric primitives, and generating an enhanced structured feature list; constructing an instruction compiler, inputting the enhanced structured feature list, mapping each feature to a feature class calling function in the engineering knowledge base, and synthesizing a Python source code sequence to generate a parameterized 3D model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision and image processing, and in particular to a method and system for automatic 3D modeling of 2D engineering drawings. Background Technology

[0002] In the field of non-standard automated equipment and precision pressure vessel manufacturing, historical assets mostly exist in the form of 2D engineering drawings. With current technology, reconstructing them into 3D models presents the following problems:

[0003] First, engineering drawings often have complex structures, resulting in low accuracy in the reconstructed 3D models, making them unsuitable for direct application in subsequent engineering designs. For instance, traditional visual recognition techniques based on geometric operators, using libraries like OpenCV to extract lines, have weak anti-interference capabilities for arcs, and cannot handle complex scenarios such as overlapping annotation lines and overlapping projections of three views. On the other hand, methods that use generative AI to directly predict 3D mesh models lack physically meaningful parameterized constraints, resulting in model accuracy that only reaches the visual similarity level, making them unsuitable for direct application in subsequent engineering design changes or manufacturing reuse.

[0004] Second, the reconstructed 3D model cannot achieve modular reuse of non-standard features. Traditional solutions mostly output static geometric models (point clouds or meshes) that cannot be edited, resulting in a large amount of manual redrawing still being required for the modification and reuse of non-standard parts. Summary of the Invention

[0005] The technical problem to be solved by this invention is to propose a method and system for automatic 3D modeling of 2D engineering drawings, addressing the above-mentioned deficiencies of the prior art, and solving the problems of low accuracy and inability to edit and reuse 3D reconstruction models.

[0006] To solve the above-mentioned technical problems, the technical solution proposed by this invention is as follows:

[0007] Firstly, a method for automatically creating 3D models from 2D engineering drawings is proposed, including the following steps:

[0008] Input 2D engineering drawings;

[0009] Parse the title block in 2D engineering drawings to obtain the engineering background; read the pipe / part list / parts list to generate a feature to-do list, which contains multiple features; parse the three-view area and establish a cross-view space mapping coordinate system.

[0010] Extract the textual semantics of the feature to-do list to obtain semantic identifiers, which at least include the component type corresponding to each feature; obtain the parametric topological constraint rules corresponding to each component type from a preset engineering knowledge base, which at least include the geometric contour of the component type in the three views; adopt a target-oriented search to search for geometric contours that match the feature to-do list in the three views to obtain the geometric primitives and their spatial poses corresponding to each feature; read the dimension annotations in the 2D engineering drawings, and attach the dimension values ​​as logical variables to the corresponding geometric primitives to generate an enhanced structured feature list; the enhanced structured feature list at least includes the engineering background, semantic identifiers, the spatial poses of the geometric primitives corresponding to each feature, and the topological relationship between the geometric primitives and the dimension values.

[0011] Build an instruction compiler, take an enhanced list of structured features as input, map each feature to a feature class function in the engineering knowledge base in real time, and synthesize a sequence of Python source code;

[0012] A 3D model was generated based on this Python source code sequence.

[0013] In one implementation, when the semantic identifier also includes the view region where the feature is located, a target-oriented search is adopted to search for geometric contours that match the feature to-do list in the view region where the feature is located; when the semantic identifier does not include the view region where the feature is located, a low-resolution scan is first performed on the three views to output candidate target regions containing geometric contours that match the feature to-do list, and then the geometric primitives corresponding to each feature are locked in the candidate target regions.

[0014] In one implementation, high-weight engineering feature areas in 2D engineering drawings are magnified, denoised, and resampled at high resolution. The high-weight engineering feature areas include at least a title block and a pipe / parts list.

[0015] A target-oriented search is adopted. When the density of edge lines or the number of connected components exceeds a preset density threshold, the view area / candidate target area where the feature is located is magnified, denoised, and high-resolution resampling is performed.

[0016] When searching for geometric contours that match the feature to-do list in the view region where the feature is located, candidate geometric bounding boxes are output. When the confidence of the candidate geometric bounding box is lower than the preset confidence threshold, the view region where the feature is located is magnified, denoised, and high-resolution resampling is performed.

[0017] When the confidence level of the candidate geometric bounding box is greater than the preset confidence threshold, the candidate geometric primitive is output and the pixel size of the candidate geometric primitive is obtained; the dimension annotation in the 2D engineering drawing is read; the dimension annotation and the pixel size are compared by scale conversion; when the deviation is greater than the preset deviation threshold, the view area where the feature is located is enlarged, denoised, and high-resolution resampling is performed.

[0018] After performing high-resolution resampling, the sub-pixel level geometric primitives and their spatial poses corresponding to each feature are obtained.

[0019] In one implementation, before inputting the enhanced structured feature list into the instruction compiler, the features are parameter-completed using a preset engineering knowledge base. The completed parameters include at least the physical properties of the standard parts.

[0020] In one implementation, based on an enhanced structured feature list and combined with a pre-defined engineering knowledge base, the subordinate logical and physical dependencies of each feature are analyzed to construct a feature dependency topology tree with a parent-child hierarchical structure; the instruction compiler synthesizes a Python source code sequence according to the priority of the feature dependency topology tree.

[0021] In one implementation, based on the parent-child hierarchical structure of the feature dependency topology tree, the relative offset coordinates between features with parent-child hierarchical relationships are calculated to form geometric logical constraints; the geometric logical constraints are injected into the instruction compiler to generate a Python source code sequence.

[0022] In one implementation, the instruction compiler converts the size values ​​in the enhanced structured feature list into programmable variables, and the synthesized Python source code sequence contains a global parameter variable definition area; the user can directly drive the reconstruction of the 3D model by modifying the values ​​in the global parameter variable definition area.

[0023] In one implementation, the generated 3D model is back-projected into a 2D view, and the 2D view is compared with the original 2D engineering drawing. When the error exceeds a preset error threshold, the value of the global parameter variable definition area is modified to drive the reconstruction of the 3D model.

[0024] Secondly, an automatic 3D modeling system for 2D engineering drawings is provided. The system includes a central scheduling agent and an atomic skill set. The central scheduling agent calls specific skills in the atomic skill set.

[0025] The central dispatch agent is used to input 2D engineering drawings; it calls the visual exploration skills in the atomized skill set to parse the title block in the 2D engineering drawings to obtain the engineering background; it reads the nozzle table / parts list to generate a feature to-do list, which contains multiple features; it parses the three-view area and establishes a cross-view space mapping coordinate system;

[0026] The semantic deconstruction skill from the atomization skill set is invoked to extract the textual semantics of the feature to-do list and obtain semantic identifiers, which at least include the component type corresponding to each feature. Parametric topological constraint rules corresponding to each component type are obtained from a preset engineering knowledge base, which at least include the geometric contour of the component type in the three-view drawings. A target-oriented search is employed to search for geometric contours matching the feature to-do list in the three-view drawings, obtaining the geometric primitives and their spatial poses corresponding to each feature. Dimensions are read from 2D engineering drawings, and the dimension values ​​are used as logical variables to attach to the corresponding geometric primitives, generating an enhanced structured feature list. This enhanced structured feature list at least includes the engineering background, semantic identifiers, the spatial poses of the geometric primitives corresponding to each feature, and the topological relationship between the geometric primitives and their dimension values.

[0027] The code generation skills in the atomic skill set are invoked to build an instruction compiler. An enhanced structured feature list is input, and each feature is mapped in real time to a feature class calling function in the engineering knowledge base to synthesize a Python source code sequence. A 3D model is generated based on this Python source code sequence.

[0028] In one implementation, the system further includes a sub-agent that feeds back the execution results to the central scheduling agent;

[0029] The central scheduling agent invokes the feature detection sub-agent for high-rate resampling under the following circumstances:

[0030] Enlarge and denoise the high-weight engineering feature areas in the 2D engineering drawings, and perform high-resolution resampling. The high-weight engineering feature areas include at least the title block and the pipe / parts table.

[0031] A target-oriented search is adopted. When the density of edge lines or the number of connected components exceeds a preset density threshold, the view area / candidate target area where the feature is located is magnified, denoised, and high-resolution resampling is performed.

[0032] When searching for geometric contours that match the feature to-do list in the view region where the feature is located, candidate geometric bounding boxes are output. When the confidence of the candidate geometric bounding box is lower than the preset confidence threshold, the view region where the feature is located is magnified, denoised, and high-resolution resampling is performed.

[0033] When the confidence level of the candidate geometric bounding box is greater than the preset confidence threshold, the candidate geometric primitive is output and the pixel size of the candidate geometric primitive is obtained; the dimension annotation in the 2D engineering drawing is read; the dimension annotation and the pixel size are compared by scale conversion; when the deviation is greater than the preset deviation threshold, the view area where the feature is located is enlarged, denoised, and high-resolution resampling is performed.

[0034] The central dispatch agent also calls the consistency verification sub-agent to back-project the generated 3D model into a 2D view, compare the 2D view with the original 2D engineering drawings, and when the error exceeds the preset error threshold, modify the value of the global parameter variable definition area to drive the reconstruction of the 3D model.

[0035] The beneficial effects of this invention are:

[0036] 1. This invention establishes a scientific logical order of reading tables first and then reviewing drawings by simulating the thought process of professional engineers interpreting drawings. By linking geometric primitives with the depth of their physical meaning, it effectively improves the understanding from traditional shape reconstruction to engineering comprehension, significantly enhancing the accuracy of 3D reconstruction models.

[0037] 2. This invention abandons the traditional closed path of direct 2D to 3D conversion, proposing a conversion paradigm of 2D drawings - structured code - 3D model. By converting dimensional values ​​bound to geometric contours into programmable variables, modularization and parameterization of features are achieved. Enterprises only need to modify the global parameter variable definition area to quickly generate similar series of products. This provides a standardized technical path for the conversion of massive historical 2D drawing assets into editable and evolvable digital assets, shortening the secondary development cycle of non-standard parts.

[0038] 3. This invention performs target-oriented search based on a feature to-do list, accurately locating key feature areas and performing high-magnification resampling only on these specific areas. This significantly reduces the inefficient use of computing resources by full-image scanning and improves the concurrent processing capability and response speed for large-scale drawing processing.

[0039] 4. Driven by a central scheduling agent (Master Agent), this invention constructs a dynamic collaboration system composed of atomic skill sets and recursive sub-agents, ensuring the stability of complex task processing and allowing the system to easily adapt to different underlying modeling kernels by expanding the skill set, thus possessing a certain degree of industry universality. Attached Figure Description

[0040] The invention will now be further described with reference to the accompanying drawings.

[0041] Figure 1 This is a system flowchart for automatic 3D modeling of 2D engineering drawings according to an embodiment of the present invention. Detailed Implementation

[0042] This invention provides a method for automatically creating 3D models from 2D engineering drawings, comprising the following steps:

[0043] S1, Input 2D engineering drawings;

[0044] Parse the title block in 2D engineering drawings to obtain the engineering background; read the pipe / part list / parts list to generate a feature to-do list, which contains multiple features; parse the three-view area and establish a cross-view space mapping coordinate system.

[0045] Specifically, a feature heatmap of the 2D image is generated using a Convolutional Neural Network (CNN) or a Visual Transformer (ViT). A region proposal algorithm is used to automatically identify the title bar (usually located in the lower right corner), the nozzle / partition table (a densely packed rectangular area), and the bounding boxes of the three-view areas based on the heatmap response intensity. OCR technology is used to identify the title bar and determine the engineering background. A feature to-do list is generated by reading the nozzle / partition table (e.g., the N1 air inlet is a DN150 flange). The three-view areas are analyzed, baselines for each view are marked, and a mapping relationship between 2D pixel coordinates and the logical space of the engineering drawing is established. A global affine transformation matrix is ​​established to obtain a cross-view spatial mapping coordinate system. A scaling operator is introduced when establishing the global affine transformation matrix to unify the scale. Simultaneously, based on the global affine transformation matrix, an anchor-aligned coordinate transformation method is used to spatially align the interconnected feature points in the three views. After features are detected in the main view, the sampling target can be simultaneously locked on the corresponding projection line in the top view, ensuring consistency in 3D spatial position. The feature to-do list includes multiple features that refer to the smallest parametric modeling units that constitute engineering component entities, possessing physical semantics, geometric parameters, and topological relationships. For example, main body primitive features refer to the geometric entities that constitute the main structure of the component, defined as the root node of spatial positioning, such as a shell, head, or main frame; engineering accessory features refer to functional components mounted on the main body primitives, possessing specific standard specifications, such as flanges, nozzles, reinforcing ribs, and nameplate holders; detailed process features refer to secondary processing features performed on the main body or accessories, such as threads, counterbores, chamfers, and bevels.

[0046] S2, extract the text semantics of the feature to-do list to obtain semantic identifiers, the semantic identifiers include at least the component type corresponding to each feature; obtain the parameterized topology constraint rules corresponding to each component type from the preset engineering knowledge base, the parameterized topology constraint rules include at least the geometric contour of the component type in the three views;

[0047] Specifically, the preset engineering knowledge base does not only store static templates, but also parametric geometric constraint models, providing parametric topological constraint rules for components. Taking the identified "N1 air inlet is a DN150 flange" as an example, the preset engineering knowledge base shows that this component is represented as a pair of symmetrical rectangular blocks in the front view and as a concentric array of circles in the top view.

[0048] S3. A goal-oriented search is adopted to search for geometric contours that match the feature to-do list in the three-view drawing, and obtain the geometric primitives and their spatial poses corresponding to each feature.

[0049] Specifically, after obtaining the semantic identifier, the corresponding visual attention mask is activated. Taking "N1 air inlet is a DN150 flange" as an example, with the expectation of finding rectangular pairs or circular arrays, probability matching is performed in a specific projection area (such as the end of the cylinder). Zero-shot detection (such as a pre-trained engineering feature detector; in this embodiment, Grounding DINO) is used. The input text prompt (such as a WN Flange profile) and local images are used. Based on a cross-attention mechanism, the semantic features of the flange are associated with the parallel and vertical line features in the pixels, outputting candidate bounding boxes. When a rectangular outline is found on the left side of the main view, it is identified as a pressure vessel air inlet rather than a simple rectangle.

[0050] In one implementation, when the semantic identifier also includes the view region where the feature is located, a target-oriented search is adopted to search for geometric contours that match the feature's to-do list within the view region where the feature is located. For example, if the N1 connector is known to be marked as the left end cap air inlet in the bill of quantities, the search area is limited to a local pixel block on the left edge of the main view based on the spatial coordinate mapping established in stage S1, thus avoiding false alarms caused by full-image search.

[0051] In one implementation, when the semantic identifier does not include the view region where the feature is located, a low-resolution scan of the three views is first performed to output candidate target regions that may contain geometric contours matching the feature to-do list. Then, the geometric primitives corresponding to each feature are locked in these candidate target regions. Based on the Region Proposal Network (RPN) and Feature Heatmap, a pre-trained engineering feature recognition operator (convolution kernels for standard parts such as flanges, threads, and end caps) is used to generate a feature response heatmap across the entire image to determine potential candidate bounding boxes. For example, a high-probability nozzle geometric contour exists near coordinates (u,v), thus determining candidate target regions. Then, the zero-shot / few-shot target detection method described above is used to output candidate geometric bounding boxes, locking the geometric primitives corresponding to each feature.

[0052] In one implementation, high-weight engineering feature areas in 2D engineering drawings are magnified, denoised, and resampled at high resolution. The high-weight engineering feature areas include at least a title block and a pipe / parts list.

[0053] In one implementation, a target-oriented search is adopted. When the edge line density or the number of connected components exceeds a preset density threshold, the view area / candidate target area where the feature is located is magnified and denoised, and high-resolution resampling is performed. Specifically, this is used to determine whether the area is a densely labeled area or a complex structure area, where the global resolution is insufficient to deconstruct the topological relationship between the lead and the entity.

[0054] In one implementation, when searching for geometric contours that match the feature to-do list in the view region where the feature is located, candidate geometric bounding boxes are output. When the confidence of the candidate geometric bounding box is lower than a preset confidence threshold, the view region where the feature is located is magnified, denoised, and resampled at high resolution. Specifically, in this embodiment, a preset confidence threshold of 0.85 is used, and semantic denoising is performed on the magnified slice using OpenCV or AI operators to filter out guide lines and accurately extract the true geometric vertices and boundaries of the flange.

[0055] In one implementation, when the confidence level of the candidate geometric bounding box is greater than a preset confidence threshold, a candidate geometric primitive is output, and the pixel size of the candidate geometric primitive is obtained; the dimension annotations in the 2D engineering drawing are read; the dimension annotations are compared with the pixel sizes using scale conversion; when the deviation is greater than a preset deviation threshold, the view area containing the feature is magnified, denoised, and subjected to high-resolution resampling. In this embodiment, a deviation threshold of 20% is used, which is determined to be a visual misreading, requiring magnification to re-acquire sub-pixel edges.

[0056] After performing high-magnification resampling, the global coordinate offset of the resampling center point is used to reverse-map the locally obtained high-precision sub-pixel features back to the global affine transformation matrix, ensuring that the local details and the global skeleton completely overlap in the logical space. After performing high-resolution resampling, the sub-pixel-level geometric primitives and their spatial poses corresponding to each feature are obtained.

[0057] Low-resolution resampling refers to a full-scale conventional scan of the entire drawing, aimed at establishing spatial references and identifying the global layout; while high-resolution resampling refers to a scan of specific local coordinates, aimed at capturing sub-pixel-level minute details dynamically and on demand.

[0058] S4: Read the dimension annotations in the 2D engineering drawing, attach the dimension values ​​as logical variables to the corresponding geometric primitives, and generate an enhanced structured feature list; the enhanced structured feature list includes at least the engineering background, semantic identifier, spatial pose of the geometric primitives corresponding to each feature, and topological relationship between geometric primitives and dimension values.

[0059] For example

[0060] {

[0061] "feature_id": "N1_Nozzle",

[0062] "parent": "Main_Shell",

[0063] "geometric_primitive": "Cylinder",

[0064] "parameters": {"DN": 150, "PN": 1.6, "position_offset": [100, 0,0]}

[0065] }

[0066] Specifically, OCR technology is used to identify dimension annotation text blocks. Based on the leader-line tracking algorithm, the pixel gradient direction of the leader is traced until the geometric element (such as an arc or a straight line) at the end of the leader is identified. Local connectivity analysis is performed with the coordinates of the end as the center. Combined with shape priors from a pre-set engineering knowledge base (e.g., if the leader points to a closed arc, it is determined to be a pipe opening), the dimension value is used as a logical variable and attached to the corresponding geometric primitive. Furthermore, semantic masking filters out irrelevant background noise (such as background text or interference lines from other views), ensuring that the sampling center is accurately locked at the intersection of the geometric contour and the dimension annotation. The midpoint between the end of the leader (pointing to the part) and the center of the text block (annotation value) is defined as the core anchor point coordinates for resampling.

[0067] S5 builds an instruction compiler, takes an enhanced list of structured features as input, maps each feature to a feature class function in the engineering knowledge base in real time, and synthesizes a sequence of Python source code.

[0068] A 3D model was generated based on this Python source code sequence.

[0069] Specifically, this embodiment chooses to call the CadQuery / Build123d kernel to perform code-driven solid geometry (CSG) calculations. The script executes shell.cut(nozzle_hole) instead of simple patch stitching, which ensures that the generated STEP file has a realistic cavity structure, meeting CAD / CAM machining requirements.

[0070] In one implementation, before inputting the enhanced structured feature list into the instruction compiler, the features are parameter-completed using a pre-defined engineering knowledge base. The completed parameters include at least the physical properties of the standard parts. Specifically, the engineering background obtained through parsing (such as pressure vessel design standards and material categories) is used as a priori constraints. Adaptive attribute enhancement is performed on the recognition results. Intelligent supplementation is performed for implicit engineering parameters not explicitly marked in the drawings (such as detailed specifications of standard parts, flange bolt hole distribution, sealing groove geometric parameters, tolerance range, etc.), further optimizing the enhanced structured feature list. This transforms isolated geometric values ​​into an enhanced structured feature list with complete engineering semantics. Thus, even if the 2D drawings do not depict bolt hole details, the generated 3D model will automatically include bolt holes conforming to GB / T standards based on physical meaning, achieving accurate restoration of physical reality.

[0071] In one implementation, based on an enhanced structured feature list and a pre-defined engineering knowledge base, the subordinate logical and physical dependencies of each feature are analyzed to construct a feature dependency topology tree with a parent-child hierarchical structure. The instruction compiler synthesizes a Python source code sequence according to the priority of the feature dependency topology tree. Specifically, the modeling priority is automatically determined based on the logic of the main feature-derived features. For example, the cylinder or head is defined as the parent feature, and the nozzle, support, etc., are defined as child features attached to the surface of the parent feature. This topology ensures the cascading driving attributes within the model, allowing changes in the parameters of the parent feature to automatically propagate to downstream child features, achieving logical self-consistency of non-standard design in 3D space.

[0072] In one implementation, based on the parent-child hierarchical structure of the feature dependency topology tree, the relative offset coordinates between features with parent-child hierarchical relationships are calculated to form geometric logical constraints; the geometric logical constraints are injected into the instruction compiler to generate a Python source code sequence. Specifically, based on the positioning dimensions, scale, and spatial coordinates of each geometric primitive in the 2D engineering drawings, the geometric constraint equations are automatically solved. This calculates the relative displacement vector and rotation components of each sub-feature relative to its parent feature's anchor point, converting the absolute pixel coordinates in the drawings into parameterized relative offset coordinates (e.g., pos_z = TotalLength * 0.5 - Offset, where pos_z is the target pose parameter, referring to the center coordinate value of the sub-feature's Z-axis in the 3D world coordinate system; the Z-axis is usually defined as the main axis of the container, directly determining the component's installation height in 3D space; TotalLength is the global geometric variable, representing the total length of the parent feature; 0.5 is the geometric coefficient, representing the transformation constant that sets the origin of the modeling coordinate system at the geometric center of the parent feature; and Offset is the positioning dimension variable, representing the positioning dimensions identified from the 2D drawing view, such as the distance between the nozzle centerline and the end cap tangent or the cylinder edge). This transforms static dimensions into dynamic logical constraints. Therefore, the generated Python source code sequence has hierarchical nested logic and parameter relationships. Through geometric logic constraints, changes in the parameters of the parent feature (such as an increase in the diameter of the cylinder) can be automatically propagated to the downstream child features, making the non-standard design logically self-consistent in 3D space.

[0073] In one implementation, the instruction compiler converts the size values ​​in the enhanced structured feature list into programmable variables, and the synthesized Python source code sequence contains a global parameter variable definition area; the user can directly drive the reconstruction of the 3D model by modifying the values ​​in the global parameter variable definition area. For example, the instruction examples are: 1. Define the length 700 as L=700; 2. Map the modeling instruction as: tank=Cylinder(radius=D / 2,height=L), where: tank is the feature object identifier, representing the name of the instantiated 3D entity object, existing as the parent feature root node in the feature dependency tree; Cylinder is the modeling operator, representing a geometric algorithm that encapsulates the underlying B-Rep boundary representation, such as a cylindrical geometric primitive generation function; D is the diameter parameter variable, representing the nominal diameter or outer diameter value of the container obtained from the 2D engineering drawing annotations; radius=D / 2 is the radial constraint relationship, indicating that the identified diameter variable D is automatically converted into the radius variable required by the modeling kernel; L is the height parameter variable, corresponding to the total height of the identified feature, such as the length of the straight section of the cylinder; height=L is the axial length mapping, referring to dynamically mapping the identified length value L to the stretching height parameter of the 3D entity. This instruction is parameterized code synthesized by the instruction compiler, used to drive the CAD kernel to generate the basic entity. The 3D model generated in this way is driven by the underlying source code. Users only need to modify the variable L, and the model can be automatically reconstructed, solving the problem of non-reusability.

[0074] In one implementation, the generated 3D model is back-projected into a 2D view. This 2D view is then compared with the original 2D engineering drawing. When the error exceeds a preset error threshold, the values ​​in the global parameter variable definition area are modified, driving the reconstruction of the 3D model. Specifically, if the pixel overlap (IoU) does not meet the standard, the source of the error (such as positional offset or dimension misreading) will be automatically analyzed. The values ​​in the global parameter variable definition area of ​​the Python source code sequence will be automatically traced back and corrected, driving the automatic reconstruction of the 3D model and achieving a precision closed loop without manual intervention.

[0075] The pre-defined Engineering Knowledge Base (EBK) is a multi-dimensional relational database integrating geometric topology, industry standards, process constraints, and code templates. It contains at least the following five core dimensions to support the deep mapping from 2D semantics to 3D parametric entities:

[0076] (1) Standards & Context Library

[0077] Multi-national standard serialized data: Storage includes, but is not limited to, a full range of component specifications under industrial standards such as ASME (American Standard), GB (Chinese Standard), HG (Chemical Industry Standard), and JIS (Japanese Standard).

[0078] Component Specification Index: For standard parts such as flanges, nozzles, heads, and manholes, a pre-set size lookup table based on nominal diameter (DN) and pressure rating (PN) is provided (e.g., outer diameter, bolt hole center distance, sealing surface type, etc.).

[0079] Criterion mapping logic: Preset process matching rules based on material background (such as Q345R, 304SS), operating temperature and design pressure. For example, the system can automatically match the corresponding welding groove type (such as V-type, U-type) and gasket grade according to "pressure rating 1.6MPa".

[0080] (2) Component geometric primitives and topology interface definition

[0081] Geometric Primitive Logic: Defines the basic geometric structure of each component. For example, the cylinder is defined as a "hollow cylindrical primitive", and the flange is defined as a "perforated annular disk primitive".

[0082] Feature anchor points and topology interfaces (Mounting Points & Ports): Define physical mounting points for each component. For example, a flange is defined with three key interfaces: "center axis", "sealing surface reference", and "pipe connection end".

[0083] Interface protocol: Presets the "connection rules" between different components. For example, the nozzle must be coaxially constrained with the flange through the "flange connection end".

[0084] (3) Parametric Feature Library

[0085] Class templates based on the underlying code kernel: Preset parameterized classes (such as Flange_Class, Shell_Class) based on Build123d or CadQuery.

[0086] Variable structure definition: Each class contains two types of parameters:

[0087] 1. Mandatory parameters: Dimensions obtained directly from 2D recognition (such as cylinder diameter and total length).

[0088] 2. Default / Implicit Parameters: Default values ​​preset by the knowledge base based on industry conventions (such as unmarked reinforcing ring spacing and thread relief groove size).

[0089] Dynamic geometry constructor: Presets the Boolean operation logic inside the class (such as calling the make_holes() method to automatically generate bolt holes in a circular array).

[0090] (4) Implicit Parameter Inference

[0091] Missing data completion rules: The algorithm is based on industry conventions and features an automatic completion algorithm. For example, when a 2D drawing only indicates the location of the pipe but not the flange thickness, the algorithm automatically completes the missing dimensions necessary for modeling based on the "equal strength design principle" or "standard parts manual".

[0092] Semantic verification logic: The system uses a tolerance zone standard library to verify the reasonableness of the identified values. If the OCR-recognized value deviates too much from the standard library (e.g., a non-standard diameter is identified), the system will initiate a conflict arbitration mechanism.

[0093] (5) Hierarchy & Constraint Propagation

[0094] Entity Hierarchy: Defines the parent-child topology tree of project entities.

[0095] Parent feature: The main features of the container (such as the cylinder and end cap), which serve as the zero-point reference for spatial positioning.

[0096] Child features: Features that are attached to the main body (such as a connector or support).

[0097] Dynamic constraint propagation algorithm: Preset parameter cascading rules across features.

[0098] Spatial constraint preservation: Defines an algorithm for how a child feature (the nozzle mounted on it) maintains its spatial positioning using relative offset coordinates or normal constraints when the parent feature parameter changes (such as the cylinder diameter increases).

[0099] Cascading updates: Ensure that after modifying the main variables of a model, its associated sub-components are automatically relocated and new 3D Boolean operation sequences are generated.

[0100] This invention also provides an automated 3D modeling system for 2D engineering drawings. Based on an agent-based architecture, this system differs from traditional input-output programs by breaking down complex tasks into executable sub-steps. During operation, it continuously adjusts its strategies based on environmental feedback and calls external APIs or software plugins to complete closed-loop operations. The system is driven by a central scheduling agent (Master Agent) and constructs a dynamic collaborative system composed of atomic skill sets and recursive sub-agents.

[0101] like Figure 1 As shown:

[0102] 2D engineering drawing global image, including:

[0103] Title bar area: The priority detection area of ​​the central dispatch agent (Master Agent) is used to obtain part names, design standards and material background, activate the corresponding engineering knowledge base context, and complete context activation;

[0104] Feature List Area (Port Table / Detail Table): Stores specification information for non-standard components. The central scheduling agent (MasterAgent) structures the data in this area and extracts a target-oriented task list;

[0105] Main and side view areas: The primary source of geometric contours, where target-oriented detection is performed according to instructions from the Master Agent. Cross-view coordinate mapping is established through spatial mapping axes to ensure that the same component (e.g., N1) is perfectly aligned spatially from different perspectives. The Master Agent binds the semantics of the detail table text to the view's geometric contours, assigning physical meaning to the geometry (e.g., confirming that the rectangular contour is the N1 air intake), and generates a structured JSON feature stream through structured recognition.

[0106] Local detail magnification area: When the central scheduling agent (Master Agent) determines that the annotation lines at the N1 port are too dense, or finds complex annotations, such as edge line density or the number of connected components exceeding the preset density threshold (such as dense annotations of 150, 25, etc.) leading to a decrease in confidence, it will automatically trigger the sub-pixel magnification skill to perform sub-pixel level resampling to ensure the accurate extraction of tiny dimensions.

[0107] Central Dispatch Agent (Master Agent): The system's decision-making brain, responsible for dynamically allocating tasks to sub-agents or atomic skills based on the complexity of the blueprint.

[0108] The parameterized output chain involves identifying a structured JSON feature stream, using an instruction compiler to generate reusable parameterized Python source code, which is then used to call a CAD kernel to perform modeling and obtain a STEP-formatted 3D solid model. Finally, the 3D model is back-projected to verify its accuracy against the 2D engineering drawings, and the verification result is fed back to the central scheduling agent (Master Agent).

[0109] The system described in this embodiment includes a central dispatch agent and an atomized skill set. The central dispatch agent invokes specific skills from the atomized skill set. Specifically, the central dispatch agent is responsible for maintaining the CoT (Coordination of Thought) of the global drawing review strategy, making cross-stage tool invocation decisions, and coordinating the logic between modules. The CoT follows a specific order: establishing the engineering background, creating a feature list, establishing projection relationships, and tracing feature points according to the drawing, which simulates the expert's drawing reading order: first read the table, then review the drawing.

[0110] The central dispatch agent is used to input 2D engineering drawings; it calls the visual exploration skills in the atomized skill set to parse the title block in the 2D engineering drawings to obtain the engineering background; it reads the nozzle table / parts list to generate a feature to-do list, which contains multiple features; it parses the three-view area and establishes a cross-view space mapping coordinate system;

[0111] The semantic deconstruction skill from the atomization skill set is invoked to extract the textual semantics of the feature to-do list and obtain semantic identifiers, which at least include the component type corresponding to each feature. Parametric topological constraint rules corresponding to each component type are obtained from a preset engineering knowledge base, which at least include the geometric contour of the component type in the three-view drawings. A target-oriented search is employed to search for geometric contours matching the feature to-do list in the three-view drawings, obtaining the geometric primitives and their spatial poses corresponding to each feature. Dimensions are read from 2D engineering drawings, and the dimension values ​​are used as logical variables to attach to the corresponding geometric primitives, generating an enhanced structured feature list. This enhanced structured feature list at least includes the engineering background, semantic identifiers, the spatial poses of the geometric primitives corresponding to each feature, and the topological relationship between the geometric primitives and their dimension values.

[0112] The code generation skills in the atomic skill set are invoked to build an instruction compiler. An enhanced structured feature list is input, and each feature is mapped in real time to a feature class calling function in the engineering knowledge base to synthesize a Python source code sequence. A 3D model is generated based on this Python source code sequence.

[0113] In one implementation, the system further includes sub-agents, which are specialized execution units derived for specific complex features (such as takeover details) or verification tasks. The sub-agents feed back the execution results to the central scheduling agent.

[0114] The central scheduling agent invokes the feature detection sub-agent for high-rate resampling under the following circumstances. Specifically, unlike traditional global proportional scaling, it invokes sub-pixel magnification skills from the atomic skill set. This skill extracts the target region based on the coordinates indicated by the central scheduling agent, directly extracting the pixel matrix from the high-bit-depth original PDF image stream, or using a generative super-resolution operator (SRGAN) to repair details in blurred labeled areas. This achieves local detail capture at the level of one ten-millionth of the full image size, ensuring that pixel edges of annotations with minute tolerances are clearly distinguishable. Specific circumstances include:

[0115] Enlarge and denoise the high-weight engineering feature areas in the 2D engineering drawings, and perform high-resolution resampling. The high-weight engineering feature areas include at least the title block and the pipe / parts table.

[0116] A target-oriented search is adopted. When the density of edge lines or the number of connected components exceeds a preset density threshold, the view area / candidate target area where the feature is located is magnified, denoised, and high-resolution resampling is performed.

[0117] When searching for geometric contours that match the feature to-do list in the view region where the feature is located, candidate geometric bounding boxes are output. When the confidence of the candidate geometric bounding box is lower than the preset confidence threshold, the view region where the feature is located is magnified, denoised, and high-resolution resampling is performed.

[0118] When the confidence level of the candidate geometric bounding box is greater than the preset confidence threshold, the candidate geometric primitive is output and the pixel size of the candidate geometric primitive is obtained; the dimension annotation in the 2D engineering drawing is read; the dimension annotation and the pixel size are compared by scale conversion; when the deviation is greater than the preset deviation threshold, the view area where the feature is located is enlarged, denoised, and high-resolution resampling is performed.

[0119] The central dispatch agent also calls the consistency verification sub-agent to back-project the generated 3D model into a 2D view, compare the 2D view with the original 2D engineering drawings, and when the error exceeds the preset error threshold, modify the value of the global parameter variable definition area to drive the reconstruction of the 3D model.

Claims

1. A method for automatic 3D modeling of 2D engineering drawings, characterized in that, Includes the following steps: Input 2D engineering drawings; Parse the title block in 2D engineering drawings to obtain the engineering background; read the pipe / part list / parts list to generate a feature to-do list, which contains multiple features; parse the three-view area and establish a cross-view space mapping coordinate system. Extract the textual semantics of the feature to-do list to obtain semantic identifiers, which at least include the component type corresponding to each feature; obtain the parameterized topological constraint rules corresponding to each component type from a preset engineering knowledge base, which at least include the geometric contour of the component type in the three views; adopt a target-oriented search to search for the geometric contour matching the feature to-do list in the three views to obtain the geometric primitive and its spatial pose corresponding to each feature; read the dimension annotations in the 2D engineering drawings, attach the dimension values ​​as logical variables to the corresponding geometric primitives, and generate an enhanced structured feature list; This enhanced structured feature list includes at least the engineering background, semantic identifier, spatial pose of the geometric primitives corresponding to each feature, and the topological relationship between the geometric primitives and dimensions. Build an instruction compiler, take an enhanced list of structured features as input, map each feature to a feature class function in the engineering knowledge base in real time, and synthesize a sequence of Python source code; A 3D model was generated based on this Python source code sequence.

2. The method of claim 1, wherein: When the semantic identifier also includes the view region where the feature is located, a target-oriented search is adopted to search for geometric contours that match the feature to-do list in the view region where the feature is located; when the semantic identifier does not include the view region where the feature is located, a low-resolution scan is first performed on the three views to output candidate target regions containing geometric contours that match the feature to-do list, and then the geometric primitives corresponding to each feature are locked in the candidate target regions.

3. The method for automatic 3D modeling of 2D engineering drawings as described in claim 2, characterized in that: Enlarge and denoise the high-weight engineering feature areas in the 2D engineering drawings, and perform high-resolution resampling. The high-weight engineering feature areas include at least the title block and the pipe / parts table. A target-oriented search is adopted. When the density of edge lines or the number of connected components exceeds a preset density threshold, the view area / candidate target area where the feature is located is magnified, denoised, and high-resolution resampling is performed. When searching for geometric contours that match the feature to-do list in the view region where the feature is located, candidate geometric bounding boxes are output. When the confidence of the candidate geometric bounding box is lower than the preset confidence threshold, the view region where the feature is located is magnified, denoised, and high-resolution resampling is performed. When the confidence level of the candidate geometric bounding box is greater than the preset confidence threshold, the candidate geometric primitive is output and the pixel size of the candidate geometric primitive is obtained; the dimension annotation in the 2D engineering drawing is read; the dimension annotation and the pixel size are compared by scale conversion; when the deviation is greater than the preset deviation threshold, the view area where the feature is located is enlarged, denoised, and high-resolution resampling is performed. After performing high-resolution resampling, the sub-pixel level geometric primitives and their spatial poses corresponding to each feature are obtained.

4. The method for automatic 3D modeling of 2D engineering drawings as described in claim 1, characterized in that: Before inputting the enhanced structured feature list into the instruction compiler, the features are parameter-completed using a pre-defined engineering knowledge base. The completed parameters include at least the physical properties of the standard parts.

5. The method for automatic 3D modeling of 2D engineering drawings as described in claim 1, characterized in that: Based on the enhanced structured feature list and combined with the pre-set engineering knowledge base, the subordinate logical and physical dependency relationships of each feature are analyzed to construct a feature dependency topology tree with a parent-child hierarchical structure. The instruction compiler synthesizes a sequence of Python source code based on the priority of the feature dependency topology tree.

6. The method for automatic 3D modeling of 2D engineering drawings as described in claim 5, characterized in that: Based on the parent-child hierarchical structure of the feature-dependent topology tree, the relative offset coordinates between features with parent-child hierarchical relationships are calculated to form geometric logical constraints; these geometric logical constraints are then injected into the instruction compiler to generate a sequence of Python source code.

7. The method for automatic 3D modeling of 2D engineering drawings as described in claim 1, characterized in that: The instruction compiler transforms the size values ​​in the enhanced structured feature list into programmable variables, and the synthesized Python source code sequence contains a global parameter variable definition area; users can directly drive the reconstruction of the 3D model by modifying the values ​​in the global parameter variable definition area.

8. The method for automatic 3D modeling of 2D engineering drawings as described in claim 7, characterized in that: The generated 3D model is back-projected into a 2D view, and the 2D view is compared with the original 2D engineering drawing. When the error exceeds the preset error threshold, the value of the global parameter variable definition area is modified to drive the reconstruction of the 3D model.

9. An automatic 3D modeling system for 2D engineering drawings using the method of claim 1, characterized in that: The system includes a central dispatch agent and an atomized skill set, with the central dispatch agent calling specific skills from the atomized skill set; Central dispatch agent, used for inputting 2D engineering drawings; Use the visual exploration skill from the atomization skill set to parse the title block in 2D engineering drawings to obtain the engineering background; read the nozzle table / parts list to generate a feature to-do list containing multiple features; parse the three-view area and establish a cross-view space mapping coordinate system; The semantic deconstruction skill from the atomization skill set is invoked to extract the textual semantics of the feature to-do list and obtain semantic identifiers, which at least include the component type corresponding to each feature. Parametric topological constraint rules corresponding to each component type are obtained from a preset engineering knowledge base, which at least include the geometric contour of the component type in the three-view drawings. A goal-oriented search is employed to search for geometric contours matching the feature to-do list in the three-view drawings, obtaining the geometric primitives and their spatial poses corresponding to each feature. Dimensions are read from 2D engineering drawings, and the dimensional values ​​are used as logical variables and attached to the corresponding geometric primitives to generate an enhanced structured feature list. This enhanced structured feature list includes at least the engineering background, semantic identifier, spatial pose of the geometric primitives corresponding to each feature, and the topological relationship between the geometric primitives and dimensions. The code generation skills in the atomic skill set are invoked to build an instruction compiler. An enhanced list of structured features is input, and each feature is mapped in real time to a feature class function in the engineering knowledge base to synthesize a sequence of Python source code. A 3D model was generated based on this Python source code sequence.

10. The automatic 3D modeling system for 2D engineering drawings as described in claim 9, characterized in that: The system also includes sub-agents, which feed back the execution results to the central scheduling agent; The central scheduling agent invokes the feature detection sub-agent for high-rate resampling under the following circumstances: Enlarge and denoise the high-weight engineering feature areas in the 2D engineering drawings, and perform high-resolution resampling. The high-weight engineering feature areas include at least the title block and the pipe / parts table. A target-oriented search is adopted. When the density of edge lines or the number of connected components exceeds a preset density threshold, the view area / candidate target area where the feature is located is magnified, denoised, and high-resolution resampling is performed. When searching for geometric contours that match the feature to-do list in the view region where the feature is located, candidate geometric bounding boxes are output. When the confidence of the candidate geometric bounding box is lower than the preset confidence threshold, the view region where the feature is located is magnified, denoised, and high-resolution resampling is performed. When the confidence level of the candidate geometric bounding box is greater than the preset confidence threshold, the candidate geometric primitive is output and the pixel size of the candidate geometric primitive is obtained; the dimension annotation in the 2D engineering drawing is read; the dimension annotation and the pixel size are compared by scale conversion; when the deviation is greater than the preset deviation threshold, the view area where the feature is located is enlarged, denoised, and high-resolution resampling is performed. The central dispatch agent also calls the consistency verification sub-agent to back-project the generated 3D model into a 2D view, compare the 2D view with the original 2D engineering drawings, and when the error exceeds the preset error threshold, modify the value of the global parameter variable definition area to drive the reconstruction of the 3D model.