CN117237978B - CAD drawing electrical bridge information extraction method and system - Google Patents

CAD drawing electrical bridge information extraction method and system Download PDF

Info

Publication number
CN117237978B
CN117237978B CN202311523852.4A CN202311523852A CN117237978B CN 117237978 B CN117237978 B CN 117237978B CN 202311523852 A CN202311523852 A CN 202311523852A CN 117237978 B CN117237978 B CN 117237978B
Authority
CN
China
Prior art keywords
area
preset threshold
bridge
certain
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311523852.4A
Other languages
Chinese (zh)
Other versions
CN117237978A (en
Inventor
彭飞
周自强
李一华
李杉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangxi Shaoke Intelligent Construction Technology Co ltd
Original Assignee
Jiangxi Shaoke Intelligent Construction Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangxi Shaoke Intelligent Construction Technology Co ltd filed Critical Jiangxi Shaoke Intelligent Construction Technology Co ltd
Priority to CN202311523852.4A priority Critical patent/CN117237978B/en
Publication of CN117237978A publication Critical patent/CN117237978A/en
Application granted granted Critical
Publication of CN117237978B publication Critical patent/CN117237978B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a CAD drawing electrical bridge information extraction method and a system, wherein the method comprises the following steps: if the difference value between the area of a certain target closed area and the minimum external rectangular area of the certain target closed area is within a first preset threshold range, defining the certain target closed area as a bridge; if the number of the edges of the certain target closed area is not in the first preset threshold range, judging whether the number of the edges of the certain target closed area is in the second preset threshold range or not, and judging whether the number of the convex right angles of the certain target closed area is in the third preset threshold range or not; if the edge number of a certain target closing area is in a second preset threshold range and the number of the convex right angles of the certain target closing area is in a third preset threshold range, defining the certain target closing area as a connecting piece; and matching a certain bridge frame with a certain connecting piece to obtain a matching relation, and determining the connection relation of all bridge frames according to the matching relation. The purpose of extracting the outline information of the bridge and the connection relation between the bridge is achieved.

Description

CAD drawing electrical bridge information extraction method and system
Technical Field
The invention belongs to the technical field of information extraction, and particularly relates to a CAD drawing electrical bridge information extraction method and system.
Background
The electric bridge frame is divided into a bridge frame and a connecting piece, and is an important component of a CAD building design drawing. Accurate identification, positioning of the bridge and the connecting piece are important basic functions for drawing the BIM. In the traditional modeling process, a designer needs to check drawings to determine the type, length, height and other information of the bridge frame. And then drawing the bridge in BIM software and adding attribute information of the bridge. When the drawing of a large building is processed, different types of bridges are arranged on the buildings on different floors, and a designer is required to manually adjust the bridges. Meanwhile, the bridge frames are mutually intersected and overlapped on the CAD drawing. The designer needs to carefully distinguish to identify the complete bridge. In addition, the situation that the data in the CAD building design drawing and the BIM model are inconsistent is easy to occur in the manual drawing process, and once a bridge drawing error occurs, the place where the error occurs is difficult to be excluded. Automated identification and extraction of bridges and connectors is therefore a very interesting function in driving digital architectural designs.
There are also many difficulties in extracting the positive pattern of the bridge from CAD drawings. First, although the electrical bridge is relatively fixed in shape, it is difficult to precisely position and shape the connector. Secondly, the bridges can overlap and influence each other during drawing. This can lead to difficult identification of the bridge and the connection. Finally, during actual drawing, the style of the bridge frame can be changed due to personal habit and fine adjustment, and the difficulty of recognizing and positioning the bridge frame is increased. In addition, the difficulty is increased due to data errors and drawing accuracy.
Disclosure of Invention
The invention provides a method and a system for extracting electrical bridge information of a CAD drawing, which are used for solving the technical problem of how to extract electrical patterns of a bridge in the CAD drawing.
In a first aspect, the invention provides a method for extracting electrical bridge information of a CAD drawing, which comprises the following steps: acquiring a bridge frame layer containing bridge frame line segments in a CAD drawing, and extracting all line segments and end point coordinates of all line segments in the bridge frame layer to obtain a target image; scanning the target graph based on a breadth-first search algorithm to obtain at least one closed region; selecting at least one target closed region meeting a first preset condition and a second preset condition from the at least one closed region, wherein the first preset condition is that the length of any line segment in the closed region is not greater than a first preset threshold, the second preset condition is that the area of the closed region is greater than a second preset threshold and the vertex number of the closed region is greater than a third preset threshold; judging whether the difference value between the area of a certain target closed area and the minimum external moment area of the certain target closed area is within a first preset threshold range or not; if the difference value between the area of a certain target closed area and the minimum external moment area of the certain target closed area is within a first preset threshold range, defining the certain target closed area as a bridge; if the difference value between the area of a certain target closed area and the minimum external rectangular area of the certain target closed area is not in the first preset threshold range, judging whether the edge number of the certain target closed area is in the second preset threshold range or not, and whether the number of the convex right angles of the certain target closed area is in the third preset threshold range or not; if the number of edges of the certain target closing area is in a second preset threshold range and the number of the convex right angles of the certain target closing area is in a third preset threshold range, defining the certain target closing area as a connecting piece; judging whether the distance between the connecting point of a certain bridge and the connecting point of a certain connecting piece is smaller than a fourth preset threshold value, wherein the connecting point of the certain bridge is the midpoint of a short side in the certain bridge, and the connecting point of the certain connecting piece is the midpoint of a line segment between two convex right angles in the certain connecting piece; if the distance between the connecting point of a certain bridge frame and the connecting point of a certain connecting piece is smaller than a fourth preset threshold, matching the certain bridge frame with the certain connecting piece to obtain a matching relation, and determining the connecting relation of all bridge frames according to the matching relation.
In a second aspect, the present invention provides a CAD drawing electrical bridge information extraction system, including: the acquisition module is configured to acquire a bridge frame layer containing bridge frame line segments in a CAD drawing, and extract all line segments and end point coordinates of all line segments in the bridge frame layer to obtain a target image; the scanning module is configured to scan the target graph based on a width-first search algorithm to obtain at least one closed region; the selecting module is used for selecting at least one target closed region meeting a first preset condition and a second preset condition from the at least one closed region, wherein the first preset condition is that the length of any line segment in the closed region is not greater than a first preset threshold value, the second preset condition is that the area of the closed region is greater than a second preset threshold value and the number of vertexes of the closed region is greater than a third preset threshold value; the first judging module is configured to judge whether the difference value between the area of a certain target closed area and the minimum external rectangular area of the certain target closed area is within a first preset threshold range or not; the first defining module is configured to define a certain target closed area as a bridge frame if the difference value between the area of the certain target closed area and the minimum external rectangular area of the certain target closed area is within a first preset threshold range; the second judging module is configured to judge whether the edge number of a certain target closed area is in a second preset threshold range or not and whether the number of the convex right angles of the certain target closed area is in a third preset threshold range or not if the difference value between the area of the certain target closed area and the minimum external rectangular area of the certain target closed area is not in the first preset threshold range; the second definition module is configured to define the certain target closed area as a connecting piece if the edge number of the certain target closed area is in a second preset threshold range and the number of the convex right angles of the certain target closed area is in a third preset threshold range; the third judging module is configured to judge whether the distance between the connecting point of a certain bridge and the connecting point of a certain connecting piece is smaller than a fourth preset threshold, wherein the connecting point of the certain bridge is the midpoint of a short side in the certain bridge, and the connecting point of the certain connecting piece is the midpoint of a line segment between two convex right angles in the certain connecting piece; and the matching module is configured to match a certain bridge frame with a certain connecting piece to obtain a matching relationship if the distance between the connecting point of the certain bridge frame and the connecting point of the certain connecting piece is smaller than a fourth preset threshold value, and determine the connection relationship of all bridge frames according to the matching relationship.
In a third aspect, there is provided an electronic device, comprising: the computer-readable storage medium comprises at least one processor and a memory communicatively connected with the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the CAD drawing electrical bridge information extraction method of any one of the embodiments of the present invention.
In a fourth aspect, the present invention further provides a computer readable storage medium, on which a computer program is stored, where the program instructions, when executed by a processor, cause the processor to execute the steps of the CAD drawing electrical bridge information extraction method according to any of the embodiments of the invention.
The CAD drawing electrical bridge information extraction method and system have the following advantages: if the difference value between the area of a certain target closed area and the minimum external rectangular area of the certain target closed area is within a first preset threshold range, defining the certain target closed area as a bridge; if the difference value between the area of a certain target closed area and the minimum external rectangular area of the certain target closed area is not in the first preset threshold range, judging whether the edge number of the certain target closed area is in the second preset threshold range or not, and whether the number of the convex right angles of the certain target closed area is in the third preset threshold range or not; if the edge number of a certain target closing area is in a second preset threshold range and the number of the convex right angles of the certain target closing area is in a third preset threshold range, defining the certain target closing area as a connecting piece; and matching a certain bridge frame with a certain connecting piece to obtain a matching relation, and determining the connection relation of all bridge frames according to the matching relation. The method has the advantages that the effect of extracting the outline information of the bridge and the connection relation between the bridge is achieved, and the data are stored in an ifc format so as to construct the BIM model.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for extracting electrical bridge information from CAD drawings according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a CAD drawing line segment pre-processing according to an embodiment of the present invention;
FIG. 3 is a schematic view of a closed region according to an embodiment of the present invention;
FIG. 4 (a) is a schematic view of a three-way connector according to an embodiment of the present invention;
FIG. 4 (b) is a schematic view of a bending connection member according to an embodiment of the present invention;
FIG. 4 (c) is a schematic view of a four-way connector according to an embodiment of the present invention;
FIG. 5 is a block diagram of a CAD drawing electrical bridge information extraction system according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, a flowchart of a CAD drawing electrical bridge information extraction method is shown.
As shown in fig. 1, the method for extracting the electrical bridge information of the CAD drawing specifically includes the following steps:
step S101, a bridge frame layer containing bridge frame line segments in a CAD drawing is obtained, all line segments in the bridge frame layer and end point coordinates of all line segments are extracted, and a target graph is obtained.
In the step, a bridge frame layer containing bridge frame line segments in the CAD drawing is obtained by analyzing the DWG format file and preprocessing the analyzed CAD drawing, so that the bridge frame layer containing the bridge frame line segments in the CAD drawing is obtained, and all line segments and end point coordinates of all line segments in the bridge frame layer are extracted to obtain a target drawing.
It should be noted that, the DWG format file is parsed: by adopting the objectARX tool to analyze the DWG format file, all the primitives in the DWG can be decomposed into basic straight lines, text information and examples can be stored in the form of blocks, and the data in the DWG can be stored in layers. The names of the layers are then analyzed, and the layers containing the bridge line segments are screened out by keywords. The line segment information is represented using a coordinate pair of a start point and an end point.
Preprocessing the analyzed CAD drawing: because the precision of the CAD drawing is very high, people cannot pay attention to the fine errors on the drawing when reading the drawing. The parsed line segment data may not be consistent with the intuitively viewable data. Two line segments which are originally a line segment and can be mutually overlapped; the line segments which originally appear to be connected are actually disconnected after the precision is amplified; or what appears to be collinear, there is actually a slight deviation. Thus, the parsed data needs to be preprocessed. The end points of the line segments are combined, and points falling within a certain range are combined into one point. As in region a of fig. 2, solid dots are used instead of surrounding hollow neighboring dots. And synchronously modifying the coordinates of the end points of the corresponding line segments. And then performing de-duplication processing on the overlapped line segments, and reconnecting the overlapped line segments according to the endpoint sequence to form a new line segment, such as a region b in fig. 2.
Step S102, scanning the target graph based on a breadth-first search algorithm to obtain at least one closed region.
In this step, since the space-plus-style bridge itself is a closed region, the data preprocessing eliminates errors inherent to the data itself. The data of the line segments can thus be organized using the data structure of the graph, and then the minimum closed area of the graph is analyzed, as logically shown below:
selecting any one end point in the target graph as a starting point, and performing breadth-first search to obtain a spanning tree;
when the current point is in the spanning tree, a basic ring appears, the current point and a unique path corresponding to the current point are recorded as vertex coordinates of the basic ring, and the other endpoint in the target graph is repeatedly selected as a starting point until all endpoints in the target graph are scanned, so that at least one closed area is obtained. Wherein the current point is the point being searched in the depth-first search process.
Resulting in a closed area as in fig. 3. Each of the closure areas may be a bridge or a connector. To reduce the amount of data for subsequent judgment, too small or too large closure areas such as A and B may be screened out, leaving behind as the target closure areas for judgment of the bridge and connection.
Step S103, selecting at least one target closed region meeting a first preset condition and a second preset condition from the at least one closed region, wherein the first preset condition is that the length of any line segment in the closed region is not greater than a first preset threshold, and the second preset condition is that the area of the closed region is greater than a second preset threshold and the number of vertexes of the closed region is greater than a third preset threshold.
In this step, at least one target closed region meeting a first preset condition and a second preset condition is selected from at least one closed region, the first preset condition is that the length of any line segment in the closed region is not more than 1000mm, and the second preset condition is that the area of the closed region is more than 10mm 2 And the number of vertices of the closed region is greater than 3.
Step S104, judging whether the difference value between the area of a certain target closed area and the minimum external moment area of the certain target closed area is within a first preset threshold range.
In this step, the bridge is fixed in a rectangular shape and the shape of the connecting member is more complicated due to the inherent shape characteristics of the bridge and the connecting member. Thus for each candidate geometry, it is possible to distinguish whether a certain target closure zone is a bridge or a connection according to the following rules:
calculating the area of a certain target closed area and the minimum circumscribed moment area of the certain target closed area through the endpoint coordinates of the certain target closed area, carrying out difference between the area of the certain target closed area and the minimum circumscribed moment area of the certain target closed area, and judging whether the obtained difference is within 0-two percent of the area of the certain target closed area.
If the difference value between the area of a certain target closed area and the minimum external rectangular area of the certain target closed area is not in the first preset threshold range, judging whether the edge number of the certain target closed area is in the second preset threshold range or not, and whether the number of the convex right angles of the certain target closed area is in the third preset threshold range or not.
The minimum circumscribed rectangle area is the area of the minimum circumscribed rectangle.
Step S105, if the difference between the area of a certain target closed area and the minimum external moment area of the certain target closed area is within the first preset threshold range, defining the certain target closed area as a bridge.
Step S106, if the difference between the area of a certain target closed area and the minimum external rectangular area of the certain target closed area is not within the first preset threshold range, judging whether the edge number of the certain target closed area is within the second preset threshold range, and whether the number of the convex right angles of the certain target closed area is within the third preset threshold range.
In this step, if the difference between the area of a certain target closed region and the minimum external rectangular area of the certain target closed region is not within the first preset threshold range, the certain target closed region may be a connecting element, so that for a candidate region that may be a connecting element, it is necessary to recombine broken line segments in the graph into one line segment. The shape of the pattern is then further analyzed. The method comprises the following steps:
if the difference between the area of a certain target closed area and the minimum external rectangular area of the certain target closed area is not within 0-two percent of the area of the certain target closed area, judging whether the edge number of the certain target closed area is within 6-16, and whether the number of the convex right angles of the certain target closed area is within 4-12.
Step S107, if the number of edges of the certain target closed area is within the second preset threshold range and the number of convex right angles of the certain target closed area is within the third preset threshold range, defining the certain target closed area as a connecting piece.
In this step, if the number of sides of the certain target closed area is within 6-16 and the number of convex right angles of the certain target closed area is within 4-12, the certain target closed area is defined as a connecting piece.
Specifically, as shown in fig. 4 (a), 4 (b) and 4 (c), if the number of sides of a certain target closed area is 6 and the number of convex right angles of a certain target closed area is 5, a certain target closed area is defined as a curved connection; if the number of edges of a certain target closing area is 8 and the number of convex right angles of the certain target closing area is 6, defining the certain target closing area as a three-way connecting piece; if the number of sides of a certain target closing area is 12 and the number of convex right angles of a certain target closing area is 8, a certain target closing area is defined as a four-way connector.
Step S108, judging whether the distance between the connecting point of a certain bridge and the connecting point of a certain connecting piece is smaller than a fourth preset threshold, wherein the connecting point of the certain bridge is the midpoint of a short side in the certain bridge, and the connecting point of the certain connecting piece is the midpoint of a line segment between two convex right angles in the certain connecting piece.
In the step, judging whether the distance between the connecting point of a certain bridge frame and the connecting point of a certain connecting piece is smaller than 10mm;
if the distance between the connecting point of a certain bridge and the connecting point of a certain connecting piece is not smaller than 10mm, calculating the distance between the connecting point of a certain bridge and the connecting point of another connecting piece until all the connecting points of the bridge and all the connecting pieces are traversed.
It should be noted that, since the bridge is rectangular, the connection point of the bridge is the midpoint of the bridge broadside, and the connection point of the connecting piece is the midpoint of the line segment between the two convex right angles in the connecting piece. For example, the solid points in fig. 4 (a), 4 (b) and 4 (c) are all connection points of the connector.
Step S109, if the distance between the connection point of a certain bridge and the connection point of a certain connecting piece is smaller than a fourth preset threshold, matching the certain bridge with the certain connecting piece to obtain a matching relationship, and determining the connection relationship of all the bridges according to the matching relationship.
In this step, in order to facilitate BIM model generation, the connection relationship of the bridge is extracted while the bridge information is extracted. According to the shape of the bridge, all connection points on the bridge are calculated first. The positions of the connection points of the connection pieces are then calculated from the shapes of the connection pieces as shown in fig. 4 (a), 4 (b) and 4 (c). And finally, matching the connection point of the bridge frame with the connection point of the connecting piece. And finally, determining the final bridge connection relation according to the matching relation of the connection points. And finally, reconfirming the connection point of the bridge frame.
In summary, in the method of the present application, if the difference between the area of a certain target closed area and the minimum external rectangular area of the certain target closed area is within a first preset threshold range, defining the certain target closed area as a bridge; if the difference value between the area of a certain target closed area and the minimum external rectangular area of the certain target closed area is not in the first preset threshold range, judging whether the edge number of the certain target closed area is in the second preset threshold range or not, and whether the number of the convex right angles of the certain target closed area is in the third preset threshold range or not; if the edge number of a certain target closing area is in a second preset threshold range and the number of the convex right angles of the certain target closing area is in a third preset threshold range, defining the certain target closing area as a connecting piece; and matching a certain bridge frame with a certain connecting piece to obtain a matching relation, and determining the connection relation of all bridge frames according to the matching relation. The method has the advantages that the effect of extracting the outline information of the bridge and the connection relation between the bridge is achieved, and the data are stored in an ifc format so as to construct the BIM model.
Referring to fig. 5, a block diagram of a CAD drawing electrical bridge information extraction system of the present application is shown.
As shown in fig. 5, the CAD drawing electrical bridge information extraction system 200 includes an acquisition module 210, a scanning module 220, a selection module 230, a first determination module 240, a first determination module 250, a second determination module 260, a second definition module 270, a third determination module 280, and a matching module 290.
The acquiring module 210 is configured to acquire a bridge layer containing bridge segments in a CAD drawing, and extract all segments in the bridge layer and end point coordinates of all segments to obtain a target graph; a scanning module 220 configured to scan the target graph based on a breadth-first search algorithm to obtain at least one closed region; a selecting module 230, configured to select at least one target closed region that meets a first preset condition and a second preset condition from the at least one closed region, where the first preset condition is that a length of any line segment in the closed region is not greater than a first preset threshold, and the second preset condition is that an area of the closed region is greater than a second preset threshold and a number of vertices of the closed region is greater than a third preset threshold; a first judging module 240 configured to judge whether a difference between an area of a certain target closed area and a minimum external rectangular area of the certain target closed area is within a first preset threshold range; the first defining module 250 is configured to define a certain target closed area as a bridge if a difference between an area of the certain target closed area and a minimum external moment area of the certain target closed area is within a first preset threshold range; a second judging module 260, configured to judge whether the number of edges of a certain target closed area is within a second preset threshold range and whether the number of convex right angles of the certain target closed area is within a third preset threshold range if the difference between the area of the certain target closed area and the minimum external rectangular area of the certain target closed area is not within the first preset threshold range; a second defining module 270, configured to define the certain target closed area as a connector if the number of edges of the certain target closed area is within a second preset threshold range and the number of convex right angles of the certain target closed area is within a third preset threshold range; the third judging module 280 is configured to judge whether a distance between a connection point of a certain bridge and a connection point of a certain connecting piece is smaller than a fourth preset threshold, where the connection point of the certain bridge is a midpoint of a short side in the certain bridge, and the connection point of the certain connecting piece is a midpoint of a line segment between two convex right angles in the certain connecting piece; and the matching module 290 is configured to match a certain bridge with a certain connecting piece to obtain a matching relationship if the distance between the connecting point of the certain bridge and the connecting point of the certain connecting piece is smaller than a fourth preset threshold, and determine the connection relationship of all the bridges according to the matching relationship.
It should be understood that the modules depicted in fig. 5 correspond to the various steps in the method described with reference to fig. 1. Thus, the operations and features described above for the method and the corresponding technical effects are equally applicable to the modules in fig. 5, and are not described here again.
In other embodiments, the present invention further provides a computer readable storage medium, on which a computer program is stored, where the program instructions, when executed by a processor, cause the processor to perform the method for extracting electrical bridge information from CAD drawing in any of the above method embodiments;
as one embodiment, the computer-readable storage medium of the present invention stores computer-executable instructions configured to:
acquiring a bridge frame layer containing bridge frame line segments in a CAD drawing, and extracting all line segments and end point coordinates of all line segments in the bridge frame layer to obtain a target image;
scanning the target graph based on a breadth-first search algorithm to obtain at least one closed region;
selecting at least one target closed region meeting a first preset condition and a second preset condition from the at least one closed region, wherein the first preset condition is that the length of any line segment in the closed region is not greater than a first preset threshold, the second preset condition is that the area of the closed region is greater than a second preset threshold and the vertex number of the closed region is greater than a third preset threshold;
judging whether the difference value between the area of a certain target closed area and the minimum external moment area of the certain target closed area is within a first preset threshold range or not;
if the difference value between the area of a certain target closed area and the minimum external moment area of the certain target closed area is within a first preset threshold range, defining the certain target closed area as a bridge;
if the difference value between the area of a certain target closed area and the minimum external rectangular area of the certain target closed area is not in the first preset threshold range, judging whether the edge number of the certain target closed area is in the second preset threshold range or not, and whether the number of the convex right angles of the certain target closed area is in the third preset threshold range or not;
if the number of edges of the certain target closing area is in a second preset threshold range and the number of the convex right angles of the certain target closing area is in a third preset threshold range, defining the certain target closing area as a connecting piece;
judging whether the distance between the connecting point of a certain bridge and the connecting point of a certain connecting piece is smaller than a fourth preset threshold value, wherein the connecting point of the certain bridge is the midpoint of a short side in the certain bridge, and the connecting point of the certain connecting piece is the midpoint of a line segment between two convex right angles in the certain connecting piece;
if the distance between the connecting point of a certain bridge frame and the connecting point of a certain connecting piece is smaller than a fourth preset threshold, matching the certain bridge frame with the certain connecting piece to obtain a matching relation, and determining the connecting relation of all bridge frames according to the matching relation.
The computer readable storage medium may include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for a function; the data storage area may store data created from use of the CAD drawing electrical bridge information extraction system, and the like. In addition, the computer-readable storage medium may include high-speed random access memory, and may also include memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the computer readable storage medium optionally includes memory remotely located with respect to the processor, the remote memory being connectable to the CAD drawing electrical bridge information extraction system via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 6, where the device includes: a processor 310 and a memory 320. The electronic device may further include: an input device 330 and an output device 340. The processor 310, memory 320, input device 330, and output device 340 may be connected by a bus or other means, for example in fig. 6. Memory 320 is the computer-readable storage medium described above. The processor 310 executes various functional applications and data processing of the server by running nonvolatile software programs, instructions and modules stored in the memory 320, that is, implements the CAD drawing electrical bridge information extraction method of the method embodiment described above. The input device 330 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the CAD drawing electrical bridge information extraction system. The output device 340 may include a display device such as a display screen.
The electronic equipment can execute the method provided by the embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. Technical details not described in detail in this embodiment may be found in the methods provided in the embodiments of the present invention.
As an implementation manner, the electronic device is applied to a CAD drawing electrical bridge information extraction system, and is used for a client, and includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to:
acquiring a bridge frame layer containing bridge frame line segments in a CAD drawing, and extracting all line segments and end point coordinates of all line segments in the bridge frame layer to obtain a target image;
scanning the target graph based on a breadth-first search algorithm to obtain at least one closed region;
selecting at least one target closed region meeting a first preset condition and a second preset condition from the at least one closed region, wherein the first preset condition is that the length of any line segment in the closed region is not greater than a first preset threshold, the second preset condition is that the area of the closed region is greater than a second preset threshold and the vertex number of the closed region is greater than a third preset threshold;
judging whether the difference value between the area of a certain target closed area and the minimum external moment area of the certain target closed area is within a first preset threshold range or not;
if the difference value between the area of a certain target closed area and the minimum external moment area of the certain target closed area is within a first preset threshold range, defining the certain target closed area as a bridge;
if the difference value between the area of a certain target closed area and the minimum external rectangular area of the certain target closed area is not in the first preset threshold range, judging whether the edge number of the certain target closed area is in the second preset threshold range or not, and whether the number of the convex right angles of the certain target closed area is in the third preset threshold range or not;
if the number of edges of the certain target closing area is in a second preset threshold range and the number of the convex right angles of the certain target closing area is in a third preset threshold range, defining the certain target closing area as a connecting piece;
judging whether the distance between the connecting point of a certain bridge and the connecting point of a certain connecting piece is smaller than a fourth preset threshold value, wherein the connecting point of the certain bridge is the midpoint of a short side in the certain bridge, and the connecting point of the certain connecting piece is the midpoint of a line segment between two convex right angles in the certain connecting piece;
if the distance between the connecting point of a certain bridge frame and the connecting point of a certain connecting piece is smaller than a fourth preset threshold, matching the certain bridge frame with the certain connecting piece to obtain a matching relation, and determining the connecting relation of all bridge frames according to the matching relation.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on such understanding, the foregoing technical solutions may be embodied essentially or in part in the form of a software product, which may be stored in a computer-readable storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the various embodiments or methods of some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. The method for extracting the electrical bridge information of the CAD drawing is characterized by comprising the following steps of:
acquiring a bridge frame layer containing bridge frame line segments in a CAD drawing, and extracting all line segments and end point coordinates of all line segments in the bridge frame layer to obtain a target image;
scanning the target graph based on a breadth-first search algorithm to obtain at least one closed region;
selecting at least one target closed region meeting a first preset condition and a second preset condition from the at least one closed region, wherein the first preset condition is that the length of any line segment in the closed region is not greater than a first preset threshold, the second preset condition is that the area of the closed region is greater than a second preset threshold and the vertex number of the closed region is greater than a third preset threshold;
judging whether the difference value between the area of a certain target closed area and the minimum external rectangular area of the target closed area is within a first preset threshold range or not;
if the difference value between the area of a certain target closed area and the minimum external rectangular area of the target closed area is within a first preset threshold range, defining the target closed area as a bridge;
if the difference value between the area of a certain target closed area and the minimum external rectangular area of the target closed area is not in the first preset threshold range, judging whether the edge number of the target closed area is in the second preset threshold range or not, and whether the number of the convex right angles of the target closed area is in the third preset threshold range or not;
if the number of edges of the target closed region is within a second preset threshold range and the number of convex right angles of the target closed region is within a third preset threshold range, defining the target closed region as a connecting piece;
judging whether the distance between the connecting point of a certain bridge and the connecting point of a certain connecting piece is smaller than a fourth preset threshold value, wherein the connecting point of a certain bridge is the midpoint of a short side in the bridge, and the connecting point of a certain connecting piece is the midpoint of a line segment between two convex right angles in the connecting piece;
if the distance between the connecting point of a certain bridge frame and the connecting point of a certain connecting piece is smaller than a fourth preset threshold, matching the bridge frame with the connecting piece to obtain a matching relation, and determining the connecting relation of all bridge frames according to the matching relation.
2. The method for extracting electrical bridge information from CAD drawing according to claim 1, wherein before obtaining the bridge layer containing the bridge segments in the CAD drawing, the method further comprises:
and analyzing the DWG format file, and preprocessing the analyzed DWG format file to obtain a bridge frame layer containing bridge frame line segments in the CAD drawing.
3. The method for extracting electrical bridge information from CAD drawing according to claim 1, wherein said scanning said target graph based on a breadth-first search algorithm to obtain at least one closed region comprises:
selecting any one end point in the target graph as a starting point, and performing breadth-first search to obtain a spanning tree;
when the current point is in the spanning tree, a basic ring appears, the current point and a unique path corresponding to the current point are recorded as vertex coordinates of the basic ring, and the other endpoint in the target graph is repeatedly selected as a starting point until all endpoints in the target graph are scanned, so that at least one closed area is obtained.
4. The method for extracting electrical bridge information from CAD drawing according to claim 1, wherein said first preset threshold is set to 1000; the second preset threshold is set to 10; the third preset threshold is set to 3.
5. The method for extracting electrical bridge information from CAD drawing according to claim 1, wherein said first preset threshold range is set to 0-two percent of the area of a certain target closed area; the second preset threshold range is set to be 6-16; the third preset threshold range is set to 4-12.
6. The method for extracting electrical bridge information from CAD drawing according to claim 1, wherein defining the target closed area as the connection member if the number of edges of the target closed area is within a second preset threshold range and the number of convex right angles of the target closed area is within a third preset threshold range comprises:
if the number of edges of the certain target closing area is 6 and the number of convex right angles of the target closing area is 5, defining the target closing area as a bent connecting piece;
if the number of edges of a certain target closing area is 8 and the number of convex right angles of the target closing area is 6, defining the target closing area as a three-way connecting piece;
if the number of sides of the certain target closing area is 12 and the number of convex right angles of the target closing area is 8, the target closing area is defined as a four-way connecting piece.
7. The method for extracting information from an electrical bridge of a CAD drawing according to claim 1, wherein determining whether the distance between the connection point of a bridge and the connection point of a certain connection piece is smaller than a fourth preset threshold comprises:
and judging whether the distance between the connecting point of a certain bridge frame and the connecting point of a certain connecting piece is smaller than 10.
8. The utility model provides a CAD drawing electrical bridge information extraction system which characterized in that includes:
the acquisition module is configured to acquire a bridge frame layer containing bridge frame line segments in a CAD drawing, and extract all line segments and end point coordinates of all line segments in the bridge frame layer to obtain a target image;
the scanning module is configured to scan the target graph based on a width-first search algorithm to obtain at least one closed region;
the selecting module is used for selecting at least one target closed region meeting a first preset condition and a second preset condition from the at least one closed region, wherein the first preset condition is that the length of any line segment in the closed region is not greater than a first preset threshold value, the second preset condition is that the area of the closed region is greater than a second preset threshold value and the number of vertexes of the closed region is greater than a third preset threshold value;
the first judging module is configured to judge whether the difference value between the area of a certain target closed area and the minimum external rectangular area of the target closed area is within a first preset threshold range;
the first defining module is configured to define the target closed area as a bridge frame if the difference value between the area of the certain target closed area and the minimum external rectangular area of the target closed area is within a first preset threshold range;
the second judging module is configured to judge whether the edge number of the target closed area is in a second preset threshold range or not and whether the number of the convex right angles of the target closed area is in a third preset threshold range or not if the difference value between the area of a certain target closed area and the minimum external rectangular area of the target closed area is not in the first preset threshold range;
the second definition module is configured to define the target closed area as a connecting piece if the number of edges of the target closed area is within a second preset threshold range and the number of convex right angles of the target closed area is within a third preset threshold range;
the third judging module is configured to judge whether the distance between the connecting point of a certain bridge and the connecting point of a certain connecting piece is smaller than a fourth preset threshold, wherein the connecting point of the certain bridge is the midpoint of a short side in the bridge, and the connecting point of the certain connecting piece is the midpoint of a line segment between two convex right angles in the connecting piece;
and the matching module is configured to match the bridge frame with the connecting piece to obtain a matching relation if the distance between the connecting point of a certain bridge frame and the connecting point of a certain connecting piece is smaller than a fourth preset threshold value, and determine the connection relation of all bridge frames according to the matching relation.
9. An electronic device, comprising: at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 7.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method of any of claims 1 to 7.
CN202311523852.4A 2023-11-16 2023-11-16 CAD drawing electrical bridge information extraction method and system Active CN117237978B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311523852.4A CN117237978B (en) 2023-11-16 2023-11-16 CAD drawing electrical bridge information extraction method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311523852.4A CN117237978B (en) 2023-11-16 2023-11-16 CAD drawing electrical bridge information extraction method and system

Publications (2)

Publication Number Publication Date
CN117237978A CN117237978A (en) 2023-12-15
CN117237978B true CN117237978B (en) 2024-03-08

Family

ID=89084810

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311523852.4A Active CN117237978B (en) 2023-11-16 2023-11-16 CAD drawing electrical bridge information extraction method and system

Country Status (1)

Country Link
CN (1) CN117237978B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111681300A (en) * 2020-06-02 2020-09-18 西安电子科技大学 Method for obtaining target area composed of outline sketch lines
CN113989826A (en) * 2021-11-04 2022-01-28 山东新汉唐数据科技有限公司 Graph theory algorithm-based construction CAD drawing segmentation identification method
EP3996055A1 (en) * 2020-11-10 2022-05-11 Autodesk, Inc. Machine learning techniques for extracting floorplan elements from architectural drawings
CN116595612A (en) * 2023-05-22 2023-08-15 江西少科智能建造科技有限公司 Drawing intelligent examination method and system based on house design specification
CN116704542A (en) * 2022-02-24 2023-09-05 广联达科技股份有限公司 Layer classification method, device, equipment and storage medium
CN116992519A (en) * 2023-07-27 2023-11-03 杭州海康消防科技有限公司 Fire-fighting construction drawing marking method and device, electronic equipment and storage medium
CN117036401A (en) * 2023-08-04 2023-11-10 宁波市电力设计院有限公司 Distribution network line inspection method and system based on target tracking

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11841924B2 (en) * 2021-04-22 2023-12-12 Procore Technologies, Inc. Drawing matching tool

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111681300A (en) * 2020-06-02 2020-09-18 西安电子科技大学 Method for obtaining target area composed of outline sketch lines
EP3996055A1 (en) * 2020-11-10 2022-05-11 Autodesk, Inc. Machine learning techniques for extracting floorplan elements from architectural drawings
CN113989826A (en) * 2021-11-04 2022-01-28 山东新汉唐数据科技有限公司 Graph theory algorithm-based construction CAD drawing segmentation identification method
CN116704542A (en) * 2022-02-24 2023-09-05 广联达科技股份有限公司 Layer classification method, device, equipment and storage medium
CN116595612A (en) * 2023-05-22 2023-08-15 江西少科智能建造科技有限公司 Drawing intelligent examination method and system based on house design specification
CN116992519A (en) * 2023-07-27 2023-11-03 杭州海康消防科技有限公司 Fire-fighting construction drawing marking method and device, electronic equipment and storage medium
CN117036401A (en) * 2023-08-04 2023-11-10 宁波市电力设计院有限公司 Distribution network line inspection method and system based on target tracking

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Object oriented modeling: Retrospective systems information model for constructability assessment;Peter E.D. Love 等;《Automation in Construction》;第359-371页 *
建筑电气BIM碰撞模型的构建与思考;刘雯;;现代建筑电气(07);第13-16页 *

Also Published As

Publication number Publication date
CN117237978A (en) 2023-12-15

Similar Documents

Publication Publication Date Title
Kim et al. Fully automated registration of 3D data to a 3D CAD model for project progress monitoring
Gimenez et al. Automatic reconstruction of 3D building models from scanned 2D floor plans
Kim et al. Automated dimensional quality assurance of full-scale precast concrete elements using laser scanning and BIM
Kim et al. Automated construction progress measurement using a 4D building information model and 3D data
KR100753537B1 (en) Method for reverse modeling using mesh data with feature
CN110502985B (en) Form identification method and device and form identification equipment
CN110348368B (en) Method, computer readable medium and system for artificial intelligence analysis of house type graph
US20100198565A1 (en) Feature-Based Translation System and Method
CN110210377B (en) Wall body and door and window information acquisition method for three-dimensional house type reconstruction
HUE026478T2 (en) Method for forming master data for inspecting protruding and recessed figure
Yin et al. Automatic layer classification method-based elevation recognition in architectural drawings for reconstruction of 3D BIM models
CN101804541A (en) Method for repairing damaged machinery component based on three-dimensional digitization
CN116305436A (en) Existing bridge monitoring method based on combination of three-dimensional laser scanning and BIM
CN113901539A (en) Automatic identification and application method for shaft network of CAD drawing of building and structure
CN110851896B (en) CAD (computer-aided design) outer wall body identification method and device based on local neighborhood information
CN117237978B (en) CAD drawing electrical bridge information extraction method and system
CN109448115B (en) Processing method and device of three-dimensional model and computer equipment
KR102483722B1 (en) BIM model building system and information provision method for building coded digital exterior network diagram using CATIA
CN108875720B (en) Method and device for extracting skeleton line of vector font
CN113536408A (en) Residential core tube area calculation method based on CAD external reference collaborative mode
JP4908867B2 (en) Geographic image processing system
CN109764769B (en) Real-time ammunition assembly guiding method based on visual assembly system
CN114782346A (en) Cloth image defect detection method based on polymorphic data amplification and block identification
CN114444185A (en) In-situ labeling identification method and device and electronic equipment
JP5074622B2 (en) Geographic image processing system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant