CAD geometric line segment fault-tolerant processing method, system, storage medium and device

By clustering, extending, expanding and boolean operations on line segments in CAD drawings, the problem of line segment error in CAD drawings is solved, and accurate information extraction and drawing accuracy are achieved.

CN118629067BActive Publication Date: 2024-11-08ZHONGZHI DATA GRP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411110216.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-11-08
Estimated Expiration
2044-08-14

AI Technical Summary

Technical Problem

There are a large number of small drawing errors in computer-aided design (CAD) drawings, such as repeated line segments, drawing deviations and fractures, resulting in errors and performance degradation during computer analysis, affecting the normal use of upper-level applications such as three-dimensional modeling.

Method used

By identifying each line segment in the original line segment set, clustering, extending and expanding, Boolean operations are performed to identify geometric objects, and finally shortening the line segment length to form the target line segment set, controlling the degree of drawing errors.

Benefits of technology

Effectively control and eliminate line segment repetition, drawing deviation and breakage, ensure accurate extraction of CAD drawing information, improve drawing accuracy and analysis algorithm performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118629067B_ABST
    Figure CN118629067B_ABST
Patent Text Reader

Abstract

The present invention provides a CAD geometric line segment fault-tolerant processing method, system, storage medium and device, and relates to the field of data processing technology. The method comprises: clustering all line segments to obtain an initial line segment set; extending the two ends of each line segment to obtain a first line segment set; expanding each line segment to both sides except the extended parts at both ends to form a rectangle to obtain a first rectangle set; identifying the union of multiple rectangles in the first rectangle set to obtain a geometric object set, and identifying the minimum rotated rectangle to obtain a second rectangle set; identifying the central axis of each rectangle in the second rectangle set to obtain a second line segment set; shortening the length of each line segment in the second line segment set according to a first preset distance to obtain a target line segment set. The present invention aims to perform fault-tolerant processing on CAD geometric line segments, so as to facilitate accurate extraction of drawing information of CAD drawings when extracting drawing information, so as to ensure the normal use of upper-level applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a method, system, storage medium and device for fault-tolerant processing of CAD geometric line segments. Background Art

[0002] Computer-aided design (CAD), as one of the indispensable tools in the design industry in the information age, also plays a big role in the design process of the construction industry. Designers will use files designed by software such as AutoCAD (hereinafter referred to as drawings) as carriers of design ideas, concepts, and plans. The combination of a large number of basic elements such as geometric lines, fills, and text in the drawings records and expresses various required information such as the location, size, and form of most components in the building.

[0003] Drawings are the carriers of visual information, and designers usually do not care about the accuracy of the basic information recorded in the actual CAD file, such as drawing the same line segment at the same position, or some line segments not completely connected to other line segments, etc. These phenomena may occur in various links of drawing design, such as not enabling the "object snap" auxiliary function of CAD in the design stage, and drawing new line segments directly without deleting the original line segments for convenience during the modification and review stage. In fact, there are a large number of such drawing "errors" in drawings, but because these errors are very small compared to the size of the drawings themselves, and under the dual effects of human vision and brain, these drawing "errors" will be automatically corrected and erased.

[0004] Although those inconspicuous and unimportant drawing errors in drawings will not cause any problems in various stages of human use of drawings, they are a problem that cannot be ignored for computer analysis of drawings. These errors will lead to problems such as "the component outline is not a closed geometric shape" and "there is redundancy in the line segments used to close the component outline". When the computer analyzes the outline and information of specific components in CAD drawings, errors, breaks, duplications, etc. will occur. All these phenomena put forward higher requirements on the performance of subsequent analysis algorithms, which in turn affects upper-level applications such as three-dimensional modeling based on two-dimensional CAD drawings. Summary of the invention

[0005] Based on this, the purpose of the present invention is to provide a CAD geometric line segment fault-tolerant processing method, system, storage medium and device, aiming to perform fault-tolerant processing on CAD geometric line segments, so as to facilitate the accurate extraction of drawing information of CAD drawings when extracting drawing information, so as to ensure the normal use of upper-level applications.

[0006] A first aspect of the present invention is to provide a CAD geometric line segment fault tolerance processing method, the method comprising:

[0007] Identify each line segment in the original line segment set, cluster all line segments, and obtain an initial line segment set;

[0008] Extending two ends of each line segment in the initial line segment set by a first preset distance to obtain a first line segment set;

[0009] Expand each line segment in the first line segment set to both sides by a second preset distance except for the extended parts at both ends, so that each line segment forms a rectangle, thereby obtaining a first rectangle set;

[0010] Performing a Boolean operation on the first rectangular set, identifying a union of the first rectangular set to obtain a geometric object set, and identifying a minimum rotated rectangle of each geometric element in the geometric object set to obtain a second rectangular set;

[0011] Identify the central axis of each rectangle in the second set of rectangles to obtain a second set of line segments;

[0012] According to the first preset distance, the length of both ends of each line segment in the second line segment set is shortened to obtain a target line segment set.

[0013] According to one aspect of the above technical solution, the step of identifying each line segment in the original line segment set, clustering all line segments, and obtaining the initial line segment set specifically includes:

[0014] Obtaining an original line segment set, and identifying a rotation angle of each line segment in the original line segment set in the Euler coordinate system;

[0015] Taking the rotation angle as a characteristic value and the minimum angle distance as a measurement condition, clustering processing is performed on each line segment in the original line segment set to obtain an initial line segment set.

[0016] According to one aspect of the above technical solution, the initial line segment set is a set of infinitely approximately parallel line segments.

[0017] According to one aspect of the above technical solution, the step of expanding each line segment in the first line segment set by a second preset distance to both sides except for the extended parts at both ends so that each line segment forms a rectangle to obtain the first rectangle set specifically includes:

[0018] Determine the endpoint coordinates of the endpoints on both sides of each line segment according to the initial line segment set;

[0019] According to the endpoint coordinates, the connecting line between the two endpoint coordinates of each line segment in the first line segment set is expanded to both sides by a second preset distance so that each line segment forms a rectangle, thereby obtaining a first rectangle set corresponding to all line segments.

[0020] According to one aspect of the above technical solution, in the first rectangle set, the length of the rectangle is the length of the line segment, the width of the rectangle is equal to twice the second preset distance, and the line segment is equivalent to the midline of the rectangle.

[0021] According to one aspect of the above technical solution, the method further includes:

[0022] When it is identified that there are drawing errors such as repeated line segments, deviated line segments or broken line segments in the original line segment set, the error degree of the drawing errors is controlled by the minimum angle distance, the first preset distance and the second preset distance.

[0023] According to one aspect of the above technical solution, in the process of performing fault-tolerant processing on geometric line segments, the adjustment mechanism of the minimum angle distance, the first preset distance and the second preset distance is a separate adjustment or a linkage adjustment.

[0024] A second aspect of the present invention is to provide a CAD geometric line segment fault-tolerant processing system, the system comprising:

[0025] A clustering processing module is used to identify each line segment in the original line segment set, cluster all line segments, and obtain an initial line segment set;

[0026] A line segment extension module, used for extending both ends of each line segment in the initial line segment set by a first preset distance to obtain a first line segment set;

[0027] A line segment expansion module, used for expanding each line segment in the first line segment set except for the extended parts at both ends to both sides by a second preset distance, so that each line segment forms a rectangle, thereby obtaining a first rectangle set;

[0028] A Boolean operation module, configured to perform a Boolean operation on the first rectangular set, identify a union of the first rectangular set to obtain a geometric object set, and identify a minimum rotation rectangle of each geometric element in the geometric object set to obtain a second rectangular set;

[0029] A line segment recognition module, used to recognize the central axis of each rectangle in the second rectangle set to obtain a second line segment set;

[0030] The line set output module is used to shorten the length of both ends of each line segment in the second line segment set according to the first preset distance to obtain a target line segment set.

[0031] The third aspect of the present invention is to provide a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method described in the above technical solution.

[0032] The fourth aspect of the present invention is to provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the above technical solution when executing the computer program.

[0033] Compared with the prior art, the CAD geometric line segment fault tolerance processing method shown in the present invention has the following beneficial effects:

[0034] The CAD geometric line segment fault-tolerant processing method shown in the present invention can control, suppress, or even eliminate the basic and common types of line segment duplication, line segment deviation, and line segment breakage for the original line segment set containing drawing errors. In the actual application scenario of CAD, the above three values ​​can be set to appropriate values ​​individually or in conjunction to achieve the purpose of having obvious fault-tolerant processing capabilities. After that, the drawing information to be expressed in the CAD drawing can be accurately extracted through the preset drawing information extraction method. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a flowchart of a CAD geometric line segment fault tolerance processing method in the first embodiment of the present invention;

[0036] Figure 2 It is a structural block diagram of the CAD geometric line segment fault-tolerant processing system in the third embodiment of the present invention.

[0037] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0038] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0039] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.

[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0041] In order to reduce the difficulty of subsequent analysis algorithms and enable computers to have a certain fault-tolerant control capability, the common drawing errors require a more intelligent and accurate fault-tolerant processing method to solve them, so that the algorithms and systems for analyzing drawings can accurately extract the information that they want to express in the drawings. The purpose of this embodiment is to provide such a method for fault-tolerant processing of CAD geometric line segments. By performing fault-tolerant processing on geometric line segments, the drawing information extraction method can accurately extract the drawing information that they want to express in the CAD drawings.

[0042] Embodiment 1

[0043] See also Figure 1 The first embodiment of the present invention provides a CAD geometric line segment fault-tolerant processing method, which is applied to CAD drawing software and is used to perform fault-tolerant processing on CAD line segments, thereby improving the drawing accuracy of CAD line segments. The method includes steps S10 to S60:

[0044] Step S10, identifying each line segment in the original line segment set, clustering all line segments to obtain an initial line segment set.

[0045] In this embodiment, the steps of identifying each line segment in the original line segment set, clustering all line segments, and obtaining the initial line segment set specifically include:

[0046] Obtaining an original line segment set, and identifying a rotation angle of each line segment in the original line segment set in the Euler coordinate system;

[0047] Taking the rotation angle as a characteristic value and the minimum angle distance as a measurement condition, clustering processing is performed on each line segment in the original line segment set to obtain an initial line segment set.

[0048] In the actual application process, the original line segment set containing the line segment expression will be obtained first, and finally the fault tolerance processing will be performed based on several line segments in the original line segment set. After the original line segment set is obtained, each line segment in the original line segment set will be identified, and then all the line segments in the original line segment set will be classified to obtain multiple classified initial line segment sets. Among them, all the line segments in the original line segment set are classified, specifically, all the line segments are clustered by the rotation angle of the initial line segment, so as to obtain the initial line segment set after cluster analysis, and each initial line segment set includes at least two approximately parallel line segments.

[0049] In this embodiment, clustering is performed according to angles. First, the rotation angle of each line segment in the original line segment set in the standard Euler coordinate system is calculated. Then, the angle is used as the characteristic value and the distance between the angles is used as the measurement condition to perform clustering processing on all the line segments in the original line segment set. At this time, a control is made on the minimum angle distance a, that is, an angle control threshold is set, so that the algorithm has the ability to tolerate line segment angle errors, and lines with small inclination angles can be considered to be repeated to a certain extent.

[0050] For example, if there are two line segments in the original line segment set that are approximately parallel but have a certain distance between them, the distance between the two line segments is small, and there is a small angle between one end of the two line segments, then it can be determined that the two line segments are actually the same line segment, but there is a distance between them due to display accuracy. Therefore, by clustering all the line segments in the original line segment set and determining the clustering based on the minimum angle distance a to obtain the initial line segment set, the degree of "line segment deviation" in the CAD drawing can be controlled, thereby giving the algorithm a certain fault tolerance.

[0051] Step S20: Extending two ends of each line segment in the initial line segment set by a first preset distance to obtain a first line segment set.

[0052] In this embodiment, both ends of each line segment are extended by a first preset distance L to obtain a plurality of line segments whose both ends are extended by the first preset distance L, thereby obtaining a first line segment set B.

[0053] Specifically, the two ends of each line segment are extended respectively with the purpose of making the line segment longer. For example, if there are discontinuities on the line segment, the trend characteristics of the line segment can be enhanced by extending the line segment, making it easier to identify the discontinuities on the line segment, thereby helping to control the degree of "segment tearing".

[0054] Step S30 , expanding each line segment in the first line segment set to both sides by a second preset distance except for the extended parts at both ends, so that each line segment forms a rectangle, thereby obtaining a first rectangle set.

[0055] In this embodiment, the step of expanding each line segment in the first line segment set by a second preset distance to both sides except for the extended parts at both ends so that each line segment forms a rectangle to obtain the first rectangle set specifically includes:

[0056] Determine the endpoint coordinates of the endpoints on both sides of each line segment according to the initial line segment set;

[0057] According to the endpoint coordinates, the connecting line between the two endpoint coordinates of each line segment in the first line segment set is expanded to both sides by a second preset distance so that each line segment forms a rectangle, thereby obtaining a first rectangle set corresponding to all line segments.

[0058] Specifically, before extending the two ends of the line segment by the first preset distance L respectively, the endpoint coordinates of the two end points of each line segment in the Boolean coordinate system are determined according to each line segment in the initial line segment set, and then the line between the coordinates of the two end points of each line segment (equivalent to the original line segment) is extended to both sides of the line segment by the second preset distance d, so that each line segment is expanded to both sides to form a rectangle, thereby obtaining the first rectangle set D corresponding to the line segment.

[0059] That is to say, in this embodiment, for the processing of line segments, it is necessary to cluster the line segments in the original line segment set to obtain an initial line segment set, and then extend the two ends of each line segment in the initial line segment set by a first preset distance L to obtain a first line segment set B, and expand each line segment in the first line segment set B to both sides except the extended segment by a second preset distance d to obtain a first rectangular set D.

[0060] In the first rectangle set D, the length of the rectangle is the length of the line segment, the width of the rectangle is equal to twice the second preset distance d, and the original line segment is equivalent to the midline of the rectangle.

[0061] In this embodiment, the first line segment set B is obtained by extending the two ends of each line segment in the initial line segment set by a first preset distance L, and then the part of each line segment in the first line segment set B except the extended segment, that is, the original segment of the line segment is expanded by a second preset distance d to obtain a first rectangle set D, which includes multiple rectangles, each rectangle is obtained by expanding the original segment of a line segment, and the overlap rate between the multiple rectangles is calculated. When the overlap rate of two rectangles is greater than the preset overlap rate threshold, it is determined that the original segments of the line segments corresponding to the two rectangles are repeated.

[0062] Step S40, performing a Boolean operation on the first rectangular set, identifying a union of the first rectangular set to obtain a geometric object set, and identifying a minimum rotated rectangle of each geometric element in the geometric object set to obtain a second rectangular set.

[0063] In this embodiment, when obtaining the first rectangle set D, a Boolean operation is performed on the first rectangle set D to identify the union of multiple rectangles in the first rectangle set D and obtain the corresponding geometric object set G.

[0064] Then, the minimum rotation rectangle of each geometric element in the geometric object set G is identified to obtain a second rectangle set D'.

[0065] Step S50, identifying the central axis of each rectangle in the second rectangle set to obtain a second line segment set.

[0066] Specifically, the central axis of each rectangle in the second rectangle set D' is identified to obtain a new line segment set, that is, the second line segment set B'.

[0067] Step S60: shortening the length of both ends of each line segment in the second line segment set according to the first preset distance to obtain a target line segment set.

[0068] Specifically, both ends of each line segment in the second line segment set B' are reduced by the first preset distance L shown in the above step S20 to obtain multiple target line segments that have undergone fault tolerance processing, thereby obtaining a final target line segment set.

[0069] In this embodiment, for the original line segment set containing drawing errors, after the processing of the above steps S10 to S60 in this embodiment, the basic common types of line segment duplication, line segment deviation and line segment breakage existing in the original line segment set can be controlled, suppressed, or even eliminated.

[0070] Specifically, the minimum angle distance a in step S10 controls the degree of "line segment deviation", the second preset distance d in step S30 controls the degree of "line segment duplication", and the first preset distance L in steps S20 and S60 controls the degree of "line segment breakage". In the actual application scenario of CAD, the above three values ​​can be set to appropriate values ​​individually or in conjunction to achieve the purpose of having obvious fault tolerance processing capabilities.

[0071] When it is identified that there are drawing errors such as repeated line segments, deviated line segments or broken line segments in the original line segment set, the error degree of the drawing error is controlled by the minimum angle distance, the first preset distance and the second preset distance.

[0072] Compared with the prior art, the CAD geometric line segment fault tolerance processing method shown in this embodiment has the following beneficial effects:

[0073] The CAD geometric line segment fault-tolerant processing method shown in this embodiment, for the original line segment set containing drawing errors, through the method shown in this embodiment, basic and common types such as line segment duplication, line segment deviation and line segment breakage can be controlled, suppressed, or even eliminated. In the actual application scenario of CAD, the above three values ​​can be set to appropriate values ​​individually or in conjunction to achieve the purpose of having obvious fault-tolerant processing capabilities, and then the drawing information to be expressed in the CAD drawing can be accurately extracted through the preset drawing information extraction method.

[0074] Embodiment 2

[0075] See also Figure 2 The second embodiment of the present invention provides a CAD geometric line segment fault-tolerant processing system, which is applied to CAD drawing software and is used to perform fault-tolerant processing on CAD line segments, thereby improving the drawing accuracy of CAD line segments. The system includes: a clustering processing module 10, a line segment extension module 20, a line segment expansion module 30, a Boolean operation module 40, a line segment identification module 50 and a line set output module 60.

[0076] The clustering processing module 10 is used to identify each line segment in the original line segment set, cluster all the line segments, and obtain an initial line segment set.

[0077] In the actual application process, the original line segment set containing the line segment expression will be obtained first, and finally the fault tolerance processing will be performed based on several line segments in the original line segment set. After the original line segment set is obtained, each line segment in the original line segment set will be identified, and then all the line segments in the original line segment set will be classified to obtain multiple classified initial line segment sets. Among them, all the line segments in the original line segment set are classified, specifically, all the line segments are clustered by the rotation angle of the initial line segment, so as to obtain the initial line segment set after cluster analysis, and each initial line segment set includes at least two approximately parallel line segments.

[0078] In this embodiment, clustering is performed according to angles. First, the rotation angle of each line segment in the original line segment set in the standard Euler coordinate system is calculated. Then, the angle is used as the characteristic value and the distance between the angles is used as the measurement condition to perform clustering processing on all the line segments in the original line segment set. At this time, a control is made on the minimum angle distance a, that is, an angle control threshold is set, so that the algorithm has the ability to tolerate line segment angle errors, and lines with small inclination angles can be considered to be repeated to a certain extent.

[0079] For example, if there are two line segments in the original line segment set that are approximately parallel but have a certain distance between them, the distance between the two line segments is small, and there is a small angle between one end of the two line segments, then it can be determined that the two line segments are actually the same line segment, but there is a distance between them due to display accuracy. Therefore, by clustering all the line segments in the original line segment set and determining the clustering based on the minimum angle distance a to obtain the initial line segment set, the degree of "line segment deviation" in the CAD drawing can be controlled, thereby giving the algorithm a certain fault tolerance.

[0080] The line segment extension module 20 is used to extend the two ends of each line segment in the initial line segment set by a first preset distance to obtain a first line segment set.

[0081] In this embodiment, both ends of each line segment are extended by a first preset distance L to obtain a plurality of line segments whose both ends are extended by the first preset distance L, thereby obtaining a first line segment set B.

[0082] Specifically, the two ends of each line segment are extended respectively with the purpose of making the line segment longer. For example, if there are discontinuities on the line segment, the trend characteristics of the line segment can be enhanced by extending the line segment, making it easier to identify the discontinuities on the line segment, thereby helping to control the degree of "segment tearing".

[0083] The line segment expansion module 30 is used to expand each line segment in the first line segment set to both sides by a second preset distance except for the extended parts at both ends, so that each line segment forms a rectangle, thereby obtaining a first rectangle set.

[0084] Specifically, before extending the two ends of the line segment by the first preset distance L respectively, the endpoint coordinates of the two end points of each line segment in the Boolean coordinate system are determined according to each line segment in the initial line segment set, and then the line between the coordinates of the two end points of each line segment (equivalent to the original line segment) is extended to both sides of the line segment by the second preset distance d, so that each line segment is expanded to both sides to form a rectangle, thereby obtaining the first rectangle set D corresponding to the line segment.

[0085] That is to say, in this embodiment, for the processing of line segments, it is necessary to cluster the line segments in the original line segment set to obtain an initial line segment set, and then extend the two ends of each line segment in the initial line segment set by a first preset distance L to obtain a first line segment set B, and expand each line segment in the first line segment set B to both sides except the extended segment by a second preset distance d to obtain a first rectangular set D.

[0086] In the first rectangle set D, the length of the rectangle is the length of the line segment, the width of the rectangle is equal to twice the second preset distance d, and the original line segment is equivalent to the midline of the rectangle.

[0087] In this embodiment, the first line segment set B is obtained by extending the two ends of each line segment in the initial line segment set by a first preset distance L, and then the part of each line segment in the first line segment set B except the extended segment, that is, the original segment of the line segment is expanded by a second preset distance d to obtain a first rectangle set D, which includes multiple rectangles, each rectangle is obtained by expanding the original segment of a line segment, and the overlap rate between the multiple rectangles is calculated. When the overlap rate of two rectangles is greater than the preset overlap rate threshold, it is determined that the original segments of the line segments corresponding to the two rectangles are repeated.

[0088] The Boolean operation module 40 is used to perform Boolean operation on the first rectangular set, identify the union of the first rectangular set to obtain a geometric object set, and identify the minimum rotated rectangle of each geometric element in the geometric object set to obtain a second rectangular set.

[0089] In this embodiment, when obtaining the first rectangle set D, a Boolean operation is performed on the first rectangle set D to identify the union of multiple rectangles in the first rectangle set D and obtain the corresponding geometric object set G.

[0090] Then, the minimum rotation rectangle of each geometric element in the geometric object set G is identified to obtain a second rectangle set D'.

[0091] The line segment identification module 50 is used to identify the central axis of each rectangle in the second rectangle set to obtain a second line segment set.

[0092] Specifically, the central axis of each rectangle in the second rectangle set D' is identified to obtain a new line segment set, that is, the second line segment set B'.

[0093] The line set output module 60 is used to shorten the length of both ends of each line segment in the second line segment set according to the first preset distance to obtain a target line segment set.

[0094] Specifically, both ends of each line segment in the second line segment set B' are reduced by the first preset distance L shown in the above step S20 to obtain multiple target line segments that have undergone fault tolerance processing, thereby obtaining a final target line segment set.

[0095] When it is identified that there are drawing errors such as repeated line segments, deviated line segments or broken line segments in the original line segment set, the error degree of the drawing error is controlled by the minimum angle distance, the first preset distance and the second preset distance.

[0096] Compared with the prior art, the CAD geometric line segment fault tolerance processing method shown in this embodiment has the following beneficial effects:

[0097] The CAD geometric line segment fault-tolerant processing method shown in this embodiment, for the original line segment set containing drawing errors, through the method shown in this embodiment, basic and common types such as line segment duplication, line segment deviation and line segment breakage can be controlled, suppressed, or even eliminated. In the actual application scenario of CAD, the above three values ​​can be set to appropriate values ​​individually or in conjunction to achieve the purpose of having obvious fault-tolerant processing capabilities, and then the drawing information to be expressed in the CAD drawing can be accurately extracted through the preset drawing information extraction method.

[0098] Embodiment 3

[0099] A third embodiment of the present invention provides a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed by a processor, the steps of the method described in the above embodiment are implemented.

[0100] Embodiment 4

[0101] A fourth embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the above embodiment when executing the computer program.

[0102] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0103] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A method for fault-tolerant processing of CAD geometric line segments. It is characterized in that The method comprises: Identify each line segment in the original line segment set, cluster all line segments, and obtain an initial line segment set; Extending two ends of each line segment in the initial line segment set by a first preset distance to obtain a first line segment set; Expand each line segment in the first line segment set to both sides by a second preset distance except for the extended parts at both ends, so that each line segment forms a rectangle, thereby obtaining a first rectangle set; Performing a Boolean operation on the first rectangular set, identifying a union of the first rectangular set to obtain a geometric object set, and identifying a minimum rotated rectangle of each geometric element in the geometric object set to obtain a second rectangular set; Identify the central axis of each rectangle in the second set of rectangles to obtain a second set of line segments; According to the first preset distance, shorten the length of both ends of each line segment in the second line segment set to obtain a target line segment set; The step of identifying each line segment in the original line segment set and clustering all line segments to obtain the initial line segment set specifically includes: Obtaining an original line segment set, and identifying a rotation angle of each line segment in the original line segment set in the Euler coordinate system; Taking the rotation angle as a characteristic value and the minimum angle distance as a measurement condition, clustering is performed on each line segment in the original line segment set to obtain an initial line segment set; The initial line segment set is a set of infinitely approximately parallel line segments.

2. The CAD geometric line segment fault-tolerant processing method according to claim 1, It is characterized in that The step of expanding each line segment in the first line segment set except for the extended parts at both ends to both sides by a second preset distance so that each line segment forms a rectangle to obtain the first rectangle set specifically includes: Determine the endpoint coordinates of the endpoints on both sides of each line segment according to the initial line segment set; According to the endpoint coordinates, the connecting line between the two endpoint coordinates of each line segment in the first line segment set is expanded to both sides by a second preset distance so that each line segment forms a rectangle, thereby obtaining a first rectangle set corresponding to all line segments.

3. The CAD geometric line segment fault-tolerant processing method according to claim 2, It is characterized in that In the first rectangle set, the length of the rectangle is the length of the line segment, the width of the rectangle is equal to twice the second preset distance, and the line segment is equivalent to the midline of the rectangle.

4. The CAD geometric line segment fault-tolerant processing method according to any one of claims 1 to 3, It is characterized in that The method further comprises: When it is identified that there are drawing errors such as repeated line segments, deviated line segments or broken line segments in the original line segment set, the error degree of the drawing errors is controlled by the minimum angle distance, the first preset distance and the second preset distance.

5. The CAD geometric line segment fault-tolerant processing method according to claim 4, It is characterized in that In the process of performing fault tolerance processing on the geometric line segment, the adjustment mechanism of the minimum angle distance, the first preset distance and the second preset distance is a separate adjustment or a linkage adjustment.

6. A CAD geometric line segment fault-tolerant processing system, It is characterized in that The method applied to any one of claims 1 to 5, wherein the system comprises: A clustering processing module is used to identify each line segment in the original line segment set, cluster all line segments, and obtain an initial line segment set; A line segment extension module, used for extending both ends of each line segment in the initial line segment set by a first preset distance to obtain a first line segment set; A line segment expansion module, used for expanding each line segment in the first line segment set except for the extended parts at both ends to both sides by a second preset distance, so that each line segment forms a rectangle, thereby obtaining a first rectangle set; A Boolean operation module, configured to perform a Boolean operation on the first rectangular set, identify a union of the first rectangular set to obtain a geometric object set, and identify a minimum rotation rectangle of each geometric element in the geometric object set to obtain a second rectangular set; A line segment recognition module, used to recognize the central axis of each rectangle in the second rectangle set to obtain a second line segment set; The line set output module is used to shorten the length of both ends of each line segment in the second line segment set according to the first preset distance to obtain a target line segment set.

7. A computer-readable storage medium having computer instructions stored thereon, It is characterized in that When the computer instructions are executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.