CN117237977B - Area division method and system for CAD drawing - Google Patents

Area division method and system for CAD drawing Download PDF

Info

Publication number
CN117237977B
CN117237977B CN202311523596.9A CN202311523596A CN117237977B CN 117237977 B CN117237977 B CN 117237977B CN 202311523596 A CN202311523596 A CN 202311523596A CN 117237977 B CN117237977 B CN 117237977B
Authority
CN
China
Prior art keywords
concave polygon
line group
lines
minimum
point
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
CN202311523596.9A
Other languages
Chinese (zh)
Other versions
CN117237977A (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 CN202311523596.9A priority Critical patent/CN117237977B/en
Publication of CN117237977A publication Critical patent/CN117237977A/en
Application granted granted Critical
Publication of CN117237977B publication Critical patent/CN117237977B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a region dividing method and a region dividing system for CAD drawings, wherein the method comprises the following steps: grouping all the lines according to the intersecting relation to obtain at least one line group, and removing the line group which only contains the single line in the at least one line group to obtain at least one target line group; judging whether the number of lines in each target line group is larger than a preset threshold value; if the point set is larger than the preset threshold value, sampling the points of the lines in each target line group to obtain at least one point set corresponding to the target line group; calculating to obtain a minimum external concave polygon of at least one point set according to a calculation geometry library; defining the midpoint of a line segment in a picture name as a position point of the picture name, and defining the centroid of a minimum circumscribed concave polygon as a position point of the minimum circumscribed concave polygon; and taking a certain picture name with the shortest distance as a picture name of a certain minimum circumscribed concave polygon. Separation of the regions within the frame is achieved for individual processing of the regions.

Description

Area division method and system for CAD drawing
Technical Field
The invention belongs to the technical field of CAD drawing processing, and particularly relates to a region dividing method and system of a CAD drawing.
Background
BIM (Building Information Model) is a short term of building information model, is a multidimensional information model integration technology, and can integrate professional information such as building, structure, heating ventilation, water supply and drainage and the like into a three-dimensional building model, thereby greatly improving design production efficiency. In the process of intelligently generating the building information model, firstly, the information of each frame in the CAD drawing is extracted, however, in most drawings, for example, the frame of a 'motor vehicle ramp map' comprises a 'next-layer plan view' and a 'next-layer plan view', and the information of a plurality of areas possibly contained in a single frame causes inconvenience in processing the frame.
Disclosure of Invention
The invention provides a region dividing method and a region dividing system for CAD drawings, which are used for solving the technical problem that a single drawing frame possibly contains information of a plurality of regions, so that the drawing frame is inconvenient to process.
In a first aspect, the present invention provides a method for dividing a region of a CAD drawing, including: acquiring all lines in a picture frame; scanning all lines in the picture frame based on a preset plane scanning algorithm to obtain an intersection relation of all lines; grouping all lines according to the intersection relation to obtain at least one line group, and removing the line group which only contains single lines in the at least one line group to obtain at least one target line group, wherein any line in any target line group is intersected with other lines in the target line group where any line is located; judging whether the number of lines in each target line group is larger than a preset threshold value; if the number of lines in each target line group is larger than a preset threshold value, sampling the lines in each target line group based on a preset sampling interval to obtain at least one point set corresponding to the target line group, wherein the point set comprises a starting point, a point and an end point which are separated from the starting point by N times of the sampling interval, and N is a positive integer; calculating the minimum circumscribed concave polygon of the at least one point set according to a calculation geometry library; obtaining all picture names in a picture frame, wherein the format of one picture name is a line segment plus a text; defining a midpoint of a line segment in a picture name as a first location point of the picture name, and defining a centroid of a minimum circumscribing concave polygon as a second location point of the minimum circumscribing concave polygon; calculating the distance between each first position point and each second position point, and taking a certain picture name with the shortest distance as a picture name of a certain minimum circumscribed concave polygon; and storing the certain minimum circumscribed concave polygon and the picture name of the certain minimum circumscribed concave polygon.
In a second aspect, the present invention provides a system for dividing a region of a CAD drawing, including: the first acquisition module is configured to acquire all lines in the picture frame; the scanning module is configured to scan all lines in the picture frame based on a preset plane scanning algorithm to obtain an intersection relation of all lines; the grouping module is configured to group all the lines according to the intersection relation to obtain at least one line group, and remove the line group which only contains the single line in the at least one line group to obtain at least one target line group, wherein any line in any target line group is intersected with other lines in the target line group where any line is located; the judging module is configured to judge whether the number of lines in each target line group is larger than a preset threshold value; the sampling module is used for sampling points of all lines in each target line group based on a preset sampling interval if the number of the lines in each target line group is larger than a preset threshold value, so as to obtain at least one point set corresponding to the target line group, wherein the point set comprises a starting point, a point and an end point which are separated from the starting point by N times of the sampling interval, and N is a positive integer; a first computing module configured to compute a minimum circumscribing concave polygon of the at least one point set from a computation geometry library; the second acquisition module is configured to acquire all picture names in the picture frame, wherein the format of one picture name is a line segment plus a text; the definition module defines the midpoint of a line segment in a picture name as a first position point of the picture name, and defines the centroid of a minimum circumscribed concave polygon as a second position point of the minimum circumscribed concave polygon; the second calculation module is configured to calculate the distance between each first position point and each second position point, and take a certain picture name with the shortest distance as a picture name of a certain minimum circumscribed concave polygon; and the storage module is configured to store the picture names of the certain minimum circumscribed concave polygon and the certain minimum circumscribed concave polygon.
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 region partitioning method of the CAD drawing of any one of the embodiments of the invention.
In a fourth aspect, the present invention also provides a computer readable storage medium having stored thereon a computer program, which when executed by a processor, causes the processor to perform the steps of the region division method of a CAD drawing of any of the embodiments of the invention.
According to the area dividing method and system for the CAD drawing, all lines are grouped according to the intersecting relation to obtain at least one line group, the line group which only contains single lines in the at least one line group is removed to obtain at least one target line group, whether the number of the lines in each target line group is larger than a preset threshold value is judged, if so, point sampling is conducted on each line in each target line group based on a preset sampling interval to obtain at least one point set corresponding to the target line group, and the minimum external concave polygon of the at least one point set is obtained according to calculation of a calculation geometry library, so that each area in a frame is separated, and each area is processed independently.
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 dividing areas of a CAD drawing according to an embodiment of the present invention;
FIG. 2 is a block diagram of a system for dividing areas of CAD drawings according to an embodiment of the present invention;
fig. 3 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 method for dividing areas of a CAD drawing of the present application is shown.
As shown in fig. 1, the area dividing method of the CAD drawing specifically includes the following steps:
step S101, all lines in the frame are acquired.
In the step, all the primitives in the picture frame are decomposed into straight lines and arcs based on a preset objectARX tool, and the arcs are fitted into straight lines based on a preset external polygon, so that all the lines in the picture frame are obtained.
Specifically, a DWG drawing analysis library provided by ODA is adopted to analyze the drawing, and all the primitives in the drawing are decomposed into basic straight lines and arc lines. The arc line can be approximately fitted by using the circumscribed polygon through calculating the circumscribed polygon. Thus we have obtained all the straight lines within the frame.
Step S102, scanning all lines in the frame based on a preset plane scanning algorithm to obtain the intersection relation of all lines.
Step S103, grouping all the lines according to the intersection relation to obtain at least one line group, and removing the line group which only contains the single line in the at least one line group to obtain at least one target line group, wherein any line in any target line group is intersected with other lines in the target line group where any line is located.
In the step, all lines are grouped according to the intersection relation according to a union algorithm to obtain at least one line group, and the line group which only contains single lines in the at least one line group is removed to obtain at least one target line group.
Step S104, judging whether the number of lines in each target line group is larger than a preset threshold value.
The preset threshold is set to 3, for example. Specifically, it is determined whether the number of lines in each target line group is greater than 3.
In one embodiment, if the number of lines in a certain target line group is not greater than a preset threshold, the certain target line group is removed.
Step S105, if the number of lines in each target line group is greater than a preset threshold, performing point sampling on each line in each target line group based on a preset sampling interval, so as to obtain at least one point set corresponding to the target line group, where the point set includes a start point, a point and an end point that are separated from the start point by N times of the sampling interval, and N is a positive integer.
In the step, the sampling interval is set according to the drawing proportion;
it should be noted that if the number of lines in each target line group is greater than a preset threshold, setting the sampling interval to be half of the drawing proportion; and carrying out point sampling on each line in each target line group based on half of the drawing proportion to obtain at least one point set corresponding to the target line group.
For example, in the frame of 1:400, if a line length in a certain target line group is 600 and the sampling interval is set to be 200, the sampling points are as follows: a start point, a point a distance 200 from the start point, a point a distance 400 from the start point, and an end point.
Step S106, calculating the minimum circumscribed concave polygon of the at least one point set according to the calculation geometry library.
In this step, after the point sets are obtained, for each point set, a minimum circumscribed concave polygon of the point set is calculated using a calculation geometry library provided by geo.
It should be noted that, a plurality of minimum external concave polygons are obtained, and in the actual calculation process, the situation that the existing minimum external concave polygons are contained by other larger minimum external concave polygons may occur, and because they belong to the same area, the contained minimum external concave polygons are deleted, and only those minimum external concave polygons which have larger areas and are not contained by any other minimum external concave polygons are left. The resulting concave polygons are the desired region division result.
Specifically, the position relation of each minimum circumscribed concave polygon is obtained, wherein the position relation comprises a containing relation and a parallel relation; if a certain minimum external concave polygon is in a containing relation with another minimum external concave polygon, and the certain minimum external concave polygon is contained in the other minimum external concave polygon, deleting the certain minimum external concave polygon; if a certain minimum external concave polygon is in parallel relation with another minimum external concave polygon, judging whether the minimum distance between any side of the certain minimum external concave polygon and any side of the other minimum external concave polygon is larger than a preset distance threshold value or not; if the minimum distance between any side of a certain minimum external concave polygon and any side of another minimum external concave polygon is not greater than the preset distance threshold, combining the certain minimum external concave polygon with the other minimum external concave polygon to obtain a final dividing result; and if the minimum distance between any side of a certain minimum circumscribed concave polygon and any side of another minimum circumscribed concave polygon is larger than a preset distance threshold, respectively taking the certain minimum circumscribed concave polygon and the other minimum circumscribed concave polygon as final dividing results.
In step S107, all the picture names in the picture frame are acquired, wherein a format of a picture name is a line segment plus a text.
In this step, in the case of DWG drawings, generally, each region has a corresponding drawing name. After the regions within the frame are separated, the regions also need to be mapped to names for subsequent operations. The format of the picture name is a thick line segment plus a text.
In step S108, the midpoint of the line segment in a picture name is defined as a first location point of the picture name, and the centroid of a minimum circumscribed concave polygon is defined as a second location point of the minimum circumscribed concave polygon.
Step S109, calculating the distance between each first position point and each second position point, and taking a certain picture name with the shortest distance as a picture name of a certain minimum circumscribed concave polygon.
In this step, after all the names in the frame are obtained, the midpoint of the thick line segment is taken to represent the position of the name. And for each divided minimum circumscribed concave polygon, taking the centroid of the minimum circumscribed concave polygon to represent the position of the region, calculating the distances between the centroid and all the graph names, and taking the graph name with the shortest distance as the graph name of the region.
Step S110, the picture names of the certain minimum circumscribed concave polygon and the certain minimum circumscribed concave polygon are stored.
In this step, the obtained region division result needs to be stored in a database for subsequent use.
Database format design:
{
“DrawingName”:
“Coords”:[]
}。
wherein dragname represents the region graph name and the Coords field gives the coordinate points of the concave polygon in a clockwise order.
In summary, according to the method, all lines are grouped according to an intersecting relation to obtain at least one line group, the line group which only contains single lines in the at least one line group is removed to obtain at least one target line group, whether the number of the lines in each target line group is larger than a preset threshold value is judged, if so, point sampling is carried out on each line in each target line group based on a preset sampling interval to obtain at least one point set corresponding to the target line group, and the minimum external concave polygon of the at least one point set is obtained according to calculation of a calculation geometry library, so that each region in a picture frame is separated, and each region is processed independently.
Referring to fig. 2, a block diagram of a zoning system of a CAD drawing of the present application is shown.
As shown in fig. 2, the area dividing system 200 includes a first acquisition module 210, a scanning module 220, a grouping module 230, a judging module 240, a sampling module 250, a first calculating module 260, a second acquisition module 270, a defining module 280, a second calculating module 290, and a storage module 211.
The first obtaining module 210 is configured to obtain all lines in the frame; the scanning module 220 is configured to scan all lines in the frame based on a preset plane scanning algorithm to obtain an intersection relationship of all lines; the grouping module 230 is configured to group all the lines according to the intersection relationship to obtain at least one line group, and remove the line group only comprising the single line in the at least one line group to obtain at least one target line group, wherein any line in any target line group intersects with other lines in the target line group where any line is located; a judging module 240 configured to judge whether the number of lines in each target line group is greater than a preset threshold; the sampling module 250 performs point sampling on each line in each target line group based on a preset sampling interval if the number of lines in each target line group is greater than a preset threshold value, so as to obtain at least one point set corresponding to the target line group, wherein the point set comprises a starting point, a point and an end point which are separated from the starting point by N times of the sampling interval, and N is a positive integer; a first calculation module 260 configured to calculate a minimum circumscribing concave polygon of the at least one point set from a calculation geometry library; a second obtaining module 270, configured to obtain all the names in the frame, where a format of a name is a line segment plus a text; the definition module 280 defines a midpoint of a line segment in a name as a first location point of the name and a centroid of a minimum circumscribing concave polygon as a second location point of the minimum circumscribing concave polygon; a second calculating module 290, configured to calculate the distance between each first position point and each second position point, and take a certain graph name with the shortest distance as a graph name of a certain minimum circumscribed concave polygon; the storage module 211 is configured to store the certain minimum circumscribed concave polygon and the picture name of the certain minimum circumscribed concave polygon.
It should be understood that the modules depicted in fig. 2 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. 2, 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 partitioning areas of a CAD drawing in any of the method embodiments described above;
as one embodiment, the computer-readable storage medium of the present invention stores computer-executable instructions configured to:
acquiring all lines in a picture frame;
scanning all lines in the picture frame based on a preset plane scanning algorithm to obtain an intersection relation of all lines;
grouping all lines according to the intersection relation to obtain at least one line group, and removing the line group which only contains single lines in the at least one line group to obtain at least one target line group, wherein any line in any target line group is intersected with other lines in the target line group where any line is located;
performing point sampling on each line in each target line group based on a preset sampling interval to obtain at least one point set corresponding to the target line group, wherein the point set comprises a starting point, a point which is N times of the sampling interval from the starting point and an end point, and N is a positive integer;
calculating the minimum circumscribed concave polygon of the at least one point set according to a calculation geometry library;
obtaining all picture names in a picture frame, wherein the format of one picture name is a line segment plus a text;
defining a midpoint of a line segment in a picture name as a first location point of the picture name, and defining a centroid of a minimum circumscribing concave polygon as a second location point of the minimum circumscribing concave polygon;
calculating the distance between each first position point and each second position point, and taking a certain picture name with the shortest distance as a picture name of a certain minimum circumscribed concave polygon;
and storing the certain minimum circumscribed concave polygon and the picture name of the certain minimum circumscribed concave polygon.
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 storage data area may store data created according to the use of the area division system of CAD drawings, 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 zoning system of the CAD drawing through 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. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 3, 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. 3. Memory 320 is the computer-readable storage medium described above. The processor 310 executes various functional applications of the server and data processing, that is, implements the area division method of the CAD drawing of the above-described method embodiment, by running nonvolatile software programs, instructions, and modules stored in the memory 320. The input device 330 may receive input numeric or character information and generate key signal inputs related to user settings and function controls of the zoning system of the CAD drawing. 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 region division system of a CAD drawing, 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 all lines in a picture frame;
scanning all lines in the picture frame based on a preset plane scanning algorithm to obtain an intersection relation of all lines;
grouping all lines according to the intersection relation to obtain at least one line group, and removing the line group which only contains single lines in the at least one line group to obtain at least one target line group, wherein any line in any target line group is intersected with other lines in the target line group where any line is located;
performing point sampling on each line in each target line group based on a preset sampling interval to obtain at least one point set corresponding to the target line group, wherein the point set comprises a starting point, a point which is N times of the sampling interval from the starting point and an end point, and N is a positive integer;
calculating the minimum circumscribed concave polygon of the at least one point set according to a calculation geometry library;
obtaining all picture names in a picture frame, wherein the format of one picture name is a line segment plus a text;
defining a midpoint of a line segment in a picture name as a first location point of the picture name, and defining a centroid of a minimum circumscribing concave polygon as a second location point of the minimum circumscribing concave polygon;
calculating the distance between each first position point and each second position point, and taking a certain picture name with the shortest distance as a picture name of a certain minimum circumscribed concave polygon;
and storing the certain minimum circumscribed concave polygon and the picture name of the certain minimum circumscribed concave polygon.
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 (8)

1. The area dividing method of the CAD drawing is characterized by comprising the following steps of:
acquiring all lines in a picture frame;
scanning all lines in the picture frame based on a preset plane scanning algorithm to obtain an intersection relation of all lines;
grouping all lines according to the intersection relation to obtain at least one line group, and removing the line group which only contains single lines in the at least one line group to obtain at least one target line group, wherein any line in any target line group is intersected with other lines in the target line group where any line is located;
judging whether the number of lines in each target line group is larger than a preset threshold value;
if the number of lines in each target line group is larger than a preset threshold value, sampling the lines in each target line group based on a preset sampling interval to obtain at least one point set corresponding to the target line group, wherein the point set comprises a starting point, a point and an end point which are separated from the starting point by N times of the sampling interval, and N is a positive integer;
calculating the minimum circumscribed concave polygon of the at least one point set according to a calculation geometry library, wherein after calculating the minimum circumscribed concave polygon of the at least one point set according to the calculation geometry library, the position relation of each minimum circumscribed concave polygon is obtained, and the position relation comprises a containing relation and a parallel relation;
if a certain minimum external concave polygon is in a containing relation with another minimum external concave polygon, and the certain minimum external concave polygon is contained in the other minimum external concave polygon, deleting the certain minimum external concave polygon;
if a certain minimum external concave polygon is in parallel relation with another minimum external concave polygon, judging whether the minimum distance between any side of the certain minimum external concave polygon and any side of the other minimum external concave polygon is larger than a preset distance threshold value or not;
if the minimum distance between any side of a certain minimum external concave polygon and any side of another minimum external concave polygon is not greater than a preset distance threshold, merging the certain minimum external concave polygon with the other minimum external concave polygon to obtain a final dividing result;
if the minimum distance between any side of a certain minimum circumscribed concave polygon and any side of another minimum circumscribed concave polygon is larger than a preset distance threshold, respectively taking the certain minimum circumscribed concave polygon and the other minimum circumscribed concave polygon as final dividing results;
obtaining all picture names in a picture frame, wherein the format of one picture name is a line segment plus a text;
defining a midpoint of a line segment in a picture name as a first location point of the picture name, and defining a centroid of a minimum circumscribing concave polygon as a second location point of the minimum circumscribing concave polygon;
calculating the distance between each first position point and each second position point, and taking a certain picture name with the shortest distance as a picture name of a certain minimum circumscribed concave polygon;
and storing the certain minimum circumscribed concave polygon and the picture name of the certain minimum circumscribed concave polygon.
2. The method for partitioning areas of a CAD drawing according to claim 1, wherein said obtaining all lines in a frame comprises:
decomposing all the primitives in the frame into straight lines and arcs based on a preset objectARX tool, and fitting the arcs into straight lines based on a preset external polygon to obtain all lines in the frame.
3. The method for dividing areas of a CAD drawing according to claim 1, wherein grouping all lines according to the intersecting relationship to obtain at least one line group comprises:
and grouping all the lines according to the intersection relation according to a union algorithm to obtain at least one line group.
4. The area dividing method of a CAD drawing according to claim 1, wherein after determining whether the number of lines in each target line group is greater than a preset threshold, the method further comprises:
and if the number of the lines in a certain target line group is not greater than a preset threshold value, removing the certain target line group.
5. The method for dividing areas of a CAD drawing according to claim 1, wherein the sampling interval is set according to a drawing scale;
the step of performing point sampling on each line in each target line group based on a preset sampling interval to obtain at least one point set corresponding to the target line group comprises the following steps:
setting the sampling interval to be half of the drawing proportion;
and carrying out point sampling on each line in each target line group based on half of the drawing proportion to obtain at least one point set corresponding to the target line group.
6. A system for zoning a CAD drawing, comprising:
the first acquisition module is configured to acquire all lines in the picture frame;
the scanning module is configured to scan all lines in the picture frame based on a preset plane scanning algorithm to obtain an intersection relation of all lines;
the grouping module is configured to group all the lines according to the intersection relation to obtain at least one line group, and remove the line group which only contains the single line in the at least one line group to obtain at least one target line group, wherein any line in any target line group is intersected with other lines in the target line group where any line is located;
the judging module is configured to judge whether the number of lines in each target line group is larger than a preset threshold value;
the sampling module is used for sampling points of all lines in each target line group based on a preset sampling interval if the number of the lines in each target line group is larger than a preset threshold value, so as to obtain at least one point set corresponding to the target line group, wherein the point set comprises a starting point, a point and an end point which are separated from the starting point by N times of the sampling interval, and N is a positive integer;
the first calculation module is configured to calculate the minimum circumscribed concave polygon of the at least one point set according to the calculation geometry library, wherein after the minimum circumscribed concave polygon of the at least one point set is calculated according to the calculation geometry library, the position relation of each minimum circumscribed concave polygon is acquired, and the position relation comprises a containing relation and a parallel relation;
if a certain minimum external concave polygon is in a containing relation with another minimum external concave polygon, and the certain minimum external concave polygon is contained in the other minimum external concave polygon, deleting the certain minimum external concave polygon;
if a certain minimum external concave polygon is in parallel relation with another minimum external concave polygon, judging whether the minimum distance between any side of the certain minimum external concave polygon and any side of the other minimum external concave polygon is larger than a preset distance threshold value or not;
if the minimum distance between any side of a certain minimum external concave polygon and any side of another minimum external concave polygon is not greater than a preset distance threshold, merging the certain minimum external concave polygon with the other minimum external concave polygon to obtain a final dividing result;
if the minimum distance between any side of a certain minimum circumscribed concave polygon and any side of another minimum circumscribed concave polygon is larger than a preset distance threshold, respectively taking the certain minimum circumscribed concave polygon and the other minimum circumscribed concave polygon as final dividing results;
the second acquisition module is configured to acquire all picture names in the picture frame, wherein the format of one picture name is a line segment plus a text;
the definition module defines the midpoint of a line segment in a picture name as a first position point of the picture name, and defines the centroid of a minimum circumscribed concave polygon as a second position point of the minimum circumscribed concave polygon;
the second calculation module is configured to calculate the distance between each first position point and each second position point, and take a certain picture name with the shortest distance as a picture name of a certain minimum circumscribed concave polygon;
and the storage module is configured to store the picture names of the certain minimum circumscribed concave polygon and the certain minimum circumscribed concave polygon.
7. 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 5.
8. 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 one of claims 1 to 5.
CN202311523596.9A 2023-11-16 2023-11-16 Area division method and system for CAD drawing Active CN117237977B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311523596.9A CN117237977B (en) 2023-11-16 2023-11-16 Area division method and system for CAD drawing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311523596.9A CN117237977B (en) 2023-11-16 2023-11-16 Area division method and system for CAD drawing

Publications (2)

Publication Number Publication Date
CN117237977A CN117237977A (en) 2023-12-15
CN117237977B true CN117237977B (en) 2024-03-08

Family

ID=89084795

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311523596.9A Active CN117237977B (en) 2023-11-16 2023-11-16 Area division method and system for CAD drawing

Country Status (1)

Country Link
CN (1) CN117237977B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109255187A (en) * 2018-09-12 2019-01-22 深圳市彬讯科技有限公司 Analysis method and device
CN111460202A (en) * 2020-04-01 2020-07-28 上海建工四建集团有限公司 Label determining method and device for electronic engineering drawing, storage medium and terminal
CN112461256A (en) * 2021-02-03 2021-03-09 中智行科技有限公司 Path planning method and device
CN112883799A (en) * 2021-01-20 2021-06-01 上海品览智造科技有限公司 Method for accurately identifying slope in CAD (computer-aided design) slope big sample graph
CN113779046A (en) * 2021-11-15 2021-12-10 亿海蓝(北京)数据技术股份公司 Irregular area index generation method, device, medium and electronic equipment
CN114241509A (en) * 2022-02-24 2022-03-25 江西少科智能建造科技有限公司 Space segmentation method, system, storage medium and equipment based on construction drawing
CN114429640A (en) * 2022-01-28 2022-05-03 广联达科技股份有限公司 Drawing segmentation method and device and electronic equipment
CN114529936A (en) * 2022-02-22 2022-05-24 云南电网有限责任公司保山供电局 Method for scanning and converting paper power engineering drawing into electronic CAD drawing
CN115100673A (en) * 2022-07-19 2022-09-23 北京国盛华兴科技有限公司 Electronic drawing identification method and device, electronic equipment and storage medium
CN115995092A (en) * 2023-02-16 2023-04-21 上海帮图信息科技有限公司 Drawing text information extraction method, device and equipment
CN116704542A (en) * 2022-02-24 2023-09-05 广联达科技股份有限公司 Layer classification method, device, equipment and storage medium
CN116935430A (en) * 2023-06-30 2023-10-24 深圳市万翼数字技术有限公司 Picture frame identification method and device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230205820A1 (en) * 2021-12-29 2023-06-29 Autodesk, Inc. Geometry-based design data search tool

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109255187A (en) * 2018-09-12 2019-01-22 深圳市彬讯科技有限公司 Analysis method and device
CN111460202A (en) * 2020-04-01 2020-07-28 上海建工四建集团有限公司 Label determining method and device for electronic engineering drawing, storage medium and terminal
CN112883799A (en) * 2021-01-20 2021-06-01 上海品览智造科技有限公司 Method for accurately identifying slope in CAD (computer-aided design) slope big sample graph
CN112461256A (en) * 2021-02-03 2021-03-09 中智行科技有限公司 Path planning method and device
CN113779046A (en) * 2021-11-15 2021-12-10 亿海蓝(北京)数据技术股份公司 Irregular area index generation method, device, medium and electronic equipment
CN114429640A (en) * 2022-01-28 2022-05-03 广联达科技股份有限公司 Drawing segmentation method and device and electronic equipment
CN114529936A (en) * 2022-02-22 2022-05-24 云南电网有限责任公司保山供电局 Method for scanning and converting paper power engineering drawing into electronic CAD drawing
CN114241509A (en) * 2022-02-24 2022-03-25 江西少科智能建造科技有限公司 Space segmentation method, system, storage medium and equipment based on construction drawing
CN116704542A (en) * 2022-02-24 2023-09-05 广联达科技股份有限公司 Layer classification method, device, equipment and storage medium
CN115100673A (en) * 2022-07-19 2022-09-23 北京国盛华兴科技有限公司 Electronic drawing identification method and device, electronic equipment and storage medium
CN115995092A (en) * 2023-02-16 2023-04-21 上海帮图信息科技有限公司 Drawing text information extraction method, device and equipment
CN116935430A (en) * 2023-06-30 2023-10-24 深圳市万翼数字技术有限公司 Picture frame identification method and device, electronic equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
CAD of Magic Tee with Interior Stepped Post for High Performance Designs;Ralf Beyer 等;《2003 IEEE MTT-S Digest》;1207-1210 *
利用单元格和特征点实现图纸信息的自动提取;龚雄 等;《计算机辅助设计与图形学学报》;第17卷(第8期);1883-1888 *
基于设计环境的图纸BOM管理系统;罗年猛 等;《图学学报》;第33卷(第5期);141-146 *

Also Published As

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

Similar Documents

Publication Publication Date Title
CN112163251B (en) Building model unitization method and device, storage medium and electronic equipment
CN110516370B (en) Prefabricated part deepening drawing generation method and device, computer equipment and medium
JP4893148B2 (en) Shape simplification device and program used therefor
CN115293751B (en) Method, system and equipment for processing BIM model data of rail transit
CN110084894B (en) Local amplification display method and device of three-dimensional model and electronic equipment
CN110598331B (en) Roof modeling method and device
CN110544298A (en) transformer substation modeling method and device, computer equipment and storage medium
CN112150610A (en) Retaining wall modeling method and system based on dimension marking
CN117237977B (en) Area division method and system for CAD drawing
CN114782645A (en) Virtual digital person making method, related equipment and readable storage medium
CN107679305B (en) Road network model creating method and device
CN103065306B (en) The disposal route of graph data and device
CN116596750A (en) Point cloud processing method and device, electronic equipment and storage medium
CN114529686B (en) Building model generation method, device, equipment and medium
CN116152108A (en) Tunnel section point cloud filtering method based on minimum circle algorithm and electronic equipment
CN115481268A (en) Parallel line wall data identification method, device, equipment and storage medium
CN113919027A (en) Component adjustment method and device in BIM (building information modeling) model, computer equipment and storage medium
CN112991492B (en) Curved surface curtain wall generation method and device, computer equipment and readable storage medium
CN112287005A (en) Data processing method, device, server and medium
CN112837420A (en) Method and system for completing shape of terracotta warriors point cloud based on multi-scale and folding structure
CN117252869B (en) CAD drawing wall path information extraction method and system
CN115459867B (en) Spectrum monitoring resource allocation optimization method
CN112614046B (en) Method and device for drawing three-dimensional model on two-dimensional plane
CN115937454B (en) Method and device for automatically placing tree models in large-scale city scene
CN115587403A (en) Wall polygon drawing method and device, terminal device and storage medium

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