Automated three-dimensional layout generation method, system, and device

By automating the processing of 2D CAD drawing data, the system achieves automatic association between equipment elements and numbers and precise matching of 3D models, solving the problem of low efficiency in existing technologies, improving the accuracy and efficiency of 3D layout generation, and supporting rapid design iteration.

CN123181722APending Publication Date: 2026-11-27RIAMB (BEIJING) TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611378980.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-07
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies cannot achieve automated semantic recognition, accurate matching and automatic positioning of 3D models for 2D CAD equipment layout drawings, resulting in low efficiency, high error rate and difficulty in supporting rapid design iteration in 3D layout generation.

Method used

By acquiring 2D CAD drawing data, extracting blocks and numbered text, calculating the width, height, and center point coordinates of the bounding box, grouping and tolerance clustering using device numbers, generating cluster labels, retrieving matching models from the 3D model library, and accurately placing the 3D model in the 3D scene through translation and selective rotation.

Benefits of technology

It enables automatic association between equipment elements and service numbers, reduces the storage burden of the model library, improves the accuracy and efficiency of 3D layout generation, and supports rapid design iteration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123181722A_ABST
    Figure CN123181722A_ABST
Patent Text Reader

Abstract

The application discloses an automatic three-dimensional layout generation method, system and device, and relates to the fields of computer-aided design and three-dimensional visualization. The method comprises the following steps: extracting device blocks and independent numbered characters from CAD drawings; calculating the size and center point coordinates of the block bounding box, matching the device numbers through spatial inclusion relation, and obtaining structured information; after grouping according to the device types, rounding the size, and tolerance clustering, a clustering label containing the type identifier and the standard size is generated; the matching three-dimensional model is retrieved and loaded from a three-dimensional model library by using the clustering label; and the model is translated and selectively rotated according to the bounding box coordinates and the size, so that the position and direction of the model are consistent with the CAD drawings. The application realizes full-automatic conversion from the CAD layout drawing to the three-dimensional scene, significantly improves the efficiency and the accuracy, and supports incremental updating.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer-aided design and 3D visualization technology, and more specifically, to automated 3D layout generation methods, systems, and devices. Background Technology

[0002] In engineering fields such as factory planning, production line design, and warehousing and logistics simulation, 3D visualization technology has become an indispensable core tool. Autodesk 3ds Max and other 3D modeling software, with their powerful rendering and animation capabilities, are widely used to create high-precision 3D scenes and simulation animations. In actual workflows, designers typically first complete the planar layout design in 2D software such as AutoCAD, generating CAD drawings containing equipment blocks, numbers, outlines, and location information. These drawings serve as the authoritative basis for all subsequent 3D work. 3D modelers need to import the DWG format CAD base map into 3ds Max, precisely scale it to the actual size, and freeze it as the background. Then, referring to each graphic symbol on the base map, they must search for the corresponding individual model from a massive 3D model library, and then manually drag, move, rotate, and scale it to ensure the 3D model perfectly matches the graphic position and angle in the CAD base map. When projects are large-scale, with numerous types of equipment and complex layouts, this manual identification, matching, and placement chain is extremely time-consuming, inefficient, and prone to model mismatch and spatial alignment deviations due to visual fatigue or operational errors.

[0003] Several technical solutions exist for converting 2D CAD to 3D models. In the field of Building Information Modeling (BIM), BIM software such as Revit, through secondary development, can automatically generate building components such as walls, doors, and windows from CAD lines or blocks on specific layers. This is achieved by establishing a one-to-one correspondence between elements and system families or loadable families. However, this method only applies to parametric building components and cannot handle diverse, non-standard, general equipment layouts. In 3ds Max, there are script-based batch modeling plugins. For example, city generation plugins can programmatically generate building complexes based on plot outlines according to set rules. Their generation logic is universal and random, not relying on the unique semantic information of specific elements in the CAD base map. Other tools attempt to use computer vision technology to identify wall and window areas in floor plans for model conversion. Their identification target is the geometric topology of enclosed spaces, rather than independent equipment elements carrying business meaning. Furthermore, auxiliary scripts that enable batch display or hiding of models through layer state management only optimize scene browsing efficiency and do not change the inherently manual operation of the layout process.

[0004] Therefore, existing technologies cannot achieve automated semantic recognition, accurate matching and automatic positioning of 3D models for 2D CAD equipment layout drawings, nor can they respond to design changes by performing incremental scene updates. They still rely heavily on manual repetitive placement operations, resulting in low efficiency, high error rate and difficulty in supporting rapid design iterations in 3D layout generation. Summary of the Invention

[0005] To address this, this application provides an automated 3D layout generation method, system, and device, which helps solve the problem that existing technologies cannot achieve automated semantic recognition, accurate matching and automatic positioning of 3D models for 2D CAD equipment layout drawings, and still rely heavily on manual repetitive placement operations, resulting in low efficiency, high error rate and difficulty in supporting rapid design iteration in 3D layout generation.

[0006] To achieve the above objectives, this application adopts the following technical solution:

[0007] Firstly, this application provides an automated 3D layout generation method, including: Acquire two-dimensional CAD drawing data; and extract blocks and independent numbered text from the two-dimensional CAD drawing data; wherein the two-dimensional CAD drawing data contains one or more devices; each device is defined as a single block in the CAD drawing, and the block is defined by a bounding box. For each of the aforementioned tiles, the vertex coordinates of all geometric primitives within the tile are traversed. Based on the corresponding two-dimensional affine transformation matrix, the coordinates of each vertex are transformed to the world coordinate system. The width, height, and center point coordinates of the bounding box of the tile are calculated based on the transformed vertex coordinates. Then, through the spatial inclusion relationship between the bounding box and the numbered text, a corresponding device number is matched for the tile to obtain the structured information of the device corresponding to the tile. The structured information includes: device number, bounding box width, bounding box height, and bounding box center point coordinates. The devices are grouped according to the identifier representing the device type in the device number; the width and height of the bounding box corresponding to each device in each group are rounded up as the width and height of the device, and tolerance clustering is performed based on the rounded dimensions, and devices with size deviations within a preset threshold are grouped into the same cluster category; a standard dimension is calculated for each cluster category and a cluster label is generated; the cluster label includes the device type identifier and the standard dimension; For each of the aforementioned devices, using the clustering tags of the devices, a 3D model matching the clustering tags of the devices is retrieved from the 3D model library and loaded; if at least one dimension of the loaded 3D model is inconsistent with the bounding box dimension corresponding to the structured information of the device, then a size adaptation process is performed on the 3D model; wherein, all models in the 3D model library have a base point uniformly set at their geometric center; Based on the center point coordinates, width, and height of the bounding box corresponding to the device, the loaded 3D model is spatially transformed so that the position and orientation of the 3D model in the 3D scene are consistent with the blocks in the 2D CAD drawing data; wherein, the spatial transformation is achieved through translation and selective rotation.

[0008] Secondly, this application provides an automated 3D layout generation system, applied to any of the above-described automated 3D layout generation methods, comprising: An acquisition module is used to acquire two-dimensional CAD drawing data; and extract blocks and independent numbered text from the two-dimensional CAD drawing data; wherein the two-dimensional CAD drawing data contains one or more devices; each device is defined as a single block in the CAD drawing, and the block is defined by a bounding box. The first processing module is configured to, for each of the aforementioned tiles, traverse the vertex coordinates of all geometric primitives within the tile, perform coordinate transformation on each vertex coordinate based on the two-dimensional affine transformation matrix corresponding to the tile, so as to transform each vertex coordinate to the world coordinate system; calculate the width, height, and center point coordinates of the bounding box of the tile based on the transformed vertex coordinates, and match the corresponding device number for the tile through the spatial inclusion relationship between the bounding box of the tile and the numbered text, thereby obtaining the structured information of the device corresponding to the tile; the structured information includes: device number, width of the bounding box, height of the bounding box, and center point coordinates of the bounding box; The second processing module is used to group the devices according to the identifier representing the device type in the device number; round the width and height of the bounding box corresponding to each device in each group as the width and height of the device, and perform tolerance clustering based on the rounded dimensions, classifying devices with size deviations within a preset threshold into the same cluster category; calculate the standard size for each cluster category and generate a cluster label; the cluster label includes the device type identifier and the standard size; The third processing module is used to retrieve and load a 3D model that matches the clustering label of the device from the 3D model library for each device; if at least one dimension of the loaded 3D model is inconsistent with the bounding box dimension corresponding to the structured information of the device, then size adaptation processing is performed on the 3D model; wherein, all models in the 3D model library have a base point uniformly set at their geometric center. The fourth processing module is used to perform spatial transformation on the loaded 3D model according to the center point coordinates, width and height of the bounding box corresponding to the device, so that the position and orientation of the 3D model in the 3D scene are consistent with the blocks of the 2D CAD drawing data; wherein, the spatial transformation is achieved by translation and selective rotation.

[0009] The application employs the above technical solution and has at least the following beneficial effects: This invention provides an automated 3D layout generation method. The method first acquires 2D CAD drawing data and extracts blocks and independent numbered text from it, which can automatically obtain the original design data. For each block, the width, height and center point coordinates of its bounding box are calculated, and the corresponding equipment number is automatically matched with the spatial inclusion relationship with the numbered text, thereby forming structured information containing equipment number and geometric dimensions. This realizes the automatic association between equipment elements and business numbers, eliminating the need for manual labeling and ensuring the integrity and accuracy of data acquisition.

[0010] Simultaneously, this method groups devices according to their type identifiers in the device number. The width and height of the bounding box corresponding to each device within a group are then rounded down to the device's width and height. Tolerance-based clustering is performed on these rounded dimensions, grouping devices with dimensional deviations within a preset threshold into the same cluster. A standard dimension is then calculated for each cluster, generating a cluster label containing both the device type identifier and the standard dimension. This process automatically groups devices with similar dimensions into a unified standard specification, effectively reducing dimensional redundancy caused by drawing errors or subtle differences among similar devices. This allows subsequent model retrieval to be based on standardized cluster labels, reducing the number of model specifications required to be stored in the 3D model library and lowering the burden of building and maintaining the model library.

[0011] Based on this, the method uses the clustering tags of each device to automatically retrieve and load matching 3D models from the 3D model library. All models in the 3D model library have a base point uniformly set at their geometric center, which ensures the consistency of the base point when loading the model and eliminates the problem of inconsistent positioning reference caused by the difference in the base point position of different models, thus providing a reliable basis for subsequent accurate transformation.

[0012] Finally, this method performs spatial transformations on the loaded 3D model using translation and selective rotation based on the center point coordinates, width, and height of the bounding box corresponding to the device. This ensures that the position and orientation of the 3D model in the 3D scene are completely consistent with the blocks in the CAD drawing. Specifically, the translation operation achieves precise alignment of the model's base point based on the center point coordinates, while the selective rotation operation automatically determines the rotation angle based on the comparison of width and height, thus ensuring that the placement of the 3D model strictly matches the design drawing. The entire transformation process is automatically driven by numerical calculations, requiring no manual intervention. This ensures both the accuracy of layout generation and achieves efficient and automated conversion from 2D drawings to a 3D scene.

[0013] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

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

[0015] Figure 1 This is a flowchart illustrating an automated 3D layout generation method according to an exemplary embodiment; Figure 2 This is an overall design flowchart of an automated 3D layout generation method according to an exemplary embodiment; Figure 3 This is a flowchart illustrating an automated 3D model matching and generation process according to an exemplary embodiment; Figure 4 This is a flowchart illustrating the design of an incremental update mechanism according to an exemplary embodiment; Figure 5 This is a schematic diagram illustrating the components of an automated 3D layout generation system based on a CAD base map and a 3D model library, according to an exemplary embodiment. Detailed Implementation

[0016] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be described in detail below. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other implementation methods obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0017] Example 1 For specific implementation details, please refer to [link / reference]. Figure 1 , Figure 1 This is a flowchart illustrating an automated 3D layout generation method according to an exemplary embodiment, the method comprising: S1. Acquire two-dimensional CAD drawing data; and extract blocks and independent numbered text from the two-dimensional CAD drawing data; wherein the two-dimensional CAD drawing data contains one or more devices; each device is defined as a single block in the CAD drawing, and the block is defined by a bounding box. S2. For each of the aforementioned blocks, calculate the width, height, and center point coordinates of the bounding box of the block, and match the corresponding device number for the block based on the spatial inclusion relationship with the numbered text to obtain the structured information of the device corresponding to the block; the structured information includes: device number, width of the bounding box, height of the bounding box, and center point coordinates of the bounding box; S3. Group the devices according to the identifier representing the device type in the device number; round the width and height of the bounding box corresponding to each device in each group as the width and height of the device, and perform tolerance clustering based on the rounded dimensions, classifying devices with size deviations within a preset threshold into the same cluster category; calculate the standard dimension for each cluster category and generate a cluster label; the cluster label includes the device type identifier and the standard dimension; S4. For each of the aforementioned devices, using the clustering tags of the devices, a 3D model matching the clustering tags of the devices is retrieved from the 3D model library and loaded; if at least one dimension of the loaded 3D model is inconsistent with the bounding box dimension corresponding to the structured information of the device, then the 3D model is subjected to size adaptation processing to make its dimension precisely match the standard dimension in the clustering tags; wherein, all models in the 3D model library have a base point uniformly set at their geometric center; S5. Based on the center point coordinates, width, and height of the bounding box corresponding to the device, perform spatial transformation on the loaded 3D model so that the position and orientation of the 3D model in the 3D scene are consistent with the blocks of the 2D CAD drawing data; wherein, the spatial transformation is achieved through translation and selective rotation.

[0018] For specific implementation details, please refer to [link / reference]. Figure 2 In this embodiment, the application scenario is the 3D layout design of a logistics conveyor line workshop. The CAD drawings were created using AutoCAD, and the 3D scene was constructed in 3ds Max.

[0019] First, obtain the 2D CAD drawing data. This drawing data is a DWG format file containing top-view graphics of various equipment, such as chain conveyors, roller conveyors, elevators, shuttles, and other logistics equipment. Each piece of equipment is defined as a single block in the CAD drawing, i.e., a block reference object in CAD, and the block's geometry is defined by a bounding box. A bounding box is the smallest bounding rectangle that completely encloses all graphic elements within the block.

[0020] It should be noted that after acquiring the CAD drawing data, the CAD drawings are layer-wise normalized, irrelevant layers and hidden block references are cleaned up, and all blocks representing the device to be generated are located on several preset visible layers. At the same time, spatial zeroing and unit unification are performed, adjusting the reference point of the CAD drawings to near the origin, and ensuring that the drawing units are consistent with the system units of the 3D modeling software, for example, both using millimeters as the unit.

[0021] All blocks and unique numbered text are extracted from the 2D CAD drawing data. The numbered text is a single-line text object located inside or near the corresponding equipment block, and its content follows the naming rule of "first letter of equipment type + number," for example, "L1001" represents chain conveyor number 1001, and "H2003" represents hoist number 2003. The extraction operation is performed by traversing the block table and text entity table of the CAD database.

[0022] After extracting the blocks, the blocks are filtered out to remove those whose bounding box area or side length exceeds a preset threshold, so as to avoid misidentifying non-equipment elements such as building outlines and area boundaries in the drawings as equipment.

[0023] For each tile, calculate the width, height, and center point coordinates of its bounding box. The calculation method is as follows: traverse the vertex coordinates of all geometric primitives within the tile to obtain the corresponding 2D affine transformation matrix. This matrix is ​​constructed in memory in real-time using the tile's insertion point, X / Y axis scaling factors, and rotation angle. Multiply each vertex coordinate by this affine transformation matrix to transform all vertices to the world coordinate system, and then calculate the transformation based on the transformed vertex coordinates. Find the minimum and maximum values ​​of the X and Y coordinates respectively, width = Xmax - Xmin, height = Ymax - Ymin, center point coordinates = ((Xmin + Xmax) / 2, (Ymin + Ymax) / 2).

[0024] The device IDs are matched to the blocks using spatial inclusion relationships. Specifically, the insertion point coordinates of each ID text are compared with the bounding boxes of all blocks using spatial inclusion testing. If the insertion point of the ID text is inside the bounding box of a block, the ID text is associated with that block. When multiple block bounding boxes contain the same ID text, the ID text is matched to the block with the smallest bounding box area. After matching, the structured information of the device corresponding to the block is obtained, including: device ID, bounding box width, bounding box height, and bounding box center point coordinates. The structured information is output in CSV table format, containing fields for block name, layer, bounding box vertices, center point, width, height, and device ID.

[0025] The equipment is grouped according to the identifier representing the equipment type in the equipment number. The identifier representing the equipment type is the first letter of the equipment number. For example, all equipment starting with the letter "L" is grouped into chain conveyor groups, and equipment starting with the letter "H" is grouped into hoist groups.

[0026] The width and height of the bounding box corresponding to each device within each group are used as the device's width and height, and then rounded up. The rounding method is as follows: the smaller of the width and height is taken as the short side and rounded up to the nearest hundred; the larger of the width and height is taken as the long side and rounded down to the nearest ten. For example, a width of 1758mm is rounded to 1800mm, and a height of 2010mm is rounded to 2000mm. Tolerance clustering is performed based on the rounded dimensions, where the short side is precisely grouped, and the long side is merged sequentially according to a 5% tolerance. Devices with dimensional deviations within a preset threshold are grouped into the same cluster category. The preset threshold is set to 5%, meaning that within the same group, two devices with a rounded width difference percentage and a rounded height difference percentage both less than 5% are grouped into the same category.

[0027] Calculate the standard dimensions for each cluster. The calculation method is as follows: calculate the weighted average of the rounded widths of all devices in the cluster, calculate the weighted average of the rounded heights of all devices in the cluster, and round both weighted averages to the nearest hundred. These two weighted averages are then used as the standard width and standard height for that cluster.

[0028] Generate cluster labels, which include the equipment type identifier and the standard dimensions. The label format is "equipment type identifier_standard width_standard height", for example, "L_1000_1600" represents a chain conveyor with a standard width of 1000mm and a standard height of 1600mm.

[0029] For each of the aforementioned devices, using the clustering tags of the devices, 3D models matching the clustering tags of the devices are retrieved from the 3D model library and loaded. All models in the 3D model library have a base point uniformly set at their geometric center. Each individual 3D model in the 3D model library corresponds to an independent file, with its base point uniformly set at the geometric center of the model. The model file name includes the device type identifier and standard dimensions, such as L_1600_1000.max. The 3D model library uses a hierarchical folder structure of "category / model / file," such as "conveyor equipment / chain machine / L_1600_1000.max." Only one editable polygonal object or group object in the model file is named according to the device numbering naming rules; other auxiliary objects are not named according to these rules to avoid identification conflicts.

[0030] Based on the center point coordinates, width, and height of the bounding box corresponding to the device, a spatial transformation is performed on the loaded 3D model to ensure that the position and orientation of the 3D model in the 3D scene are consistent with the blocks in the 2D CAD drawing data. This spatial transformation is achieved through translation and selective rotation.

[0031] After the spatial transformation is complete, the generated 3D model undergoes recursive naming and automatic layering. Recursive naming involves starting from the root node after placement, performing a depth-first traversal of all child objects, finding objects whose names conform to the format "uppercase letter + number," and renaming them to device numbers. Automatic layering involves creating a corresponding layer for each type of device, grouping models of the same type into their respective layers to maintain the structural order of the 3D scene.

[0032] For specific implementation, please refer to the following code: merged = False minScore = 1E+99 For i = 1 To sortedClusters.Count - 1 For j = i + 1 To sortedClusters.Count If c1("type") = c2("type") Then diffW = Abs(c1("width") - c2("width")) / c1("width") diffH = Abs(c1("height") - c2("height")) / c1("height") maxDiff = IIf(diffW>diffH, diffW, diffH) If maxDiff <= tolerance, then 'Calculate the merging priority score (prioritize those with smaller differences and greater quantity) score = maxDiff + 1 / (c1("count") + c2("count") + 1) If score <minscore then minscore="score:" mergeidx1 mergeidx2="j" end if next j i>0 Then Merge two clusters: calculate the weighted average size avgW = (c1("width") c1("count") + c2("width") c2("count")) / (c1("count") + c2("count")) avgH = (c1("height") c1("count") + c2("height") c2("count")) / (c1("count") + c2("count")) Round up to the nearest hundred again. c1("width") = Round(avgW / 100, 0) 100 c1("height") = Round(avgH / 100, 0) 100 c1("count") = c1("count") + c2("count") c1("items") = c1("items")&", "&c2("items") sortedClusters.Remove mergeIdx2 merged = True End If Loop While merged This embodiment treats 2D CAD drawings as an instruction set, sequentially executing standardized preprocessing, primitive filtering, bounding box calculation, text snapping and matching, dimension clustering, model retrieval and matching, and spatial transformation to achieve fully automated generation from CAD layout drawings to 3D scenes. Compared to the traditional manual drag-and-drop, alignment, and rotation process, this method reduces the generation time of large scenes from several days to several minutes, improving efficiency by tens of times. Simultaneously, based on the mathematical alignment of the bounding box center point and the model base point, and the automatic determination of selective rotation, it eliminates positional deviations and directional errors inherent in manual operations, achieving accuracy at the basic unit level of modeling software. Recursive naming and automatic layering mechanisms further ensure the structural standardization and orderliness of the generated scene, facilitating subsequent editing and team collaboration.

[0033] Example 2 Based on Example 1, this embodiment further specifies the block normalization preprocessing step to be performed after extracting the blocks and numbered text and before calculating the bounding box.

[0034] In actual CAD drawings, the original state of a block may have a reference point that is not at the geometric center or a rotation angle that is not zero. For example, when drawing equipment, the designer may use the lower left corner as the insertion base point, or rotate the entire equipment block by a certain angle to fit the workshop column grid layout. These factors will directly affect the accuracy of the bounding box calculation. For example, the width and height of the bounding box of a tilted equipment block will not accurately reflect the actual size of the equipment.

[0035] Therefore, after extracting the blocks and independent numbered text from the two-dimensional CAD drawing data, and before calculating the width, height, and center point coordinates of the bounding box for each block, the following operations are performed: For each extracted tile, the center point of the tile is moved to the geometric center of the tile, and the rotation angle of the tile is reset to zero.

[0036] The specific implementation involves: traversing all vertices within the tile and calculating the coordinates of its geometric center; creating a translation matrix to move the tile from its original center point to the geometric center; and creating a rotation matrix to rotate the tile around its geometric center until the angle is zero. The zeroed-out tile's bounding box is an axis-aligned bounding box, whose width and height accurately reflect the actual dimensions of the device when placed horizontally, providing an accurate geometric data foundation for subsequent size clustering and 3D model matching.

[0037] This embodiment inserts a standardized preprocessing step after block extraction and before bounding box calculation. This resets the reference points of all blocks to their geometric centers and zeroes the rotation angles, ensuring that all subsequently calculated bounding boxes are axis-aligned. The width and height accurately reflect the actual dimensions of the equipment, rather than the dimensions of the circumscribed rectangle under tilt. This process eliminates the influence of original block pose differences in CAD drawings on the analytical results, guaranteeing the accuracy of size clustering and model matching, and laying the foundation for precise automated layout.

[0038] As an alternative to this standardized preprocessing step, instead of actually moving and rotating the tiles themselves, the coordinates of each vertex can be transformed directly using the two-dimensional affine transformation matrix carried by the tiles during subsequent bounding box calculations. The vertices are then transformed to the world coordinate system for calculation. The two methods are mathematically equivalent and can both eliminate the influence of the original pose differences of the tiles on the bounding box calculations.

[0039] Example 3 This embodiment, based on Embodiment 1, provides a detailed explanation of the specific implementation of rounding and tolerance clustering.

[0040] Round the width and height of each device within each group to the nearest integer. The rounding rules are as follows: take the smaller of the width and height as the shorter side and round it up to the nearest hundred; take the larger of the width and height as the longer side and round it down to the nearest ten. The specific algorithm for rounding to the nearest hundred is: divide the original value by 100, round it up according to the rounding rule, and then multiply by 100. For example, if the original shorter side is 1758mm: 1758 ÷ 100 = 17.58, round it up to 18, and multiply by 100 to get 1800mm. The specific algorithm for rounding to the nearest ten is: divide the original value by 10, round it down according to the rounding rule, and then multiply by 10. For example, if the original long side is 2010mm: 2010÷10=201.0, round down to 201, and multiply by 10 to get 2010mm; if the original long side is 2019mm: 2019÷10=201.9, round down to 201, and multiply by 10 to get 2010mm.

[0041] Within the same group, devices with the same short side after rounding are grouped into the same short-side group. Within each short-side group, devices are arranged in ascending order of their long side after rounding, and devices with a long side deviation within a preset percentage threshold are grouped into the same cluster category. The preset percentage threshold is set to 5%. The deviation calculation formula is: Deviation = |Current device long side - Current cluster center value| / Current cluster center value × 100%.

[0042] The clustering uses a greedy sequential merging algorithm: within the same short-side group, after sorting by long-side in ascending order, the first cluster is created using the long side of the first device as the initial center value; subsequent devices are traversed in turn, if the deviation of the long side of the current device from the current cluster center value is less than 5%, it is assigned to the current cluster, and the center value is immediately updated with the weighted average of the long sides of all devices in the cluster; if the deviation reaches or exceeds 5%, the current clustering is stopped, and the next cluster is created using the long side of the device as the new center value; this process is repeated until all devices are classified.

[0043] It should be noted that, since the short sides are strictly identical during the clustering process, the short side of each cluster category is the common short side of all devices in that category; the center value of the long side is the weighted average of the long sides of all devices in that category. This center value is dynamically updated during the clustering process and eventually converges to the standard long side of that category.

[0044] For example, within a certain short-side group, the rounded long sides of the devices are 1600mm (occurring 5 times), 1650mm (occurring 3 times), 1720mm (occurring 2 times), and 1850mm (occurring once). Using 1600 as the initial center, if the deviation between 1650 and 1600 is 3.1% (<5%), the center is updated to (1600×5+1650×3) / 8=1618.75≈1620. If the deviation between 1720 and 1620 is 6.2% (≥5%), the current class is stopped, and a new class is created with 1720. If the deviation between 1850 and 1720 is 7.6% (≥5%), a new class is created again. Ultimately, the devices are classified into three categories: standard long sides 1620, 1720, and 1850.

[0045] After clustering is completed, the cluster labels are written back to the original structured data table. The write-back rules are as follows: the short side of the device after rounding is precisely matched with the short side for grouping, and the deviation between the long side after rounding and the cluster center value is within a preset threshold. The corresponding cluster labels are then written into the structured information of the device. At the same time, a clustering report is generated for modeling engineers to refer to and verify.

[0046] Example 4 This embodiment, based on embodiment 1, provides a detailed explanation of the specific implementation of standard size calculation and cluster label generation.

[0047] For each cluster, the short side of the cluster is used as the standard width, and the center value of the long side is used as the standard height. The center value of the long side is the weighted average of the rounded long sides of all devices within the cluster. This weighted average is dynamically updated during the greedy sequential merging process, and the final converged value is the standard long side of the cluster. The weighted average uses the frequency of each device appearing in the cluster as the weight. For example, if a cluster contains 8 devices, all with a rounded short side of 1000, and rounded long sides of 1600 (appearing 5 times) and 1650 (appearing 3 times), then the standard width is 1000, and the standard height = (1600×5 + 1650×3) / 8 = 1618.75 ≈ 1620 mm. If there are slight differences in the long sides of devices within the same cluster, the weighted average can more reasonably reflect the size center trend of the cluster.

[0048] The device type identifier is combined with the standard width and standard height in a preset format to generate cluster labels. The preset format is "device type identifier_standard width_standard height". For example, if the device type identifier is "L", the standard width is 1000, and the standard height is 1620, then the generated cluster label is "L_1000_1620". It should be noted that the dimensions in the cluster label are arranged in the order of "short side_long side", that is, standard width first and standard height second, consistent with the file naming rules of the 3D model library. This label will be directly used to find the corresponding named model file in the 3D model library. This embodiment calculates the standard dimensions by weighted averaging and rounding to the nearest hundredth, so that the representative dimensions of the cluster categories are closer to the distribution center of the actual device dimensions, avoiding the influence of extreme values ​​on the standard dimensions. The generated cluster labels adopt a unified format of "type_size1_size2", which is completely consistent with the file naming rules of the 3D model library, realizing direct mapping from CAD data to model files without the need for additional mapping configuration files or databases, resulting in a simple and efficient system architecture.

[0049] Example 5 This embodiment, based on embodiment 1, provides a detailed explanation of the spatial inclusion matching of text and graphics.

[0050] Spatial inclusion tests were performed on each of the individual numbered texts and the bounding boxes of all tiles to determine whether the position coordinates of each numbered text were within the geometric range defined by the bounding boxes of each tile. It should be noted that the bounding boxes of the tiles participating in the spatial inclusion test are axis-aligned bounding boxes in the world coordinate system, obtained by transforming the coordinates of each vertex based on the corresponding two-dimensional affine transformation matrix of each tile. Their width and height accurately reflect the actual projected size of the device on the horizontal plane, rather than the original size in the local coordinate system of the tile.

[0051] The position coordinates of the numbered text are taken as the coordinates of its insertion point; the geometric range defined by the bounding box of the tile refers to the closed area enclosed by the four sides of the bounding box, including the boundary. The spatial inclusion test is determined as follows: let the insertion point coordinates of the numbered text be (X_text, Y_text), and the range of the bounding box of the tile be X_min≤X≤X_max, Y_min≤Y≤Y_max. If X_min≤X_text≤X_max and Y_min≤Y_text≤Y_max, then the numbered text is contained within the bounding box of the tile.

[0052] It should be noted that when multiple bounding boxes contain the same numbered text, the numbered text is matched to the block with the smallest bounding box area, and the numbered text is determined as the device number corresponding to that block. This situation usually occurs when there is a nested relationship between device blocks and base blocks, such as a smaller device block superimposed on a larger base block. In this case, the numbered text may fall within the bounding boxes of two blocks simultaneously, and the block corresponding to the bounding box with the smallest area is selected for matching.

[0053] Furthermore, for numbered text contained within only one bounding box, the numbered text is directly associated with the block without additional checks. It should be noted that if the coordinates of a numbered text do not fall within the geometric area defined by any block bounding box, then the numbered text is determined to be unable to be associated with an existing equipment block. The system marks the numbered text as 'not matched' and records it in the log; subsequent processes will not process it. This type of situation typically corresponds to independent annotation text, legend descriptions, or non-equipment-related numbering information in CAD drawings; ignoring it will not affect the completeness and accuracy of the generated equipment layout.

[0054] The device number is combined with the width, height, and center point coordinates of the corresponding bounding box of the image block to form the structured information of the device corresponding to the image block. It is stored in the form of data rows, for example: device number "L1001", width 1800, height 2000, center point X coordinate 15000, center point Y coordinate 32000.

[0055] The matching process does not rely on the block's own name attribute. That is, this solution does not require block names in CAD drawings to be standardized as equipment numbers; even if a block's name is random or without any pattern, as long as there are standardized independent numbered characters within or near it, the system can correctly identify it through spatial inclusion relationships. This feature significantly reduces reliance on CAD drawing specifications and improves the solution's versatility and robustness.

[0056] This embodiment automatically matches numbered text with blocks based on spatial inclusion relationships, rather than relying on the block's own name attribute for identification. This fundamentally solves the problem of recognition failure caused by non-standard block naming in CAD drawings. The minimum area priority matching strategy effectively handles nested block scenarios, ensuring that numbered text is correctly assigned to equipment blocks rather than base blocks. This semantic recognition engine enables the system to accurately establish a one-to-one correspondence between blocks and equipment numbers without manual intervention, providing key technical support for fully automated layout generation.

[0057] Example 6 This embodiment, based on Embodiment 1, provides a detailed explanation of the spatial transformation of the three-dimensional model.

[0058] The base point of the 3D model is moved to a 3D spatial position corresponding to the X and Y coordinates of the center point of the bounding box. In the 3ds Max coordinate system, the X and Y axes are typically used as the horizontal coordinate axes, and the Z axis as the height axis. The base point of the model is translated to (X_center, Y_center, Z_temp), where X_center and Y_center are the coordinates of the center point of the bounding box.

[0059] The Z-axis position of the 3D model is set to a preset ground plane height plus half of the model's own height, so that the bottom of the 3D model rests on the ground plane. The ground plane height is preset according to project requirements, usually set to Z=0. The model's own height is obtained by reading the bounding box or geometric vertex information of the model file. Let the model's own height be H_model and the ground plane height be Z_ground, then the final Z coordinate of the model is Z_ground + H_model / 2. For example, if the ground plane is set to 0 and the model height is 2000mm, then the Z coordinate of the model's base point is set to 1000mm, so that the bottom of the model is exactly flush with the ground plane.

[0060] The width and height of the bounding box in the structured information of the device are compared. When the width of the bounding box is less than the height of the bounding box, the 3D model is rotated 90 degrees around the vertical axis of the 3D space. The vertical axis is the Z-axis in 3ds Max.

[0061] The rotation operation is used to adjust the model orientation: Models in the 3D model library are stored with their height greater than or equal to their width. If the width of a block in the CAD drawing is less than its height, it means that the device is placed vertically in the CAD layout. In this case, rotating the model 90 degrees around the Z-axis will align the model orientation with the drawing orientation. When the width is greater than or equal to the height, no rotation is performed because the default orientation of the model in the model library is already consistent with the drawing orientation.

[0062] This embodiment achieves precise placement of the 3D model in the scene through translational alignment based on the bounding box center point and the model's base point, bottom alignment based on the ground plane height and the model's height, and automatic rotation determination based on width-to-height comparison. Compared to the imperceptible positional and angular deviations that occur with manual dragging and alignment, this method achieves alignment accuracy at the level of basic units in modeling software, providing a reliable 3D scene foundation for subsequent collision detection and simulation analysis. The bottom alignment mechanism ensures that the bottom surfaces of all device models are on the same horizontal plane, avoiding visual errors such as floating or sinking into the ground.

[0063] Example 7 This embodiment adds a detailed description of the incremental update mechanism based on Embodiment 1.

[0064] For details, please refer to Figure 4 After the initial 3D scene generation is completed, a state snapshot is saved. This state snapshot contains the mapping relationships between each 3D model loaded into the 3D scene and its corresponding tiles, as well as the coordinates of the bounding box center point, width, and height of each tile. The state snapshot also records the CAD file path and modification time, the mapping table version used, the unique identifier of each generated model instance, and its corresponding CAD tile handle and location information. The state snapshot is stored locally as a structured data file, such as JSON format.

[0065] The system receives an update command for the 2D CAD drawing data. This update command is triggered by the user through a preset interface button in the 3D modeling software. Upon triggering, the system reloads the specified CAD drawing file and executes the same block extraction and text matching process as the initial generation, obtaining updated structured information for each device. The structured information for each device obtained by re-parseing the updated CAD drawing data is then compared with the status snapshot.

[0066] If a device is identified that exists in the current analysis result but not in the state snapshot, it is determined to be a newly added device. A 3D model matching the newly added device is loaded from the 3D model library, and the translation and selective rotation are performed based on the structured information of the newly added device. Newly added devices typically correspond to newly drawn device blocks in CAD drawings.

[0067] If a device is identified that exists in the state snapshot but not in the current parsing result, it is determined to be a deleted device, and the corresponding 3D model loaded into the 3D scene is removed. The removal operation includes deleting the model node and all its child nodes from the 3D scene.

[0068] If a device is identified that exists in both the current analysis result and the state snapshot, but differs in at least one of its bounding box center point coordinates, width, or height, it is determined to be a changed device. Based on the changed bounding box center point coordinates, width, and height, the translation and selective rotation are re-executed on the corresponding 3D model already loaded into the 3D scene. Changed devices typically correspond to device blocks in CAD drawings whose position has moved or whose dimensions have been adjusted. For block instances with the same handle but changed position or angle information, the system only updates the transformation matrix of the corresponding model; there is no need to reload the model file. For most unchanged models, their original state remains unchanged, requiring no further action.

[0069] This embodiment addresses the pain point of traditional solutions requiring complete reconstruction of the 3D scene after changes to CAD drawings through an incremental update mechanism that uses state snapshots and difference comparisons. The system automatically identifies newly added, deleted, and modified devices, performing corresponding operations only on the differing parts, while leaving most unchanged models untouched. This mechanism reduces the response time of design iteration from tens of times that of global reconstruction to processing only the changed parts, enabling the 3D scene to respond quickly to design modifications in CAD drawings and achieving an efficient iterative closed loop of modification-synchronization. Simultaneously, the state snapshot also records information such as the mapping table version, facilitating traceability and auditing.

[0070] Example 8 This embodiment, based on Embodiment 1, provides a detailed explanation of the retrieval and loading strategy for 3D models.

[0071] For specific implementation details, please refer to [link / reference]. Figure 3 The system searches the 3D model library for model files whose filenames correspond to the clustering labels. For example, if the device clustering label is "L_1000_1600", the system will search for the model file named "L_1000_1600.max". The search path defaults to the user-preset root directory of the 3D model library, and the system recursively searches within the root directory and its subfolders.

[0072] If a corresponding model file is found, it is used as the matching file. If no corresponding model file is found, among the model files of the same device type, the model file whose standard size differs from the standard size in the cluster label within a preset tolerance range is selected as the matching file. A model file of the same device type refers to a model file whose filename begins with the same letter as the device type identifier in the cluster label. The standard size difference is calculated as follows: the standard width and standard height are parsed from the candidate model file's filename, and the absolute differences between these values ​​and the standard width and standard height in the cluster label are calculated. When both the width and height differences are within the preset tolerance range, the candidate file is selected. The preset tolerance range is 50mm, i.e., width difference ≤ 50mm and height difference ≤ 50mm. If multiple candidate files meet the condition, the file with the smallest total difference (width difference + height difference) is selected. This tolerance matching mechanism allows the model library to automatically match the closest standard model even if the device size differs slightly, without needing to include models of all possible sizes.

[0073] For the matched file, determine whether it has been imported into the 3D scene. The determination method is to search for the file path of the matched file in the system-maintained list of imported files.

[0074] If the matching file has not been imported into the 3D scene, a merge import operation is performed on the matching file to import it into the 3D scene, and the group structure information of the matching file is recorded.

[0075] Specifically, the merge import operation calls the merge import interface of the 3D modeling software to import all geometry, materials, and group hierarchy structures from the model file into the current scene.

[0076] Furthermore, the group structure information records whether the top-level object of the model file is a group object, and whether there are nested group objects within the group. Specifically, the group structure information includes three types: no group structure (the model consists of independent editable polygon objects), single-level group structure (the model consists of a top-level group object and several direct child objects, and the child objects do not contain groups), and nested group structure (the model contains multiple levels of groups, that is, there are still groups within the child objects of the groups).

[0077] If the matched file has already been imported into the 3D scene, the recorded group structure information of the matched file is read. If the group structure information contains nested groups, the merge import operation is re-executed. This is because the internal structure of nested groups is complex, and directly copying existing instances from the scene and reorganizing them may lead to the loss or disorder of hierarchical relationships. Re-merging and importing ensures the integrity and correctness of the model structure. For model files containing nested groups that are used again after the first use, the merge import is re-executed each time. Although this is slightly slower, it ensures the stability and reliability of the structure.

[0078] When the group structure information is a single-layer group or no group, the model already in the 3D scene of the matching file is copied and reassembled according to the original group structure. For models without a group structure, all sub-objects are directly copied while maintaining their relative positions; for models with a single-layer group structure, all sub-objects within the group are copied, a new group object with the same name is created, and the copied sub-objects are added to the group. Simultaneously, the Z-axis position is corrected based on the bottom offset recorded during the initial merge to ensure that the bottom of the copied and reassembled model remains precisely aligned with the ground plane.

[0079] For specific implementation, please refer to the following code: text else ( -- First time encountering this file: merge and analyze if there are groups mergeMAXFile matchedFile #select #mergeDups #useSceneMtDups ... if groupHead != undefined then ( hasGroup = true originalGroupName = groupHead.name members = groupHead.children hasNested = hasNestedGroup groupHead if not hasNested then templateData = members -- an array of members of a simple group else templateData = undefined -- nested group, members not cached offsetZ = groupHead.pos.z - groupHead.min.z -- Record the bottom offset else ( hasGroup = false templateData = roots -- an array of ungrouped top-level objects offsetZ = 0.0 ) cache[matchedFile] = #(hasGroup, hasNested, templateData, offsetZ,originalGroupName) ) This embodiment maximizes model reuse efficiency while ensuring model matching accuracy and structural integrity through a two-level retrieval strategy prioritizing precise matching and a fallback strategy of tolerance matching, as well as a hierarchical instantiation strategy of initial merging and importing followed by differentiated loading. The 50mm tolerance matching mechanism provides the model library with moderate fault tolerance, reducing reliance on the completeness of the model library size. The differentiated loading strategy based on group structure information uses a copy-and-reorganize approach for simple models and a re-merging and import approach for complex nested group models, balancing loading efficiency and structural stability. The bottom offset correction mechanism ensures that the copied and reorganized model remains precisely positioned on the ground plane in the Z-axis direction.

[0080] It should be noted that after the above model file is loaded into the 3D scene, if the size of the model file differs from the standard size in the cluster labels, size adaptation processing needs to be performed. The specific implementation method is described in the following embodiments.

[0081] Example 9 This embodiment, based on Embodiments 1 and 8, provides a detailed explanation of the size adaptation process performed after the 3D model is loaded and before spatial transformation. The core task of the size adaptation process is to automatically adapt the standard specification models stored in the 3D model library to the target size specified by the clustering label, avoiding layout deviations caused by the model size not matching the drawing size, while maintaining the integrity of the original structure and appearance of the model to the greatest extent possible.

[0082] The size adaptation process specifically includes the following steps: The first step is vertex deformation based on reference objects (intelligent non-uniform scaling). Rigid and flexible regions defined by user-preset reference lines are obtained in the 3D model. These reference lines are auxiliary line objects pre-marked in the model file, used to define key structural areas in the model that must not be deformed. For example, in a conveyor model, areas such as the motor mounting base and control box base are marked as rigid regions, while the conveyor belt frame area is marked as a flexible region. When stretching or compressing the model along its length is required, the algorithm only performs non-uniform scaling on the mesh vertices within the flexible regions, while the mesh vertices within the rigid regions remain in their original positions. Specifically, the vertex sets on both sides of the reference lines are obtained, the scaling ratio between the target size and the current size is calculated, and this scaling ratio is applied only to the vertex coordinates of the flexible regions, ensuring that the overall model size reaches the target value while the core functional structures retain their original shape.

[0083] The second step is connected component analysis, used to automatically identify repeatable parts in the 3D model (such as rollers and chain links in a conveyor). The mesh data of the 3D model is obtained, and the `polyOp.getElementsUsingFace` function is used to obtain a set of unconnected continuous faces on the mesh, with each set of continuous faces representing an independent part. Each independent part is iterated through, and the dimensional proportions of its 3D bounding box in the X, Y, and Z axes are calculated. If a part's 3D bounding box meets a preset proportion condition—that is, its dimension along the model's length (Y-axis) is the longest, and its dimensions in the two dimensions perpendicular to the length (X-axis and Z-axis) are similar (the difference is within a preset proportion range)—then the part is identified as a repeatable part. Taking a roller conveyor as an example, the algorithm automatically identifies each roller part in the model in this way, without requiring manual specification.

[0084] The third step involves dynamic array rearrangement and equidistant interpolation, used to automatically adjust the number and spacing of repeatable parts based on the target size. The target number of repeatable parts is calculated based on the target size and the preset standard spacing. The formula for calculating the target number is: Target Number = Target Size ÷ Standard Spacing, with the result rounded to the nearest integer. If the target number is greater than the current number, an increase operation is performed; if the target number is less than the current number, a deletion operation is performed. It is important to note that the deletion operation uses a one-time collection strategy: first, all faces of the part to be deleted are traversed, and their face indices are collected into the same set; then, all faces in this set are deleted at once, avoiding the face index disorder caused by iterative deletion. After the increase and decrease operations are completed, the equidistant distribution spacing is calculated based on the target size and the new number of parts, and the positions of all repeatable parts are rearranged using linear interpolation to ensure consistent spacing between adjacent parts.

[0085] For example, a standard roller conveyor model stored in a 3D model library has a total length of 2000mm, contains 10 rollers, and the spacing between adjacent rollers is 200mm. The clustering label requires a target total length of 3500mm. The algorithm automatically identifies the 10 roller components in the model through connected component analysis; calculates the target number of rollers = 3500 ÷ 200 = 17.5 ≈ 18; performs an addition operation, adding 8 new rollers; then rearranges all 18 rollers at equal intervals of 3500 ÷ 18 ≈ 194.4mm to ensure uniform spacing. Throughout the process, rigid areas such as the motor remain unchanged, only the frame area and roller distribution change.

[0086] Through the above three steps, the 3D model is precisely adapted to the standard size specified by the clustering label while maintaining the integrity of the core structure, providing a dimensionally accurate model foundation for subsequent translation and selective rotation spatial transformations.

[0087] Example 10 Please see Figure 5 This embodiment provides an automated 3D layout generation system based on CAD base maps and a 3D model library, used to execute the method described in any of the above embodiments. The system is integrated into 3D modeling software as a plug-in and includes an acquisition module, a first processing module, a second processing module, a third processing module, and a fourth processing module.

[0088] The acquisition module 10 is used to acquire 2D CAD drawing data and extract blocks and independent numbered text from it. This module calls the CAD data reading interface to load the drawing, traverses the block table and text entity table, and extracts the block reference objects representing the equipment and the numbered text that conforms to the naming rules, respectively.

[0089] The first processing module 20 calculates the width, height, and center point coordinates of each tile's bounding box, and assigns a matching device number to the tile based on spatial inclusion relationships, obtaining structured information including the device number, bounding box size, and center point coordinates. This module performs the normalization preprocessing described in Example 2 and the spatial inclusion matching described in Example 5.

[0090] The second processing module 30 is used to group by device type, round down and perform tolerance clustering on the dimensions, calculate the standard dimensions, and generate cluster labels. This module performs the rounding clustering described in Example 3 and the standard dimension calculation and label generation described in Example 4.

[0091] The third processing module 40 is used to retrieve and load matching 3D models from the 3D model library based on clustering labels. This module executes the file retrieval, tolerance matching, and differential loading strategies described in Example 8.

[0092] The fourth processing module 50 is used to perform spatial transformations of translation and selective rotation on the loaded 3D model based on the coordinates of the bounding box center point, width, and height. This module performs the base point translation, bottom alignment, and orientation rotation operations described in Example 6.

[0093] Information is exchanged between modules through a unified data structure: the tile list and text list output by the acquisition module are passed to the first processing module; the structured data output by the first processing module is passed to the second processing module; the structured data with clustering labels output by the second processing module is passed to the third processing module; and the 3D model loaded by the third processing module is passed to the fourth processing module to complete the spatial transformation. The system also includes an incremental update module, which performs the state snapshot saving and difference comparison update described in Example 7.

[0094] Beneficial effects: This system integrates CAD parsing, semantic recognition, clustering matching, model loading, and spatial transformation into a unified process through a modular architecture. Users only need to specify the CAD drawing path and model library path to automatically generate 3D scenes with a single click. The functional boundaries of each module are clearly defined, facilitating maintenance and expansion.

[0095] In the description of this specification, the references to "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0096] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.< / minscore>

Claims

1. An automated 3D layout generation method, characterized in that, The method includes: Acquire two-dimensional CAD drawing data; and extract blocks and independent numbered text from the two-dimensional CAD drawing data; wherein the two-dimensional CAD drawing data contains one or more devices; each device is defined as a single block in the CAD drawing, and the block is defined by a bounding box. For each of the aforementioned tiles, the vertex coordinates of all geometric primitives within the tile are traversed. Based on the corresponding two-dimensional affine transformation matrix, the coordinates of each vertex are transformed to the world coordinate system. The width, height, and center point coordinates of the bounding box of the tile are calculated based on the transformed vertex coordinates. Then, through the spatial inclusion relationship between the bounding box and the numbered text, a corresponding device number is matched for the tile to obtain the structured information of the device corresponding to the tile. The structured information includes: device number, bounding box width, bounding box height, and bounding box center point coordinates. The devices are grouped according to the identifier representing the device type in the device number; the width and height of the bounding box corresponding to each device in each group are rounded up as the width and height of the device, and tolerance clustering is performed based on the rounded dimensions, and devices with size deviations within a preset threshold are grouped into the same cluster category; a standard dimension is calculated for each cluster category and a cluster label is generated; the cluster label includes the device type identifier and the standard dimension; For each of the aforementioned devices, using the clustering tags of the devices, a 3D model matching the clustering tags of the devices is retrieved from the 3D model library and loaded; if at least one dimension of the loaded 3D model is inconsistent with the bounding box dimension corresponding to the structured information of the device, then a size adaptation process is performed on the 3D model; wherein, all models in the 3D model library have a base point uniformly set at their geometric center; Based on the center point coordinates, width, and height of the bounding box corresponding to the device, the loaded 3D model is spatially transformed so that the position and orientation of the 3D model in the 3D scene are consistent with the blocks in the 2D CAD drawing data; wherein, the spatial transformation is achieved through translation and selective rotation.

2. The method according to claim 1, characterized in that, After extracting blocks and independent numbered text from the 2D CAD drawing data, and before calculating the width, height, and center point coordinates of the bounding box for each block, the method further includes: For each extracted tile, the center point of the tile is moved to the geometric center of the tile, and the rotation angle of the tile is reset to zero.

3. The method according to claim 1, characterized in that, The width and height of the bounding box corresponding to each device within each group are rounded down to the device's width and height. Tolerance clustering is then performed based on the rounded dimensions, grouping devices with dimensional deviations within a preset threshold into the same cluster category, including: The smaller of the width and height of each device in each group is taken as the short side and rounded up to the nearest hundred; the larger of the width and height is taken as the long side and rounded down to the nearest ten. Within the same group, devices with the same short side after rounding are grouped into the same short side group; within each short side group, they are sorted in ascending order by the long side after rounding, and adjacent devices with long side deviations within a preset percentage threshold are sequentially merged into the same cluster category. After each merge, the center value of the cluster is updated with the weighted average of the long side of the merged category, and the deviation is compared with the next device based on the updated center value until the deviation exceeds the preset percentage threshold, at which point the current clustering stops and a new category is created.

4. The method according to claim 1, characterized in that, The process of calculating standard dimensions and generating cluster labels for each cluster category includes: For each cluster category, the short side of the category is used as the standard width, and the center value of the long side of the category is used as the standard height, where the center value of the long side is the weighted average of the rounded long sides of all devices in the category. The device type identifier is combined with the standard width and standard height in a preset format to generate cluster labels.

5. The method according to claim 1, characterized in that, The step of matching the corresponding device number to the image block based on the spatial inclusion relationship with the numbered text, and obtaining the structured information of the device corresponding to the image block, includes: Spatial containment tests are performed on all independent numbered texts and the bounding boxes of all tiles one by one to determine whether the position coordinates of each numbered text are within the geometric range defined by the bounding boxes of each tile; wherein, the bounding box of the tile is the bounding box in the world coordinate system obtained by performing coordinate transformation on the coordinates of each vertex based on the two-dimensional affine transformation matrix corresponding to the tile. When multiple bounding boxes contain the same number text, the number text is matched to the block with the smallest bounding box area, and the number text is determined as the device number corresponding to that block. The device number is combined with the width, height, and center point coordinates of the bounding box of the corresponding block to form the structured information of the device corresponding to the block.

6. The method according to claim 1, characterized in that, The step of performing a spatial transformation on the loaded 3D model based on the center point coordinates, width, and height of the bounding box corresponding to the device, so that the position and orientation of the 3D model in the 3D scene are consistent with the corresponding blocks in the CAD drawing, includes: Move the base point of the 3D model to a 3D spatial position corresponding to the X and Y coordinates of the center point of the bounding box; Set the Z-axis position of the 3D model to a preset ground plane height plus half the height of the 3D model itself; The width and height of the bounding box in the structured information of the device are compared. When the width of the bounding box is less than the height of the bounding box, the three-dimensional model is rotated 90 degrees around the vertical axis of the three-dimensional space. Otherwise, no rotation is performed.

7. The method according to claim 1, characterized in that, Also includes: After the initial 3D scene generation is completed, a state snapshot is saved. The state snapshot includes the mapping relationship between each 3D model loaded into the 3D scene and its corresponding tile, as well as the coordinates of the center point of the bounding box of each tile, its width, and its height. Receive an update instruction for the two-dimensional CAD drawing data, and compare the structured information of each device obtained by re-parse the updated CAD drawing data with the status snapshot; If a device is identified that exists in the current analysis result but does not exist in the state snapshot, it is determined to be a new device. A 3D model matching the new device is loaded from the 3D model library, and the translation and selective rotation are performed according to the structured information of the new device. If a device is identified that exists in the state snapshot but does not exist in the current analysis result, it is determined to be a deleted device, and the 3D model corresponding to the deleted device that has been loaded into the 3D scene is removed. If a device is identified that exists in both the current analysis result and the state snapshot, but its bounding box center point coordinates, width, or height are different, it is determined to be a changed device. Based on the changed bounding box center point coordinates, width, and height, the translation and selective rotation are re-executed on the 3D model that has been loaded into the 3D scene corresponding to the changed device.

8. The method according to claim 1, characterized in that, The step of retrieving and loading 3D models that match the clustering tags of the device from a 3D model library using the clustering tags of the device includes: Search the 3D model library for model files whose filenames correspond to the clustering labels; If a corresponding model file is found, then that model file is used as the matching file; If no corresponding model file is found, then among the model files of the same device type, select the model file whose standard size differs from the standard size in the cluster label within a preset tolerance range as the matching file; For the matched file, determine whether it has been imported into a 3D scene; If the matching file has not been imported into the 3D scene, a merge import operation is performed on the matching file to import it into the 3D scene, and the group structure information of the matching file is recorded; wherein, the group structure information of the matching file includes: the group structure information of the matching file; If the matching file has been imported into the 3D scene, then read the group structure information of the recorded matching file; If the group structure information contains nested groups, re-execute the merge import operation; When the group structure information is a single-layer group or no group, copy the model of the matching file that is already in the 3D scene and reorganize it according to the original group structure.

9. The method according to claim 1, characterized in that, If at least one dimension of the loaded 3D model is inconsistent with the bounding box dimension corresponding to the structured information of the device, then a size adaptation process is performed on the 3D model, including: Obtain the rigid and flexible regions defined by user-preset reference lines in the 3D model; when it is necessary to stretch or compress the 3D model in the length direction, only perform non-uniform scaling on the mesh vertices in the flexible region, while the mesh vertices in the rigid region remain in their original positions; The repeatable parts in the 3D model are identified by connected component analysis. The connected component analysis includes: acquiring the mesh data of the 3D model, decomposing the 3D model into several sets of continuous faces that are not connected to each other using face connectivity, with each set of continuous faces being an independent part; calculating the ratio of the 3D bounding box of each independent part, and identifying the parts in the 3D bounding box that meet the preset ratio conditions as repeatable parts. Calculate the target number of repeatable parts based on the target size, and perform add / delete operations on the repeatable parts based on the target number; after the add / delete operations are completed, rearrange the repeatable parts by equidistant interpolation according to the target size.

10. An automated 3D layout generation system, applied to the automated 3D layout generation method according to any one of claims 1-9, characterized in that, include: The acquisition module is used to acquire 2D CAD drawing data; And extract blocks and independent numbered text from the two-dimensional CAD drawing data; wherein the two-dimensional CAD drawing data contains one or more devices; each device is defined as a single block in the CAD drawing, and the block is defined by a bounding box to define its geometric extent; The first processing module is configured to, for each of the aforementioned tiles, traverse the vertex coordinates of all geometric primitives within the tile, perform coordinate transformation on each vertex coordinate based on the two-dimensional affine transformation matrix corresponding to the tile, so as to transform each vertex coordinate to the world coordinate system; calculate the width, height, and center point coordinates of the bounding box of the tile based on the transformed vertex coordinates, and match the corresponding device number for the tile through the spatial inclusion relationship between the bounding box of the tile and the numbered text, thereby obtaining the structured information of the device corresponding to the tile; the structured information includes: device number, width of the bounding box, height of the bounding box, and center point coordinates of the bounding box; The second processing module is used to group the devices according to the identifier representing the device type in the device number; round the width and height of the bounding box corresponding to each device in each group as the width and height of the device, and perform tolerance clustering based on the rounded dimensions, classifying devices with size deviations within a preset threshold into the same cluster category; calculate the standard size for each cluster category and generate a cluster label; the cluster label includes the device type identifier and the standard size; The third processing module is used to retrieve and load a 3D model that matches the clustering label of the device from the 3D model library for each device; if at least one dimension of the loaded 3D model is inconsistent with the bounding box dimension corresponding to the structured information of the device, then size adaptation processing is performed on the 3D model; wherein, all models in the 3D model library have a base point uniformly set at their geometric center. The fourth processing module is used to perform spatial transformation on the loaded 3D model according to the center point coordinates, width and height of the bounding box corresponding to the device, so that the position and orientation of the 3D model in the 3D scene are consistent with the blocks of the 2D CAD drawing data; wherein, the spatial transformation is achieved by translation and selective rotation.