CAD automatic multi-label generation method and system

By building an extended protocol library, the annotation of complex entities is automatically generated for CAD software, which solves the problems of low labeling efficiency and high resource utilization in the existing technology, and realizes automated, standardized and efficient annotation generation.

CN120279140AActive Publication Date: 2025-07-08SUZHOU CAD SOFTWARE CO LTD

Patent Information

Application Number
CN202510728461.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-03
Publication Date
2025-07-08
Estimated Expiration
2045-06-03

AI Technical Summary

Technical Problem

Existing CAD software is difficult to automatically identify and generate labels of complex entities, especially ellipses, polylines, cuboids, spheres, etc., resulting in a large number of entity labels relying on manual operations, affecting design efficiency, and relying on deep neural networks to cause excessive computing resource utilization.

Method used

Build an extended protocol library to register extended protocols for various types of entities, including key features and labeling rules, obtain entity types through user selection and automatically generate labels, and adjust the label location or transparency to avoid conflicts when labels and labels or entities interfere with each other.

Benefits of technology

It realizes automatic generation of multiple key feature annotations, improves design efficiency, reduces manual intervention, reduces operational thresholds, and reduces labeling errors, ensuring standardized and clear labeling, and adapts to different user needs and technological developments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120279140A_ABST
    Figure CN120279140A_ABST
Patent Text Reader

Abstract

The invention discloses a CAD automatic multi-label generation method and system. The method comprises the following steps: constructing an extension protocol library, and registering extension protocols for various entities; the extension protocol comprises at least one key feature needing to be labeled by an entity and a rule for labeling the key feature; the rule comprises a labeling style and a labeling position; the entity type is obtained based on user selection, and a corresponding extension protocol is called from an extension protocol library so as to obtain key features, needing to be labeled, of the entity; and obtaining annotation data corresponding to the key features, needing to be annotated, of the entity, and generating annotations for the entity according to the annotation data and the annotation rules. According to the method, the entity type can be automatically obtained, the annotation is generated according to the rule, manual annotation setting on each key feature one by one is not needed, the annotation time is greatly saved, and the drawing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of computer-aided design, and in particular relates to a CAD automatic multi-annotation generation method and system. Background Art

[0002] The existing CAD (computer-aided design) software intelligent annotation function can only recognize a few basic entity objects such as lines, circles, and arcs. For dozens of complex entities commonly seen in engineering design, such as ellipses, polylines, cuboids, and spheres, CAD software usually needs to decompose them into basic entities (such as line segments and arcs) and rely on the user to select specific sub-entities through the mouse position before generating annotations. For example, for polyline entities, it is necessary to decompose and select the line segments or arc parts; and for non-decomposable entities such as spheres and cuboids, existing technologies cannot directly recognize their geometric features, resulting in the complete inability to generate annotations (such as radius annotations for spheres, size annotations for cuboids, etc.). This limitation means that the annotation of a large number of entities still needs to rely on manual operations, which seriously affects design efficiency.

[0003] Prior art Chinese patent application CN117058157A discloses a method for cutting and marking CAD drawings, comprising the following steps: parsing elements in a DXF file through an element parser and extracting line-type image entities; grouping related lines together through a cutting algorithm; redrawing the grouped lines into a DXF file and generating a picture; the marking algorithm relies on a CNN convolutional neural network to recognize the image, recognize the structure contained in each picture and mark the structure, and continuously optimizes the network based on the recognition results to improve the recognition accuracy.

[0004] In the above-mentioned prior art, the basic entities are grouped into a group through an algorithm, and the model of each group of entities is automatically labeled with multiple key features. However, it is difficult to plug in a neural network for general CAD software. In addition, the prior art relies on CNN convolutional neural networks for image recognition. Deep neural networks contain a large number of convolutional layers, pooling layers, and fully connected layers, which require a lot of computing resources. The CAD software itself consumes a lot of memory and CPU resources. Superimposing model reasoning can easily cause system jams and affect the smoothness of the design process. Summary of the invention

[0005] The purpose of the present invention is to provide a CAD automatic multiple annotation generation method and system, which partially solves or alleviates the above-mentioned deficiencies in the prior art. The user only needs to select an entity to automatically generate multiple key feature annotations for the selected entity.

[0006] In order to solve the above-mentioned technical problems, the present invention specifically adopts the following technical solutions: In a first aspect of the present invention, there is provided a CAD automatic multi-annotation generation method, including: Construct an extended protocol library, and register extended protocols for various types of entities; the extended protocol includes at least one key feature of the entity, and rules for annotating the key feature; the rules include annotation styles and annotation positions; Based on user selection, obtain the entity type of a specified entity, and call the corresponding extended protocol from the extended protocol library to obtain at least one key feature of the specified entity; Obtain annotation data corresponding to at least one key feature of the specified entity, and automatically generate multiple annotations for the specified entity according to the annotation data and the rules for annotation.

[0007] Further, before generating annotations, obtain the outer bounding box position information of each annotation, and determine whether there is interference between annotations and between annotations and entities according to the outer bounding box position information; in the case of interference between annotations and / or between annotations and entities, adjust the annotation position and / or expand the annotation area.

[0008] Further, the method for adjusting the annotation position includes: Sort at least one key feature of a certain entity according to importance; Preset multiple annotation positions for the key feature with the highest importance ranking, and preset an annotation position sequence; If there is interference between annotations, and the annotation with the highest importance ranking is included in the interfering annotations, then adjust the annotation position according to the preset annotation position sequence until there is no interference; if all preset annotation positions of the key feature with the highest importance ranking will cause interference, then annotate the key feature with the highest importance ranking at the first preset annotation position, and hide the annotation that interferes with the annotation of the key feature with the highest importance ranking; If there is interference between annotations, and the annotation with the highest importance ranking is not included in the interfering annotations, then hide the annotations of the key features with lower importance ranking; If there is interference between an annotation and an entity, and the interfering annotation is the key feature with the highest importance ranking, then adjust the annotation position according to the preset annotation position sequence until there is no interference; If there is interference between an annotation and an entity, and the interfering annotation is not the key feature with the highest importance ranking, then hide the annotation of the key feature.

[0009] Further, the method for adjusting the annotation position includes: Sort at least one key feature of a certain entity according to importance; Preset multiple annotation positions for each key feature, and preset an annotation position sequence; If there is interference between annotations, adjust the annotation positions of the key features with a lower importance ranking according to the preset annotation position sequence until there is no interference; if interference occurs at all preset annotation positions, hide the annotations of the key features with a lower importance ranking. If an annotation interferes with an entity, adjust the annotation position according to the preset annotation position sequence until there is no interference.

[0010] Furthermore, the hidden annotations are displayed in the sidebar.

[0011] Furthermore, in the case of interference between annotations and / or between an annotation and an entity, sort the key features of a certain entity according to importance; If there is interference between annotations, adjust the transparency of the annotation of the key feature with a lower importance ranking to the preset transparency I; If an annotation interferes with an entity, adjust the transparency of the annotation to the preset transparency II.

[0012] Furthermore, preset several annotation styles for the user to choose; in the case of interference between annotations and / or between an annotation and an entity, pop up a warning box asking the user to adjust the annotation style.

[0013] Furthermore, preset a gap threshold for between annotations, and determine that there is interference between annotations when the gap between annotations is less than the gap threshold.

[0014] Furthermore, the extended protocol library is loaded into the CAD program based on user requirements.

[0015] The present invention also provides a CAD automatic multi-annotation generation system, including: An extended protocol library construction module, used to construct an extended protocol library and register extended protocols for various types of entities; the extended protocols include at least one key feature of the entity and the rules for annotating each of the key features; the rules include annotation styles and annotation positions; An entity key feature acquisition module, used to obtain the entity type of a specified entity based on user selection, and call the corresponding extended protocol from the extended protocol library to obtain at least one key feature of the specified entity; An annotation module, used to obtain annotation data corresponding to at least one key feature of a specified entity, and generate an annotation for the entity according to the annotation data and the rules for making annotations.

[0016] Beneficial effects: By constructing an extended protocol library and presetting key features and annotation rules (including annotation styles and annotation positions, etc.) for various types of entities, the system can automatically obtain the entity type and generate annotations automatically according to the rules, without the need for manual annotation settings for each key feature one by one, and even less need to select the feature types to be annotated one by one in the toolbar, greatly saving the annotation time and improving the drawing efficiency.

[0017] Since the rules such as annotation styles and positions are uniformly set in the extended protocol library, for the same type of entity, its annotation method remains consistent, avoiding problems such as inconsistent styles and chaotic positions that may occur in manual annotation, making the annotations on the CAD drawings more standardized and neat, and improving the readability and professionalism of the drawings.

[0018] The design of the entity key feature acquisition module and the annotation module enables the user to only select the entity, and the system can automatically complete the subsequent key feature acquisition and annotation generation work, without the user having in-depth annotation knowledge and complex operation skills, reducing the operation threshold of CAD annotation and facilitating the use by beginners and non-professionals.

[0019] The construction of the extended protocol library allows registering extended protocols for different types of entities, facilitating the addition of new entity types or the modification of existing entity annotation rules according to needs during subsequent use, having good scalability, and being able to adapt to the diverse needs of different users and the continuous development of CAD technology.

[0020] The automatic annotation process reduces manual intervention, thereby reducing the probability of annotation errors caused by human negligence or mistakes, such as missing annotations, incorrect annotation values, etc., and improving the accuracy and reliability of annotations.

[0021] In addition, the present invention also sets up various methods to avoid interference between annotations and between annotations and entities, ensuring that all annotation information on the drawing is clearly visible and does not affect the user's understanding and use of the CAD drawing. By presetting rules or an automatic detection mechanism, the annotation interference problem is avoided in advance, reducing the time and energy consumption of the user for manually adjusting the annotation position and improving the annotation efficiency. Description of the Drawings

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts do not necessarily draw according to the actual scale. Obviously, the following-described drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to these drawings without creative efforts.

[0023] Figure 1 It is a flow chart of the first embodiment.

[0024] Figure 2 It is a multi-annotation example of a straight line.

[0025] Figure 3 It is a multi-annotation example of an arc.

[0026] Figure 4 It is a structural diagram of the second embodiment.

[0027] Figure 5a It is an example of the annotation position of the first priority of the key feature - radius of the arc entity.

[0028] Figure 5b It is an example of the annotation position of the second priority of the key feature - radius of the arc entity.

[0029] Figure 5c It is an example of the annotation position of the third priority of the key feature - radius of the arc entity.

[0030] Figure 5d It is an example of the annotation position of the fourth priority of the key feature - radius of the arc entity. Detailed implementation manners

[0031] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in 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. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0032] In this article, suffixes such as "module", "component" or "unit" used to represent elements are only for the convenience of explaining the present invention and have no specific meaning in themselves. Therefore, "module", "component" or "unit" can be used interchangeably.

[0033] In this article, the orientation or positional relationship indicated by terms such as "upper", "lower", "inner", "outer", "front", "rear", "one end", "the other end", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.

[0034] In this text, unless otherwise clearly specified and defined, terms such as "installation", "equipped with", "connection", etc. shall be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, a direct connection, or an indirect connection through an intermediate medium, and can also be the communication inside two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0035] In this text, "and / or" includes any and all combinations of one or more of the listed related items.

[0036] In this text, "a plurality of" means two or more, that is, it includes two, three, four, five, etc.

[0037] In this text, "entity" refers to the graphic data on the CAD file, which is displayed on the CAD drawing interface. An entity has attributes, that is, the data values that control the specific visual characteristics (such as visibility, color, and line style) of the entity or element. In different embodiments, an entity can also be referred to as "graphic element", "primitive".

[0038] In this text, "object" refers to the information on the CAD file that will not be displayed on the CAD drawing interface. For example, layers, text styles, dimension styles, etc. In this text, "style" refers to the named set of attributes used to classify and define specific geometric and text elements (such as line styles or text styles).

[0039] In this text, "element" refers to all possible information on the CAD file, that is, it includes "entity" and "object", and can also be blocks, groups, and unit definitions based on "entity" and / or "object".

[0040] In this text, "file" refers to various types of files that can run in a CAD system and are used for drawing, editing, modifying, storing, and viewing CAD drawings. Common CAD file formats include, but are not limited to, DWG, DXF, DWT, DWF, DWL, DWS, DWX, MNU, MNC, MNL, MNS, CUI, CUIX, SHX, PAT, LIN, CTB, STB, PLT, PC3, etc.

[0041] Embodiment 1: As Figure 1 shown, this embodiment provides a CAD automatic multi-dimension generation method, including: S1 Build an extended protocol library and register extended protocols for each type of entity; the extended protocol includes at least one key feature of the entity and the rules for dimensioning the key feature; the rules include dimension styles and dimension positions.

[0042] In a CAD (Computer-Aided Design) system, different types of entities (such as lines, circles, rectangles, polygons, etc.) have different geometric features. To achieve automatic multi-annotation generation, a unified set of rules is required to guide how to annotate the features of these entities. The extension protocol library provides a standardized annotation framework for the CAD system, enabling the system to automatically generate appropriate annotations according to the entity type. Each entity has its unique attributes and features. By registering extension protocols for each type of entity, specific annotation rules can be defined for each entity.

[0043] The content of the extension protocol includes key features and annotation rules.

[0044] At least one key feature that the entity needs to be annotated with, and these features are important information describing the geometric attributes of the entity. For example, for a line, the key features are length and angle, see Figure 2 ; for a circle, the key feature is the radius.

[0045] The annotation rules include annotation styles and annotation positions. Among them, the annotation style refers to the appearance form of the annotation, such as the shape of the annotation, the style of the line, the font size, color, etc. The annotation position specifies the specific position on or near the entity where the annotation is placed. For example, the length annotation of a line can be placed above or below the line, and the radius annotation of a circle can be placed outside the circle and pointing to the center of the circle.

[0046] In addition, in some embodiments, the extension protocol library is loaded into the CAD program based on user requirements.

[0047] The design tasks processed by CAD software are diverse, and the annotation requirements of different users vary greatly in different projects. Loading the extension protocol library based on user requirements means that the software will not load all possible extension protocols into memory when starting up, but selectively load the required extension protocols according to the current actual operation requirements of the user, so as to meet the needs of different users.

[0048] S2 Obtain the entity type of the specified entity based on the user's selection, and call the corresponding extension protocol from the extension protocol library to obtain the key features of the specified entity.

[0049] In the operation interface of the CAD software, the user selects one or more entities through interactive methods such as mouse clicking, box selection, or shortcut keys. The CAD system will identify and analyze the user's selection operation, and use its internal graphic data structure and entity recognition algorithm to determine the specific type of the entity selected by the user. For example, if the user selects a line, the system will identify that the entity type is "line"; if a circle is selected, the system will determine its type as "circle".

[0050] The extended protocol library stores extended protocols corresponding to various entity types. When the system determines the type of the entity selected by the user, it will search in the extended protocol library to find the extended protocol that matches the entity type. For example, if the entity selected by the user is a "straight line", the system will find the extended protocol corresponding to the "straight line" in the extended protocol library.

[0051] After finding the corresponding extended protocol, the system will extract at least one key feature of the entity from the protocol. The extended protocol clearly stipulates the key features of each entity type, and these features are important information for describing the geometric properties and design requirements of the entity. See Figure 2 , taking the "straight line" entity set at an inclination as an example, its extended protocol may stipulate that the key features are "length" and "angle", and the system will obtain this information from the protocol to prepare for subsequent generation of annotations.

[0052] S3 Obtain the annotation data corresponding to the key features of the specified entity, and automatically generate multiple annotations for the specified entity according to the annotation data and the annotation rules.

[0053] Once the user selects an entity, the system, based on the key features obtained in step S2, obtains the annotation data for each key feature and automatically generates the annotations corresponding to the key features, as shown in Figure 2 and Figure 3 . Among them, the annotation data refers to the data information of the key features of the entity. For example, Figure 2 the length and angle of the straight line shown in Figure 3 , and the radius, arc length, central angle, etc. of the arc shown in

[0054] These annotation data are all generated when creating the entity. Due to the data length and the user's adjustment of the default style, such as font size, etc., there may be problems of interference between annotations, between annotations and entities. To solve this problem, obtain the position information of the bounding boxes of each annotation before generating the annotations, and judge whether there is interference between annotations and between annotations and entities according to the position information of the bounding boxes; in the case of interference between annotations and / or between annotations and entities, adjust the annotation position and / or expand the annotation area.

[0055] In CAD software, each dimension can be regarded as an object with a certain geometric shape and size. To facilitate the judgment of whether there is interference between dimensions and between dimensions and entities, the system generates a bounding box for each dimension. This bounding box is the smallest rectangular area that can completely contain all elements of the dimension. By calculating and recording the position information of the bounding box, the system can accurately determine the actual occupied space of each dimension on the drawing. For example, for a linear length dimension, its bounding box will contain the dimension text such as "50mm" and the dimension line connected to the line, and the position information of the bounding box obtained by the system can accurately reflect the position and size of the dimension on the drawing.

[0056] Based on the obtained position information of the bounding box, the system can use geometric algorithms to determine whether there is interference between dimensions and between dimensions and entities. When there is an overlapping part in the space of the bounding boxes of two dimensions, it is determined that there is interference between the dimensions; when there is an overlapping part between the bounding box of the dimension and the geometric shape of the entity (which can also be represented by a bounding box or other geometric means), it is determined that there is interference between the dimension and the entity. For example, in a complex mechanical part drawing, if the bounding boxes of two dimension markings overlap each other, it will be difficult to identify the dimension information. At this time, the system will recognize this interference situation between dimensions; if the bounding box of a radius dimension covers a part of the graphic of the part entity, it belongs to the interference between the dimension and the entity.

[0057] In some embodiments, a gap threshold can also be preset between dimensions, and it is determined as interference between dimensions when the gap between dimensions is less than the gap threshold.

[0058] In CAD design, to ensure that the dimensions are clear and easy to read, a certain interval needs to be maintained between dimensions. For example, in the field of mechanical drawing, industry standards and long-term practical experience show that the minimum clear interval between dimension texts is 2mm. Then, when the relevant CAD software is for mechanical drawing scenarios, the gap threshold may be set to 2mm. This value is not fixed and will be adjusted according to different industry specifications, drawing scales, and dimension contents. For large-scale drawings, the gap threshold can be appropriately increased to ensure clear distinction between larger-sized dimension elements; while for drawings with compact content and limited space, the gap threshold will be appropriately reduced on the premise of ensuring the readability of the dimensions.

[0059] When interference is detected, the system will adjust the dimension position according to the preset rules. In some cases, it is also possible to consider expanding the dimension area. However, expanding the dimension area involves fine-tuning the overall drawing layout, such as appropriately enlarging the drawing scale, or reasonably utilizing the blank area around the entity without affecting the overall design expression to provide more space for the dimensions to ensure that the dimensions can be clearly displayed without interfering with other elements.

[0060] More specifically, in this embodiment, a variety of methods for adjusting the annotation position are provided.

[0061] Method 1: S301 sorts the key features of a certain entity according to importance.

[0062] In CAD design, an entity often has multiple key features that need to be annotated, and the importance of these features for understanding the design intent and function of the entity is not the same. Therefore, it is necessary to sort the importance of these key features according to certain rules. For example, for the entity "line", obviously its length is more important than the angle. Another example is the entity "arc", and the importance of its key features is in the order of radius, central angle, and arc length, see Figure 3 .

[0063] S302 presets multiple annotation positions for the key feature with the highest importance ranking, and presets an annotation position sequence.

[0064] The key feature with the highest importance ranking is often the core information for understanding the design intent and function of the entity, and plays a key role in the accuracy and readability of the entire design. Presetting multiple annotation positions for it and determining the position sequence can provide multiple options to adjust the annotation position in case of annotation interference, so as to ensure that the important annotation information is always clearly visible.

[0065] Presetting multiple annotation positions is considered based on the diversity and complexity of CAD drawings. In actual design, different entity shapes, sizes, and the distribution of other surrounding elements will affect the optimal position of the annotation. And presetting the annotation position sequence is to provide a clear priority order for adjusting the annotation position, avoiding blind attempts and improving the adjustment efficiency.

[0066] For example, for an arc entity, the key feature with the highest importance ranking is usually the radius. The multiple preset annotation positions include: Position 1 (priority is 1): Horizontally outside the arc, see Figure 5a . Place the radius annotation outside the arc, and the annotation line points horizontally to the center of the circle. This position is suitable when there is enough space horizontally around the arc and there will be no interference with other annotations or entities, and it can allow readers to intuitively see the radius value.

[0067] Position 2 (priority is 2): Vertically outside the arc, see Figure 5b . When there is insufficient horizontal space, the annotation can be considered to be placed vertically outside the arc, and the annotation line points vertically to the center of the circle. This position is more applicable when there is space vertically and it does not affect the display of other elements.

[0068] Position 3 (priority is 3): Inside the arc, seeFigure 5c If the space outside the arc is limited and there is enough space inside, the dimension can be placed inside the arc. However, this position may affect the readability of the dimension when the arc is small, so it is generally used as a backup position.

[0069] Position 4 (priority 4): Along the tangent direction of the arc, see Figure 5d For some drawings with special layouts, when neither the horizontal nor the vertical direction is appropriate, the dimension can be placed along the tangent direction of the arc, with the dimension line in the same direction as the tangent and pointing to the center of the circle. This position can effectively utilize the space in complex graphics.

[0070] S303 If there is interference between dimensions and the interfering dimensions include the key feature with the highest importance ranking, adjust the dimension positions according to the preset dimension position sequence until there is no interference; if all the preset dimension positions of the key feature with the highest importance ranking will cause interference, mark the key feature with the highest importance ranking at the first preset dimension position and hide the dimensions that interfere with the marking of the key feature with the highest importance ranking.

[0071] This step is used to handle the interference situation between dimensions containing the feature with the highest importance.

[0072] When there is interference between dimensions and one of them includes the key feature with the highest importance ranking, the system will try to adjust the dimension position of this important feature in turn according to the preset dimension position sequence until the interference is eliminated. For example, if the diameter dimension of a circle interferes with other dimensions, first try to adjust the diameter dimension to the next preset position in the horizontal direction. If there is still interference, then try the preset position in the vertical direction, and so on.

[0073] If all the preset dimension positions of the key feature with the highest importance ranking will cause interference, to ensure the display of the marking of this important feature, mark it at the first preset dimension position and hide other dimensions that interfere with it at the same time. This can ensure that the most important information can be seen and avoid the loss of important information due to interference.

[0074] S304 If there is interference between dimensions and the interfering dimensions do not include the key feature with the highest importance ranking, hide the dimensions of the key features with lower importance ranking.

[0075] If there is interference between dimensions but it does not include the key feature with the highest importance ranking, in order to avoid the dimensions being too chaotic, directly hide the dimensions of the key features with lower importance ranking. For example, in the dimensions of a complex part, some secondary chamfer size dimensions interfere with other dimensions and the importance of these chamfer sizes is relatively low, so they can be hidden.

[0076] If the annotation interferes with the entity, and the interfering annotation is the key feature with the highest importance ranking, adjust the annotation position according to the preset annotation position sequence until there is no interference.

[0077] When the annotation interferes with the entity, and the interfering annotation is the key feature with the highest importance ranking, also adjust the position of the annotation according to the preset annotation position sequence until the interference is eliminated. For example, the diameter annotation of the shaft interferes with the contour line of the shaft. By adjusting the annotation position, it is made not to overlap with the contour line of the shaft.

[0078] Of course, when adjusting the annotation position to avoid interference with the entity, it is possible that a certain annotation position no longer interferes with the entity but interferes with other annotations. At this time, the adjustment rules when the annotation interferes with other annotations can be referred to for adjustment.

[0079] For example, in an architectural drawing, a circular column is annotated. Its radius annotation originally interfered with the filling pattern of the column. After moving the radius annotation outward, it interfered with the annotation of the wall thickness next to it. At this time, according to the adjustment rules for annotation interference, if the key feature corresponding to the radius annotation is more important than the key feature corresponding to the wall thickness annotation, and the radius annotation has other preset annotation positions, the software will try to adjust the radius annotation to other preset positions, such as leading out the annotation line along different angles; if all preset positions of the radius annotation are tried and still interfere with other annotations, and its importance is the highest, then it may hide the wall thickness annotation that interferes with it or adjust it to other appropriate positions to ensure the clear display of the radius annotation.

[0080] S306 If the annotation interferes with the entity, and the interfering annotation is not the key feature with the highest importance ranking, then hide the annotation of this key feature. For example, some secondary process dimension annotations interfere with the entity graph. To not affect the display of the entity graph and the reading of important information, these secondary annotations are hidden.

[0081] In Method 1, only the key features with the highest importance are preset and sorted for multiple annotation positions, which can greatly reduce the number of presets and simplify the system design.

[0082] Method 2: S311 Sort the key features of a certain entity according to importance.

[0083] Similar to Method 1, in Method 2, it is also necessary to sort the key features by importance to determine the priority when dealing with annotation interference.

[0084] S312 Preset multiple annotation positions for each key feature and preset the annotation position sequence.

[0085] In this method, multiple annotation positions are preset for each key feature to provide more adjustment options in case of annotation interference. Different design scenarios and drawing layouts may require placing the annotations at different positions to achieve the best display effect. The preset annotation position sequence defines the order of adjusting the annotation positions. For example, for the radius annotation of an arc, multiple annotation positions such as horizontal, vertical, and 45-degree diagonal can be preset, and a position sequence such as first horizontal, then vertical, and finally 45-degree diagonal can be determined.

[0086] S313 If there is interference between annotations, adjust the annotation position of the key feature with a lower importance ranking according to the preset annotation position sequence until there is no interference; if interference occurs at all preset annotation positions, hide the annotation of the key feature with a lower importance ranking.

[0087] When interference occurs between annotations, give priority to adjusting the annotation position of the key feature with a lower importance ranking. Try to adjust in turn according to the preset annotation position sequence until the interference is eliminated. If interference cannot be avoided at all preset annotation positions, hide the annotation of the key feature with a lower importance ranking. The purpose of this rule is to minimize the conflict between annotations on the premise of ensuring the complete display of important information. For example, in a complex assembly drawing, when some secondary dimension annotations interfere with important positioning dimension annotations, give priority to adjusting the position of the secondary dimension annotations. If it is really impossible to adjust, hide the secondary dimension annotations to ensure that the important positioning dimension annotations are clearly visible.

[0088] S314 If the annotation interferes with the entity, adjust the annotation position according to the preset annotation position sequence until there is no interference.

[0089] This step ensures that the annotation does not cover important parts of the entity, guaranteeing the graphic integrity of the entity and the accuracy of the annotation. For example, in architectural drawings, when the annotation of the wall thickness interferes with the wall graphic, adjust the annotation position so that it does not overlap with the wall graphic, facilitating the clear display of the wall size and position information.

[0090] It can be foreseen that when adjusting the annotation position to avoid interference with the entity, it is possible that a certain annotation position no longer interferes with the entity but interferes with other annotations. At this time, the adjustment rules when interference occurs between annotations can be referred to for adjustment.

[0091] The method provided by Method 2 for adjusting the annotation position requires presetting the annotation positions and sorting for each key feature, but the determination process is simpler and is suitable for entities with fewer key features.

[0092] In addition, in some embodiments, the annotations hidden due to interference in Method 1 and Method 2 are displayed in the sidebar for the convenience of the user to view.

[0093] This embodiment also provides a method for solving the interference between annotations and between annotations and entities. The specific steps include: S321 When interference occurs between annotations or / and between an annotation and an entity, sort the key features of a certain entity according to importance.

[0094] Similar to Method 1 and Method 2, this method also needs to sort the key features according to importance to determine the priority when dealing with annotation interference.

[0095] S322 If there is interference between annotations, adjust the transparency of the annotation with the lower importance ranking of key features to the preset transparency I.

[0096] Of course, to solve the interference problem, several annotation styles can also be preset for the user to choose; when interference occurs between annotations or / and between an annotation and an entity, a warning box is popped up to require the user to adjust the annotation style.

[0097] When interference occurs between annotations, instead of directly hiding or moving the annotations, the transparency of the annotation with the lower importance is reduced. The preset transparency I is a preset value. By adjusting the transparency, the interfering annotations present a "weakening" effect visually but can still be seen. This not only reduces the visual conflict between annotations but also retains all annotation information, avoiding information loss that may be caused by hiding annotations.

[0098] For some scenarios with high requirements for the integrity of annotation information, such as complex assembly drawing design, each annotation may contain important assembly information. By adjusting the transparency, designers can see all annotations simultaneously, facilitating overall analysis and understanding without missing certain details due to the hiding of annotations. In addition, compared with frequently adjusting the annotation position, this method is more convenient and fast in operation, saving design time.

[0099] S323 If there is interference between an annotation and an entity, adjust the transparency of the annotation to the preset transparency II.

[0100] When interference occurs between an annotation and an entity, adjust the transparency of the annotation to the preset transparency II, so that the annotation "blends into" the background to a certain extent, reducing the occlusion of the entity graph while retaining the annotation information. The preset transparency II may be the same as the preset transparency I or may be set to different values according to actual needs, usually determined according to the complexity of the entity graph and the importance of the annotation.

[0101] In CAD design, the integrity and clarity of entity graphics are crucial to understanding the design intent. By adjusting the transparency of annotations, the entity graphics can be clearly displayed without losing key information such as size and position conveyed by the annotations. This is particularly important in architectural design drawings. For example, when annotating the dimensions of the internal structure of a building, adjusting the transparency of annotations that interfere with entities such as walls and columns allows designers to clearly understand the size information of each part while viewing the entity structure.

[0102] Transparency I and transparency II may be the same or different, and can be set by those skilled in the art according to requirements, and are not limited in the present invention.

[0103] Of course, you can also preset several annotation styles for users to choose from; when there is interference between annotations or / and between annotations and entities, a warning box will pop up to ask the user to adjust the annotation style. This allows users to understand the problems in the drawings more clearly and make adjustments based on their design intentions and aesthetic preferences. Compared with the above system-set adjustment rules, it is easier to satisfy users.

[0104] S4 obtains annotation data corresponding to key features of the entity that need to be annotated, and generates annotations for the entity according to the annotation data and annotation rules.

[0105] It is worth noting that step S3 is only used to determine the final position of the mark, while this step is used to display the standard.

[0106] The annotation data corresponding to the key feature comes from the CAD system's calculation of the geometric parameters of the selected entity. For example, when the entity is a straight line, the system uses the distance formula to calculate the length based on the coordinates of the two end points of the line. This length value is the annotation data of the "length" key feature; if it is a circle, the radius is determined by the center and a point on the circumference, and the radius value is the corresponding annotation data. For complex entities, such as polylines, geometric operations need to be performed on each line segment to obtain annotation data such as the total length and the length of each segment.

[0107] Format the appearance of annotations according to the annotation style set in the extended protocol. For example, for font settings, select Songti, Arial and other fonts to ensure that the text is clear and easy to read; adjust the font size according to the drawing scale and industry specifications to make the annotations moderate in size on the drawing; use colors to distinguish different types of annotations, such as blue for length annotations and green for angle annotations, to enhance the recognition of drawing information; and the annotation line style (such as solid line, dashed line, dotted line) is also determined according to the rules to meet the engineering drawing standards.

[0108] Place the annotation at the appropriate position according to the preset annotation position rules. For the straight-line length annotation, it can be placed parallel above or below the straight line; the radius annotation of a circle is drawn from the center of the circle to the circumference, and the annotation text is close to the circumference; for the angle annotation, the annotation text is placed inside the angle or on a suitable extension line to ensure that the annotation is closely related to the feature being represented and does not affect the overall layout of the drawing.

[0109] Embodiment 2: As Figure 4 shown, this embodiment provides a CAD automatic multi-annotation generation system, including: An extended protocol library construction module, used to construct an extended protocol library and register extended protocols for various types of entities; the extended protocols include at least one key feature of the entity and the rules for annotating the key feature; the rules include annotation styles and annotation positions; An entity key feature acquisition module, used to obtain the entity type of the specified entity based on user selection, and call the corresponding extended protocol from the extended protocol library to obtain at least one key feature of the specified entity; An annotation module, used to obtain the annotation data corresponding to at least one key feature of the specified entity, and automatically generate multiple annotations for the specified entity according to the annotation data and the rules for annotation.

[0110] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitations, the element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.

[0111] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc) and includes several instructions for causing a computer terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.

[0112] The embodiments of the present invention have been described above in conjunction with the accompanying drawings. However, the present invention is not limited to the above specific embodiments. The above specific embodiments are merely illustrative rather than restrictive. Under the inspiration of the present invention, those of ordinary skill in the art can also make many forms without departing from the purpose of the present invention and the scope protected by the claims. All of these are within the protection scope of the present invention.

Claims

1. A CAD automatic multi-dimension generation method, characterized in that Including: Construct an extended protocol library to register extended protocols for various types of entities; the extended protocols include at least one key feature of the entity and rules for annotating each of the key features; the rules include annotation styles and annotation positions; Based on the user's selection, obtain the entity type of the specified entity, and call the corresponding extended protocol from the extended protocol library to obtain at least one key feature of the specified entity; Obtain the annotation data corresponding to at least one key feature of the specified entity, and automatically generate multiple annotations for the specified entity according to the annotation data and the rules for annotation.

2. The CAD automatic multi-annotation generation method according to claim 1, characterized in that: Before generating annotations, obtain the outer bounding box position information of each annotation, and judge whether there is interference between annotations and between annotations and entities according to the outer bounding box position information; in the case of interference between annotations and / or between annotations and entities, adjust the annotation position and / or expand the annotation area.

3. The method for automatically generating multiple CAD annotations according to claim 2, characterized in that The method for adjusting the annotation position includes: Sort the key features of a certain entity according to importance; Preset multiple annotation positions for the key feature with the highest importance ranking, and preset an annotation position sequence; If there is interference between annotations and the annotation with the highest importance ranking is included in the interfering annotations, adjust the annotation position according to the preset annotation position sequence until there is no interference; if all the preset annotation positions of the key feature with the highest importance ranking will cause interference, then annotate the key feature with the highest importance ranking at the first preset annotation position, and hide the annotation that interferes with the annotation of the key feature with the highest importance ranking; If there is interference between annotations and the annotation with the highest importance ranking is not included in the interfering annotations, then hide the annotation of the key feature with a lower importance ranking; If there is interference between an annotation and an entity and the interfering annotation is the key feature with the highest importance ranking, adjust the annotation position according to the preset annotation position sequence until there is no interference; If there is interference between an annotation and an entity and the interfering annotation is not the key feature with the highest importance ranking, then hide the annotation of this key feature.

4. A CAD automatic multi-dimension generation method according to claim 2, characterized in that The method for adjusting the annotation position includes: Sort at least one key feature of a certain entity according to importance; Preset multiple annotation positions for each key feature, and preset an annotation position sequence; If there is interference between annotations, then adjust the annotation position of the key feature with a lower importance ranking according to the preset annotation position sequence until there is no interference; if all the preset annotation positions will cause interference, then hide the annotation of the key feature with a lower importance ranking; If there is interference between an annotation and an entity, then adjust the annotation position according to the preset annotation position sequence until there is no interference.

5. A CAD automatic multi-dimension generation method according to claim 3 or 4, characterized in that: The hidden annotations are displayed in the sidebar.

6. A CAD automatic multi-dimension generation method according to claim 1, characterized in that: In the case of interference between annotations and / or between annotations and entities, sort the key features of a certain entity according to importance; If there is interference between annotations, then adjust the transparency of the annotation of the key feature with a lower importance ranking to the preset transparency I; If there is interference between an annotation and an entity, then adjust the transparency of this annotation to the preset transparency II.

7. A CAD automatic multi-dimension generation method according to claim 1, characterized in that: Preset several annotation styles for the user to choose; in the case of interference between annotations or / and between an annotation and an entity, a warning box pops up to require the user to adjust the annotation style.

8. A CAD automatic multi-dimension generation method according to any one of claims 2, 6, and 7, characterized in that: Preset a gap threshold between annotations, and when the gap between annotations is less than the gap threshold, it is judged as interference between annotations.

9. A CAD automatic multi-dimension generation method according to claim 1, characterized in that: The extended protocol library is loaded into the CAD program based on user requirements.

10. A CAD automatic multi-dimension generation system, characterized in that It includes: An extended protocol library construction module, which is used to construct an extended protocol library and register extended protocols for various types of entities; the extended protocols include at least one key feature of the entity and rules for annotating each of the key features; the rules include annotation styles and annotation positions; An entity key feature acquisition module, which is used to obtain the entity type of the specified entity based on user selection and call the corresponding extended protocol from the extended protocol library to obtain at least one key feature of the specified entity; An annotation module, which is used to obtain annotation data corresponding to at least one key feature of the specified entity and automatically generate multiple annotations for the specified entity according to the annotation data and the rules for making annotations.

Citation Information

Patent Citations

  • Cutting and labeling method for CAD drawing

    CN117058157A

  • Labeling avoidance method and device

    CN104123314A

  • POI labeling method and device

    CN106610976A

  • Automatic labeling and typesetting method for decoration drawings

    CN110598195A

  • Method for automatically arranging drawing marks, electronic equipment and computer program product

    CN114254586A

Cited By

  • CAD (Computer Aided Design) floor structure identification and automatic auxiliary element adding method

    CN117272441A

  • A cad floor structure identification and auxiliary element automatic adding method

    CN117272441B