Method for automatically generating civil engineering BIM model based on CAD drawing of graph neural network

Through the graph neural network, the CAD drawings are analyzed, and the symbols of building components are automatically identified and classified, which solves the problems of low efficiency and high cost in the existing BIM modeling methods, and realizes efficient and accurate civil engineering BIM model generation, supporting the rapid construction of construction engineering informationization and urban information models.

CN120449268APending Publication Date: 2025-08-08NANJING NORMAL UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510544478.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing BIM modeling methods rely on manual interpretation and knowledge rule base, resulting in low modeling efficiency and high cost, difficult to adapt to the rapid production needs of large-scale building information models, and difficult to deal with CAD drawings of different formats and standards.

Method used

The graph neural network is used to analyze CAD drawings, identify building component symbols and extract information, combine deep learning and knowledge rule constraints, and build automated building engineering CAD drawing analysis technology through the graph neural network model to realize high accuracy automatic classification and three-dimensional model generation of building component symbols.

Benefits of technology

It improves the intelligence level of BIM model generation, reduces manual intervention and system maintenance costs, and realizes efficient and accurate automatic construction of civil engineering BIM models, supporting the rapid construction of construction engineering information and urban information models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0005380322590000093
    Figure BDA0005380322590000093
  • Figure BDA0005380322590000111
    Figure BDA0005380322590000111
  • Figure BDA0005380322590000141
    Figure BDA0005380322590000141
Patent Text Reader

Abstract

The invention relates to a method for automatically generating a civil engineering BIM model through a CAD drawing based on a graph neural network. The method comprises the steps of building engineering CAD drawing information analysis and BIM model generation. The construction engineering CAD drawing information analysis is used for analyzing a construction engineering CAD drawing based on a graph neural network method, identifying a building component symbol and extracting related information, and specifically comprises the steps of constructing a graph neural network model and analyzing the CAD drawing based on the graph neural network model; in the BIM model generation stage, based on the extracted building component information, different reconstruction strategies are adopted for different types of building components. According to the method, an automatic constructional engineering CAD drawing analysis technical route combining deep learning driving and knowledge rule constraint is constructed, building component symbol primitive semantic extraction is carried out based on the graph neural network, high-accuracy building component symbol primitive automatic classification is achieved, a topological structure surface and spatial clustering method is introduced, and the construction efficiency is improved. And an automatic, efficient and high-stability building component instance segmentation task is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for automatically generating a civil engineering BIM model, and in particular to a method for automatically generating a civil engineering BIM model from a CAD drawing based on a graph neural network. Background Art

[0002] BIM technology is a core area of information technology development in the construction industry, playing a vital role in building design, construction management, and operations and maintenance. The core of BIM lies in the digital construction of high-precision, interactive three-dimensional building models to support information management throughout the building lifecycle. However, the efficient acquisition of BIM data remains a key technical challenge in the industry.

[0003] Currently, the generation of BIM data primarily relies on manual modeling. This involves manually creating three-dimensional components based on architectural design drawings and then completing the modeling within specialized BIM software. This approach offers high modeling accuracy and can meet the needs of representing complex building structures. However, it suffers from low modeling efficiency, high labor costs, and a strong reliance on specialized skills, making it difficult to adapt to the rapid production of large-scale building information models. Consequently, automated BIM modeling technology based on existing architectural design drawings has become a research hotspot.

[0004] CAD drawings for architectural projects are an important data source for BIM data generation, and include various forms of expression such as building plans, elevations, and sections. These drawings carry the three-dimensional information of the building in a two-dimensional form, and use graphic symbols to represent actual building components such as walls, columns, doors, windows, stairs, etc. However, traditional BIM modeling methods for CAD drawings rely on a large amount of manual interpretation and the construction of a knowledge rule base. Due to the complex layer organization of CAD drawings and the non-uniform expression of component graphics, existing methods face great challenges in the process of information extraction and graphic classification, resulting in a large amount of manual intervention in the modeling process. In addition, the knowledge rule-based modeling method has high maintenance costs and is difficult to adapt to CAD drawings of different formats and standards, which limits the degree of automation of BIM modeling.

[0005] In recent years, with the development of artificial intelligence (AI) technology, intelligent modeling methods based on deep learning have garnered widespread attention. Graph Neural Networks (GNNs) have advantages in processing graph-structured data and can be used to analyze the topological relationships and semantic information of building components in CAD drawings, providing a new solution for automated BIM modeling. Therefore, researching a GNN-based automated BIM modeling technique for CAD drawings, which reduces the need for manual intervention and improves modeling efficiency, has important engineering applications. Summary of the Invention

[0006] Purpose of the invention: The purpose of the present invention is to propose a method for automatically generating civil engineering BIM models from CAD drawings based on graph neural networks, so as to improve the intelligence level and modeling efficiency of BIM model generation.

[0007] Technical solution: The present invention includes: construction project CAD drawing information analysis and BIM model generation; the construction project CAD drawing information analysis is to analyze the construction project CAD drawings based on a graph neural network method, identify building component symbols and extract relevant information, specifically including graph neural network model construction and CAD drawing analysis based on the graph neural network model; BIM model generation is based on the extracted building component information, and adopts different reconstruction strategies for different types of building components.

[0008] The graph neural network model construction specifically includes:

[0009] Specify sample labels;

[0010] Construct the model input layer, use two separate multi-layer perceptrons MLP to receive the initial node features V and edge features E respectively, and stack them separately into and The two MLP structures of the input layer are the same;

[0011] The GATv2 stacking layer of the model is constructed. The initial GATv2 layer receives the stacked node features V′ and edge features E′, and each subsequent GATv2 layer receives the node features and edge features output by the previous GATv2 layer.

[0012] The CAD drawing parsing based on the graph neural network model specifically includes:

[0013] Split a single architectural drawing file containing multiple drawing sheets into individual drawing sheets;

[0014] For all the planar map sheets obtained by cutting the drawing, select points with the same vertical position as the registration points, and adjust the position of each planar map sheet by horizontal translation;

[0015] Based on the elevation or section drawings, confirm the height information of each floor of the building;

[0016] Explode all drawing entities contained in each plan view sheet multiple times until only basic entities remain.

[0017] For each exploded plan view, extract the geometric properties of all basic elements and calculate the topological connection relationship between each element;

[0018] For each exploded planar image, an undirected graph is generated with each primitive as a node and the topological connections between primitives as edges. The characteristics of each graph node include the type and geometric properties of the primitive corresponding to the node, and the characteristics of each graph edge include the type and properties of the topological connection corresponding to the edge.

[0019] For each undirected graph corresponding to a floor plan, input it into the constructed graph neural network model and output the building component type classification results of all nodes;

[0020] Mapping the node classification results of the undirected graph back to the plane map corresponding to the undirected graph to obtain the building component type classification results of all the elements;

[0021] For elements classified as walls or columns, the left-turn closed topological faceting algorithm is applied to obtain a complete symbolic representation of the wall or column;

[0022] For the graphics elements that are not classified as walls or columns, they are discretized into dense points, and the relationship between the graphics elements and the discrete points is recorded. The spatial clustering algorithm is applied to the discrete points to obtain multiple point clusters.

[0023] Taking multiple point clusters as aggregation targets, based on the relationship between primitives and discrete points, the cluster with the most discrete points corresponding to each primitive is taken as its aggregation target, and all primitives are aggregated to obtain a complete building component symbol.

[0024] When constructing the GATv2 stacking layer of the model, the GATv2 version of the graph attention network is used as the backbone of the graph neural network model.

[0025] The BIM model generation specifically includes: modeling for wall and column components, modeling for door and window components, modeling for stair components, modeling for floor components and hole structures, and modeling for roof components.

[0026] The modeling of wall column components specifically includes:

[0027] For each plan drawing sheet that has been parsed using CAD drawings, obtain all building component symbols of the wall or column type;

[0028] For each complete component symbol of a wall or column, its plane shape is used as the stretching object, the elevation of the floor where it is located is used as the stretching starting point, and the floor height is used as the stretching amount. The symbol is stretched in the vertical direction to obtain the corresponding wall or column model.

[0029] The modeling of door and window components specifically includes:

[0030] Step 1: For each plan drawing sheet that has been parsed by CAD drawings, obtain all building component symbols of the wall or column type;

[0031] Step 2: For each door or window complete component symbol, generate its overall bounding box shape;

[0032] Step 3: Based on the component symbols of all walls and columns that have been obtained, retrieve the two closed polygons that are closest to the bounding box generated in step 2;

[0033] Step 4: Based on the line segments e0 and e1 that intersect the two closed polygons obtained in step 3 and the bounding box in step 2, determine whether the lines on which they lie are parallel or perpendicular. If they are parallel, execute steps 5 to 6; if they are perpendicular, execute step 7.

[0034] Step 5: Take the two endpoints p0 and p1 of e0 and the two endpoints p2 and p3 of e1 in step 4, project p0 and p1 onto the line where e1 is located, and the projection points are p′0 and p′1 respectively. Project p2 and p3 onto the line where e0 is located, and the projection points are p′2 and p′3 respectively. Take the two closest points among p0, p1, p′2 and p′3 to form the line segment e′0, and take the two closest points among p2, p3, p′0 and p′1 to form the line segment e′1.

[0035] Step 6: Reset the two endpoints of e′0 to p0 and p1 and the two endpoints of e′1 to p2 and p3, and connect p0 and p2 to form a line segment e 02 , connect p1 and p3 to form line segment e 13 , if e 02 With e 13 If they intersect, connect the points in the order of p0p1p2p3p0 to construct a polygon and output it. Otherwise, connect the points in the order of p0p1p3p2p0 to construct a polygon and output it, which is the simplified door or window component symbol.

[0036] Step 7: Take the two endpoints p0 and p1 of e0 and the two endpoints p2 and p3 of e1, and connect p0 and p2 to form line segment e 02 , connect p1 and p3 to form line segment e 13 , construct straight lines l0 and l1 through p0 and p1 perpendicular to e0, respectively, construct straight lines l2 and l3 through p2 and p3 perpendicular to e1, respectively, if e 02 With e 13 Intersect, take the intersection of l1 and l2, the intersection of l3 and l0 as p 12 and p 30 , with p0p1p 12 p2p3p 30 Connect the points in the order of p0 to construct a polygon and output it. Otherwise, take the intersection of l1 and l3, and the intersection of l2 and l0 as p respectively. 13and p 20 , with p0p1p 13 p3p2p 20 Connect the points in order of p0 to construct a polygon and output it, which is the simplified door or window component symbol;

[0037] Step 8: Get the simplified symbol of the door or window obtained in step 6 or step 7, use its plane shape as the stretching object, use the specified height of the door or window as the stretching height, and stretch it in the vertical direction to obtain the corresponding door or window model.

[0038] The modeling of stair components specifically includes:

[0039] Step 1: For each plan view after CAD drawing analysis, obtain all building component symbols of the staircase type;

[0040] Step 2: Traverse the complete component symbol of each staircase, count the lengths of all line segments within a single symbol, take out the line segments with the largest number of the same lengths, and obtain the midpoint set P of these line segments mid ;

[0041] Step 3: Take the midpoint set P obtained in step 2 mid , use the RANSAC algorithm to fit several straight lines, and calculate the number of points contained in each straight line. mid All the points in the group are grouped to obtain n point sets, P0, P1, ..., P n ;

[0042] Step 4: Loop through P0, P1, ..., P obtained in step 3 n , execute steps 5 to 7;

[0043] Step 5: Point set P i , find the two points with the greatest distance from each other, from lss steps Take these two points as the step line segment ls corresponding to the midpoint of the step line segment i and ls j , take ls i and ls j The two endpoints p0 and p1, p2 and p3, respectively, construct the line segment ls with p0 and p2, p1 and p3 02 and ls 13 , let the overall outline rectangle of the stair section be rect, if ls 02 and ls 13 If they do not intersect, connect the vertices in the order of p0p1p2p3p0 to construct the stair outline rectangle rect; otherwise, connect the vertices in the order of p0p1p3p2p0 to construct rect;

[0044] Step 6: Point set Pi , let the line corresponding to the RANSAC fitting in step 3 be l i , take the rect and l i Find the average length len of two non-intersecting edges, and set P i The average width w of the step is obtained by subtracting 1 from the number of elements contained in step , if w step Less than 300mm, let w step Equal to 300mm;

[0045] Step 7: Calculation The value c, along l i Divide rect into c rectangles in the direction, and get the rectangle set steps, which represents the two-dimensional shape of each step of the stair segment. Output the stair segment outline rectangle rect, the step outline rectangle set steps and the stair segment centerline l i ;

[0046] Step 8: Get all the input stair segment outline rectangles rect, step outline rectangle sets steps and stair segment center lines l obtained after looping steps 5 to 7 i The number of cycles is the number of stair sections, recorded as n. If n is equal to 1, the stair section is directly output as a single-tread stair component. If n is equal to 2, execute step 9; if n is equal to 3, execute step 14;

[0047] Step 9: Input two staircases, f1 and f2, the staircase outline rectangles, rect1 and rect2, and the staircase centerlines, l1 and l2. If l1 and l2 are parallel, it is determined to be a parallel double-tread staircase and proceed to step 10. If l1 and l2 are perpendicular, it is determined to be a right-angled double-tread staircase and proceed to step 11.

[0048] Step 10: Let the polygon set of all wall component symbols be walls, search for all polygons that intersect perpendicularly with l1 or l2 in walls, calculate the minimum distance to rect1 and rect2, and select the polygon wall with the minimum result. root , find the distance wall from the bounding box rect0 of rect1 and rect2 root The two nearest vertices p1 and p2 are projected onto the wall along the directions of l1 and l2 respectively. root , select the projection points closest to each other as p3 and p4, connect the vertices in the order of p1p2p4p3p1 to construct the polygon platform, which is the platform;

[0049] Step 11: Calculate the intersection point p0 of l1 and l2, select the two vertices p1 and p2, p3 and p4 closest to p0 from rect1 and rect2 respectively, and construct line segment l with p1 and p3, p2 and p4 respectively 13 and l 24 , construct a straight line along the direction of l1 through p1 and p2 respectively and Construct a straight line along the direction of l2 through p3 and p4 respectively and If l 13 With l 24 If they intersect, go to step 12; otherwise, go to step 13.

[0050] Step 12: Connect the vertices in the order p1p2p3p4p1 to construct a polygon platform and calculate and The intersection point p 41 , if p 41 does not overlap with p1 and does not overlap with p4, then p 41 Insert between p4 and p1 of platform and calculate and The intersection point p 23 , if p 23 does not overlap with p2 and does not overlap with p3, then p 23 Insert it between p2 and p3 of platform, and the output platform is the platform;

[0051] Step 13: Connect the vertices in the order p1p2p4p3p1 to construct a polygon platform and calculate and The intersection point p 31 , if p 31 does not overlap with p1 and does not overlap with p3, then p 31 Insert between p3 and p1 of platform and calculate and The intersection point p 24 , if p 24 does not overlap with p2 and does not overlap with p4, then p 24 Insert it between p2 and p4 of platform, and the output platform is the platform;

[0052] Step 14: The three stair sections are input as f1, f2 and f3, and the center lines of the stair sections are l1, l2 and l3 respectively. Check whether l1 is perpendicular to l2, l1 and l3 respectively. If all are perpendicular, then record f1 as f mid, that is, the stair section f1 is the middle stair section of a three-tread staircase. If l1 is perpendicular to l2 but parallel to l3, then f2 is f mid , if l1 is parallel to l2 but perpendicular to l3, then f3 is f mid , remember f mid The other two steps are f′1 and f′2, f mid , f′1, f′2 corresponding to the ladder outline rectangle are rect mind rect1 and rect2, the center lines of the stair sections are l mid , l′1 and l′2;

[0053] Step 15: Calculate l mid The intersection point p0 with l′1, from rect mid Select the two vertices p1 and p2, p3 and p4 closest to p0 in rect1 respectively. The following operations are the same as steps 11 to 13 to obtain the connection f mid Platform with f′1 mid1 And output;

[0054] Step 16: F mid Perform the same calculation as step 15 with f′2 to obtain the connection f mid Platform with f′2 mid2 And output.

[0055] The modeling of floor components and hole structures specifically includes:

[0056] Step 1: Take the 2D symbolic geometry of all walls, columns, doors, windows, and curtain wall components on the current floor, eliminate the gaps between the component symbols, perform expansion processing, and then merge them. Then, after eliminating the internal holes, perform erosion processing on the result at the same distance.

[0057] Step 2: Take all the hole-type structural symbols contained in the current floor, subtract the shapes of these symbols from the merged result obtained in step 1, and record the result as the temporary shape of the current floor slab;

[0058] Step 3: If the current floor is the lowest floor of the building, the temporary shape of the floor slab of that floor is taken and output as the final shape of the floor slab. Otherwise, the temporary shape of the floor slab of the floor below the current floor is taken and the temporary shape of the floor slab of the current floor is combined with it to obtain the final shape of the floor slab of the current floor.

[0059] Step 4: After obtaining the horizontal shape of the floor slab component, stretch it with the specified floor slab thickness to obtain the three-dimensional model of the floor slab component.

[0060] The modeling of roof components specifically includes:

[0061] Step 1: Extract the roof structure outline from the CAD drawing of the roof layer;

[0062] Step 2: Based on the structural contours obtained in step 1, select and add the corner points of each panel one by one to create a patch in 3D space;

[0063] Step 3: Use the three-dimensional facets obtained in step 2 to generate a three-dimensional model, which is the three-dimensional model of the roof.

[0064] Beneficial effects: The present invention has the following advantages:

[0065] 1) This paper constructs a technical route for automated architectural engineering CAD drawing parsing that combines deep learning-driven and knowledge-rule-constrained approaches. It extracts the semantics of building component symbols and primitives based on graph neural networks, achieving highly accurate automatic classification of building component symbols and primitives. It also introduces topological faceting and spatial clustering methods to achieve automatic, efficient, and stable building component instance segmentation.

[0066] 2) Architectural component symbol processing and 3D modeling strategies for BIM modeling tasks fully consider the characteristics and interrelationships of architectural components, implement automatic simplification and replacement methods for diverse component symbols, and automatically generate 3D models from 2D symbols of various architectural components through different modeling strategies. The three-level structure of "building-floor-building component" is integrated and output as complete BIM data for individual buildings. The modeling results can support the rapid construction of refined urban architectural scenes.

[0067] 3) It significantly improves the intelligence level of BIM model generation, reduces dependence on complex knowledge rule bases and manual intervention, reduces system maintenance and labor costs, and improves modeling efficiency. Compared with traditional human-computer interaction modeling, this invention can efficiently and accurately complete the automatic construction of civil engineering BIM models, and has broad application value in the fields of construction engineering informatization, digital twins, and city information models (CIM). BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 is a flow chart of the present invention;

[0069] Figure 2 Network architecture for graph node classification and recognition tasks;

[0070] Figure 3 CAD drawings are converted into undirected graphs;

[0071] Figure 4 Illustration of the wall / column element grouping process;

[0072] Figure 5 Illustration of step 17;

[0073] Figure 6 Illustration of step 20;

[0074] Figure 7 A diagram illustrating step 22;

[0075] Figure 8 Azimuth definition diagram;

[0076] Figure 9 Illustration of steps 30 and 31;

[0077] Figure 10 a graphic illustration of step 36;

[0078] Figure 11 Illustration of steps 35-38;

[0079] Figure 12 Left-turn algorithm topology generation flowchart;

[0080] Figure 13 Schematic diagram of the discretization processing of basic graphic elements;

[0081] Figure 14 Schematic diagram of scattered point cluster generation;

[0082] Figure 15 Schematic diagram of modeling of wall / column components;

[0083] Figure 16 Schematic diagram of the calculation of close distance;

[0084] Figure 17 Graphic illustration of step 5;

[0085] Figure 18 Graphic illustration of steps 6-7;

[0086] Figure 19 Illustration of step 8;

[0087] Figure 20 Schematic diagram of modeling of door / window components;

[0088] Figure 21 Schematic diagram of step length edge segment collection based on segment length statistics;

[0089] Figure 22 Graphic illustration of step 3;

[0090] Figure 23 Graphic illustration of steps 5-7;

[0091] Figure 24 Schematic diagram of platform generation for a parallel double-tread staircase;

[0092] Figure 25Schematic diagram of platform generation for a right-angled double-tread staircase;

[0093] Figure 26 Schematic diagram of platform generation for a three-flight staircase;

[0094] Figure 27 Schematic diagram of stair component modeling;

[0095] Figure 28 Schematic diagram of the process of generating the 2D shape of floor slab components;

[0096] Figure 29 Principles and process diagram of manual modeling of sloping roofs;

[0097] Figure 30 Generate result plots for BIM models. DETAILED DESCRIPTION

[0098] The present invention will be further described below with reference to the accompanying drawings.

[0099] like Figure 1 As shown, this embodiment of the method for automatically generating civil engineering BIM models from CAD drawings based on graph neural networks includes: parsing construction CAD drawing information and generating BIM models. During the processing stage of parsing construction CAD drawing information, the construction CAD drawings are parsed using a graph neural network method to identify building component symbols and extract information such as their location, geometry, and attributes. Specifically, the method includes two sub-stages: graph neural network model construction and CAD drawing parsing based on the graph neural network model.

[0100] The specific process of building a graph neural network model is as follows:

[0101] Step 1: Specify sample labels, which are semantic annotations of CAD elements, representing the type of building components they belong to, including doors, windows, stairs, curtain walls, openings, elevators, and others;

[0102] Step 2: Based on Python language and PyTorch library, use the GATv2 version of the Graph Attention Network (GAT) as the backbone of the graph neural network model to build a graph neural network model. Its architecture is as follows: Figure 2 As shown, it includes three modules: model input layer, GATv2 stacking layer and output layer. The specific construction method of each module is described in steps 3 to 5.

[0103] Step 3: Construct the model input layer, use two separate multilayer perceptrons (MLP) to receive the initial node features V and edge features E respectively, and stack them into and The two MLPs in the input layer have the same structure, each consisting of two fully connected layers connected by a ReLU activation function. For the input value x, the ReLU function is calculated as follows:

[0104] ReLU(x)=max(0,x)

[0105] Step 4: Construct the GATv2 stacking layer of the model. The initial GATv2 layer receives the stacked node features V′ and edge features E′. Each subsequent GATv2 layer receives the node features and edge features output by the previous GATv2 layer.

[0106] Step 5: Construct the output layer of the model. An MLP receives the node features V″ output from the GATv2 stacked layer and maps them to the probability distribution vector p of the classification prediction result. The output layer MLP consists of two fully connected layers, connected by a ReLU activation function in the middle, and finally mapped to the category probability vector p through the Softmax activation function. The Softmax function is often used in the output layer of multi-class classification tasks. It can convert a real number vector into a probability distribution. For any real number vector z = [z1,z2,…,z C ], where C is the total number of categories and the Softmax function is defined as:

[0107]

[0108] Step 4: Construct the model's output layer. An MLP receives the node features V″ output from the GATv2 stacked layer and maps them to the probability distribution vector p of the classification prediction result. The output layer MLP consists of two fully connected layers, connected by a ReLU activation function in the middle, and finally mapped to the category probability vector p through the Softmax activation function. The Softmax function is often used in the output layer of multi-class classification tasks. It can convert a real number vector into a probability distribution.

[0109] The specific process of CAD drawing parsing based on the graph neural network model is as follows:

[0110] Step 1: Open the engineering drawing file (.dwg format) in AutoCAD, and split the single architectural drawing file containing multiple drawing sheets into drawing files (.dwg format) for each drawing sheet.

[0111] Step 2: For all the plan view sheets obtained by dividing the drawing, select points with the same vertical position as the registration points, and adjust the position of each plan view sheet by horizontal translation;

[0112] Step 3: Based on the elevation drawing or section drawing, confirm the height information of each floor of the building;

[0113] Step 4: Explode all drawing entities contained in each plan view sheet multiple times until the entities only contain line segments, circles, arcs, ellipses, and text;

[0114] Step 5: For each exploded plan view, extract the geometric properties of all its primitives and calculate the topological connection relationship between each primitive;

[0115] Step 6: For each exploded planar image, an undirected graph is generated with each element as a node and the topological connection between elements as edges, such as Figure 3 As shown, the characteristics of each graph node include the type and geometric properties of the graph element corresponding to the node, and the characteristics of each graph edge include the type and properties of the topological connection relationship corresponding to the edge.

[0116] Step 7: For each undirected graph corresponding to a floor plan, input it into the constructed graph neural network model and output the building component type classification results of all nodes;

[0117] Step 8: Map the node classification results of the undirected graph back to the corresponding plan view of the undirected graph to obtain the building component type classification results of all graphic elements;

[0118] Step 9: For elements classified as walls or columns, remove all line segments that are too short (the length threshold is 0.1 mm);

[0119] Step 10: Loop through each plan view, extract the line segments of the wall or column processed in step 9, and let the set containing all line segments be lss all , neighbor spacing tolerance nbr (Take 10mm);

[0120] Step 11: Loop to calculate LSS all The midpoint distance d between the inner two line segments mid and the sum of their lengths len sum , if d mid Less than len sum Half and tolerance nbr The sum of the two segments is marked as neighbors, and the lss is constructed based on this. all The adjacency matrix mat of all elements adj ;

[0121] Step 12: Loop LSS all All line segments within, for line segment ls i , with ls i As the starting point, traverse mat in depth first adj , find all with ls iDirectly or indirectly adjacent line segments ls j , ls i With all ls j The output is a set of line segments lss i and from lss all Remove ls i With all ls j ;

[0122] Step 13: Repeat step 12 until lss all Is empty, such as Figure 4 , output all line segment groups;

[0123] Step 14: Loop through each line segment group obtained in step 13 and execute steps 15 to 23;

[0124] Step 15: Let the input line segment set be lss, which contains the line segment elements of all wall / column components in the current group, and the neighbor spacing tolerance nbr (Take 10mm), topological calculation tolerance topo (Take 0.1mm);

[0125] Step 16: Loop to calculate the midpoint distance d between each pair of line segments in LSS mid and the sum of their lengths, len sum , if d mid Less than len sum Half and tolerance nbr The sum of , then mark the two line segments as neighbors;

[0126] Step 17: Loop all line segments in lss and perform i , loop through all its neighbors ls j , if ls i and ls j The distance between them is less than tolerance topo , then find ls i and ls j The two points head1 and head2 that are farthest from each other and the two points tail1 and tail2 that are closest to each other are used to construct a new line segment ls with head1 and head2 as the two endpoints. k , if tail1 and tail2 to ls k The distance is less than tolerance topo , then ls k Replace ls i Join lss and remove ls from lss j ,like Figure 5 As shown;

[0127] Step 18: Let the line segment set lss hang Equal to lss, when lss hang If it is not empty, repeat steps 19 and 20;

[0128] Step 19: Loop all the line segments in lss and perform the following operations on line segment ls: i , if ls i Also in lss hang Then check whether its two endpoints are separated by any other line segment lss in lss j Contains, if so, then ls i From lss hang Delete in;

[0129] Step 20: Loop all line segments in lss and perform i , if ls i Also in lss hang In the ls i The two endpoints p1 and p2, check whether there is any other line segment ls in lss j , there is ls j The distance to p1 (or p2) is less than tolerance topo If so, calculate ls i with ls j The intersection point p0 of their respective lines, if the distance from p0 to p1 (or p2) is less than tolerance topo , then move p1 to the position of p0, and if ls j Does not contain p0, and ls j There exists a distance p0 less than tolerance topo If the endpoint of lss does not exist in lss, then the endpoint is also moved to the position of p0; j , then check whether there is any other line segment ls in lss k , there is ls k The distance to p1 (or p2) is less than tolerance topo If so, for ls k The two endpoints p3 and p4, if the distance from p1 (or p2) to p3 (or p4) is less than tolerance topo , then move p1 (or p2) to the position of p3 (or p4), such as Figure 6 As shown;

[0130] Step 21: Loop to determine the line segments ls in lss i and ls jDo they intersect? If so, determine whether the intersection point p0 is in ls i or ls j If yes, record p0 as ls i (or ls j ) breakpoint;

[0131] Step 22: Let the line segment set lss new Is an empty set, loop all the line segments in lss, for line segment ls i , if ls i If there is no breakpoint, ls i Join LSS new Otherwise, if Figure 7 As shown, take ls i The two endpoints p0 and p1 of ls are sorted in ascending order according to the distance from p0. i Sort all the breakpoints and let the sorted breakpoint set be P i ={p i0 ,p i1 ,…,p in}, where p ik It is the kth break point after sorting, followed by p ik and p i(k+1) Construct line segment ls ik And join lss new Finally, p0 and p i0 The line segment ls is And p1 and p in The line segment ls ie Join LSS new middle;

[0132] Step 23: Output lss new , which is the component symbol line segment set of the wall or column after topological correction;

[0133] Step 24: Define the line segment ls with endpoints p0 and p1, construct the vector v = p1-p0, and v = (x, y). Then the azimuth angle α of ls starting from p0 is Figure 8 As shown, the calculation is as follows:

[0134]

[0135] Step 25: For all the component symbol line segment sets of walls or columns outputted by the looped step 23, loop through steps 26-41 until all the line segment sets have been processed;

[0136] Step 26: Let the input line segment set be lss, which contains the line segment elements of all wall / column components in the current group, and the neighbor spacing tolerancenbr (Take 10mm);

[0137] Step 27: Loop to calculate the midpoint distance d between each pair of line segments in LSS mid and the sum of their lengths len sum , if d mid Less than len sum Half and tolerance nbr The sum of , then mark the two line segments as neighbors;

[0138] Step 28: Let the line segment set lss used1 ,lss used2 Is an empty set, lss re Equal to lss;

[0139] Step 29: Set the polygon vertex set vertices and edge set edges to empty sets;

[0140] Step 30: Loop LSS re For all the line segments in the equation, find the point p0 whose sum of horizontal and vertical coordinates is the smallest among the endpoints of all the line segments;

[0141] Step 31: Find all line segments ls with p0 as one of their endpoints in lss st0 and its other endpoint p other , calculate ls st0 The azimuth angle α from p0 is taken as the starting point, and the ls that makes α have the minimum value is taken st0 for ls st ,like Figure 9 As shown;

[0142] Step 32: Check ls st Is it in lss used0 If so, then ls st Join LSS used2 and from lss used1 Remove ls st Otherwise, ls st Join LSS used1 ;

[0143] Step 33: ls st The two endpoints p0 and p1 are added to vertices in turn, and ls st Add edges;

[0144] Step 34: Let point p cur Equal to p1, line segment ls next Equal to ls st ;

[0145] Step 35: Let the line segment set lssnext Is an empty set, loop ls next All neighboring line segments ls j , find all the cur Is one of the endpoints and is not in lss used2 ls in j Join LSS next ;

[0146] Step 36: LSS next If it contains only one element ls j , then let ls next Equal to ls j Otherwise, if Figure 10 As shown, calculate ls next With p cur is the azimuth angle of the starting point α i , loop lss next All line segments in ls j , calculate ls j With p cur is the azimuth angle of the starting point α j , and for all α j Sort in ascending order, in all i Take the maximum value α from the azimuth radian value maxj , take the corresponding ls j , let ls next Equal to ls j ;

[0147] Step 37: Check ls next Is it in lss used0 If so, then ls next Join LSS used2 and from lss used1 Remove ls st Otherwise, ls next Join LSS used1 ;

[0148] Step 38: Get ls next The difference between cur The other endpoint p of the overlap next , p next Add vertices and change ls next Add edges and let p cur Equal to p next ;

[0149] Step 39: Repeat steps 35 to 38 until p cur is equal to p0, such as Figure 11 As shown, output vertices and edges;

[0150] Step 40: Check whether the first and last elements in vertices are the same. If so, connect all vertices in the order recorded in vertices to generate a polygon. i and from lss re Delete all elements located in edges;

[0151] Step 41: Repeat steps 29-40. Figure 12 As shown, until lss re Empty to output all polygons, that is, complete component symbols for all walls and columns.

[0152] Step 42: For drawing elements that are not classified as walls or columns, all line segments and arcs are sampled using a uniform preset spacing to obtain a discrete sampling point set, such as Figure 13 As shown, the identifier of the basic primitive to which each sampling point belongs is recorded;

[0153] Step 43: For the primitives whose lengths are less than the preset interval of the equally spaced sampling in step 42, special processing is performed to ensure that they are sampled as at least three points, that is, the two endpoints and the midpoint of the line segment or arc are taken as the discretization results;

[0154] Step 44: For the arc processed in step 42, in addition to the equally spaced sampling along the arc, it is also necessary to perform filling sampling inside the corresponding sector;

[0155] Step 45: Generate clusters using the HDBSCAN algorithm for the discrete point set obtained after processing in steps 42 to 44, generate an index for each cluster, and record the cluster index to which each point belongs. The HDBSCAN algorithm only needs to set a minimum number of points for generating clusters.

[0156] Step 46: Traverse all the primitives, extract the cluster indexes of all its discrete points for each primitive, find the index value that accounts for the absolute majority, and record it as the cluster index of this primitive. Aggregate all the primitives according to their cluster index, and you will get the aggregation effect of all component symbol objects, such as Figure 14 shown.

[0157] In the processing stage of the BIM model generation device, different reconstruction strategies are adopted for different types of building components based on the extracted building component information. The modeling steps for specific building component types are as follows:

[0158] The modeling process for wall column components is as follows:

[0159] Step 1: For each plan drawing sheet that has been parsed by CAD drawings, obtain all building component symbols of the wall or column type;

[0160] Step 2: If Figure 15 As shown, for each complete component symbol of a wall or column, its plane shape is used as the stretching object, the elevation of the floor where it is located is used as the stretching starting point, and the floor height is used as the stretching amount. The symbol is stretched in the vertical direction to obtain the corresponding wall or column model.

[0161] The modeling process for door and window components is as follows:

[0162] Step 1: For each plan drawing sheet that has been parsed by CAD drawings, obtain all building component symbols of the wall or column type;

[0163] Step 2: For each door or window complete component symbol, generate its overall bounding box shape;

[0164] Step 3: Define the given two line segments ls i and ls j , for ls i Sampling is performed into a point set P of n points i ={p i0 ,p i1 ,...,p in}, then ls i ls j The close distance d, such as Figure 16 As shown, it is defined as:

[0165]

[0166] Among them, dist is the shortest distance between two geometric primitives;

[0167] Step 4: Let the polygon set of all wall component symbols be walls, the overall bounding box of the target door / window symbol be rect, and the topological calculation tolerance be tolerance topo (Take 0.1mm);

[0168] Step 5: Loop through all polygons in walls, and for each edge segment e of each polygon, loop through the four edge segments e of rect rect , judge e and e rect Is the distance between them less than tolerance? topo and parallel or nearly parallel, such as Figure 17 If so, calculate e versus e rect Find the two line segments e0 and e1 with the smallest d among all the above e. If e0 is parallel to e1, execute steps 6-7. Figure 18 As shown, if e0 is perpendicular to e1, execute step 8, as Figure 19 As shown;

[0169] Step 6: Take the two endpoints p0 and p1 of e0 and the two endpoints p2 and p3 of e1, project p0 and p1 onto the line where e1 is located, and the projection points are p′0 and p′1 respectively. Project p2 and p3 onto the line where e0 is located, and the projection points are p′2 and p′3 respectively. Take the two closest points among p0, p1, p′2 and p′3 to form the line segment e′0, and take the two closest points among p2, p3, p′0 and p′1 to form the line segment e′1.

[0170] Step 7: Reset the two endpoints of e′0 to p0 and p1 and the two endpoints of e′1 to p2 and p3, and connect p0 and p2 to form a line segment e 02 , connect p1 and p3 to form line segment e 13 , if e 02 With e 13 If they intersect, connect the points in the order of p0p1p2p3p0 to construct a polygon and output it. Otherwise, connect the points in the order of p0p1p3p2p0 to construct a polygon and output it, which is the simplified door or window component symbol.

[0171] Step 8: Take the two endpoints p0 and p1 of e0 and the two endpoints p2 and p3 of e1, and connect p0 and p2 to form line segment e 02 , connect p1 and p3 to form line segment e 13 , construct straight lines l0 and l1 through p0 and p1 perpendicular to e0, respectively, construct straight lines l2 and l3 through p2 and p3 perpendicular to e1, respectively, if e 02 With e 13 Intersect, take the intersection of l1 and l2, the intersection of l3 and l0 as p 12 and p 30 , with p0p1p 12 p2p3p 30 Connect the points in the order of p0 to construct a polygon and output it. Otherwise, take the intersection of l1 and l3, and the intersection of l2 and l0 as p respectively. 13 and p 20 , with p0p1p 13 p3p2p 20 The points are connected in sequence according to p0 to construct a polygon and output it, which is the simplified door or window component symbol.

[0172] Step 9: Get the simplified symbol of the door or window obtained in step 7 or step 8, use its plane shape as the stretching object, use the specified height of the door or window as the stretching height, and stretch it in the vertical direction to obtain the corresponding door or window model, such as Figure 20 As shown;

[0173] The modeling process for stair components is as follows:

[0174] Step 1: For each plan view after CAD drawing analysis, obtain all building component symbols of the staircase type;

[0175] Step 2: Traverse the complete component symbols of each stair, such as Figure 21 As shown, count the lengths of all line segments within a single symbol, take out the line segments with the largest number of the same lengths, and obtain the midpoint set P of these line segments. mid ;

[0176] Step 3: Take the midpoint set P obtained in step 2 mid ,like Figure 22 As shown, the RANSAC (Random sample consensus) algorithm is used to fit several straight lines, and the P mid All the points in the group are grouped to obtain n point sets P0, P1, ..., P n ;

[0177] Step 4: Loop through P0, P1, ..., P obtained in step 3 n , perform steps 5 to 7, such as Figure 23 As shown;

[0178] Step 5: Point set P i , find the two points with the greatest distance from each other, from lss steps Take these two points as the step line segment ls corresponding to the midpoint of the step line segment i and ls j , take ls i and ls j The two endpoints p0 and p1, p2 and p3, respectively, construct the line segment ls with p0 and p2, p1 and p3 02 and ls 13 , let the overall outline rectangle of the stair section be rect, if ls 02 and ls 13 If they do not intersect, connect the vertices in the order of p0p1p2p3p0 to construct the stair outline rectangle rect; otherwise, connect the vertices in the order of p0p1p3p2p0 to construct rect;

[0179] Step 6: Point set P i , let the line corresponding to the RANSAC fitting in step 3 be l i (i.e. the center line of the stair section), take the center of rect and l i Find the average length len of two non-intersecting edges, and set P i The average width w of the step is obtained by subtracting 1 from the number of elements contained in step , if w stepLess than 300mm, let w step Equal to 300mm;

[0180] Step 7: Calculation The value c, along l i Divide rect into c rectangles in the direction, and get the rectangle set steps, which represents the two-dimensional shape of each step of the stair segment. Output the stair segment outline rectangle rect, the step outline rectangle set steps and the stair segment centerline l i .

[0181] Step 8: Get all the input stair segment outline rectangles rect, step outline rectangle sets steps and stair segment center lines l obtained after looping steps 5 to 7 i The number of cycles is the number of stair sections, recorded as n. If n is equal to 1, the stair section is directly output as a single-tread stair component. If n is equal to 2, execute step 9; if n is equal to 3, execute step 14;

[0182] Step 9: Input two staircases, f1 and f2, the staircase outline rectangles, rect1 and rect2, and the staircase centerlines, l1 and l2. If l1 and l2 are parallel, it is determined to be a parallel double-tread staircase and proceed to step 10. If l1 and l2 are perpendicular, it is determined to be a right-angled double-tread staircase and proceed to step 11.

[0183] Step 10: Let the polygon set of all wall component symbols be walls, search for all polygons that intersect perpendicularly with l1 or l2 in walls, calculate the minimum distance to rect1 and rect2, and select the polygon wall with the minimum result. root , find the distance wall from the bounding box rect0 of rect1 and rect2 root The two nearest vertices p1 and p2 are projected onto the wall along the directions of l1 and l2 respectively. root , select the closest projection points p3 and p4 respectively, connect the vertices in the order of p1p2p4p3p1 to construct the polygon platform, which is the platform, such as Figure 24 As shown;

[0184] Step 11: Calculate the intersection point p0 of l1 and l2, select the two vertices p1 and p2, p3 and p4 closest to p0 from rect1 and rect2 respectively, and construct line segment l with p1 and p3, p2 and p4 respectively 13 and l 24 , construct a straight line along the direction of l1 through p1 and p2 respectively and Construct a straight line along the direction of l2 through p3 and p4 respectively and If l 13 With l 24 If they intersect, go to step 12; otherwise, go to step 13.

[0185] Step 12: Connect the vertices in the order p1p2p3p4p1 to construct a polygon platform and calculate and The intersection point p 41 , if p 41 does not overlap with p1 and does not overlap with p4, then p 41 Insert between p4 and p1 of platform and calculate and The intersection point p 23 , if p 23 does not overlap with p2 and does not overlap with p3, then p 23 Insert it between p2 and p3 of platform, and the output platform is the platform, such as Figure 25 As shown;

[0186] Step 13: Connect the vertices in the order p1p2p4p3p1 to construct a polygon platform and calculate and The intersection point p 31 , if p 31 does not overlap with p1 and does not overlap with p3, then p 31 Insert between p3 and p1 of platform and calculate and The intersection point p 24 , if p 24 does not overlap with p2 and does not overlap with p4, then p 24 Insert it between p2 and p4 of platform, and the output platform is the platform, such as Figure 25 As shown;

[0187] Step 14: The three stair sections are input as f1, f2 and f3, and the center lines of the stair sections are l1, l2 and l3 respectively. Check whether l1 is perpendicular to l2, l1 and l3 respectively. If all are perpendicular, then record f1 as f mid , that is, the stair section f1 is the middle stair section of a three-tread staircase. If l1 is perpendicular to l2 but parallel to l3, then f2 is f mid , if l1 is parallel to l2 but perpendicular to l3, then f3 is f mid , remember f mid The other two steps are f′1 and f′2, f mid , f′1, f′2 corresponding to the ladder outline rectangle are rect mid rect1 and rect2, the center lines of the stair sections are lmid , l′1 and l′2;

[0188] Step 15: Calculate l mid The intersection point p0 with l′1, from rect mid Select the two vertices p1 and p2, p3 and p4 closest to p0 in rect1 respectively. The following operations are the same as steps 11 to 13 to obtain the connection f mid Platform with f′1 mid1 And output;

[0189] Step 16: F mid Perform similar calculations as in step 15 with f′2 to obtain the connection f mid Platform with f′2 mid2 And output, such as Figure 26 As shown;

[0190] Step 17: The overall height range of the stair component is from the upper surface of the floor slab of the lower floor to the upper surface of the floor slab, including the height of each stair segment and the thickness of all platforms. The height of each stair segment is divided equally by the number of steps to obtain the step height. The platforms and steps are stretched according to their determined heights. Multiple steps form a stair segment, and the stair segment and the platform together constitute the stair component, as shown in the figure. Figure 27 shown.

[0191] like Figure 28 As shown in the figure, the modeling process for floor components and hole structures includes:

[0192] Step 1: Take the 2D symbol geometry of all walls, columns, doors, windows, and curtain wall components on the current floor, eliminate any gaps between component symbols, perform expansion processing for a certain distance, and then merge them. After eliminating internal holes, perform erosion processing on the result at the same distance to eliminate any gaps between component symbols caused by possible data errors.

[0193] Step 2: Take all the hole-type structural symbols contained in the current floor, subtract the shapes of these symbols from the merged result obtained in step 1, and record the result as the temporary shape of the current floor slab;

[0194] Step 3: If the current floor is the lowest floor of the building, the temporary shape of the floor slab of that floor is taken and output as the final shape of the floor slab. Otherwise, the temporary shape of the floor slab of the floor below the current floor is taken and combined with the temporary shape of the floor slab of the current floor to obtain the final shape of the floor slab of the current floor.

[0195] Step 4: After obtaining the horizontal shape of the floor slab component, stretch it with the specified floor slab thickness to obtain the three-dimensional model of the floor slab component.

[0196] like Figure 29 As shown in the figure, the modeling process for roof components is as follows:

[0197] Step 1: Extract the roof structure outline from the CAD drawing of the roof layer;

[0198] Step 2: Based on the structural contours obtained in step 1, select and add the corner points of each panel one by one to create a patch in 3D space;

[0199] Step 3: Use the 3D facets obtained in step 2 to generate a 3D model, which is the 3D model of the roof. Figure 30 shown.

[0200] This invention combines deep learning drive and knowledge rule constraints, and based on the graph neural network model, analyzes the building component information in the construction project CAD drawings, automatically extracts and generates three-dimensional building models, and realizes efficient BIM data production.

Claims

1. A method for automatically generating civil engineering BIM models from CAD drawings based on graph neural networks, characterized in that: include: Construction project CAD drawing information analysis and BIM model generation; the construction project CAD drawing information analysis is to analyze the construction project CAD drawings based on a graph neural network method, identify building component symbols and extract relevant information, specifically including graph neural network model construction and CAD drawing analysis based on the graph neural network model; BIM model generation is based on the extracted building component information, and adopts different reconstruction strategies for different types of building components.

2. The method for automatically generating a civil engineering BIM model from a CAD drawing based on a graph neural network according to claim 1, characterized in that: The graph neural network model construction specifically includes: Specify sample labels; Construct the model input layer, use two separate multi-layer perceptrons MLP to receive the initial node features V and edge features E respectively, and stack them separately into and The two MLP structures of the input layer are the same; The GATv2 stacking layer of the model is constructed. The initial GATv2 layer receives the stacked node features V′ and edge features E′, and each subsequent GATv2 layer receives the node features and edge features output by the previous GATv2 layer.

3. The method for automatically generating civil engineering BIM models from CAD drawings based on graph neural networks according to claim 1 is characterized in that: The CAD drawing parsing based on the graph neural network model specifically includes: Split a single architectural drawing file containing multiple drawing sheets into individual drawing sheets; For all the planar map sheets obtained by cutting the drawing, select points with the same vertical position as the registration points, and adjust the position of each planar map sheet by horizontal translation; Based on the elevation or section drawings, confirm the height information of each floor of the building; Explode all drawing entities contained in each plan view sheet multiple times until only basic entities remain. For each exploded plan view, extract the geometric properties of all basic elements and calculate the topological connection relationship between each element; For each exploded planar image, an undirected graph is generated with each primitive as a node and the topological connections between primitives as edges. The characteristics of each graph node include the type and geometric properties of the primitive corresponding to the node, and the characteristics of each graph edge include the type and properties of the topological connection corresponding to the edge. For each undirected graph corresponding to a floor plan, input it into the constructed graph neural network model and output the building component type classification results of all nodes; Mapping the node classification results of the undirected graph back to the plane map corresponding to the undirected graph to obtain the building component type classification results of all the elements; For elements classified as walls or columns, the left-turn closed topological faceting algorithm is applied to obtain a complete symbolic representation of the wall or column; For the graphics elements that are not classified as walls or columns, they are discretized into dense points, and the relationship between the graphics elements and the discrete points is recorded. The spatial clustering algorithm is applied to the discrete points to obtain multiple point clusters; Taking multiple point clusters as aggregation targets, based on the relationship between primitives and discrete points, the cluster with the most discrete points corresponding to each primitive is taken as its aggregation target, and all primitives are aggregated to obtain a complete building component symbol.

4. The method for automatically generating a civil engineering BIM model from a CAD drawing based on a graph neural network according to claim 3 is characterized in that: When constructing the GATv2 stacking layer of the model, the GATv2 version of the graph attention network is used as the backbone of the graph neural network model.

5. The method for automatically generating civil engineering BIM models from CAD drawings based on graph neural networks according to claim 1 is characterized in that: The BIM model generation specifically includes: modeling for wall and column components, modeling for door and window components, modeling for stair components, modeling for floor components and hole structures, and modeling for roof components.

6. The method for automatically generating civil engineering BIM models from CAD drawings based on graph neural networks according to claim 5 is characterized in that: The modeling of wall column components specifically includes: For each plan drawing sheet that has been parsed using CAD drawings, obtain all building component symbols of the wall or column type; For each complete component symbol of a wall or column, its plane shape is used as the stretching object, the elevation of the floor where it is located is used as the stretching starting point, and the floor height is used as the stretching amount. The symbol is stretched in the vertical direction to obtain the corresponding wall or column model.

7. The method for automatically generating civil engineering BIM models from CAD drawings based on graph neural networks according to claim 5 is characterized in that: The modeling of door and window components specifically includes: Step 1: For each plan drawing sheet that has been parsed by CAD drawings, obtain all building component symbols of the wall or column type; Step 2: For each door or window complete component symbol, generate its overall bounding box shape; Step 3: Based on the component symbols of all walls and columns that have been obtained, retrieve the two closed polygons that are closest to the bounding box generated in step 2; Step 4: Based on the line segments e0 and e1 that intersect the two closed polygons obtained in step 3 and the bounding box in step 2, determine whether the lines they are on are parallel or perpendicular. If they are parallel, execute steps 5 to 6; if they are perpendicular, execute step 7. Step 5: Take the two endpoints p0 and p1 of e0 and the two endpoints p2 and p3 of e1 in step 4, project p0 and p1 onto the line where e1 is located, and the projection points are p′0 and p′1 respectively. Project p2 and p3 onto the line where e0 is located, and the projection points are p′2 and p′3 respectively. Take the two closest points among p0, p1, p′2 and p′3 to form the line segment e′0, and take the two closest points among p2, p3, p′0 and p′1 to form the line segment e′1. Step 6: Reset the two endpoints of e′0 to p0 and p1 and the two endpoints of e′1 to p2 and p3, and connect p0 and p2 to form a line segment e 02 , connect p1 and p3 to form line segment e 13 , if e 02 With e 13 If they intersect, connect the points in the order of p0p1p2p3p0 to construct a polygon and output it. Otherwise, connect the points in the order of p0p1p3p2p0 to construct a polygon and output it, which is the simplified door or window component symbol. Step 7: Take the two endpoints p0 and p1 of e0 and the two endpoints p2 and p3 of e1, and connect p0 and p2 to form line segment e 02 , connect p1 and p3 to form line segment e 13 , construct straight lines l0 and l1 through p0 and p1 perpendicular to e0, respectively, construct straight lines l2 and l3 through p2 and p3 perpendicular to e1, respectively, if e 02 With e 13 Intersect, take the intersection of l1 and l2, the intersection of l3 and l0 as p 12 and p 30 , with p0p1p 12 p2p3p 30 Connect the points in the order of p0 to construct a polygon and output it. Otherwise, take the intersection of l1 and l3, and the intersection of l2 and l0 as p respectively. 13 and p 20 , with p0p1p 13 p3p2p 20 Connect the points in order of p0 to construct a polygon and output it, which is the simplified door or window component symbol; Step 8: Get the simplified symbol of the door or window obtained in step 6 or step 7, use its plane shape as the stretching object, use the specified height of the door or window as the stretching height, and stretch it in the vertical direction to obtain the corresponding door or window model.

8. The method for automatically generating civil engineering BIM models from CAD drawings based on graph neural networks according to claim 5 is characterized in that: The modeling of stair components specifically includes: Step 1: For each plan view after CAD drawing analysis, obtain all building component symbols of the staircase type; Step 2: Traverse the complete component symbol of each staircase, count the lengths of all line segments within a single symbol, take out the line segments with the largest number of the same lengths, and obtain the midpoint set P of these line segments mid ; Step 3: Take the midpoint set P obtained in step 2 mid , use the RANSAC algorithm to fit several straight lines, and calculate the number of points contained in each straight line. mid All the points in the group are grouped to obtain n point sets, P0, P1, ..., P n ; Step 4: Loop through the P0, P1, ..., P obtained in step 3 n , execute steps 5 to 7; Step 5: Point set P i , find the two points with the greatest distance from each other, from lss steps Take these two points as the step line segment ls corresponding to the midpoint of the step line segment i and ls j , take ls i and ls j The two endpoints p0 and p1, p2 and p3, respectively, construct the line segment ls with p0 and p2, p1 and p3 02 and ls 13 , let the overall outline rectangle of the stair section be rect, if ls 02 and ls 13 If they do not intersect, connect the vertices in the order of p0p1p2p3p0 to construct the stair outline rectangle rect; otherwise, connect the vertices in the order of p0p1p3p2p0 to construct rect; Step 6: Point set P i , let the line corresponding to the RANSAC fitting in step 3 be l i , take the rect and l i Find the average length len of two non-intersecting edges, and set P i The average width w of the step is obtained by subtracting 1 from the number of elements contained in step , if w step Less than 300mm, let w step Equal to 300mm; Step 7: Calculation The value c, along l i Divide rect into c rectangles in the direction, and get the rectangle set steps, which represents the two-dimensional shape of each step of the stair segment. Output the stair segment outline rectangle rect, the step outline rectangle set steps and the stair segment centerline l i ; Step 8: Get all the input stair segment outline rectangles rect, step outline rectangle sets steps and stair segment center lines l obtained after looping steps 5 to 7 i The number of cycles is the number of stair sections, recorded as n. If n is equal to 1, the stair section is directly output as a single-tread stair component. If n is equal to 2, execute step 9; if n is equal to 3, execute step 14; Step 9: Input two staircases, f1 and f2, the staircase outline rectangles, rect1 and rect2, and the staircase centerlines, l1 and l2. If l1 and l2 are parallel, it is determined to be a parallel double-tread staircase and proceed to step 10. If l1 and l2 are perpendicular, it is determined to be a right-angled double-tread staircase and proceed to step 11. Step 10: Let the polygon set of all wall component symbols be walls, search for all polygons that intersect perpendicularly with l1 or l2 in walls, calculate the minimum distance to rect1 and rect2, and select the polygon wall with the minimum result. root , find the distance wall from the bounding box rect0 of rect1 and rect2 root The two nearest vertices p1 and p2 are projected onto the wall along the directions of l1 and l2 respectively. root , select the projection points closest to each other as p3 and p4, connect the vertices in the order of p1p2p4p3p1 to construct the polygon platform, which is the platform; Step 11: Calculate the intersection point p0 of l1 and l2, select the two vertices p1 and p2, p3 and p4 closest to p0 from rect1 and rect2 respectively, and construct line segment l with p1 and p3, p2 and p4 respectively 13 and l 24 , construct a straight line along the direction of l1 through p1 and p2 respectively and Construct a straight line along the direction of l2 through p3 and p4 respectively and If l 13 With l 24 If they intersect, go to step 12; otherwise, go to step 13. Step 12: Connect the vertices in the order p1p2p3p4p1 to construct a polygon platform and calculate and The intersection point p 41 , if p 41 does not overlap with p1 and does not overlap with p4, then p 41 Insert between p4 and p1 of platform and calculate and The intersection point p 23 , if p 23 does not overlap with p2 and does not overlap with p3, then p 23 Insert it between p2 and p3 of platform, and the output platform is the platform; Step 13: Connect the vertices in the order p1p2p4p3p1 to construct a polygon platform and calculate and The intersection point p 31 , if p 31 does not overlap with p1 and does not overlap with p3, then p 31 Insert between p3 and p1 of platform and calculate and The intersection point p 24 , if p 24 does not overlap with p2 and does not overlap with p4, then p 24 Insert it between p2 and p4 of platform, and the output platform is the platform; Step 14: The three stair sections are input as f1, f2 and f3, and the center lines of the stair sections are l1, l2 and l3 respectively. Check whether l1 is perpendicular to l2, l1 and l3 respectively. If all are perpendicular, then record f1 as f mid , that is, the stair section f1 is the middle stair section of a three-tread staircase. If l1 is perpendicular to l2 but parallel to l3, then f2 is f mid , if l1 is parallel to l2 but perpendicular to l3, then f3 is f mid , remember f mid The other two steps are f′1 and f′2, f mid , f′1, f′2 corresponding to the ladder outline rectangle are rect mind , rect1 and rect2, the center lines of the stair sections are l mid , l′1 and l′2; Step 15: Calculate l mid The intersection point p0 with l′1, from rect mid Select the two vertices p1 and p2, p3 and p4 closest to p0 in rect1 respectively. The following operations are the same as steps 11 to 13 to obtain the connection f mid Platform with f′1 mid1 And output; Step 16: F mid Perform the same calculation as step 15 with f′2 to obtain the connection f mid Platform with f′2 mid2 And output.

9. The method for automatically generating civil engineering BIM models from CAD drawings based on graph neural networks according to claim 5, characterized in that: The modeling of floor components and hole structures specifically includes: Step 1: Take the 2D symbolic geometry of all walls, columns, doors, windows, and curtain wall components on the current floor, eliminate the gaps between the component symbols, perform expansion processing, and then merge them. Then, after eliminating the internal holes, perform erosion processing on the result at the same distance. Step 2: Take all the hole-type structural symbols contained in the current floor, subtract the shapes of these symbols from the merged result obtained in step 1, and record the result as the temporary shape of the current floor slab; Step 3: If the current floor is the lowest floor of the building, the temporary shape of the floor slab of that floor is taken and output as the final shape of the floor slab. Otherwise, the temporary shape of the floor slab of the floor below the current floor is taken and the temporary shape of the floor slab of the current floor is combined with it to obtain the final shape of the floor slab of the current floor. Step 4: After obtaining the horizontal shape of the floor slab component, stretch it with the specified floor slab thickness to obtain the three-dimensional model of the floor slab component.

10. The method for automatically generating civil engineering BIM models from CAD drawings based on graph neural networks according to claim 5, characterized in that: The modeling of roof components specifically includes: Step 1: Extract the roof structure outline from the CAD drawing of the roof layer; Step 2: Based on the structural contours obtained in step 1, select and add the corner points of each panel one by one to create a patch in 3D space; Step 3: Use the three-dimensional facets obtained in step 2 to generate a three-dimensional model, which is the three-dimensional model of the roof.