A computer planar method based structural beam data automatic recognition and extraction method
Patent Information
- Application Number
- CN202611290140.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-25
- Publication Date
- 2026-10-27
AI Technical Summary
作业过程需人工手动选中对应图元、触发执行指令,无法实现批量、无人值守的全自动提取作业
[0021]通过采用梁名称文字插入点位于直线图元起点和终点所定义的线段范围内、垂直距离小于预设容差值且文字旋转角度与直线角度之差接近90度的三重几何条件联合判定集中标注引线,摒弃了单一的邻近匹配,从根本上避免了将支座边线、尺寸线等非引线直线错误关联为集中标注引线的情形,引线与梁名称的对应关系准确无误。在引线确定后,以引线为中心在预设半径内收集候选文字,并依次执行包含字符“L”、“@”、“;”以及“N”或“G”的分级语义匹配,据此将文本自动归类为梁名称、箍筋信息、上部与下部钢筋分隔信息以及腰筋信息,并存入梁数据对象的对应字段。这一过程利用引线精确位置限定搜索范围,分级语义规则保障了标注文字解析的条理性和完备性,避免信息错位或遗漏。
Smart Images

Figure CN122990744A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer-aided design data processing technology in building engineering, specifically a method for automatic identification and extraction of structural beam data based on computer-aided flat surface annotation. Background Technology
[0002] In architectural structural construction drawings, beam reinforcement information is often expressed using the flat slab method and stored in DWG format. For quantity surveying or structural analysis, it is necessary to automatically extract beam names, sections, reinforcement, and span geometry information from the drawing files.
[0003] Currently, the industry's technology for extracting beam component information from DWG structural drawings mainly falls into two mainstream categories. Both categories have inherent technical flaws and cannot meet the requirements for high-precision, automated engineering data extraction, as detailed below:
[0004] Firstly, there is the image-based and simplified OCR-based recognition and extraction method. This approach requires converting the vector-format DWG drawing into a raster image before recognition, completely abandoning the precise vector primitive information of the DWG file, resulting in a fundamental technical shortcoming. The image conversion process easily leads to the loss of detail in the drawing, and it cannot effectively handle common situations such as overlapping text and intersecting lines. The recognition effect is highly dependent on the quality of the original image, with extremely poor stability and adaptability, making it difficult to achieve accurate and effective extraction of structural beam information. This type of approach completely loses the geometric relationships between primitives in the vector drawing, making it impossible to accurately bind beam annotations based on the spatial positional relationship between text and leader lines, and also unable to utilize the topological relationships of beam lines to complete the complete extraction of multi-span beams. This is one of the core reasons why existing beam recognition technologies suffer from errors in span count and annotation association.
[0005] Secondly, there is the interactive extraction method based on CAD software APIs. This method relies on AutoCAD's ActiveX and .NET API to write scripts, which can read drawing element information within the CAD environment. While this ensures basic extraction accuracy, the degree of automation is extremely low. The process requires manual selection of the corresponding elements and triggering of execution commands, making it impossible to achieve batch, unattended, fully automated extraction. This solution can only serve as a manual auxiliary tool, not a truly automated extraction system, resulting in low processing efficiency and an inability to meet the data reuse needs of large-scale engineering drawings. This type of solution also fails to solve the problems of automatic association between beam annotations and beam lines, and automatic traversal of multi-span beam lines: due to the reliance on manual selection of elements, it cannot automatically match leader lines and associate annotation text based on the flat standard annotation rules, nor can it automatically verify and complete multi-span beam lines using the number of spans N in the centralized annotation. It can only achieve information extraction for single spans and a small number of beams, making it difficult to support the batch digitization of all building beam components.
[0006] Both of the above-mentioned solutions have their limitations. While the interactive extraction solution based on CAD API can obtain accurate vector primitives using the CAD environment, it still fails to solve the core accuracy problems of beam annotation association and multi-span beam line extraction. Typically, it first obtains the beam name by matching text using regular expressions, then collects surrounding text as annotation content based on the name's location and its proximity. For leader lines unique to concentrated annotations, it often uses simple line proximity judgment without comprehensively considering the inclusion relationship between the text insertion point and the line, the vertical distance, and the coordination between the text direction and the line angle. This easily leads to irrelevant lines being mistaken for leader lines, causing errors in annotation text association and resulting in confusion in subsequent reinforcement analysis. Regarding beam line extraction, beam components are often composed of multi-span continuous straight line segments. Existing solutions mostly rely on the proximity of the endpoint coordinates of adjacent line segments for chain-like connections. Once a beam line has a small gap at the support due to improper drawing, or a slight deflection between adjacent span beam lines, the search process terminates, failing to automatically traverse all span beam lines. Furthermore, neither of the two approaches fully utilizes the span number N explicitly given in the centralized annotations as the extraction termination condition and verification basis. The extracted span number often does not match the actual number, resulting in omissions or redundancies. Due to the lack of accurate leader identification methods and multi-span automatic search mechanisms based on the annotated span number, existing structural beam data identification and extraction technologies struggle to meet the requirements of accuracy and completeness, becoming a bottleneck for the efficient reuse of design data. Summary of the Invention
[0007] The purpose of this invention is to provide an automatic identification and extraction method for structural beam data based on computer-aided flat surface annotation. This method can accurately capture concentrated annotation leader lines and precisely associate annotation text. At the same time, it automatically iterates and searches based on the number of annotation spans and completely extracts all multi-span beam lines to obtain correct and complete structural beam data.
[0008] To achieve the above objectives, the present invention provides the following technical solution: The present invention provides an automatic identification and extraction method for structural beam data based on computer-aided flat slab annotation, used to automatically identify and structurally extract reinforcement information of beams annotated according to the flat slab method in building structural drawings, thereby replacing tedious manual reading operations. The method includes the following steps:
[0009] Step 1: Obtain text and line elements from the DWG file. Preferably, when obtaining text elements, the DWG parsing engine traverses the DWG database to extract all TEXT and MTEXT elements, recording the text content, insertion point coordinates, rotation angle, and bounding box information for each element. When obtaining line elements, all LINE and POLYLINE elements are extracted, and the start-point coordinates, end-point coordinates, length, and angle information for each element are recorded. This allows for the complete extraction of the basic graphic elements in the drawing used to represent beam annotations and beam lines, providing a data foundation for subsequent accurate identification.
[0010] Step two involves identifying beam names from text-based graphic elements and constructing an initial beam data object. Preferably, all text-based graphic elements are traversed, and predefined regular expressions are used to match text that conforms to the beam naming rules. Upon successful matching, this text-based graphic element is used as the initial identifier for the beam, creating a data structure object. The text content is stored in the beam name field, and the insertion point coordinates are stored as the beam name location within this object. Regular expression matching allows for rapid filtering of all beam component identifiers from a large number of graphic elements, avoiding omissions.
[0011] Step 3: Based on geometric relationships, identify the centralized annotation leader lines associated with the beam name from the linear primitives. As a preferred embodiment of the present invention, for each beam name text primitive and each linear primitive, determine whether the insertion point of the text primitive is within the line segment defined by the start and end points of the linear primitive, and whether the vertical distance from the insertion point to the linear primitive is less than a preset tolerance value, while the difference between the rotation angle of the text primitive and the angle of the linear primitive is close to 90 degrees; linear primitives that simultaneously meet the above three conditions are identified as the centralized annotation leader lines corresponding to the beam name. This constraint fully utilizes the graphic features of the leader line being perpendicular and centered to the name text, thereby reliably establishing the correspondence between the name and the leader line.
[0012] Step four: Based on spatial relationships and semantic rules, identify the centralized annotation text associated with the centralized annotation leader line. Preferably, with the centralized annotation leader line as the center, search all text elements within a preset radius as a candidate text set; traverse each text element in the candidate text set, and perform hierarchical semantic matching on its text content in sequence: the first level matches whether the text contains the character "L", if so, the text is marked as the beam name; the second level matches whether the text contains the character "@", if so, the text is parsed as stirrup information; the third level matches whether the text contains the character ";", if so, the text is parsed as the separation information between the upper and lower reinforcement bars; the fourth level matches whether the text contains the characters "N" or "G", if so, the text is parsed as the web reinforcement information. The successfully matched text elements are determined as centralized annotation text, and the text content is stored in the corresponding field of the data object according to the matched semantic type. This hierarchical semantic parsing strategy can adapt to the multi-line and disordered arrangement of centralized annotation text in the flat standard annotation, and accurately capture key information such as cross-sectional dimensions, stirrups, upper and lower continuous reinforcement bars, and web reinforcement bars.
[0013] Step 5: Based on the geometric position of the centralized annotation leader, identify the beam line of the span in which the centralized annotation is located. Preferably, using the centralized annotation leader as a reference, search among all linear primitives for linear primitives that intersect with the leader in the two-dimensional plane and are perpendicular to each other, and mark them as candidate beam lines. From the candidate beam lines, select two linear primitives that are parallel to another candidate beam line in the same span and whose endpoint distance is less than a preset threshold, and use them as the two beam lines of that span. This can accurately locate the geometric line of the beam segment in the span indicated by the centralized annotation, providing the starting conditions for subsequent multi-span beam line expansion.
[0014] Step Six: Based on the span number N in the centralized annotation corresponding to the beam name, iteratively execute the multi-span beam line search algorithm to obtain all N span beam lines. The beam line in the span of the centralized annotation identified in Step Five is taken as the current span beam line, and the found span number is initialized to 1. In each iteration, using the endpoint of the current span beam line as the search starting point, search for candidate beam lines for the next span that meet the following conditions among all linear primitives: the angle between the direction of the candidate beam line and the direction of the current span beam line is less than a preset angle threshold; the spatial distance between the starting point of the candidate beam line and the endpoint of the current span beam line is less than a preset gap threshold; and the absolute value of the difference between the length of the candidate beam line and the length of the current span beam line is less than a preset length difference threshold. Linear primitives that simultaneously meet the above conditions are marked as candidate beam lines for the next span. When the searched candidate beam line for the next span is unique, it is determined as the next span beam line; when multiple candidate beam lines are searched, the direction angle, starting point distance, and length difference between each candidate beam line and the current span beam line are calculated respectively, and the candidate beam line with the smallest direction angle, smallest starting point distance, and smallest length difference is selected as the next span beam line. Update the number of spans found, and use the newly determined next span beam line as the current span to continue iterating until the number of spans found equals the number of spans N.
[0015] As a further preferred approach, before each iteration of the candidate search, it is first determined whether there is a collinear relationship between the end point of the current span beam line and the starting point of the next candidate beam line. The direction vector of the current span beam line and the connection vector from the end point of the current span beam line to the starting point of the candidate beam line are calculated. If the angle between the connection vector and the direction vector is less than a preset collinearity angle threshold, then the two are determined to be collinear. Subsequent parallelism, gap, and length matching judgments are only performed on candidate beam lines determined to be collinear. By introducing collinearity constraints, interference from intersecting but discontinuous beam lines caused by the complexity of the drawing can be effectively filtered out.
[0016] As another preferred solution, when multiple candidate beam lines still have a score difference value less than the preset difference threshold after comprehensive comparison of direction angle, starting point spacing and length difference, the distance between the midpoint of each candidate beam line and the insertion point of the beam name text element is compared, and the candidate beam line with the smallest distance is selected as the next span beam line, so as to ensure that the selected beam line is closest to the beam component identification position in the overall layout and improve the rationality of continuous beam line connection.
[0017] Through the above iterative search and optimization mechanism, even if the beam lines in the drawings are cut off by other components or are discontinuous, the entire beam line of the complete multi-span continuous beam can be automatically and robustly connected.
[0018] Step seven involves integrating all extracted information into structured data and outputting it. Preferably, a JSON object is created for each beam member. This JSON object contains: a beam name field, beam cross-section width and height fields parsed from the centralized annotation text, a span number field, and a span list field. The span list field stores an array, where each element corresponds to the structured information of a span. Each element contains the start and end coordinates of the two beam lines of that span, the cross-sectional dimensions of that span, and the corresponding in-situ annotation text content. The final output structured data can directly provide accurate and consistent data input for downstream applications such as building information model generation, quantity calculation, and rebar detailing.
[0019] The method of this invention achieves fully automatic conversion from original DWG drawings to structured beam data through progressive geometric analysis and semantic parsing, significantly improving the efficiency and accuracy of structural construction drawing recognition and processing.
[0020] The technical effects and advantages provided by the present invention in the above technical solution are as follows:
[0021] By employing a triple geometric condition—the insertion point of the beam name text being within the line segment defined by the start and end points of the straight line element, the vertical distance being less than a preset tolerance value, and the difference between the text rotation angle and the straight line angle being close to 90 degrees—the centralized annotation leader line is determined. This eliminates the need for simple proximity matching and fundamentally avoids the situation where non-leader lines such as support edges and dimension lines are incorrectly associated with centralized annotation leaders, ensuring accurate correspondence between leaders and beam names. After the leader line is determined, candidate text is collected within a preset radius centered on the leader line, and hierarchical semantic matching containing the characters "L", "@", ";", and "N" or "G" is performed sequentially. Based on this, the text is automatically classified into beam name, stirrup information, upper and lower reinforcement separation information, and web reinforcement information, and stored in the corresponding fields of the beam data object. This process uses the precise location of the leader line to limit the search range, and the hierarchical semantic rules ensure the systematic and complete parsing of annotation text, avoiding information misalignment or omission.
[0022] For multi-span beam line extraction, the process begins with the beam line identified by the centrally labeled leader line and iteratively searches based on the span number N in the label. Each iteration starts with the current span's endpoint as the search starting point, selecting lines from all line primitives that simultaneously satisfy a direction angle less than a preset threshold, a starting point spacing less than a preset gap threshold, and an absolute length difference less than a preset length difference threshold as candidates for the next span. When multiple candidates appear, the candidate with the smallest deviation in all three factors (direction angle, starting point spacing, and length difference) is selected, eliminating ambiguity caused by multiple similar beam lines. Before iteration, collinearity is pre-judged by calculating the angle between the connection vector and the direction vector, and subsequent matching is performed only on collinear candidates, effectively filtering out significantly deviating interference segments. In special cases where candidate scores are not significantly different, the distance between the midpoint of the candidate beam line and the beam name insertion point is further compared, selecting the one with the smallest distance. The name space location is used to assist in the judgment, confining the search within a reasonable range. The above-mentioned multidimensional constraints and optimization strategies work together to automatically track and extract all span beam lines with a total number of N, even if there are gaps left by beam line breaks, slight bends or length fluctuations in the original drawing. The number of spans accurately matches the design expression, realizing the complete extraction of geometric information of multi-span beams. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0024] Figure 1 This is a flowchart of a method for automatic identification and extraction of structural beam data based on computer-aided flat surface annotation.
[0025] Figure 2 This is a flowchart of beam name recognition and beam data object construction.
[0026] Figure 3 This is a flowchart for identifying the cross-beam lines where the concentrated annotations are located;
[0027] Figure 4 These are the probability density distribution curves of beam cross-sectional widths with different spans. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0029] See Figure 1 This invention provides an automatic identification and extraction method for structural beam data based on computer-aided flat surface annotation, comprising: Step 1, acquiring text primitives and line primitives from a DWG file; Step 2, identifying beam names from the text primitives and constructing an initial beam data object; Step 3, identifying centralized annotation leaders associated with the beam names from the line primitives based on geometric relationships; Step 4, identifying centralized annotation text associated with the centralized annotation leaders based on spatial relationships and semantic rules; Step 5, identifying the beam line of the span in which the centralized annotation is located based on the geometric position of the centralized annotation leaders; Step 6, iteratively executing a multi-span beam line search algorithm according to the number of spans N in the centralized annotations corresponding to the beam name to obtain all N span beam lines; Step 7, integrating all extracted information into structured data and outputting it.
[0030] Example 1:
[0031] In specific implementation, please refer to Figure 2Step 1: Obtain text and line primitives from the DWG file. The DWG parsing engine traverses the DWG database, extracting all TEXT and MTEXT primitives. For each TEXT and MTEXT primitive, record the text content, insertion point coordinates, rotation angle, and bounding box information of the corresponding text primitive. The text content is the string stored within the TEXT or MTEXT primitive. The insertion point coordinates are the position coordinates of the text primitive in the paper space coordinate system. The rotation angle is the angle value of the text primitive's text direction relative to the horizontal direction. The bounding box information is the coordinates of the lower left and upper right corners of the smallest bounding rectangle of the text primitive. When obtaining line primitives, the DWG parsing engine extracts all LINE and POLYLINE primitives. For each LINE primitive, record the start and end coordinates, and calculate the length and angle of the LINE primitive. The length of the LINE primitive is determined by the Euclidean distance between the start and end coordinates, and the angle of the LINE primitive is determined by the angle between the direction vector from the start to the end coordinates and the positive horizontal direction. For POLYLINE primitives, the DWG parsing engine decomposes them into multiple line segments. For each decomposed line segment, it records the start-point coordinates, end-point coordinates, length, and angle, in the same way as the LINE primitives. Step two involves identifying beam names from text primitives and constructing an initial beam data object. In practice, all text primitives obtained in step one are traversed, and a recognition operation is performed on each one. The text content of the text primitives is obtained, and a predefined regular expression is used to match and judge the text content. The predefined regular expression defines the naming rules for beams: the text content begins with an uppercase letter, followed by at least one digit. When the text content of a text primitive successfully matches the predefined regular expression, the successfully matched text primitive is identified as the initial identifier of the beam, and a data structure object is created. The data structure object contains a beam name field and a beam name location field. The text content of the successfully matched text elements is assigned to the beam name field of the data structure object, and the insertion point coordinates of the successfully matched text elements are assigned to the beam name position field of the data structure object. In some embodiments, the predefined regular expression is specifically: "^(W?K?[TZL]?L[az]?\d+[az]?)(?:-(\d+))?([AB]?)$", which is used to match the beam number, type, number of spans, and cantilever information. It can be understood that the above predefined regular expression is used to match combinations of uppercase letters and numbers, and can also match the number of spans within the parentheses.
[0032] Example 2:
[0033] In the specific implementation, step three involves identifying the centralized annotation leader lines associated with the beam name from the linear primitives based on geometric relationships. For each beam name text primitive obtained through regular expression matching in step two, the entire set of linear primitives extracted in step one is traversed. Each linear primitive in the set contains recorded start-point coordinates, end-point coordinates, and angle information. For both the beam name text primitive and each traversed linear primitive, the following three geometric relationship judgments are performed.
[0034] First, determine whether the insertion point of the beam name text element is within the line segment defined by the start and end coordinates of the line element. Obtain the start coordinates of the line element. and endpoint coordinates The coordinates of the insertion point of the text element for the beam name are recorded as follows: Calculate vectors (From the starting point to the ending point) and vectors (From the starting point to the insertion point), vector (From the endpoint to the insertion point). The condition for the insertion point to lie within the range of the line segment is: vector with vector The dot product of the vectors is greater than or equal to 0, and the vectors are... with vector The dot product is greater than or equal to 0. The geometric meaning of this condition is to guarantee the insertion point... At the starting point and the end point Between. When both of the above dot product conditions are satisfied simultaneously, the result of judgment 1 is true.
[0035] Judgment 2: Determine if the vertical distance from the insertion point of the beam name text element to the straight line element is less than the preset tolerance value. The preset tolerance value is set to 0.01 drawing units. The basis for setting 0.01 drawing units is that in the drawing of architectural engineering drawings, the conventional clearance distance between text elements and leader lines is usually not less than 0.1 drawing units. Selecting one-tenth of this value as the tolerance limit for judging coincidence or slight offset can cover the slight coordinate deviations introduced by drawing scanning conversion or manual drawing. When calculating the vertical distance, the straight line equation of the straight line element is constructed using the starting and ending coordinates of the straight line element. The straight line equation is expressed as follows: ,in , , These are the coefficients of the linear term, the constant term, and the parameters of the equation of the straight line. The calculation method is as follows .parameter The calculation method is as follows .parameter The calculation method is as follows Substitute the coordinates of the insertion point of the beam name text element into the following vertical distance calculation formula:
[0036]
[0037] In the formula, This indicates the vertical distance from the insertion point of the text element representing the beam name to the line element. The coefficient of the linear term in the equation of a straight line; The coefficient of the linear term in the equation of a straight line; Represents the constant term in the equation of a straight line; The x-coordinate of the insertion point of the text element representing the beam name; This represents the ordinate of the insertion point of the text element indicating the beam name. The vertical distance is calculated. Afterwards, comparison The value is close to the preset tolerance value of 0.01. When When the value is less than 0.01, the result of judgment two is true.
[0038] Third, determine if the difference between the rotation angle of the beam name text element and the angle of the straight line element is close to 90 degrees. Obtain the rotation angle of the beam name text element recorded in step one, and denote the rotation angle of the beam name text element as... , The values are in degrees. Obtain the angle of the line element recorded in step one, and denote the angle of the line element as... , The values are in degrees. Calculate the absolute value of the difference in rotation angles. The angle difference is adjusted to a range of 0 to 180 degrees. The condition for an angle difference close to 90 degrees is that the absolute value of the difference between the adjusted angle difference and 90 degrees is less than the preset angle tolerance value. The preset angle tolerance value is set to 5 degrees. The basis for this 5-degree setting is as follows: In architectural engineering flat-style construction drawings, the centralized annotation leader line is drawn perpendicular to the beam line, and the centralized annotation leader line is usually perpendicular to the writing direction of the associated beam name text element. However, in manual drawing, the vertical relationship captured by hand or software has a common fluctuation range of no more than 5 degrees. Therefore, 5 degrees is used as the tolerance criterion for the vertical relationship. When the absolute value of the angle difference and 90 degrees is less than 5 degrees, the result of judgment three is true.
[0039] In the combination judgment of each beam name text element and each straight line element, when the results of judgment one, judgment two and judgment three are all true, the current straight line element is judged as the centralized annotation leader line corresponding to the current beam name text element.
[0040] Step four: Based on spatial relationships and semantic rules, identify the centralized annotation text associated with the centralized annotation leader. In specific implementation, for each centralized annotation leader determined in step three, search within a preset radius centered on the centralized annotation leader for all textual elements obtained in step one as a candidate text set. The preset radius is set to 10 drawing units. The basis for setting 10 drawing units is that, under the commonly used drawing scale of architectural engineering drawings, 10 drawing units can cover the entire content range of the centralized annotation text group in the extension direction of the tip of the centralized annotation leader. This range includes all areas where text in the same row and text in a new line may appear. During the search, obtain the geometric midpoint coordinates of the centralized annotation leader. The x-coordinate of the geometric midpoint coordinates of the centralized annotation leader is... The ordinate of the geometric midpoint is Calculate the Euclidean distance between the insertion point coordinates of each text primitive and the geometric midpoint coordinates of the central annotation leader. When the Euclidean distance is less than 10 drawing units, add the corresponding text primitive to the candidate text set.
[0041] Iterate through each character primitive in the candidate character set, obtain the text content of the character primitive, and perform hierarchical semantic matching on the text content in turn. Hierarchical semantic matching includes four levels of matching rules.
[0042] The first level of matching checks if the text content contains the character "L". At the character encoding level, it checks if the text content string of the text element contains either an uppercase "L" or a lowercase "l". When the text content string contains the character "L" or the character "l", the text content of the current text element is marked as a beam name semantic type, which indicates that the current text element is a beam identification number.
[0043] The second level of matching checks if the text content contains the character "@". It checks if the text content string of a text element contains the character "@". If the text content string contains "@", the text content of the current text element is parsed into a stirrup information semantic type. This stirrup information semantic type indicates that the content of the current text element describes the specifications, diameter, spacing, and number of stirrups.
[0044] The third level of matching checks if the text content contains the character ";". It checks if the text content string of a text element contains the character ";". When the text content string contains ";", the text content of the current text element is parsed into a semantic type indicating the separation between upper and lower reinforcement bars. This semantic type indicates that the first half of the text element's content, separated by a semicolon, represents the upper longitudinal reinforcement configuration of the beam, and the second half represents the lower longitudinal reinforcement configuration of the beam.
[0045] The fourth level of matching checks if the text content contains the characters "N" or "G". It checks if the text content string of a text element contains the uppercase English letter "N" or the uppercase English letter "G". When the text content string contains "N" or "G", the text content of the current text element is parsed into a "reinforcement information" semantic type. This type indicates that the content of the current text element describes the configuration of longitudinal structural reinforcement or torsional reinforcement on the side of the beam.
[0046] The text content of the text element is executed sequentially according to the above four-level matching rules. When the text content of the text element meets the conditions of a certain level of matching rule, the hierarchical semantic matching process of the current text element ends and the matching judgment of subsequent levels is no longer executed.
[0047] Text elements that successfully match the hierarchical semantics are identified as centrally labeled text. The semantic type corresponding to the successfully matched text elements is obtained, and the text content of the text elements is stored in the corresponding field of the beam data object constructed in step two according to the semantic type. When the semantic type of the text element is beam name, the text content is stored in the beam name field of the beam data object; when the semantic type of the text element is stirrup information, the text content is stored in the stirrup information field of the beam data object; when the semantic type of the text element is the separation information of top and bottom reinforcement, the text content is stored in the reinforcement information field of the beam data object; when the semantic type of the text element is the web reinforcement information, the text content is stored in the web reinforcement information field of the beam data object.
[0048] Example 3:
[0049] In specific implementation, please refer to Figure 3 Step 5: Based on the geometric position of the centralized annotation leader, identify the beam line of the span where the centralized annotation is located. Using the centralized annotation leader identified in Step 3 as a reference, search through the entire set of straight line elements obtained in Step 1, and select straight line elements that meet the preset geometric conditions as the beam line of the span where the centralized annotation is located.
[0050] During the search process, each line primitive in the line primitive set is traversed. For each line primitive traversed, the following three geometric conditions are checked.
[0051] Condition 1: Determine if a line primitive and a concentrated annotation leader intersect in the 2D plane. Obtain the start and end coordinates of the concentrated annotation leader. The start coordinates of the concentrated annotation leader are the start coordinates of the line primitive corresponding to the concentrated annotation leader recorded in step 3, and the end coordinates of the concentrated annotation leader are the end coordinates of the line primitive corresponding to the concentrated annotation leader. Obtain the start and end coordinates of the currently traversed line primitive. Use the line segment intersection determination method to determine if two line segments intersect. The line segment intersection determination method is as follows: Represent the concentrated annotation leader as the first line segment, and the currently traversed line primitive as the second line segment. Calculate whether the bounding boxes of the first and second line segments intersect. When the bounding boxes intersect, continue to calculate whether the two endpoints of the first line segment are distributed on both sides of the line containing the second line segment, and whether the two endpoints of the second line segment are distributed on both sides of the line containing the first line segment. When both distribution conditions are met simultaneously, it is determined that the two line segments intersect. When the output of the line segment intersection determination method shows that the centralized label leader has an intersection point with the currently traversed line primitive, the judgment result of condition one is true.
[0052] Condition two: Determine whether the direction of the linear primitive is perpendicular to the direction of the concentrated annotation leader. According to geometric principles, the necessary and sufficient condition for two lines to be perpendicular is that their included angle is 90 degrees. To facilitate computer calculation, this embodiment uses the dot product of direction vectors for this determination: Obtain the direction vector of the concentrated annotation leader, which is determined by the coordinates from the starting point to the ending point of the concentrated annotation leader. Let the direction vector of the concentrated annotation leader be... , direction vector The x-axis component is The vertical axis component is ,in The coordinates are obtained by subtracting the x-coordinate of the starting point from the x-coordinate of the endpoint of the centrally labeled leader line. The direction vector is obtained by subtracting the starting point's ordinate from the ending point's ordinate of the centrally labeled leader line. The direction vector of the currently traversed line primitive is determined by the coordinates from its starting point to its ending point. Let the direction vector of the currently traversed line primitive be denoted as... , direction vector The x-axis component is The vertical axis component is ,in It is obtained by subtracting the starting point's x-coordinate from the ending point's x-coordinate of the currently traversed line primitive. The perpendicularity of two lines is obtained by subtracting the starting point's ordinate from the ending point's ordinate of the currently traversed line primitive. The condition for two lines to be perpendicular is the direction vector. With direction vector Since the dot product is zero, considering the deviation of perpendicular relationships in engineering drawings, a perpendicularity judgment formula is introduced:
[0053]
[0054] In the formula, Represents direction vector With direction vector The absolute value of the dot product; Indicates the direction vector of the centrally labeled leader. The x-axis component; Indicates the direction vector of the centrally labeled leader. The ordinate components; This represents the direction vector of the currently traversed line primitive. The x-axis component; This represents the direction vector of the currently traversed line primitive. The ordinate components; This represents the vertical tolerance threshold. Vertical tolerance threshold Set to 0.01 multiplied by the length of the centrally labeled leader line and then multiplied by the length of the currently traversed straight line primitive, for the vertical tolerance threshold. The value is determined by the product. The calculation shows that, among which Indicates the direction vector of the centrally labeled leader. The length of the mold, This represents the direction vector of the currently traversed line primitive. The modulus length. The basis for setting the coefficient to 0.01 is as follows: In two-dimensional plane geometry, when the cosine value of the angle between two lines is less than approximately 0.01 in absolute value, the deviation of the corresponding angle from 90 degrees does not exceed 0.57 degrees. This deviation range is within the allowable range of the drawing accuracy of architectural engineering drawings, and can determine that approximately perpendicular lines generated by drawing conversion or manual drawing are mutually perpendicular. When the above perpendicularity judgment formula is true, the judgment result of condition two is true.
[0055] Condition 3: Mark the line primitives that simultaneously satisfy conditions 1 and 2 as candidate beam lines. When the judgment result of condition 1 is true and the judgment result of condition 2 is true, mark the currently traversed line primitive as a candidate beam line and add the candidate beam line to the candidate beam line set.
[0056] After traversing all line elements and marking the line elements that meet the conditions as candidate beam lines, select two line elements from the candidate beam line set that are parallel to another candidate beam line in the same span and whose endpoint spacing is less than a preset threshold, and use them as the two beam lines of the span to be centrally labeled.
[0057] During the screening process, each candidate beam line in the candidate beam line set is traversed. For the current candidate beam line, the remaining candidate beam lines in the set (excluding the current candidate beam line itself) are searched to find another candidate beam line that forms a beam span pairing relationship with the current candidate beam line. For two candidate beam lines to form a beam span pairing relationship, both the parallelism condition and the endpoint spacing condition must be satisfied simultaneously.
[0058] The method for determining parallelism is as follows: According to geometric common sense, the necessary and sufficient condition for two straight lines to be parallel is that their angle difference is 0 degrees. To facilitate efficient computer calculation, this embodiment determines parallelism by calculating the cosine of the angle between two direction vectors. The direction vectors of the current candidate beam line and the candidate beam line to be paired are obtained, and the cosine of the angle between the two direction vectors is calculated. When the absolute value of the cosine is greater than 0.999, the two candidate beam lines are determined to be parallel. An absolute value greater than 0.999 corresponds to an angle between the two lines being less than approximately 2.56 degrees. The 2.56-degree threshold is set based on the fact that the angular deviation between parallel lines in architectural beam line drawing does not exceed 2 degrees under standard drafting specifications. A slightly larger threshold is used to accommodate minor deformations during the drawing conversion process.
[0059] The endpoint spacing condition is determined as follows: The starting and ending coordinates of the current candidate beam line and the starting and ending coordinates of the candidate beam line to be paired are obtained. The spatial distance between the starting point of the current candidate beam line and the starting point of the candidate beam line to be paired, and the spatial distance between the ending point of the current candidate beam line and the ending point of the candidate beam line to be paired, are calculated respectively. When the maximum value of the two spatial distances is less than a preset threshold, the endpoint spacing condition is considered true. The preset threshold is set to twice the estimated beam section height. The estimated beam section height is obtained by reading the beam section height field parsed from the centralized annotation text. When the section height has not yet been parsed from the centralized annotation text, the estimated beam section height is set to a default value of 300 drawing units. The 300 drawing units are based on the fact that the most commonly used beam section height range in architectural engineering is 300 mm, which corresponds to 300 drawing units in a 1:1 scale drawing. This default value can cover the section dimensions of most conventional beam components.
[0060] When two candidate beam lines simultaneously satisfy both the parallelism condition and the endpoint spacing condition, the two candidate beam lines are determined as the two beam lines of the span in which the concentrated annotation is located.
[0061] Example 4:
[0062] In the specific implementation, step six involves iteratively executing a multi-span beam line search algorithm based on the span number N in the centralized annotation corresponding to the beam name, to obtain all N span beam lines. The beam line of the span in which the centralized annotation identified in step five is located is taken as the current span beam line, and the number of spans found is initialized to 1.
[0063] In each iteration, before starting the search from the end point of the current span beam line, a collinearity determination step is performed. This step determines whether the end point of the current span beam line is collinear with the starting point of the next candidate span beam line. To determine collinearity, the coordinates of the end point of the current span beam line are obtained and denoted as... Obtain the starting coordinates of the current span line, and denote the starting coordinates of the current span line as... The direction vector of the current beam crossing line is calculated using the starting and ending coordinates. The direction vector of the current beam crossing line is denoted as... , direction vector x-axis components From the x-coordinate of the endpoint Subtract the x-coordinate of the starting point We obtain the direction vector. ordinate components From the endpoint ordinate Subtract the starting point ordinate Obtain the following: Traverse all the line primitives obtained in step one, and treat each traversed line primitive as a candidate beam line to be judged. Obtain the starting coordinates of the candidate beam line to be judged, and denote the starting coordinates of the candidate beam line to be judged as... Calculate the connection vector from the end point of the current beam crossing line to the starting point of the candidate beam crossing line to be judged. The connection vector is denoted as... Connect vectors x-axis components The x-coordinate of the starting point of the candidate beam line to be determined Subtract the x-coordinate of the current span line's endpoint We obtain the connection vector. ordinate components The starting point ordinate of the candidate beam line to be judged Subtract the ordinate of the current span line's endpoint get.
[0064] Calculate the connection vector With direction vector The angle between them. The angle is calculated using the dot product of the vectors and the magnitude of the vectors, and the formula is:
[0065]
[0066] In the formula, Represents the connection vector With direction vector The cosine of the angle between them; Indicates the direction vector of the current beam span. The x-axis component; Indicates the direction vector of the current beam span. The ordinate components; Represents the connection vector The x-axis component; Represents the connection vector The ordinate components are obtained using the inverse cosine function. With direction vector The angle between The value of the included angle. The value is compared with the preset collinearity angle threshold. The preset collinearity angle threshold is set to 8 degrees. The basis for setting 8 degrees is: in the layout of beam components in building engineering, the beam lines of each span of a continuous multi-span beam extend along the same axial direction. Small angular deviations due to drawing errors or the expression of support width are allowed at the connection points of adjacent beam lines. 8 degrees is sufficient to cover the common deviation error range caused by manual drawing or software capturing of the axis, while excluding irrelevant straight line elements that have a significant angle with the direction of the current beam line. When the included angle... When the value is less than the preset collinearity angle threshold of 8 degrees, the connection vector is determined. With direction vector Collinear, and mark the candidate beam lines to be judged as collinear candidate beam lines. When the included angle When the value is greater than or equal to the preset collinearity angle threshold of 8 degrees, it is determined that the candidate beam line to be judged is not collinear with the current cross-beam line, and no further processing is performed on the candidate beam line to be judged. Only the straight line primitives determined to be collinear candidate beam lines are subjected to subsequent parallelism, gap, and length matching judgments.
[0067] For each collinear candidate beam line, perform the following three matching conditions. Condition 1: Determine if the angle between the direction of the collinear candidate beam line and the direction of the current span beam line is less than a preset angle threshold. The preset angle threshold is set to 10 degrees. The 10-degree setting is based on the following: when multiple consecutive span beams extend on the same axis, the direction of each span beam line should remain consistent. Considering coordinate system offset and capture errors during drawing, a 10-degree tolerance range can include beam lines with slight directional fluctuations on the coaxial axis in the matching range, while excluding beam lines with significantly deviated directions. Obtain the direction vector of the collinear candidate beam line, denoted as... , direction vector x-axis components The direction vector is obtained by subtracting the x-coordinate of the starting point from the x-coordinate of the ending point of the collinear candidate beam line. ordinate components The direction vector is obtained by subtracting the starting point's ordinate from the ending point's ordinate of the collinear candidate beam line. Direction vector of the current beam cross line The angle between the vectors is calculated using the vector dot product and vector magnitude method. After obtaining the angle value, it is compared with the preset angle threshold of 10 degrees. When the angle value is less than 10 degrees, the judgment result of condition one is true.
[0068] Condition two involves determining whether the spatial distance between the starting point of the collinear candidate beam line and the ending point of the current span beam line is less than a preset gap threshold. The preset gap threshold is set to 0.5 times the length of the current span beam line. The 0.5-times setting is based on the fact that in architectural drawings, the support width between beam spans is usually much smaller than the length of the beam span itself. The gap between the endpoints of adjacent span beam lines should not exceed half the beam span length. Using 0.5 times ensures that two beam lines are spatially adjacent and connected, rather than being different components that are far apart. The length of the current span beam line is calculated from the Euclidean distance between the starting and ending coordinates of the current span beam line. The Euclidean distance between the starting coordinates of the collinear candidate beam line and the ending coordinates of the current span beam line is calculated. When the Euclidean distance is less than 0.5 times the length of the current span beam line, the result of condition two is true.
[0069] Condition 3: Determine if the absolute value of the difference between the length of the collinear candidate beam line and the length of the current span beam line is less than a preset length difference threshold. The preset length difference threshold is set to 1.0 times the length of the current span beam line. The basis for setting 1.0 times is that while the spans of adjacent spans in a continuous multi-span beam system may differ, the span difference between adjacent spans of the same beam usually does not exceed one time its own span. The 1.0 times threshold can cover common engineering situations of both equal-span and unequal-span continuous beams. The length of the collinear candidate beam line is calculated from the Euclidean distance between the starting and ending coordinates of the collinear candidate beam line. Calculate the absolute value of the difference between the length of the collinear candidate beam line and the length of the current span beam line. If the absolute value is less than 1.0 times the length of the current span beam line, the result of condition 3 is true.
[0070] Collinear candidate beam lines that simultaneously satisfy conditions one, two, and three are marked as candidate beam lines for the next span.
[0071] When a unique candidate beam line for the next span is found, that unique candidate beam line is determined as the next span beam line. The number of spans found is incremented by 1, and the iteration continues with the newly determined next span beam line as the new current span beam line.
[0072] When multiple candidate beam lines for the next span are found, the direction angle, starting point spacing, and length difference between each candidate beam line and the current span beam line are calculated. The direction angle is the angle between the direction vectors of the candidate beam line and the current span beam line. The starting point spacing is the spatial distance between the starting point of the candidate beam line and the ending point of the current span beam line. The length difference is the absolute value of the difference between the length of the candidate beam line and the length of the current span beam line. The three values—direction angle, starting point spacing, and length difference—of each candidate beam line are normalized. The normalized direction angle, normalized starting point spacing, and normalized length difference are then summed to obtain a comprehensive score. The candidate beam line with the lowest comprehensive score is selected as the next span beam line.
[0073] If, after comprehensive comparison of directional angle, starting point spacing, and length difference, there are still multiple candidate beam lines for the next span whose overall score difference is less than a preset difference threshold, a distance comparison step is executed. The preset difference threshold is set to 0.1. The basis for setting 0.1 is that the overall score after the sum of the three normalized indicators ranges from 0 to 3, and a difference of 0.1 accounts for approximately 3.3% of the full score range. Multiple candidate beam lines within this difference range are geometrically similar and need to be further distinguished by spatial location. The distance comparison step is as follows: Obtain the midpoint coordinates of each candidate beam line for the next span whose overall score difference is less than the preset difference threshold of 0.1. The x-coordinate of the midpoint coordinates is obtained by averaging the x-coordinates of the starting and ending points of the candidate beam line for the next span, and the y-coordinate is obtained by averaging the y-coordinates of the starting and ending points of the candidate beam line for the next span. Obtain the insertion point coordinates of the beam name text element recorded in step two. Calculate the Euclidean distance between the midpoint of each candidate beam line for the next span and the insertion point of the beam name text element. Compare the Euclidean distances of each candidate beam line for the next span, and select the candidate beam line with the smallest Euclidean distance as the next beam line. Increment the number of spans found by 1, and continue iterating with the newly determined next beam line as the new current beam line.
[0074] The iterative process continues. After each iteration, the number of spans found is compared with the number of spans N. When the number of spans found equals the number of spans N, the iterative process is terminated, and all N span beam lines are obtained.
[0075] Example 5:
[0076] In the specific implementation, step seven involves integrating all the extracted information into structured data and outputting it. A JSON object is created for each initial data object constructed in step two; the JSON object is a hierarchical data structure conforming to the JSON data exchange format specification.
[0077] The JSON object contains a beam name field. The key of the beam name field is "beamName", and the value type is string. The beam name text content is read from the beam name string identified in step two and assigned verbatim to the value of the beam name field. The beam name field is used to store the beam name string identified in step two through regular expression matching.
[0078] The JSON object contains two fields: beam section width and beam section height. The key for the beam section width field is "sectionWidth", and the value type is numeric. The key for the beam section height field is "sectionHeight", and the value type is numeric. From the centralized annotation text identified through hierarchical semantic matching in step four, the parsed section dimension strings are read. The format of the section dimension string is "section width value × section height value". The string is split using either the character "×" or the character "*" as a delimiter. The two resulting numeric strings are converted to numeric types, and the first numeric value is assigned to the key of the beam section width field, and the second numeric value is assigned to the key of the beam section height field. The beam section width field stores the section width value parsed from the centralized annotation text, and the beam section height field stores the section height value parsed from the centralized annotation text.
[0079] The JSON object contains a span number field. The key for the span number field is "spanCount", and the key-value pair is an integer. From the aggregated labeled text identified in step four through hierarchical semantic matching, the parsed string representation of the span number N is read, converted to an integer, and then assigned to the key-value pair of the span number field. The span number field is used to store the span number N parsed from the aggregated labeled text.
[0080] The JSON object contains a span list field. The key of the span list field is "spanList", and the key-value pair is an array. The span list field stores an array, where each element corresponds to a structured information segment for a span. The length of the span list field array is equal to the number of spans N stored in the span number field.
[0081] Each element in the array of span list fields is a JSON sub-object, containing beam line coordinate information, span cross-section dimensions, and in-situ annotation text. For the spans containing the concentrated annotations identified in step five and all remaining spans obtained in step six using the multi-span beam line search algorithm, JSON sub-objects are constructed sequentially according to the span arrangement order. The span arrangement order is determined by the geometric connection order of the beam lines along the beam axis direction.
[0082] The key name of the beam line coordinate information field is "beamLines", and the key value type of the beam line coordinate information field is an array containing two sub-elements. Each sub-element corresponds to one beam line within the span. Each beam line is represented as an array of coordinate pairs, containing the start and end coordinates of the beam line. In specific implementation, the linear primitives corresponding to the two beam lines of the current span determined in steps five and six are obtained. For each linear primitive, the start and end coordinates of the linear primitive are extracted. The start coordinates are stored as a two-element array containing the x-coordinate and y-coordinate values, and the end coordinates are also stored as a two-element array containing the x-coordinate and y-coordinate values. The start coordinate array is placed in the first position of the coordinate pair array, and the end coordinate array is placed in the second position of the coordinate pair array. The coordinate pair arrays of the two beam lines are combined into an array containing two elements and assigned to the key value of the beam line coordinate information field. Each element of the beam line coordinate information field contains the start and end coordinates of the two beam lines corresponding to the span.
[0083] The key name for the span section dimension field is "sectionDimension", and the key value type is object. The span section dimension field contains a width subfield and a height subfield. The key name for the width subfield is "width", and the key name for the height subfield is "height". The beam section width value parsed from the centralized annotation text is assigned to the key value of the width subfield, and the beam section height value parsed from the centralized annotation text is assigned to the key value of the height subfield. The span section dimension field is used to store the section dimensions of the corresponding span.
[0084] The key name for the in-situ label text field is "inPlaceLabel", and the key-value type for the in-situ label text field is string. All text elements extracted in step one are retrieved. For each text element, the coordinates of its insertion point are calculated to determine if it lies within the rectangular area enclosed by the two beam lines of the current span. The rectangular area enclosed by the two beam lines is determined as follows: The starting and ending coordinates of the first and second beam lines are retrieved. The minimum, maximum, minimum, and maximum x-coordinates of the four endpoints are calculated. The minimum x-coordinate is used as the left boundary of the rectangular area, the maximum x-coordinate as the right boundary, the minimum y-coordinate as the lower boundary, and the maximum y-coordinate as the upper boundary. When the x-coordinate of the text element's insertion point is greater than or equal to the left boundary and less than or equal to the right boundary, and the y-coordinate of the text element's insertion point is greater than or equal to the lower boundary and less than or equal to the upper boundary, the text element's insertion point is determined to be within the rectangular area. The text content of text elements whose insertion point coordinates are located within the rectangular area is concatenated, with spaces separating the text content of different text elements. The concatenated text content is then assigned to the key-value pair of the in-situ label text field. When there are no text elements within the rectangular area, the key-value pair of the in-situ label text field is assigned an empty string. The in-situ label text field is used to store the in-situ label text content corresponding to that area.
[0085] After constructing all the JSON sub-objects for each span, the JSON sub-objects are stored sequentially in the array corresponding to the key-value pairs of the span list fields, arranged in the order of the spans. After assigning values to the beam name field, beam section width field, beam section height field, span number field, and span list field, the JSON object is output as the structured data recognition result.
[0086] See Figure 4 In the figure, the horizontal axis represents the beam cross-section width, in drawing units, ranging from approximately 150 to 550; the vertical axis represents the probability density, reflecting the probability distribution characteristics corresponding to different cross-section widths. Different colored curves in the legend correspond to different beam span numbers from 1 to 5. This figure, based on the structured data output method in step seven of Example 5, statistically analyzes the probability distribution of beam cross-section widths with different span numbers through multi-span beam line search results.
[0087] From the overall trend in the figure, the probability density curves corresponding to all spans show a single-peak distribution, and the position and shape of the peak value vary significantly with the number of spans. The probability density curve for the beam cross-section width of a span of 1 (blue) shows that the peak value is concentrated around 450 plotting units, indicating that the width of a single-span beam cross-section is mainly concentrated in this area; the peak value of the curve for a span of 2 (orange) shifts slightly to around 460 plotting units, and the overall curve is relatively flat, indicating that the width of a two-span beam cross-section is slightly larger and more dispersed.
[0088] The peak position of the curve with 3 spans (green) drops back to around 300 plotting units, while the curve shows local fluctuations, indicating that the width distribution of the three-span beam cross-section is relatively complex and has a small range of diversity; the curve with 4 spans (red) forms a higher peak in the range of 400 to 500 plotting units, and the maximum probability density is significantly higher than other span numbers, indicating that the width of the four-span beam cross-section is mostly concentrated in this wider range and has a strong clustering.
[0089] The peak of the curve with 5 spans (purple) is significantly to the left, around 250 plotting units. Its probability density value is generally lower than that of other span curves, and it shows a downward trend in the wider range, reflecting that the cross-sectional width of the five-span beam is relatively small and its distribution is relatively concentrated.
[0090] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for automatic identification and extraction of structural beam data based on computer-aided flat surface annotation, characterized in that, The method includes: Step 1: Obtain text and line primitives from the DWG file; Step 2: Identify the beam name from the text primitives and construct an initial beam data object; Step 3: Based on geometric relationships, identify the centralized label leader lines associated with the beam name from the linear primitives; Step 4: Based on spatial relationships and semantic rules, identify the centralized annotation text associated with the centralized annotation leader line; Step 5: Based on the geometric position of the centralized annotation leader, identify the beam line of the span in which the centralized annotation is located; Step 6: Based on the number of spans N in the centralized annotation corresponding to the beam name, iteratively execute the multi-span beam line search algorithm to obtain all N-span beam lines; Step 7: Integrate all the extracted information into structured data and output it.
2. The method for automatic identification and extraction of structural beam data based on computer-aided flat surface annotation as described in claim 1, characterized in that, In step one, when obtaining text primitives, the DWG database is traversed through the DWG parsing engine to extract all TEXT and MTEXT primitives, and the text content, insertion point coordinates, rotation angle and bounding box information of each primitive are recorded. When acquiring line elements, extract all LINE and POLYLINE elements and record the start coordinates, end coordinates, length, and angle information of each element.
3. The method for automatic identification and extraction of structural beam data based on computer-aided flat surface annotation as described in claim 1, characterized in that, In step two, when identifying the beam name from the text elements, all text elements are traversed, and predefined regular expressions are used to match text that conforms to the beam naming rules. After a successful match, a data structure object is created using the text element as the initial identifier of the beam. The text content of the text element is stored in the data structure object as the beam name, and the coordinates of the insertion point of the text element are stored in the data structure object as the position of the beam name.
4. The method for automatic identification and extraction of structural beam data based on computer-aided flat surface annotation as described in claim 1, characterized in that, In step three, when identifying the centralized label leader line associated with the beam name from the straight line elements, for each beam name text element and each straight line element, it is determined whether the insertion point of the beam name text element is within the line segment range defined by the start and end points of the straight line element. Furthermore, it is determined whether the vertical distance from the insertion point of the beam name text element to the straight line element is less than a preset tolerance value; Furthermore, it is determined whether the difference between the rotation angle of the beam name text element and the angle of the straight line element is close to 90 degrees; Linear elements that simultaneously meet the above three conditions are identified as the centralized label leader lines corresponding to the beam name.
5. The method for automatic identification and extraction of structural beam data based on computer-aided flat surface annotation as described in claim 1, characterized in that, In step four, when identifying the centralized annotation text associated with the centralized annotation leader based on spatial relationships and semantic rules, firstly, with the centralized annotation leader as the center, all text primitives are searched within a preset radius as a candidate text set. Then, each character element in the candidate character set is traversed, and hierarchical semantic matching is performed on the text content of that character element in turn: If the first-level matching text contains the character "L", then the text is marked as the beam name; The second-level match determines whether the text contains the character "@". If it does, the text is parsed as stirrup information. The third-level matching method checks whether the text contains the character ";". If it does, the text is parsed as the separator between the upper and lower reinforcing bars. The fourth level matches whether the text contains the characters "N" or "G". If it does, the text is parsed as waist muscle information. The successfully matched text elements are identified as centrally labeled text, and the text content is stored in the corresponding field of the data object according to the matched semantic type.
6. The method for automatic identification and extraction of structural beam data based on computer-aided flat surface annotation as described in claim 1, characterized in that, In step five, when identifying the beam line of the span containing the centralized annotation, the centralized annotation leader line is used as a reference to search for a straight line element among all straight line elements that satisfies all of the following conditions as the beam line of the span: The linear graphic element and the centralized labeled leader line intersect at a point in the two-dimensional plane; The direction of the linear element is perpendicular to the direction of the concentrated annotation leader; Linear primitives that intersect and are perpendicular to the centrally labeled leader lines are marked as candidate beam lines; From the candidate beam lines, two straight line elements that are parallel to another candidate beam line in the same span and whose endpoint spacing is less than a preset threshold are selected as the two beam lines of that span.
7. The method for automatic identification and extraction of structural beam data based on computer-aided flat surface annotation as described in claim 1, characterized in that, In step six, when iteratively executing the multi-span beam line search algorithm, the beam line of the span in which the concentrated annotation is identified in step five is taken as the current span beam line, and the number of spans found is initialized to 1. In each iteration, starting from the endpoint of the current span beam line, a search is conducted among all line elements to find line elements that satisfy the following conditions as candidate beam lines for the next span: The angle between the direction of the candidate beam line and the direction of the current cross beam line is less than a preset angle threshold; The spatial distance between the starting point of the candidate beam line and the ending point of the current cross-beam line is less than the preset gap threshold. The absolute value of the difference between the length of the candidate beam line and the length of the current span beam line is less than the preset length difference threshold; The linear primitives that simultaneously meet the above conditions are marked as candidate beam lines for the next span. When the candidate beam line for the next span is unique, the candidate beam line is determined as the next span beam line, and the number of spans found is incremented by 1. The next span beam line is then used as the new current span beam line to continue the iteration. When there are multiple candidate beam lines for the next span, calculate the direction angle, starting point spacing, and length difference between each candidate beam line and the current span beam line, and select the candidate beam line with the smallest direction angle, the smallest starting point spacing, and the smallest length difference as the next span beam line. The iterative process continues until the number of spans found equals the number of spans N.
8. The method for automatic identification and extraction of structural beam data based on computer-aided flat surface annotation as described in claim 7, characterized in that, In each iteration of the multi-span beam line search algorithm, before starting the search with the end point of the current span beam line as the search starting point, it is determined whether the end point of the current span beam line is collinear with the starting point of the next candidate span beam line. When determining collinearity, the direction vector of the current beam crossing line and the connection vector from the end point of the current beam crossing line to the starting point of the candidate beam line are calculated. If the angle between the connection vector and the direction vector is less than a preset collinearity angle threshold, then the two are determined to be collinear. Subsequent parallelism, gap, and length matching checks are performed only on candidate beam lines that are determined to be collinear.
9. The method for automatic identification and extraction of structural beam data based on computer-aided flat surface annotation as described in claim 7, characterized in that, In each iteration of the multi-span beam line search algorithm, when there are multiple candidate beam lines for the next span and after comprehensive comparison of direction angle, starting point spacing and length difference, there are still multiple candidate beam lines whose score difference is less than the preset difference threshold, the distance between the midpoint of each candidate beam line and the insertion point of the beam name text element is compared, and the candidate beam line with the smallest distance is selected as the next span beam line.
10. The method for automatic identification and extraction of structural beam data based on computer-aided flat surface annotation according to claim 1, characterized in that, In step seven, when integrating all the extracted information into structured data, a JSON object is created for each beam component. The JSON object contains the following fields: The beam name field is used to store the beam name string identified in step two. The beam section width and beam section height fields are used to store the section dimensions parsed from the centralized annotation text; The span number field is used to store the span number N parsed from the centrally labeled text; The span list field is used to store an array, where each element of the array corresponds to the structured information of a span. Each element contains the start and end coordinates of the two beam lines of the span, the cross-sectional dimensions of the span, and the in-situ annotation text content corresponding to the span.