A method for realizing avoidance arrangement of annotation characters in design drawings

Through multi-level classification and optimization algorithms, the annotation in the design drawings is automatically arranged, which solves the problem of overlapping numerical characters in the design drawings, and efficient and intelligent annotation arrangement is achieved, which significantly improves the design efficiency.

CN114781013BActive Publication Date: 2024-12-31FOSHAN JIUZHANG INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210541463.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-17
Publication Date
2024-12-31
Estimated Expiration
2042-05-17

AI Technical Summary

Technical Problem

Existing design tools are difficult to effectively handle the placement of numerical characters in design drawings, resulting in frequent overlapping phenomena, affecting the aesthetics and reading efficiency of the drawings, and the avoidance processing efficiency of the existing technology is low.

Method used

Multi-level classification and optimization algorithms are used to automatically arrange the annotations in the design drawings, and the coordinates and layoutable space of the annotation are obtained through preprocessing, and combined with the annotation frame to replace the annotation form, the intelligent and automated arrangement of the annotation is realized.

Benefits of technology

It significantly improves the avoidance and arrangement of characters marked in the design drawings, reduces overlap and misalignment, and achieves fast and convenient automatic arrangement, which is more efficient than traditional manual adjustments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114781013B_ABST
    Figure CN114781013B_ABST
Patent Text Reader

Abstract

The present invention generally relates to the field of image information processing, and more specifically, to a method for realizing avoidance arrangement of annotated characters in design drawings. The method comprises: inputting a two-dimensional drawing to be processed; preprocessing the input two-dimensional drawing to obtain the coordinates of the annotations in the two-dimensional drawing and the layout space that can be laid out; performing multi-level classification on the annotations; optimizing the positions of the annotations after the multi-level classification according to the coordinates of the annotations and the layout space that can be laid out, obtaining the position optimization results of the annotations and arranging the annotations. The present invention performs multi-level classification on the annotations, and after classification, automatically arranges the annotations in the drawings based on the coordinates of the annotations and the layout space combined with an optimization algorithm. Compared with the traditional manual adjustment arrangement, it is convenient and fast, and compared with the prior art of using a computer to adjust the annotations one by one left, right, up, and down, the method of the present invention also realizes intelligent automation, and significantly improves the speed of avoidance arrangement of annotated characters in design drawings.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention generally relates to the field of image information processing, and more specifically, to a method for realizing avoidance arrangement of annotation characters in design drawings. Background Art

[0002] The construction industry and industrial design industry are important pillar industries of my country's national economy. In recent years, they have maintained a trend of rapid development and the scale of the industry has been expanding. Due to the lack of technological innovation, the construction industry and industrial design industry have always had problems such as high energy consumption, high risk, and low productivity. Applying artificial intelligence technology to architectural design can greatly reduce working hours and design costs, allowing architects, industrial designers, etc. to focus more on the design of the scheme itself.

[0003] There are many existing design tools such as AutoCAD that can provide direct export of numerical values, but they cannot properly handle the placement of numerical characters in drawings. Often, two or more numerical characters overlap, or numerical characters overlap with other graphics in the building. The overlap not only affects the beauty of the entire drawing, but also directly affects the reading of the numerical values. Therefore, after exporting the numerical characters, personnel still need to manually place and arrange the numerical characters in the drawings, which relies heavily on manual arrangement and the practical experience of architects, industrial designers, etc.

[0004] There is also an avoidance process in the prior art for the arrangement of numerical characters in drawings, which specifically involves finding overlapping texts and then sliding these texts left, right, up, and down one by one to move the texts out of the overlapping areas. This method is relatively primitive and inefficient. Summary of the invention

[0005] The present invention aims to overcome at least one defect (shortcoming) of the above-mentioned prior art and provide a method and system for realizing avoidance arrangement of annotated characters in design drawings, so as to quickly and conveniently realize automatic avoidance arrangement of annotations in design drawings according to needs.

[0006] The technical solution adopted by the present invention is a method for realizing avoidance arrangement of annotation characters in design drawings, comprising:

[0007] Input the 2D drawing to be processed;

[0008] Preprocess the input 2D drawings to obtain the coordinates and layout space marked in the 2D drawings;

[0009] Perform multi-level classification on annotations;

[0010] The positions of the multi-level classified annotations are optimized according to the labeled coordinates and the layout space, the optimized position results of the annotations are obtained and the annotations are arranged.

[0011] The present invention classifies annotations into multiple levels, and after classification, automatically arranges the annotations in the drawings based on the coordinates of the annotations and the layout space combined with an optimization algorithm. Compared with the traditional manual adjustment and arrangement, this method is both convenient and fast. Moreover, compared with the prior art of using a computer to adjust the annotations one by one left, right, up and down, the method of the present invention also realizes intelligent automation, and significantly improves the speed of avoiding the arrangement of annotation characters in the design drawings.

[0012] In the above solution, the preprocessing of the input two-dimensional drawing to obtain the coordinates marked in the two-dimensional drawing specifically includes:

[0013] Process the annotations of the input 2D drawings and replace the annotation form with annotation boxes;

[0014] Get the coordinates of the annotation box as the coordinates of the annotation.

[0015] The present invention replaces the annotation form with an annotation frame, thereby establishing an annotation coordinate system, facilitating the position processing of the annotation, and improving the processing efficiency of the method.

[0016] In the above solution, the marking box is a square box, and the coordinates of the center point of the square box on the two-dimensional drawing are used as the marking coordinates.

[0017] The center of the square box is easy to find, and its center point is used as the coordinate point to facilitate subsequent calculation and processing of the coordinates.

[0018] In the above scheme, the input two-dimensional drawing is preprocessed to obtain the layout space marked in the two-dimensional drawing, specifically:

[0019] Graphically merge element entities in a two-dimensional drawing to form one or more spaces occupied by the element entities;

[0020] One or more spaces occupied by the element entity are subtracted from the entire space of the two-dimensional drawing to obtain one or more independent layout spaces; and the independent layout space where each annotation is located is determined according to the coordinates of the annotation.

[0021] In the above solution, the multi-level classification of the annotations is specifically to classify the annotations into at least three levels to obtain multi-level numbers of the annotations.

[0022] In the above scheme, the multi-level classification of annotations is specifically as follows:

[0023] Group annotations according to their associations;

[0024] On the basis of grouping, the annotations are combined and classified according to the annotation styles;

[0025] On the basis of combined classification, the annotations are divided into batches according to the space they occupy;

[0026] The labels are numbered at multiple levels according to the results of grouping, combination classification and batching.

[0027] In the above scheme, the association between annotations refers to the same annotation on the same element entity, or the same annotation is used between multiple element entities, or when the character of one annotation is changed, the character of another annotation also needs to be changed. In the above scheme, the annotations are combined and classified according to the annotation style on the basis of grouping, specifically:

[0028] Traverse all the marked square box styles in the group to obtain the square box style type of each group;

[0029] Dimensions with the same square frame style are grouped together and the groups are numbered.

[0030] In the above scheme, the annotations are divided into batches based on the space occupied by the annotations on the basis of the combined classification, specifically:

[0031] If a group and other group have the following relationship, then the group and other group are grouped together, and the following relationship is: both the group and other group have annotations in the same independent layout space and the area of ​​the independent layout space is less than x times the sum of the areas of the square boxes of all annotations in the independent layout space, where x is a preset value.

[0032] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for realizing the avoidance arrangement of annotation characters in design drawings as described above is implemented.

[0033] Compared with the prior art, the present invention has the following beneficial effects:

[0034] The present invention classifies annotations at multiple levels, and after classification, automatically arranges annotations in drawings based on the coordinates of the annotations and the layout space combined with an optimization algorithm. It is found through experiments that the overlap between the arranged annotations is low, the annotations are not misplaced, the overlap between the annotations and other drawing element entities is also low, and the optimized position of the annotations can be as close as possible to the position of the preferred annotation element, and the annotations do not undergo transitional deflection. Compared with the traditional manual adjustment and arrangement, the method of the present invention is both convenient and fast, and compared with the prior art of using a computer to adjust the annotations one by one left, right, up and down, the method of the present invention also realizes intelligent automation, and significantly improves the speed of avoiding the arrangement of annotation characters in the design drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 The present invention is a specific flow chart of a method for realizing avoidance arrangement of annotation characters in design drawings.

[0036] Figure 2 It is a schematic diagram of a reinforcement diagram in a specific embodiment of the present invention.

[0037] Figure 3 It is a schematic diagram of the independent layout space obtained by marking frame replacement standard and determination in a specific embodiment of the present invention.

[0038] Figure 4 It is a schematic diagram of multi-level numbering of labels in a specific embodiment of the present invention.

[0039] Figure 5 Schematic diagram of avoiding arrangement of labels in a specific embodiment of the present invention Figure 1 .

[0040] Figure 6 Schematic diagram of avoiding arrangement of labels in a specific embodiment of the present invention Figure 2 .

[0041] Figure 7 Schematic diagram of avoiding arrangement of labels in a specific embodiment of the present invention Figure 3 .

[0042] Figure 8 It is a schematic diagram of the optimal arrangement result of avoiding arrangement of annotations in a specific embodiment of the present invention. DETAILED DESCRIPTION

[0043] The drawings of the present invention are only for illustrative purposes and should not be construed as limiting the present invention. In order to better illustrate the following embodiments, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product; it is understandable to those skilled in the art that some well-known structures and their descriptions in the drawings may be omitted.

[0044] The design drawings mentioned in the present invention are generally design drawings with text or symbols marking the drawing contents, including architectural design drawings, industrial parts design drawings, construction drawings, etc. with text or symbols.

[0045] The element entities mentioned in the present invention can be other elements that occupy drawing space other than annotations in the drawings, such as beams, doors and windows in architectural design drawings, end covers in industrial parts design drawings, and houses in construction drawings.

[0046] Example 1

[0047] like Figure 1 As shown in FIG. 1 , it is a specific flow chart of a method for realizing avoidance arrangement of annotation characters in design drawings in this specific embodiment. Figure 1 The specific steps of a method for realizing avoidance arrangement of marked characters in a design drawing in this specific embodiment include:

[0048] S1. Input the two-dimensional drawing to be processed; the two-dimensional drawing needs to be marked and arranged and character avoidance is processed. Figure 2 As shown, Figure 2 The upper and lower cross beams 01 and 02 and three longitudinal beams 03, 04 and 05 of the reinforcement diagram are shown in the figure. The cross beams and longitudinal beams are the element entities described in the present invention. Figure 2 The beam 01 shown has three annotations, namely the left and right surface reinforcement annotation and the through-rebar annotation, which are "100×100 on the left, 50×50 in the middle, and 100×100 on the right". The beam 02 has four annotations, namely the left and right surface reinforcement annotation, the through-rebar annotation and the concentrated annotation, which are "100×100 on the left, 50×50 in the middle, 100×100 on the right" and "50X50 in the middle, 100X100 on the left and right". The left and right surface reinforcement annotation, the through-rebar annotation and the concentrated annotation are mutually exclusive. In the actual drawing, only one annotation method will be selected. In actual applications, the two-dimensional drawings can be pre-processed before input, and multiple mutually exclusive annotation methods can be used to annotate part or all of the annotations of the same element entity in order to optimize the arrangement of the element entity annotations. Figure 2 The longitudinal beams shown have a label, from left to right, "middle 200×200, middle 50×50, middle 50×50". Figure 2 As shown in the figure, there is occlusion between the annotations, and the occluded annotations need to be arranged to avoid them so that each annotation can be clearly seen.

[0049] S2. Preprocess the input two-dimensional drawing to obtain the coordinates and layout space marked in the two-dimensional drawing;

[0050] By preprocessing the two-dimensional drawings, the coordinates of the annotations and the layout space can be obtained. The layout space refers to the drawing space that can be used for annotations. Based on the coordinates of the annotations and the layout space, the position of the annotations can be optimized so that they can obtain a suitable display position in the layout space.

[0051] Specifically, the preprocessing includes preprocessing the annotations in the two-dimensional drawing to obtain the coordinates of the annotations, and the specific steps include:

[0052] S21. Process the annotations of the input two-dimensional drawing, and replace the annotation form with an annotation frame; this method can obtain each annotation on the two-dimensional drawing by traversing the two-dimensional drawing, and then surround the annotation with an annotation frame to replace the annotation form. In specific implementation, the annotation frame is implemented as a square frame, which can be a rectangular frame or a square frame. The square frame can accurately obtain the center of gravity of the frame, and determine the position of the annotation based on the center of gravity, that is, the center, so that the positioning of the annotation is more accurate. In specific implementation, other forms of annotation frames can also be used as a substitute, which is not limited here.

[0053] S22. Obtain the coordinates of the annotation box as the coordinates of the annotation. Usually, the coordinates of the annotation box are the coordinates of the position of the center of gravity as the position of the annotation box, so that the subsequent position of the annotation box is more accurate. When the annotation box is implemented as a square box, the coordinates of the annotation box are the coordinates of the center point of the square box on the two-dimensional drawing as its coordinates.

[0054] like Figure 3 As shown, the rectangular frame described by number aj is a marking frame, which is used to replace the markings of the two horizontal beams 01, 02 and the three longitudinal beams 03, 04, 05.

[0055] In the specific implementation process, the preprocessing also includes obtaining the layout space that can be occupied by the annotation in the two-dimensional drawing, which specifically includes the following steps:

[0056] S23. Graphically merge the element entities in the two-dimensional drawing to form one or more spaces occupied by the element entities; specifically, in the two-dimensional drawing, graphically merge the element entities except the annotations to form one or more spaces occupied by the element entities, that is, Figure 3 As shown, the two horizontal beams 01, 02 and the three longitudinal beams 03, 04, 05 in the figure are graphically merged to form a space D.

[0057] S24. Subtract one or more spaces occupied by the element entity from the entire space of the two-dimensional drawing to obtain one or more independently configurable spaces that are marked as configurable; in this step, the space of the two-dimensional drawing is determined, and according to the one or more spaces obtained in step S13, the one or more independently configurable spaces that can be occupied by the marking in the entire drawing can be obtained by subtraction. Specifically, one or more independently configurable spaces can be obtained by performing a difference operation on the plane using a geometric algorithm, that is, one or more spaces occupied by the element entity are subtracted from a large plane space. Since the space obtained in step S23 may be one or more spaces, the group of configurable spaces obtained after subtraction may also be one or more. Among the multiple configurable spaces, each configurable space ensures that there is no space directly connected to other configurable spaces, and these configurable spaces that are not directly connected to each other are treated as independent configurable spaces.

[0058] like Figure 3 As shown, when space D is the space occupied by other element entities in the two-dimensional drawing, the space of the drawing minus space D is subtracted to obtain three arrangable spaces A, B, and C. Since the arrangable spaces A, B, and C are not directly connected to each other, the arrangable spaces A, B, and C are three independently arrangable spaces.

[0059] S25. Determine the independent layout space where each annotation is located according to the coordinates of the annotation. Since the coordinates of the annotation are obtained by the annotation frame, the position of the annotation on the two-dimensional drawing can be determined according to the coordinates of the annotation. At the same time, since the area of ​​the independent layout space is determined, the independent layout space where the annotation frame can be placed can be calculated according to the coordinates of the annotation.

[0060] like Figure 3 As shown, labels a and b can be placed in the independent layout space B, labels c, d, e, and f can be placed in the layout space A, and labels g, h, i, and j can be placed in the layout space C.

[0061] S3. Classify the annotations into multiple levels: In this step, the annotations on the two-dimensional drawing need to be classified into multiple levels to facilitate the subsequent processing of the optimization algorithm. Preferably, the annotations can be classified into at least three levels to obtain the multi-level numbering of the annotations.

[0062] In this specific embodiment, a three-level classification method is used for the multi-level classification of annotations. In the specific implementation process, different classification methods can be used according to different selected optimization algorithms.

[0063] Specifically, the specific steps of performing three-level classification on the annotations include:

[0064] S31. Group the annotations according to the correlation between them; the correlation between annotations refers to the correlation in the business sense, which can be called the business attribute of the annotation. The annotations are grouped according to the business attributes of the annotations, and the business attributes include: i. The same annotation is on the same element entity; ii. The same annotation is used between multiple element entities; iii. When the character of one annotation is changed, the character of another annotation also needs to be changed. The annotations belonging to any of the three business attributes mentioned above are divided into the same annotation group. Figure 2 and 3 As shown, the left and right surface reinforcement markings, the through reinforcement markings, and the concentrated markings of a beam 02 are grouped into one marking group, that is, the b, c, d, and e markings are grouped into the same marking group, a, f, and g are each grouped into a marking group, and the h, i, and j markings are grouped into the same marking group.

[0065] S32. Combine and classify the annotations according to the annotation styles on the basis of the annotation groups. In the specific implementation process, the same annotation has multiple variation styles, that is, its square box has multiple variation styles, and the variation styles include mutually exclusive annotation methods, different annotation directions, etc. For the annotations in the same annotation group, the variation styles of the square boxes in the same annotation group are integer-numbered by traversing and enumerating. The annotations with the same square box style in the same annotation group are all represented by an integer number, and the integer number represents a combination of this annotation group.

[0066] like Figure 2 and 3 As shown, the marking styles of the left and right surface reinforcement and the through reinforcement of a beam 02 are the same, so these three markings are classified into one combination. The marking style of the concentrated marking is another form, which is separately classified into one combination, that is, the markings of b, c, and d are classified into the same combination, and the marking of e is classified into one combination; a, f, and g have only one change, each is a combination; the marking styles of h, i, and j are the same and classified into the same combination.

[0067] S33. Based on the combined classification, the annotations are divided into batches according to the space occupied by the annotations. This processing step is to divide all the annotation groups into batches. If one annotation group and other annotation groups have the following relationship, then the one annotation group and the other annotation groups are grouped together. The following relationship is: both the one annotation group and the other annotation groups have annotations in the same independent layout space and the area of ​​the independent layout space is less than x times the sum of the square box areas of all the annotations in the independent layout space, where x is a preset value. In the specific setting process, x can be preset according to an empirical value, such as x is set to 10, or it can be set to other values.

[0068] The purpose of using the annotation group in this specific embodiment is to split the problem into two problems: the optimization problem of the combination problem between annotations and the continuous optimization problem of the annotation layout, so as to solve the problem of poor optimization effect caused by simultaneous optimization of discrete space and continuous space. Then the purpose of using batches is to reduce the dimension of the solution space and reduce the computing power required for the solution.

[0069] Specific as Figure 3 As shown, for the annotation group where the a annotation is located and the annotation group where the b, c, d, e annotations are located, the a annotation and the b annotation exist in the same independent layout space B, and the area of ​​the independent layout space B is less than 10 times the sum of the square box areas of the a annotation and the b annotation. Therefore, the annotation group where the a annotation is located and the annotation group where the b annotation is located are divided into the same batch, that is, the a, b, c, d, e annotations are divided into one batch; in addition, in the annotation group where the f annotation is located and the annotation group where the b, c, d, e annotations are located, the f annotation and the b, c, d, e annotations exist in the same independent layout space A, and the area of ​​the independent layout space A is greater than 10 times the sum of the square box areas of the f annotation and the b, c, d, e annotations. Therefore, the annotation group where the f annotation is located and the annotation group where the b, c, d, e annotations are located cannot be divided into the same batch, that is, the f annotation and the b, c, d, e annotations are each in the same batch. For this reason, the a, b, c, d, e annotations are divided into one batch, the f annotation is divided into one batch, the g annotation is divided into one batch, and the h, i, j annotations are divided into one batch.

[0070] S3. Perform multi-level numbering on the labels according to the results of labeling grouping, combination classification and batching. In the specific implementation process, the multi-level numbering is defined as "batch-labeling group number-combination number-sequence number within the group".

[0071] like Figure 3 As shown, a, b, c, d, and e are marked as the same batch, and their batch number is defined as 1, the batch marked by f is 2, the batch number marked by g is 3, and the batch number marked by h, i, and j is 4.

[0072] In the batch number 1 pair of a, b, c, d, e annotations, a annotation and b, c, d, e annotations are divided into different annotation groups. Therefore, in the batch number 1 annotation, the annotation group number of a annotation is defined as 1, and the annotation group number of b, c, d, e annotations is defined as 2; the annotation group number 2 includes four annotations b, c, d, e, among which b, c, d annotations are divided into the same combination, and e annotation is a combination. Therefore, the combination number of b, c, d annotations is 1, and the combination number of e annotation is 2; among the three annotations of combination number 1, b, c, d annotations are sorted, and the serial numbers are 1, 2, and 3 respectively;. By analogy, the hierarchical numbers of aj, a total of 10 annotations, are obtained as follows Figure 4 shown.

[0073] S4. Optimize the positions of the multi-level classified annotations according to the coordinates of the annotations and the independently layoutable space, obtain the position optimization results of the annotations and arrange the annotations.

[0074] In the specific implementation process, step S4 optimizes each batch of annotation groups, selects a combination from each annotation group in each batch by traversal or discrete optimization algorithm, and then selects an unarranged annotation from each combination according to the sequence number in the group by traversal. The positions of all annotations to be optimized are optimized using an optimization solver, and the most reasonably arranged combination and position are obtained as the combination and arrangement position of the annotations to be optimized, until all annotations are placed.

[0075] The specific steps of step S4 include:

[0076] S41. Select all annotation groups from the current batch and select a combination, and use the selected annotation group and the i-th annotation of the combination as the annotation to be arranged, and the initial value of i is 1. Figure 4In the , the 1st batch of annotation groups 1 and 2 are selected, and 1 combination is selected for the 2 annotation groups for annotation. The annotation with the serial number 1 in the group is preferred for arrangement, that is, 1-1-1-1 and 1-2-1-1 are arranged. Among them, when the selected combination only exists in one or more annotation groups in the batch, and the combination style does not exist in other annotation groups, the other annotation groups will be optimized based on the previous combination and the combination selected by other annotation groups. For example, the 1st batch of annotation groups 1 and 2 are selected for annotation group 2. Since there is no combination 2 in annotation group 1, annotation group 1 selects combination 1 and combination 2 of annotation group 1 for position optimization. When the annotation with the serial number 1 in the group is preferred for arrangement, 1-1-1-1 and 1-2-2-1 are arranged.

[0077] S42. For each label arrangement position to be arranged and marked, the coordinates (x, y) and the clockwise rotation angle Use real numbers for encoding. Form a set of vectors with dimension n = the number of annotation groups to be arranged * 3 as the variables to be optimized.

[0078] S43. Use a particle swarm optimization solver to optimize the variables to be optimized. Each time the solution is solved, the solution is converted into a labeled layout. The reasonableness of the arrangement of the labels is calculated by using preset indicators as the target for optimization. In specific implementation, the preset indicators may include the overlapping area between characters, the overlapping area with other element entities, and the relative position close to the element entity. In specific implementation, the optimization algorithm may also use algorithms such as simulated annealing and taboo search.

[0079] For example, Figure 4 As shown, the result of arranging the labels 1-1-1-1 and 1-2-1-1 is as follows Figure 5 shown.

[0080] S44. Select the next annotation for optimization of the combination of the selected annotation group, that is, i=i+1 and repeat steps S41 to S43 until all the annotations to be arranged in the annotation group are completed, that is, if i+1> the number of annotations in the combination of the annotation group, then skip this combination and select the next combination to execute steps S41-S43; Figure 6 As shown in Figure 1, it is a schematic diagram of the result after all the labels (a, b, c, d) of the first combination are selected in batch 1 and arranged. Figure 7 As shown, this is a schematic diagram of the structure after all annotations of the second combination in batch 1 are arranged.

[0081] S45. For the annotation groups in the same batch, the most reasonable combination and arrangement position are selected as the arrangement result of the annotations to complete the arrangement of the annotations in the batch. For example, for all the annotations in batch 1, the arrangement results of combination 1 and combination 2 are as follows: Figure 6 and7 As shown, Figure 6 The results were compared. Figure 7 In the result, the annotation 1-1-1-1 is closer to the center of the element entity. The annotation 1-2-1-1 belongs to the centralized annotation style, which is relatively flexible in annotation position. Therefore, select Figure 7 The arrangement shown results in a better position.

[0082] S46. After completing this batch, process the next batch of annotation groups until all batches are arranged. The result after arranging all batches is as follows: Figure 8 shown.

[0083] S5. Arrange all annotations in the two-dimensional drawing based on the annotation characters according to the arrangement results, and output the design drawing in which the arrangement is completed and character avoidance has been achieved.

[0084] The present invention classifies annotations into multiple levels, and after classification, automatically arranges the annotations in the drawings based on the coordinates of the annotations and the layout space combined with an optimization algorithm. Compared with the traditional manual adjustment and arrangement, this method is both convenient and fast. Moreover, compared with the prior art of using a computer to adjust the annotations one by one left, right, up and down, the method of the present invention also realizes intelligent automation, and significantly improves the speed of avoiding the arrangement of annotation characters in the design drawings.

[0085] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the technical solution of the present invention, and are not intended to limit the specific implementation methods of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the claims of the present invention shall be included in the protection scope of the claims of the present invention.

Claims

1. A method for realizing avoidance arrangement of marked characters in design drawings, characterized in that: include: Input the 2D drawing to be processed; Preprocess the input 2D drawings to obtain the coordinates and layout space marked in the 2D drawings; Perform multi-level classification on annotations; Optimize the position of the multi-level classified annotations according to the annotation coordinates and the layout space, obtain the optimization results of the annotation positions and arrange the annotations; The preprocessing of the input two-dimensional drawing to obtain the coordinates marked in the two-dimensional drawing specifically includes: Process the annotations of the input 2D drawings and replace the annotation form with annotation boxes; Get the coordinates of the annotation box as the coordinates of the annotation; The marking frame is a square frame, and the coordinates of the center point of the square frame on the two-dimensional drawing are used as the marking coordinates; The multi-level classification of annotations is specifically as follows: Group annotations according to their associations; The marked square box has multiple variation styles, including mutually exclusive marking methods and different marking directions; On the basis of grouping, the annotations are combined and classified according to the styles of the square boxes of the annotations; On the basis of combined classification, the annotations are divided into batches according to the space they occupy; The labels are numbered at multiple levels according to the results of grouping, combination classification and batching.

2. A method for realizing avoidance arrangement of annotation characters in design drawings according to claim 1, characterized in that: Preprocess the input 2D drawing to obtain the layout space marked in the 2D drawing, specifically: Graphically merge element entities in a two-dimensional drawing to form one or more spaces occupied by the element entities; Subtract one or more spaces occupied by the element entity from the entire space of the two-dimensional drawing to obtain one or more independent layout spaces that can be arranged by annotation; Determine the independent layout space where each annotation is located according to the coordinates of the annotation.

3. A method for realizing avoidance arrangement of annotation characters in design drawings according to claim 2, characterized in that: The multi-level classification of the annotations is specifically to classify the annotations into at least three levels to obtain multi-level numbers of the annotations.

4. A method for realizing avoidance arrangement of annotation characters in design drawings according to claim 1, characterized in that: The association between annotations refers to the same annotation on the same element entity, or the same annotation is used between multiple element entities, or when the characters of one annotation are changed, the characters of another annotation also need to be changed.

5. A method for realizing avoidance arrangement of annotation characters in design drawings according to claim 1, characterized in that: The annotations are combined and classified according to the annotation styles on the basis of grouping, specifically: Traverse all the marked square box styles in the group to obtain the square box style type of each group; Dimensions with the same square frame style are grouped together and the groups are numbered.

6. A method for realizing avoidance arrangement of annotation characters in design drawings according to any one of claims 1, 4 and 5, characterized in that: The annotations are divided into batches based on the space occupied by the annotations on the basis of the combined classification, specifically: If a group and other group have the following relationship, then the group and other group are grouped together, and the following relationship is: both the group and other group have annotations in the same independent layout space and the area of ​​the independent layout space is less than x times the sum of the areas of the square boxes of all annotations in the independent layout space, where x is a preset value.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for avoiding arrangement of annotation characters in design drawings as described in any one of claims 1 to 6 is implemented.