A method and system for automatically generating annotations based on CAD entity types
By building a knowledge base, presetting key features and labeling styles for the entity types of the three-dimensional CAD model, the problems of low efficiency and poor accuracy of three-dimensional dimension labeling in the existing technology are solved, and automated three-dimensional graphic labeling is realized, and the labeling speed and consistency are improved.
Patent Information
- Application Number
- CN202510728185.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-06-03
AI Technical Summary
The existing three-dimensional CAD model dimensioning method requires a lot of manual operation, is inefficient, and there is redundancy and missing marking of automatic labeling results, so it is impossible to accurately deal with complex entities, especially entities such as spheres and surfaces.
Build a knowledge base to preset key features and labeling styles for each entity type. By selecting entities and key features by users, the system automatically generates labels, including the radius of the sphere and the length, width, height of the cuboid, etc., and combines the preset labeling style and position to handle interference between labels and entities.
It realizes automatic labeling of three-dimensional graphics, improves labeling speed and accuracy, reduces manual operations, ensures consistency and standardization of labeling, and adapts to the labeling habits of complex entities and different users.
Smart Images

Figure CN120259605B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer-aided design, and in particular to a method and system for automatically generating annotations based on CAD entity types. Background Art
[0002] With the development of computer-aided technology, full 3D manufacturing is replacing the 2D drawings used in traditional manufacturing, and direct dimensioning on 3D CAD models is rapidly gaining popularity in industry. Marking dimensions directly on a product's 3D geometric model makes the product's structural expression more intuitive and clear. Designers and manufacturers can view the annotation information directly in the 3D CAD model without having to flip through cumbersome 2D drawings. Furthermore, because the dimension annotations in the 3D CAD model are directly associated with the geometric features, misunderstandings and errors caused by unclear or ambiguous annotation positions in the 2D drawings can be reduced. Currently, for dimensioning 3D CAD models, the main method used in engineering is interactive manual annotation using CAD system software.
[0003] Since all dimensions of the product must be marked in the 3D CAD model, the existing display methods actually express 3D images through the 2D world, making the image "look" like 3D. Figure 1 As shown in the figure, a 3D frame diagram of a sphere appears to be a three-dimensional object to the user, but to the computer, it is actually a line on a two-dimensional plane. This can cause problems when annotating. For example, as a sphere in a three-dimensional world, the radius should be the distance from its center to any point on its surface. Therefore, when annotating, after selecting the center as the first point, the second point selected anywhere on the frame (that is, the circular line on the screen) should be used as the radius of the sphere. In other words, no matter where the second point is on the frame, it should display R9.5 (assuming the radius is 9.5).
[0004] However, the computer does not see it as a sphere, but as a circular line on a plane. Therefore, after the center of the sphere is selected as the first point, even if the second point is selected as a point on the frame, the computer will mark its length on the plane, that is, the plane projection distance. In other words, if point A is marked as 9.5, it may be 7 at point B, which is inconsistent with the actual situation of the sphere in the three-dimensional diagram.
[0005] Currently, mainstream 3D CAD software all offer their own 3D dimensioning modules, such as the PMI module in NX, the FT&A module in CATIA, the 3D Annotation module in Creo, and the DimExpert module in SolidWorks. NX's PMI module allows for manual dimensioning; CATIA's FT&A module allows for interactive dimensioning, but it cannot fully dimension a model in 3D; Creo's 3D Annotation module allows for manual dimensioning using the selected scale element; and the DimExpert module allows for interactive datum selection and automatic dimensioning of components that have a linear relationship with the datum.
[0006] While the aforementioned 3D dimensioning modules can perform dimensioning, their automated annotation capabilities fall short of engineering requirements. CATIA can only automatically dimension certain features; SolidWorks's annotation logic is overly simplistic, and its automated annotation results can include redundancies and omissions. Furthermore, 3D dimensioning of CAD models in the engineering community still primarily relies on manual user interaction.
[0007] For example, the Chinese invention patent "CN101877015A" discloses a method for manual 3D annotation of 3D models, which includes the following steps: 1) based on the process model established for each process of the component processing technology, annotating dimensions, tolerances and other manufacturing information to generate process requirements; 2) naming the process content view: 3D annotating the process model to generate process content, and organizing the process model and 3D annotation in the form of a view structure tree; 3) setting the 3D annotation of the process content; This method belongs to structured process data, making the information of the 3D model more comprehensive and specific, making the data source of downstream users unique, and getting rid of the phenomenon of inconsistent data sources of both 3D models and 2D drawings. The functional 2D comparison is more intuitive, has good visualization effects, and contains more information; the structured 3D annotation data can quickly generate inspection and measurement data, which is directly transmitted to downstream systems such as MES, reducing a lot of repetitive work for process personnel.
[0008] However, the above method for dimensioning and tolerance annotation of 3D models has the following drawbacks: First, it requires significant manual effort, as repeated dimension tolerances must be annotated sequentially. Second, it requires staff to understand and recognize 2D engineering drawings, resulting in low annotation efficiency. Third, the annotation process becomes extremely cumbersome as the model becomes more complex. Fourth, it is difficult to verify the integrity of the annotation results after dimensioning. In light of these issues, new methods for automatic dimensioning of 3D CAD models have been proposed.
[0009] For example, patent application CN102568038B discloses a method for transferring dimensions from a two-dimensional engineering drawing to a three-dimensional CAD model. The method first projects the three-dimensional CAD model to obtain its projected view. Then, the primitive information of the projected view and the two-dimensional engineering drawing is extracted, and the projected view and the two-dimensional engineering drawing are represented as a spatial relationship graph structure with the primitives as vertices. Finally, the two spatial relationship graphs are precisely matched for primitives. Experimental results show that this method can achieve precise matching of primitives and correctly map dimensional tolerances from a two-dimensional engineering drawing to a three-dimensional CAD model. However, this method is still very cumbersome. Not only does it require mapping each angle of the three-dimensional model to two-dimensional space, but it also requires annotation in two-dimensional space and then integrating and precisely matching the annotation data from multiple two-dimensional spaces, which significantly increases the computational complexity of the system. Furthermore, the projection of the three-dimensional model into two-dimensional space can lead to dimension annotation errors. Therefore, converting the annotation data from three-dimensional space back to three-dimensional space will inevitably further amplify these errors.
[0010] For example, the invention patent application with publication number CN118761116A provides a three-dimensional CAD model dimensioning method, including the following steps: defining point constraints and a point constraint gradient table; formulating constraint adding rules for the three-dimensional CAD model during the dimensioning process; determining the reference plane of the three-dimensional CAD model, and determining the reference parallel plane, reference vertical plane and general position plane based on the relative positions of each plane and the reference plane; initializing the point constraint of each vertex in the three-dimensional CAD model to obtain the initial state of the point constraint gradient table; updating the point constraint value of each vertex in the point constraint gradient table according to the position of the reference plane, and then dimensioning the reference parallel plane, reference vertical plane and general position plane in turn according to the constraint adding rules until the point constraint value of all vertices in the point constraint gradient table is 1. This method proposes the concept of "point constraint degree" and designs a "point constraint degree gradient table". Based on this point constraint degree gradient table, the automatic dimensioning function of the 3D CAD model is realized. By monitoring the changes in the point constraint degree status on the model as the dimension is marked, the method determines the dimensions that need to be marked and checks the integrity of the model's dimension marking at any time, which can successfully realize the automatic 3D dimensioning function of the CAD model.
[0011] However, the aforementioned 3D dimensioning method is based solely on the vertices of the 3D model. On the one hand, it effectively still uses the dimensioning logic of a 2D coordinate system: linear dimensioning is based on the distance between vertices. On the other hand, it cannot automatically annotate complex entities such as spheres and curved surfaces that lack vertices or are not entirely composed of vertices. Furthermore, existing technologies require users to first select the appropriate annotation type or feature, such as linear or radial annotation, and then manually select the object to be annotated. This effectively requires manual annotation, which is inefficient. Summary of the Invention
[0012] The purpose of the present invention is to provide a dimensioning method and system for entities in CAD, which partially solves or alleviates the above-mentioned deficiencies in the prior art. Users only need to select the entity to automatically generate annotations for the three-dimensional graphics.
[0013] In order to solve the above-mentioned technical problems, the present invention specifically adopts the following technical solutions:
[0014] A first aspect of the present invention is to provide a method for automatically generating annotations based on CAD entity types, for annotating three-dimensional graphics, comprising:
[0015] Build a knowledge base, set at least one key feature to be annotated for each entity, and preset the annotation style and annotation position for each key feature;
[0016] Obtaining an entity type of a specified entity based on a user selection, and calling at least one key feature required to be annotated for the specified entity from a knowledge base;
[0017] Displaying at least one key feature that can be annotated for the designated entity for selection by a user;
[0018] When the user selects one key feature and the user clicks one key point on the specified entity, the key point data selected by the user on the specified entity is obtained, the annotation position is generated according to the key point data, and the annotation style corresponding to the selected key feature is called from the knowledge base; the annotation data corresponding to the key feature that the user needs to annotate is obtained, and the annotation of the key feature is generated in combination with the corresponding annotation style and annotation position.
[0019] Furthermore, when the user has not selected a key feature and the user has clicked two or more key points on a specified entity, associated features associated with the selected key points are displayed for the user to select; based on the data of at least two key points clicked by the user, feature data corresponding to the associated feature selected by the user is calculated and annotations of the associated features are generated.
[0020] Furthermore, in the case where the associated feature is a key feature, a annotation is generated according to a preset annotation style and annotation position of the key feature;
[0021] In the case that the associated feature is a common feature, the annotation style of the common feature is generated according to a preset or user selection; the annotation position of the common feature is generated according to a preset or user-selected key point.
[0022] Furthermore, when the user selects two or more key features, the annotation style and annotation position corresponding to the selected key features are called from the knowledge base; the annotation data corresponding to the key features that the user needs to annotate are obtained, and the annotation of the key features is generated in combination with the corresponding annotation style and annotation position.
[0023] Furthermore, before generating the annotation, the outer frame position information of each annotation is obtained, and based on the outer frame position information, it is determined whether there is interference between the annotations or between the annotations and the entity; if there is interference between the annotations or / and between the annotations and the entity, the annotation position is adjusted or / and the annotation area is expanded.
[0024] Furthermore, the method for adjusting the annotation position includes:
[0025] Rank the key features of an entity in order of importance;
[0026] Preset multiple annotation positions for key features with the highest importance, and preset the annotation position sequence;
[0027] If there is interference between annotations, and the interfering annotations include the key feature with the highest importance ranking, the annotation positions will be adjusted 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, the key feature with the highest importance ranking will be marked at the first preset annotation position, and the annotations that interfere with the key feature with the highest importance ranking will be hidden.
[0028] If there is interference between annotations, and the interfering annotations do not include the key feature with the highest importance ranking, the annotations of the key features with lower importance rankings will be hidden;
[0029] If the annotation interferes with the entity, and the key feature annotation that causes interference is the key feature with the highest importance ranking, the annotation position is adjusted according to the preset annotation position sequence until no interference occurs;
[0030] If the annotation interferes with the entity and the annotation of the key feature that causes the interference is not the feature with the highest importance ranking, the annotation of the key feature will be hidden.
[0031] Furthermore, the method for adjusting the annotation position includes:
[0032] Rank the key features of an entity in order of importance;
[0033] Preset multiple annotation positions for each key feature and preset the annotation position sequence;
[0034] If there is interference between annotations, the annotation positions of key features with lower importance rankings are adjusted according to the preset annotation position sequence until no interference occurs; if all preset annotation positions will cause interference, the annotations of key features with lower importance rankings are hidden;
[0035] If the annotation interferes with the entity, the annotation position of the key feature is adjusted according to the preset annotation position sequence until no interference occurs.
[0036] Furthermore, in the case of interference between annotations and annotations or / and between annotations and entities, key features of an entity are ranked according to importance;
[0037] If there is interference between annotations, the transparency of the annotations of the key features with lower importance rankings will be adjusted to the preset transparency I;
[0038] If the annotation interferes with the entity, the transparency of the annotation is adjusted to the preset transparency II.
[0039] Furthermore, several annotation styles are preset for the user to choose from; in the event of interference between annotations or / and between annotations and entities, a warning box pops up to require the user to adjust the annotation style.
[0040] The present invention also provides a system for automatically generating annotations based on CAD entity types, comprising:
[0041] A knowledge base construction module is used to construct a knowledge base, set at least one key feature to be annotated for each entity, and preset an annotation style and an annotation position for each key feature;
[0042] The entity selection module is used to obtain the entity type of the specified entity based on the user's selection and call the key features required to be annotated for the specified entity from the knowledge base;
[0043] A display module, configured to display key features of the designated entity that can be annotated for user selection;
[0044] The annotation module is used to obtain the key point data selected by the user on the specified entity when the user selects one key feature and the user clicks one key point on the specified entity, generate an annotation position based on the key point data, and call the annotation style corresponding to the selected key feature from the knowledge base; obtain the annotation data corresponding to the key feature that the user needs to annotate, and generate an annotation for the key feature in combination with the corresponding annotation style and annotation position.
[0045] Beneficial effects:
[0046] This invention builds a knowledge base to assign key features to various entities (including three-dimensional entities and complex two-dimensional entities), and preset annotation styles and locations. For example, when annotating a sphere, the system accurately identifies the entity type and calls the corresponding annotation rules (including preset annotation styles and locations) from the knowledge base. Even if a computer displays a three-dimensional sphere as a circular line in a two-dimensional display, the system can accurately calculate the radius based on the sphere's center and the user's selected point on the sphere or wireframe, generating a correct annotation based on the preset rules. This ensures that the annotation reflects the sphere's true radius, rather than the projected distance. This solves the problem of existing CAD software's inability to automatically dimension three-dimensional graphics.
[0047] This invention builds a knowledge base and presets the annotation style and location of key features of each entity. After the user selects the entity and key features, the system automatically retrieves the annotation data used during modeling (i.e., feature data such as the radius, diameter, and center position of a sphere), applies the preset annotation style and location, and generates the annotation. This reduces the need for manual setup of annotation styles and locations, as well as the calculation of annotation data, significantly improving annotation speed. For example, when annotating the radius of a sphere, the system quickly generates the annotation based on the user's selection and preset rules, eliminating the need for multiple manual adjustments.
[0048] The knowledge base presets unified annotation styles and positions for key features, ensuring consistency and standardization when different users annotate the key features of the same entity. When annotating the length, width, and height of a rectangular solid, the font, size, arrow style, and position remain the same regardless of the user. This avoids misunderstandings caused by non-standard annotations and reduces errors during the design and manufacturing process.
[0049] For common features, annotation styles and positions can be preset, selected by the user, or generated based on user-selected key points. When annotating features of irregular shapes, users can adjust the annotation style and position to meet specific needs, ensuring they align with design intent and the actual scenario, meeting diverse annotation requirements.
[0050] This invention can handle a variety of situations, whether the user selects a key feature and a key point, no key feature but multiple key points, or multiple key features, and accurately generates the corresponding annotations. This makes it excellent for annotating complex entities and catering to different user annotation habits. For example, in the annotation of complex mechanical parts, annotations can be flexibly generated based on the user's different selections.
[0051] The present invention also offers multiple selection and automatic generation functions, reducing the difficulty of annotation for users, improving annotation efficiency and accuracy, reducing operational errors and repetitive work, and allowing users to devote more energy to design work. The annotation process is smoother, allowing users to focus more on the design content, and improving the user experience of using CAD software. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the embodiments or the description of the prior art. In all drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the various elements or parts are not necessarily drawn according to the actual scale. Obviously, the drawings described below are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without inventive work.
[0053] Figure 1 Schematic diagram of a 3D sphere.
[0054] Figure 2 This is a flow chart of embodiment 1 of the present invention.
[0055] Figure 3 This is a structural diagram of embodiment 2 of the present invention.
[0056] Figure 4a Example of first-priority dimension placement for the key feature, radius, of an arc entity.
[0057] Figure 4b Example of a second-priority dimension position for the key feature, radius, of an arc entity.
[0058] Figure 4c Example of a third-priority dimension position for the key feature, radius, of an arc entity.
[0059] Figure 4d Example of a fourth-priority dimension position for the radius, a key feature of an arc entity. DETAILED DESCRIPTION
[0060] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0061] Herein, suffixes such as "module," "component," or "unit" used to represent elements are only used to facilitate description of the present invention and have no specific meaning. Therefore, "module," "component," or "unit" may be used interchangeably.
[0062] As used herein, terms such as "upper," "lower," "inner," "outer," "front," "back," "one end," and "the other end" indicate positions or locations based on those shown in the accompanying drawings. These terms are intended solely to facilitate and simplify the description of the present invention and are not intended to indicate or imply that the devices or components referred to must have, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limitations on the present invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0063] As used herein, unless otherwise expressly specified or limited, the terms "installed," "provided with," and "connected" should be understood broadly. For example, "connected" may refer to a fixed connection, a detachable connection, or an integral connection; it may refer to a mechanical connection, a direct connection, an indirect connection via an intermediate medium, or internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention on a case-by-case basis.
[0064] As used herein, "and / or" includes any and all combinations of one or more of the associated listed items.
[0065] Herein, "plurality" means two or more than two, ie, it includes two, three, four, five, etc.
[0066] In this article, an "entity" refers to the graphical data in a CAD file, displayed within the CAD drawing interface. Entities possess attributes, which are data values that control specific visual characteristics of the entity or element, such as visibility, color, and line style. In various embodiments, entities may also be referred to as "pixels" or "primitives."
[0067] In this article, "object" refers to information in a CAD file that is not displayed in the CAD drawing interface, such as layers, text styles, dimension styles, etc. In this article, "style" refers to a named collection of attributes used to classify and define specific geometric and text elements (such as line styles or text styles).
[0068] In this article, "element" refers to all possible information on a CAD file, including "entities" and "objects", and can also be block, group, and unit definitions based on "entities" and / or "objects".
[0069] In this article, "file" refers to any file that can be used within a CAD system to create, edit, modify, store, and view 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, and PC3.
[0070] Example 1:
[0071] like Figure 2 As shown, this embodiment provides a method for automatically generating annotations based on CAD entity types. It can be used to annotate both three-dimensional graphics and two-dimensional graphics, and the principles of both are the same. The specific steps include:
[0072] S1 builds a knowledge base, sets at least one key feature that needs to be labeled for each entity, and presets the labeling style and labeling position for each key feature.
[0073] Among the many types of 3D and 2D entities used in CAD software, each has distinct key features that determine the precise description of its geometry and dimensions. The dimension style determines its appearance on the drawing, while the dimension position determines whether the dimension clearly and accurately expresses the design intent. Both require pre-setting.
[0074] Taking a sphere as an example, its key features are radius, diameter, and center coordinates. Regarding annotation styles, the radius annotation style can be set as follows: using a straight line with an arrow pointing to the surface of the sphere, the annotation text is "R+radius value", the font is Arial, the font size is 3.5, and the color is blue; the diameter annotation style is "Φ+diameter value", and the other parameters are the same as the radius annotation. In terms of annotation position, the radius annotation's lead line starts from the center of the sphere, perpendicular to the surface of the sphere, and the annotation text is placed in the middle of the lead line, maintaining a certain distance from the sphere; the diameter annotation's lead line passes through the center of the sphere, and the annotation text is located in the middle of the diameter direction.
[0075] Taking a rectangular parallelepiped as an example, its length, width, height, and vertex coordinates are key features. The dimension style specifies that linear dimensions use solid closed arrows, with the text labeled "Number" in Songti font and a font size of 3. Regarding dimension placement, when dimensioning length, the leader lines extend from the two vertices along the length of the rectangular parallelepiped, with the dimension text parallel to and located in the middle of the length. Similarly, when dimensioning width and height, the dimension extends from the vertices of the corresponding edges.
[0076] S2 obtains the entity type of the specified entity based on the user's selection, and calls the key features required to be annotated for the specified entity from the knowledge base.
[0077] In the CAD software interface, users select an entity to be dimensioned by clicking the mouse, using shortcut keys, or through other interactive methods. For example, this entity can be any geometric shape in a 3D model, such as a sphere, cuboid, cylinder, or cone. Upon receiving the user's selection, the system identifies the selected entity and determines its specific type.
[0078] CAD software typically maintains an entity data structure containing various attribute information about the entity. The system can determine the entity type by parsing this attribute information. These entity data structures are generated when the entity is created. For example, if the entity data structure contains attributes such as the center coordinates and radius, the system can determine that the entity is a sphere; if it contains attributes such as length, width, height, and vertex coordinates, the system can determine that the entity is a cuboid.
[0079] The knowledge base is constructed in step S1, which stores the key features corresponding to various entity types, as well as the annotation styles and locations of these key features. Once the system determines the type of entity selected by the user, it will search the knowledge base for the corresponding record based on this type.
[0080] For example, if the entity selected by the user is a sphere, the system will find records about the sphere in the knowledge base and obtain the key features that need to be labeled for the sphere, such as radius, diameter, etc.
[0081] S3 displays at least one key feature that can be annotated for the specified entity for user selection.
[0082] After the system obtains the entity type of the specified entity based on the user's selection and retrieves at least one key feature required to be annotated for the specified entity from the knowledge base, it displays the at least one key feature that can be annotated to the user. This process is usually presented in a list, menu, or graphical format, allowing users to intuitively see the content that can be annotated. By providing a selection interface, users are given the right to independently decide which key features to annotate, meeting the annotation needs of different users in different scenarios.
[0083] In other embodiments, a function of automatically labeling all key features with one click is also provided, such as a function option of automatically labeling with one click, so that the user can automatically generate the corresponding labels for all key features of the specified entity by clicking the function option.
[0084] S31, when the user selects one key feature and the user clicks one key point on the entity, obtains the key point data selected by the user on the specified entity, generates a marking position based on the key point data, and calls the marking style corresponding to the selected key feature from the knowledge base; obtains the marking data corresponding to the key feature that the user needs to mark, and generates the marking of the key feature in combination with the corresponding marking style and marking position.
[0085] A key point refers to a point selected by a user on an entity, such as a three-dimensional graphic. Specifically, the system records the coordinates and other data of the key point selected by the user. Based on the acquired key point data and the rules pre-set in the knowledge base, the specific location of the key feature annotation is calculated and determined. Preferably, if the calculated location differs from the pre-set annotation location in the knowledge base, the calculated annotation location prevails.
[0086] For some key features, once the user selects the key feature, the system will automatically capture at least one key point of the feature, while the user needs to select another key point or other key points. Figure 1 When marking the radius of a sphere, the system will automatically capture the center of the sphere as the first key point of the radius marking, and the other key point needs to be selected by the user. When the user clicks point A on the sphere as the key point, that is, another key point of the radius marking, the system will determine the marking position based on point A.
[0087] Find the annotation style corresponding to the selected key feature from the knowledge base. The annotation style includes font, size, color, arrow style, etc. Based on the geometric properties of the specified entity and the selected key feature, the corresponding annotation data is obtained. For example, if the selected key feature is the radius of a sphere, the radius value of the sphere needs to be obtained.
[0088] Combine annotation data, annotation style, and annotation position to generate the final annotation in the CAD model.
[0089] S32: When the user has not selected a key feature and the user has clicked two or more key points on the specified entity, the associated features that can be calculated based on the key points are displayed for the user to select (i.e., the associated features associated with the selected key points are displayed for the user to select); and the feature data corresponding to the associated features selected by the user are calculated based on the key point data clicked by the user and annotations of the features are generated.
[0090] When the user doesn't actively select key features but selects two or more key points on a given entity, the system analyzes the data for these key points. Based on the geometric properties of the given entity and the spatial relationships between these key points, the system calculates a series of associated features. These calculated key features are then displayed to the user, typically in a list or menu, allowing the user to select the associated features they wish to annotate.
[0091] For example, a user selects two key points on the surface of a sphere. For these two points on the sphere, the system can calculate the straight-line distance between the two points (i.e., the chord length between the two points), the central angle between the two points and the center of the sphere, the corresponding arc length, and other calculations. The system then presents the user with the relevant features that can be calculated for selection. This means predicting the user's annotation intent based on the key points they selected.
[0092] Once the user selects a feature from the displayed list, the system applies a geometric algorithm to calculate the value of the feature based on the data of the key point selected by the user. For example, if the user selects the distance feature between two points, the system uses the distance formula between two points to calculate the distance value based on the three-dimensional coordinates of the two key points.
[0093] After obtaining the feature data, the system will generate the annotation of the feature according to certain rules. If the feature is a key feature defined in the knowledge base, the system will generate the annotation according to the preset annotation style and annotation position; if it is an ordinary feature, the annotation style can be determined according to the preset or user selection, and the annotation position can be generated according to the preset rules or the key points selected by the user. For example, if the annotation intention selected by the user is the center angle of the arc between two points on the sphere, the system will automatically obtain the center of the sphere, and then calculate the center angle based on the center and the two key points. However, the center angle is not a key feature of the sphere, but an ordinary feature defined by the user according to actual annotation needs. Therefore, the system automatically generates the corresponding annotation according to the annotation style and annotation position of the center angle preset in the knowledge base. The position of the annotation is determined by the position of the last key point selected by the user. Of course, it can be automatically adjusted according to actual needs later.
[0094] Key features are features set for each entity when building a knowledge base, which are used to accurately describe the key geometric information of the entity. For example, for a sphere, the key feature is the radius; and for a cuboid, the key features are the length, width and height. When the feature to be annotated is a key feature, the system will generate the annotation based on the annotation style and annotation position pre-set in the knowledge base. This ensures that when annotating key features, both the appearance of the annotation and the placement on the graphic follow unified and standardized standards. For example, when annotating the key feature of the radius of a sphere, the preset annotation style is a straight line with an arrow, the arrow points to the surface of the sphere, the annotation text is "R+radius value", and the font size, font, etc. are clearly specified; the annotation position is preset to draw the annotation line from the center of the sphere, and the annotation text is placed at a suitable position on the annotation line, a certain distance away from the center of the sphere and without blocking the sphere graphic.
[0095] Common features, on the other hand, are features calculated by the system based on the spatial positional relationship of two or more key points when no key features are selected but two or more key points are selected during user operation. Common features are not pre-set features that describe the core attributes of an entity, but are dynamically generated based on the user's temporary clicking operations. There is more flexibility in the annotation style and position of common features. The annotation style can be generated according to the preset default style, or the user can select it based on their own needs and design habits. The annotation position is also flexible. It can be generated based on preset rules and with reference to the key points selected by the user, or the user can directly specify the key points to determine the annotation position.
[0096] S33, when the user selects two or more key features, calls the annotation style and annotation position corresponding to the selected key features from the knowledge base; obtains the annotation data corresponding to the key features that the user needs to annotate, and generates the annotation of the key features in combination with the corresponding annotation style and annotation position.
[0097] When the user selects two or more key features, the system will operate based on a previously constructed knowledge base. This knowledge base has pre-defined standard annotation styles and locations for various key features of different entities. The system will search and extract the corresponding annotation style and location information from the knowledge base based on the key features selected by the user.
[0098] The system calculates the specific annotation data corresponding to the key features selected by the user based on the geometric information of the CAD model. For example, if the key features selected by the user are the length, width, and height of a rectangular parallelepiped, the system will obtain the specific values of the length, width, and height by reading the relevant dimensional information of the rectangular parallelepiped in the CAD model.
[0099] The acquired annotation data is used to generate corresponding annotations on the CAD model according to the annotation style and annotation position called from the knowledge base.
[0100] Due to data length, user adjustments to the default style such as font size, etc., there may be interference between annotations and annotations, or between annotations and entities.
[0101] Therefore, in this embodiment, the outer frame position information of each annotation is obtained before the annotation is generated, and based on the outer frame position information, it is determined whether there is interference between annotations (i.e., between different annotations) or between annotations and entities; if there is interference between annotations or / and between annotations and entities, the annotation position is adjusted and / or the annotation area is expanded.
[0102] In CAD software, each annotation can be regarded as an object with a certain geometric shape and size. In order to facilitate the judgment of whether there is interference between annotations and between annotations and entities, the system will generate an outer bounding box for each annotation. This outer bounding box is the smallest rectangular area that can completely contain all elements of the annotation. By calculating and recording the position information of the outer bounding box, the system can accurately determine the actual space occupied by each annotation on the drawing. For example, the outer bounding box of a straight line length annotation will contain annotation text such as "50mm" and an annotation line connected to the straight line. The outer bounding box position information obtained by the system can accurately reflect the position and size of the annotation in the drawing.
[0103] Based on the acquired bounding box position information, the system can use geometric algorithms to determine whether there is interference between annotations, or between annotations and entities. When the bounding boxes of two annotations overlap in space, it is determined that there is interference between the annotations; when the bounding box of an annotation overlaps with the geometric shape of the entity (which can also be represented by a bounding box or other geometric methods), it is determined that there is interference between the annotation and the entity. For example, in a complex mechanical part drawing, if the bounding boxes of two dimension annotations overlap, the annotation information will become difficult to recognize. At this time, the system will identify this interference between annotations; if the bounding box of a radius annotation covers part of the part entity's graphics, it is an interference between the annotation and the entity.
[0104] In some embodiments, a gap threshold may be preset between different annotations of the same entity, and when the gap between the annotations is smaller than the gap threshold, it is determined as interference between the annotations.
[0105] In CAD design, in order to ensure that annotations are clear and easy to read, a certain distance must be maintained between annotations. For example, in the field of mechanical drawing, industry standards and long-term practical experience show that the minimum clear distance between annotation text is 2mm. Therefore, when the relevant CAD software is used 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 annotation content. For large-scale drawings, the gap threshold can be appropriately increased to ensure clear distinction between larger-sized annotation elements; for drawings with compact content and limited space, the gap threshold will be appropriately reduced while ensuring the readability of the annotations.
[0106] When interference is detected, the system adjusts the annotation position according to pre-set rules. In some cases, expanding the annotation area can be considered. However, expanding the annotation area involves fine-tuning the entire drawing layout, such as appropriately increasing the drawing scale or, without affecting the overall design expression, making rational use of the blank area around the entity to provide more space for the annotation, ensuring that the annotation is clearly displayed and does not interfere with other elements.
[0107] More specifically, this embodiment provides multiple methods for adjusting the marking position.
[0108] Method 1:
[0109] S3301 Rank the key features of each entity in order of importance.
[0110] In CAD design, a single entity often has multiple key features that need to be annotated. These features vary in importance for understanding the entity's design intent and function. Therefore, it's necessary to rank these key features according to certain rules. For example, if the entity is an inclined straight line, its length is clearly more important than its angle. Another example is an arc, where the key features are ranked in order of importance: radius, central angle, and arc length.
[0111] S3302 presets multiple annotation positions for key features ranked highest in importance, and presets an annotation position sequence.
[0112] Key features ranked highest in importance often provide essential information for understanding the design intent and functionality of a physical object, and they play a crucial role in the accuracy and readability of the entire design. By presetting multiple annotation positions and defining a sequence for these features, you have multiple options for adjusting annotation positions when interference occurs, ensuring that important annotation information remains clearly visible.
[0113] The ability to preset multiple annotation positions is a consideration given the diversity and complexity of CAD drawings. In actual designs, the varying shapes, sizes, and distribution of surrounding elements can affect the optimal placement of annotations. The purpose of the preset annotation position sequence is to provide a clear priority for adjusting annotation positions, avoiding blind attempts and improving adjustment efficiency.
[0114] Taking a 2D arc entity as an example (the same applies to 3D), the most important key feature is usually the radius. Its preset multiple annotation positions include:
[0115] Position 1 (priority 1): Horizontal direction outside the arc, see Figure 4a Place the radius dimension outside the arc, with the dimension line pointing horizontally toward the center of the circle. This placement is suitable when there is ample horizontal space around the arc and the dimension line does not interfere with other dimensions or entities. It allows readers to see the radius value directly.
[0116] Position 2 (priority 2): vertical direction outside the arc, see Figure 4b When horizontal space is insufficient, consider placing the annotation vertically outside the arc, with the annotation line pointing perpendicularly to the center of the circle. This placement is suitable when there is vertical space and it does not affect the display of other elements.
[0117] Position 3 (priority 3): inside the arc, see Figure 4c If there is limited space outside the arc and ample space inside, you can place the label inside the arc. However, this position may affect the readability of the label when the arc is small, so it is generally used as a backup position.
[0118] Position 4 (priority 4): arc tangent direction, see Figure 4d For drawings with special layouts, when neither horizontal nor vertical orientation is suitable, the annotation can be placed along the tangent of the arc, with the annotation line aligned with the tangent and pointing toward the center of the circle. This position can effectively utilize space in complex drawings.
[0119] S3303 If there is interference between annotations, and the interfering annotations include the key feature with the highest importance ranking, the annotation positions are adjusted according to the preset annotation position sequence until no interference occurs; if all preset annotation positions of the key feature with the highest importance ranking will interfere, the key feature with the highest importance ranking will be marked at the first preset annotation position, and the annotations that interfere with the key feature with the highest importance ranking will be hidden.
[0120] This step is used to handle the interference between annotations containing the most important features.
[0121] When a dimension interferes with another dimension, and one of them contains a key feature ranked as the most important, the system attempts to adjust the dimension positions of the key features in a predetermined sequence until the interference is resolved. For example, if a circular diameter dimension interferes with another dimension, the system first attempts to adjust the diameter dimension to the next predetermined horizontal position. If the interference persists, the system then attempts to adjust the vertical position, and so on.
[0122] If all preset annotation positions for the most important key feature interfere with each other, to ensure that the key feature's annotation is visible, it will be placed at the first preset annotation position, while hiding the other interfering annotations. This ensures that the most important information is visible and avoids missing important information due to interference.
[0123] S3304: If there is interference between annotations, and the interfering annotations do not include the key feature with the highest importance ranking, then the annotations of the key features with lower importance rankings are hidden.
[0124] If annotations interfere with each other but do not include the most important key feature, to avoid clutter, hide the annotations of the less important key features. For example, if some minor chamfer dimensions interfere with other annotations on a complex part, and these chamfer dimensions are relatively unimportant, you can hide them.
[0125] S3305 If the annotation interferes with the entity, and the annotation that interferes is the key feature with the highest importance ranking, the annotation position is adjusted according to the preset annotation position sequence until no interference occurs.
[0126] If a dimension interferes with a solid, and the interfering dimension is a key feature ranked highest in importance, the dimension's position is adjusted according to the preset dimension position sequence until the interference is resolved. For example, if a shaft diameter dimension interferes with the shaft outline, the dimension position is adjusted so that it does not overlap the shaft outline.
[0127] Of course, when adjusting the position of a label to avoid interference with the entity, it is possible that the position of a certain label no longer interferes with the entity, but interferes with other labels. At this time, you can refer to the adjustment rules for when labels interfere with each other and make adjustments.
[0128] For example, when annotating a cylinder in an architectural drawing, its radius annotation originally interferes with the cylinder's fill pattern. After moving the radius annotation outward, it interferes with the adjacent wall thickness annotation. 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 attempt to adjust the radius annotation to other preset positions, such as drawing the annotation line along different angles. If all preset positions of the radius annotation are tried and it still interferes with other annotations, and the most important one is still the one, the interfering wall thickness annotation may be hidden or adjusted to another appropriate position to ensure the clear display of the radius annotation.
[0129] If a dimension interferes with a solid object, and the interfering dimension is not the most important key feature, then the dimension of that key feature is hidden. For example, if some minor process dimension dimensions interfere with a solid object, these minor dimensions are hidden to avoid affecting the display of the solid object and the reading of important information.
[0130] In method 1, only the most important key features are preset and sorted in multiple annotation positions, which can greatly reduce the number of presets and simplify system design.
[0131] Method 2:
[0132] S3311Rank the key features of an entity in order of importance.
[0133] Similar to method one, method two also requires ranking the key features by importance to determine the priority when handling annotation interference.
[0134] S3312 presets multiple annotation positions for each key feature and presets the annotation position sequence.
[0135] In this method, multiple annotation positions are preset for each key feature to provide more adjustment options when annotation interference occurs. Different design scenarios and drawing layouts may require annotations to be placed in different positions to achieve the best display effect. The preset annotation position sequence clarifies the order in which the annotation positions should be adjusted. For example, for the radius annotation of an arc, multiple annotation positions can be preset in the horizontal direction, vertical direction, 45-degree oblique direction, etc., and the position sequence can be determined such as horizontal direction first, vertical direction second, and finally 45-degree oblique direction.
[0136] S3313 If there is interference between annotations, the annotation positions of key features with lower importance rankings are adjusted according to the preset annotation position sequence until no interference occurs; if all preset annotation positions will cause interference, the annotations of key features with lower importance rankings are hidden.
[0137] When interference occurs between annotations, give priority to adjusting the annotation positions of key features with lower importance rankings. Try to adjust them in sequence according to the preset annotation position sequence until the interference is eliminated. If interference cannot be avoided in all preset annotation positions, hide the annotations of key features with lower importance rankings. The purpose of this rule is to minimize conflicts between annotations while ensuring that important information is fully displayed. For example, in a complex assembly drawing, when some minor dimension annotations interfere with important positioning dimension annotations, give priority to adjusting the positions of the minor dimension annotations. If adjustment is really not possible, hide the minor dimension annotations to ensure that the important positioning dimension annotations are clearly visible.
[0138] S3314 If the annotation interferes with the entity, adjust the annotation position according to the preset annotation position sequence until no interference occurs.
[0139] This step ensures that annotations do not obscure important parts of the entity, maintaining the entity's graphical integrity and annotation accuracy. For example, in an architectural drawing, if a wall thickness annotation interferes with the wall graphic, adjusting the annotation position so that it does not overlap with the wall graphic allows for clear display of the wall's dimensions and position.
[0140] It is foreseeable that when the position of the annotation is adjusted to avoid interference with the entity, it is possible that the position of a certain annotation no longer interferes with the entity, but interferes with other annotations. At this time, adjustments can be made according to the adjustment rules for when annotations interfere with each other.
[0141] The method for adjusting the annotation position provided by Method 2 requires presetting the annotation position and sorting for each key feature, but the determination process is simpler and suitable for entities with fewer key features.
[0142] In addition, in some embodiments, the annotations that are hidden due to interference in method one and method two are displayed in the sidebar for user convenience.
[0143] This embodiment further provides a method for resolving interference between annotations and between annotations and entities, and the specific steps include:
[0144] S3321 Sort the key features of an entity by importance when there is interference between annotations and / or between annotations and the entity.
[0145] Similar to Method 1 and Method 2, this method also requires ranking the key features by importance in order to determine the priority when processing annotation interference.
[0146] S3322 If there is interference between annotations, the annotation transparency of the key features with lower importance rankings is adjusted to the preset transparency I.
[0147] Of course, in order to solve the interference problem, several annotation styles can be preset for users to choose from; when interference occurs between annotations or / and between annotations and entities, a warning box will pop up asking the user to adjust the annotation style.
[0148] When annotations interfere with each other, instead of hiding or moving them directly, the less important annotations are reduced in transparency. The default transparency, I, is a pre-set value. By adjusting the transparency, the interfering annotations appear visually "weakened," while still being visible. This reduces visual conflict between annotations while preserving all annotation information, avoiding potential loss of information due to hidden annotations.
[0149] For scenarios where the integrity of annotation information is crucial, such as complex assembly drawing design, each annotation may contain crucial assembly information. By adjusting the transparency, designers can see all annotations simultaneously, facilitating overall analysis and understanding without missing details due to hidden annotations. Furthermore, this method is simpler and faster than frequently adjusting annotation positions, saving design time.
[0150] S3323 If the annotation interferes with the entity, the transparency of the annotation is adjusted to the preset transparency II.
[0151] When a label interferes with an entity, the label's transparency is adjusted to Preset Transparency II. This allows the label to blend into the background to a certain extent, reducing obstruction of the entity while preserving the label's information. Preset Transparency II can be the same as Preset Transparency I, or it can be set to a different value based on actual needs. This is typically determined by the complexity of the entity and the importance of the label.
[0152] In CAD design, the integrity and clarity of solid graphics are crucial to understanding design intent. Adjusting annotation transparency ensures a clear display of solid graphics without losing key information such as size and position. This is particularly important in architectural design drawings. For example, when annotating the dimensions of a building's internal structures, adjusting the transparency of annotations that interfere with solid objects like walls and columns allows designers to clearly understand the dimensions of each component while viewing the physical structure.
[0153] Transparency I and transparency II may be the same or different, and can be set by those skilled in the art according to needs, and are not limited in the present invention.
[0154] Of course, several pre-set annotation styles are also available for users to choose from. If interference occurs between annotations or / and between annotations and entities, a warning dialog box pops up, prompting the user to adjust the annotation style. This allows users to more clearly understand issues within the drawing and adjust them to suit their design intent and aesthetic preferences. Compared to the aforementioned built-in adjustment rules, this approach is more likely to satisfy users.
[0155] Typically, in the user interface of 3D software such as CAD, users first select the type of annotation they want in the toolbar, then select the corresponding annotation points on the entity to be annotated in the drawing interface, and the corresponding annotation is automatically generated. However, this method still requires manual annotation, which is inefficient when encountering complex entities or when there are many features to be annotated. Moreover, when an entity requires many features to be annotated, manual selection inevitably leads to omissions. Therefore, this embodiment adopts a completely different technical approach. By directly selecting an entity and displaying all its key features for the user to select, or automatically generating annotations for all key features with a single click, the system eliminates the need to manually select the type of annotation and then generate the annotation, greatly improving work efficiency. Furthermore, the system identifies the user's annotation intent based on the multiple key points currently selected by the user (for example, is the arc length, chord length, or central angle between any two points on the sphere's surface to be annotated? For another example, is the area between any three points on the sphere's surface to be annotated, or the chord length between any two of the three points?), and automatically generates the corresponding annotation when the user confirms the annotation intent.
[0156] Example 2:
[0157] like Figure 3 As shown, this embodiment also provides a system for automatically generating annotations based on CAD entity types, including:
[0158] The knowledge base construction module is used to construct the knowledge base, set the key features required for annotation for each entity, and preset the annotation style and annotation position for the key features;
[0159] The entity selection module is used to obtain the entity type based on the user's selection and call the key features required to annotate the entity from the knowledge base;
[0160] A display module, used to display key features of the entity that can be annotated for user selection;
[0161] The annotation module is used to obtain the key point data selected by the user on the entity when the user selects one key feature and the user clicks one key point on the entity, generate an annotation position based on the key point data, and call the annotation style corresponding to the selected key feature from the knowledge base; obtain the annotation data corresponding to the key feature that the user needs to annotate, and generate the annotation of the key feature in combination with the corresponding annotation style and annotation position.
[0162] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0163] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a computer terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0164] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are protected by the present invention.
Claims
1. A method for automatically generating annotations based on CAD entity types, characterized in that include: Constructing a knowledge base, setting at least one key feature to be annotated for each entity, and presetting an annotation style and an annotation position for each key feature; Acquiring an entity type of a specified entity based on a user selection, and calling at least one key feature required to be annotated for the specified entity from the knowledge base; Displaying at least one of the key features that can be annotated for the designated entity for selection by the user; When the user selects one key feature and the user clicks one key point on the designated entity, obtain the key point data selected by the user on the designated entity, generate a labeling position based on the key point data, and call the labeling style corresponding to the selected key feature from the knowledge base; Obtain the annotation data corresponding to the key features that the user needs to annotate, and generate the annotation of the key features in combination with the corresponding annotation style and annotation position; When the user selects two or more key features, the preset annotation styles and annotation positions corresponding to the selected key features are called from the knowledge base; Obtain the annotation data corresponding to the key features that the user needs to annotate, and generate the annotation of the key features in combination with the corresponding annotation style and annotation position; Before generating the annotation, obtain the outer frame position information of each annotation, and determine whether interference occurs between different annotations or between annotations and entities based on the outer frame position information; Adjust the annotation position or / and expand the annotation area when there is interference between different annotations or / and between annotations and entities; Methods for adjusting the label position include: Rank the key features of an entity in order of importance; Preset multiple annotation positions for key features with the highest importance, and preset the annotation position sequence; If different annotations interfere with each other, and the interfering annotations include the key feature with the highest importance ranking, the annotation positions will be adjusted according to the preset annotation position sequence until no interference occurs. If all preset annotation positions of the key feature with the highest importance ranking will interfere with each other, the key feature with the highest importance ranking will be marked at the first preset annotation position, and the annotations that interfere with the key feature with the highest importance ranking will be hidden. If different annotations interfere with each other, and the key feature with the highest importance ranking is not included in the interfering annotations, the annotations of the key features with lower importance rankings will be hidden; If the annotation interferes with the entity, and the key feature annotation that causes interference is the key feature with the highest importance ranking, the annotation position is adjusted according to the preset annotation position sequence until no interference occurs; If the annotation interferes with the entity and the annotation of the key feature that causes the interference is not the feature with the highest importance ranking, the annotation of the key feature will be hidden.
2. The method for automatically generating annotations based on CAD entity types according to claim 1, characterized in that: If the user does not select a key feature and the user has selected at least two key points on the designated entity, display associated features associated with the selected key points for the user to select; Based on at least two key point data selected by the user, feature data corresponding to the associated feature selected by the user is calculated and a label of the associated feature is generated.
3. The method for automatically generating annotations based on CAD entity types according to claim 2, characterized in that: In the case where the associated feature is a key feature, generating a label according to a preset label style and label position of the key feature; In the case that the associated feature is a common feature, the annotation style of the common feature is generated according to a preset or user selection; the annotation position of the common feature is generated according to a preset or user-selected key point.
4. The method for automatically generating annotations based on CAD entity types according to claim 1, characterized in that Methods for adjusting the label position include: Rank the key features of an entity in order of importance; Preset multiple annotation positions for each key feature and preset the annotation position sequence; If there is interference between annotations, the annotation positions of key features with lower importance rankings are adjusted according to the preset annotation position sequence until no interference occurs; if all preset annotation positions will cause interference, the annotations of key features with lower importance rankings are hidden; If the annotation interferes with the entity, the annotation position of the key feature is adjusted according to the preset annotation position sequence until no interference occurs.
5. The method for automatically generating annotations based on CAD entity types according to claim 1, characterized in that: In the case of interference between annotations and / or between annotations and entities, the key features of an entity are ranked according to their importance; If there is interference between annotations, the transparency of the annotations of the key features with lower importance rankings will be adjusted to the preset transparency I; If the annotation interferes with the entity, the transparency of the annotation is adjusted to the preset transparency II.
6. The method for automatically generating annotations based on CAD entity types according to claim 1, characterized in that: Several annotation styles are preset for users to choose from; in the event of interference between annotations or / and between annotations and entities, a warning box will pop up asking the user to adjust the annotation style.
7. A system for automatically generating annotations based on CAD entity types, used to implement the method for automatically generating annotations based on CAD entity types according to any one of claims 1 to 6, characterized in that include: A knowledge base construction module is used to construct a knowledge base, set at least one key feature to be annotated for each entity, and preset an annotation style and an annotation position for each key feature; An entity selection module, configured to obtain the entity type of a specified entity based on a user selection, and call at least one key feature required to be annotated for the entity from a knowledge base; A display module, configured to display at least one key feature that can be annotated for the designated entity for selection by a user; A labeling module is used to, when the user selects one key feature and the user selects one key point on the specified entity, obtain the key point data selected by the user on the entity, generate a labeling position based on the key point data, and call the labeling style corresponding to the selected key feature from the knowledge base; obtain the labeling data corresponding to the key feature that the user needs to label, and generate the label of the key feature in combination with the corresponding labeling style and labeling position; or, when the user selects two or more key features, call the preset labeling style and labeling position corresponding to the selected key feature from the knowledge base; obtain the labeling data corresponding to the key feature that the user needs to label, and generate the label of the key feature in combination with the corresponding labeling style and labeling position; and obtain the outer frame position information of each label before generating the label, and determine whether there is interference between different labels or between the label and the entity based on the outer frame position information; in case of interference between different labels or / and between the label and the entity, adjust the labeling position or / and expand the labeling area; Specifically, adjusting the annotation position and / or expanding the annotation area includes: Rank the key features of an entity in order of importance; Preset multiple annotation positions for key features with the highest importance, and preset the annotation position sequence; If different annotations interfere with each other, and the interfering annotations include the key feature with the highest importance ranking, the annotation positions will be adjusted according to the preset annotation position sequence until no interference occurs. If all preset annotation positions of the key feature with the highest importance ranking will interfere with each other, the key feature with the highest importance ranking will be marked at the first preset annotation position, and the annotations that interfere with the key feature with the highest importance ranking will be hidden. If different annotations interfere with each other, and the key feature with the highest importance ranking is not included in the interfering annotations, the annotations of the key features with lower importance rankings will be hidden; If the annotation interferes with the entity, and the key feature annotation that causes interference is the key feature with the highest importance ranking, the annotation position is adjusted according to the preset annotation position sequence until no interference occurs; If the annotation interferes with the entity and the annotation of the key feature that causes the interference is not the feature with the highest importance ranking, the annotation of the key feature will be hidden.
Citation Information
Patent Citations
Three-dimensional labeling method for part processing
CN101877015A
Method for translating dimensions on two-dimensional engineering drawing to three-dimensional CAD (computer aided design) model
CN102568038B
Three-dimensional CAD (Computer Aided Design) model size marking method, system, equipment and medium
CN118761116A