Topological element naming method and device based on copy class features and medium
By calculating matrix chain information using a multi-branch tree structure and a depth-first search algorithm, and combining this with a geometric modeling engine to construct topological elements, the problem of complex naming of duplicated features is solved, and efficient automatic naming and management of topological elements is achieved.
Patent Information
- Application Number
- CN202511462032.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-14
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-10-14
AI Technical Summary
In existing technologies, the naming steps for topological elements of copy-type features are complex and inefficient, especially when dealing with multiple nesting and parameter copying, which are difficult to manage effectively.
The result container is initialized using a multi-branch tree structure. The matrix chain information is calculated using a depth-first search algorithm, and the topology elements are constructed using a geometric modeling engine. The elements are automatically named using the format {coordinate number + source element topology name + recursion level + feature type + feature number}.
It improves the efficiency of naming topology elements, supports multiple nesting of copy-type features and copying of dependent parameters, realizes the modeling design of mirror and array features, and meets the naming, maintenance and management needs of topology elements.
Smart Images

Figure CN120930201A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of feature-based parametric modeling technology, and in particular to a method, apparatus and medium for naming topological elements based on copy-type features. Background Technology
[0002] Computer-aided design (CAD) technology is widely used in product design and management in various fields such as architecture, aerospace, shipbuilding, and automobiles. Historically based parametric feature modeling technology is a milestone in the development of CAD technology. Various enterprises have gradually developed their own feature modeling systems, among which topological element naming is one of the key technologies in the research and development of domestically produced industrial software.
[0003] Mirroring and arraying are two basic copying features. Mirroring creates a copy of geometry symmetrical about a specified plane, while arraying creates multiple copies of geometry linearly or circularly along a specified direction. Mirroring and arraying are primarily used for design tasks involving model symmetry and structural repetition. For clarity, all topological elements obtained based on copying features need to be named individually. However, due to the multiple nested copies between copying features, the need to consider parameter copying between topological elements, and the naming and maintenance management of topological elements, the current naming process for topological elements is complex and inefficient. Summary of the Invention
[0004] This invention aims to at least solve one of the technical problems existing in the prior art. To this end, this invention proposes a method, apparatus, and medium for naming topological elements based on copy-type features. Based on a multi-branch tree structure with multiple reference features, it supports multiple nesting of reference features and the design of shapes when copying features based on dependent feature parameters. This can meet the naming, maintenance, and management needs of topological elements, and achieve automatic naming of topological elements, thereby improving naming efficiency.
[0005] In a first aspect, embodiments of the present invention provide a method for naming topological elements based on replication-type features, including: The result container is initialized based on a multi-way tree structure with multiple reference features, wherein the reference features are either copy-type features or non-copy-type features; Based on the multi-branch tree structure, the copy matrices of each of the referenced features are traversed layer by layer to obtain matrix chain information, and the matrix chain information is saved to the result container. The copy matrix of the non-copyable features is a matrix chain, and the copy matrix of the copyable features is a set of matrix chains obtained by recursive calculation based on depth-first search. The result container is traversed layer by layer to remove duplicates from the matrix chain information; The model generator of the geometric modeling engine traverses each matrix chain of the result container layer by layer, and constructs the model entity corresponding to the copying feature based on the corresponding matrix chain information and the feature parameters of the reference feature. The model entity includes the topological element corresponding to the copying feature. The element names of each of the topological elements are determined during the modeling process of the modeling entity. Specifically, when the copying feature corresponding to the topological element is a base feature, the element name is determined during modeling based on the position of the final transformation matrix calculated by the corresponding matrix chain. Alternatively, when the copying feature corresponding to the topological element is a modification feature, the element name is generated during modeling after finding the reference name of the reference element of the corresponding copying feature and then finding the modification element based on the reference name.
[0006] According to some embodiments of the present invention, the method is applied to the copy-type features, including mirroring, arrays, etc., implemented based on matrix transformation.
[0007] According to some embodiments of the present invention, the naming format of the element name is {coordinate number + source element topology name + recursion level + feature type + feature number}, wherein the expression of the coordinate number is: x&y, the coordinate number is used to record the matrix coordinate index position of the replication class feature, the expression of the source element topology name is: OrigNameRef, the expression of the recursion level is: NLevel, the expression of the feature type is: FeatType, and the expression of the feature number is: FFeatID; Wherein, when the replication class feature is a linear array, the linear array consists of N*M matrix transformations, x∈[0,N-1], y∈[0,M-1].
[0008] According to some embodiments of the present invention, the reference feature is a feature upon which the copying feature depends; The matrix chain information is obtained by encapsulating the reference features, geometric transformation information and calculation methods by defining an abstract data structure class. The matrix chain information is the geometric transformation information calculated by the copying feature based on the reference feature it depends on. The geometric transformation information of the non-copying feature is the matrix chain. The geometric transformation information of the copying feature is the set of matrix chains. The result container is an associated container that stores the matrix chain information. The retrieval of the result container is achieved through key-value pairs, and the instantiation of the result container retrieval is based on the abstract data structure class.
[0009] According to some embodiments of the present invention, based on the multi-branch tree structure, matrix chain information is obtained by traversing the copy matrices of each of the referenced features layer by layer, and the matrix chain information is saved to the result container, including: Based on any of the aforementioned copy-type features, extract all the reference features of the first level of the multi-branch tree structure of the reference features of the copy-type features, initialize i=1, wherein the multi-branch tree structure of the reference features of the copy-type features includes LevelTotal1 levels, the number of reference features of the first level of the multi-branch tree structure is FeatNum, i is a positive integer, and i is less than or equal to LevelTotal1. Initialize j=1, extract the j-th reference feature of the i-th level of the multi-branch tree structure. When the reference feature is the non-copying feature, the matrix chain information includes the reference feature and the matrix chain. The expression of the matrix chain information is FeatureA+Matrix(FeatCur). Alternatively, when the reference feature is the copying feature, the matrix chain set is recursively calculated using a depth-first search method. The expression of the matrix chain set is FeatureM+Matrix(FeatCur), where j is a positive integer, j is less than or equal to FeatNum, FeatureA is the non-copying feature, Matrix(FeatCur) is the transformation matrix of the copying feature, FeatCur is the copying feature, and FeatureM is the copying feature. j is incremented by 1, and the matrix chain information is determined based on the reference feature until j=FeatNum, so as to obtain the matrix chain information of all the reference features of the i-th level of the multi-branch tree structure, and all the matrix chain information is stored in the i-th level of the result container. Incrementing i by 1, the matrix chain information of all the reference features of the i-th level of the multi-branch tree structure is determined until i = LevelTotal1, thus obtaining the matrix chain information of all the reference features of the multi-branch tree structure, and storing all the matrix chain information in the result container.
[0010] According to some embodiments of the present invention, traversing the result container layer by layer to perform deduplication processing on the matrix chain information includes: The result container is traversed layer by layer. The matrix chain information is compared at any level in the result container. Duplicate matrix chain information is deduplicated to achieve local deduplication identification. The matrix chain information is compared at any two levels in the result container. Duplicate matrix chain information is deduplicated to achieve global deduplication identification. Alternatively, the matrix chain information can be obtained based on any of the aforementioned reference features, and the result container can be traversed layer by layer to perform a uniqueness check.
[0011] According to some embodiments of the present invention, the geometric modeling engine is a geometric modeling library based on BRep boundary representation and having geometric and topological data structures, and the geometric modeling engine can provide feature modeling APIs.
[0012] According to some embodiments of the present invention, determining the element names of each of the topological elements during the modeling process of the modeled entity includes: Based on any one of the replication-class features, determine the multi-branch tree structure of the replication-class features, set m=1, extract the m-th level of the result container and obtain the size of the m-th level of the result container, wherein the number of levels of the multi-branch tree structure is LevelTotal2; Set n=1, extract the nth matrix chain information of the mth level of the result container, parse the feature information in the matrix chain information to obtain the reference feature, wherein the reference feature is the original feature of the current reference dependency resolution; When the referenced feature is a base feature, it is transformed to the position of the final transformation matrix determined based on the matrix chain. When modeling is performed using the feature parameters of the referenced feature, a copy entity is obtained. The copy entity is named with topological elements. The copy entity and the historical result entity are subjected to Boolean operation. The result body is named with topological elements. Alternatively, when the reference feature is a modification feature, the naming information of the referenced element of the reference feature is obtained, the target element that matches the naming information is determined in the historical result entity, the target element is referenced to complete the modification shape to obtain the modification element, and the modification element is topologically named. Incrementing n by 1, traversing all the matrix chain information of the m-th level of the result container one by one, determining the element name of each topological element until n = Length, completing the shaping of all the reference features and the naming of the topological elements of the m-th level of the result container, where Length is the size of Map(m) and Map(m) is the m-th level of the result container; m is incremented by 1, and the result container is traversed layer by layer to complete the shaping of all the referenced features and the naming of the topology elements, until m = LevelTotal2.
[0013] Secondly, embodiments of the present invention provide a topology element naming apparatus based on replication-type features, including at least one control processor and a memory for communicatively connecting to the at least one control processor; the memory stores instructions executable by the at least one control processor, the instructions being executed by the at least one control processor to enable the at least one control processor to execute the topology element naming method based on replication-type features as described in the first aspect above.
[0014] Thirdly, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions for executing the topological element naming method based on replication class features as described in the first aspect above.
[0015] The topological element naming method based on replication-type features according to embodiments of the present invention has at least the following beneficial effects: Initializing the result container based on a multi-way tree structure of multiple reference features, wherein the reference features are replication-type features or non-replication-type features; based on the multi-way tree structure, traversing the replication matrices of each reference feature layer by layer to obtain matrix chain information, and saving the matrix chain information to the result container, wherein the replication matrix of the non-replication-type features is a matrix chain, and the replication matrix of the replication-type features is a set of matrix chains obtained by recursive calculation based on depth-first search; traversing the result container layer by layer to remove duplicates from the matrix chain information; and traversing each element of the result container layer by layer using the model generator of the geometric modeling engine. The matrix chain is described above. Based on the corresponding matrix chain information and the feature parameters of the referenced feature, a modeling entity corresponding to the copying feature is constructed. The modeling entity includes topological elements corresponding to the copying feature. The element names of each topological element are determined during the modeling process of the modeling entity. Specifically, when the copying feature corresponding to the topological element is a base feature, the element name is determined during modeling based on the position of the final transformation matrix calculated by the corresponding matrix chain; or, when the copying feature corresponding to the topological element is a modification feature, the element name is generated during modeling after finding the reference name of the referenced element of the corresponding copying feature and then finding the modification element based on the reference name. According to the technical solution of the present invention, it is applied to two types of copy features: mirror and array. Based on the multi-branch tree structure of multiple reference features, and according to the copying logic and modeling process of the reference features, the hierarchical storage of copying matrix information is realized through a depth-first search algorithm. Thus, when traversing the modeling process, the detailed information of the reference features can be traced. It can effectively support the multiple nesting of copy features and the modeling design when copying depends on the original parameters. It supports the modeling process implementation and topology element naming of two types of copy features: mirror and array. It meets the needs of topology element naming maintenance and management, and realizes automatic naming of topology elements to improve naming efficiency. Attached Figure Description
[0016] Figure 1 This is a flowchart of a topological element naming method based on replication class features provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the multi-branch tree structure of the reference feature of the copy class feature provided in another embodiment of the present invention; Figure 3 This is a schematic diagram of the calculation of the matrix chain of the first layer of the recursive hierarchy provided in another embodiment of the present invention; Figure 4 This is a schematic diagram of the calculation of the matrix chain in the second layer of the recursive hierarchy provided in another embodiment of the present invention; Figure 5 This is a schematic diagram of the calculation of the matrix chain of the third layer of the recursive hierarchy provided in another embodiment of the present invention; Figure 6 This is a schematic diagram of the calculation results after deduplication of all matrix chain information provided in another embodiment of the present invention; Figure 7 This is a schematic diagram of the modeling and naming process based on matrix chain information provided in another embodiment of the present invention; Figure 8 This is a schematic diagram of the field information of the element name of a topological element with a mirrored replication class feature, provided in another embodiment of the present invention. Figure 9 This is a structural diagram of a topological element naming device based on replication class features provided in another embodiment of the present invention. Detailed Implementation
[0017] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0018] In the description of this invention, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.
[0019] In the description of this invention, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0020] In the description of this invention, unless otherwise explicitly defined, terms such as "set up," "install," and "connect" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this invention in conjunction with the specific content of the technical solution.
[0021] The topological element naming method based on replication-type features according to embodiments of the present invention has at least the following beneficial effects: Initializing the result container based on a multi-way tree structure of multiple reference features, wherein the reference features are replication-type features or non-replication-type features; based on the multi-way tree structure, traversing the replication matrices of each reference feature layer by layer to obtain matrix chain information, and saving the matrix chain information to the result container, wherein the replication matrix of the non-replication-type features is a matrix chain, and the replication matrix of the replication-type features is a set of matrix chains obtained by recursive calculation based on depth-first search; traversing the result container layer by layer to remove duplicates from the matrix chain information; and traversing each element of the result container layer by layer using the model generator of the geometric modeling engine. The matrix chain is described above. Based on the corresponding matrix chain information and the feature parameters of the referenced feature, a modeling entity corresponding to the copying feature is constructed. The modeling entity includes topological elements corresponding to the copying feature. The element names of each topological element are determined during the modeling process of the modeling entity. Specifically, when the copying feature corresponding to the topological element is a base feature, the element name is determined during modeling based on the position of the final transformation matrix calculated by the corresponding matrix chain; or, when the copying feature corresponding to the topological element is a modification feature, the element name is generated during modeling after finding the reference name of the referenced element of the corresponding copying feature and then finding the modification element based on the reference name. According to the technical solution of the present invention, it is applied to two types of copy features: mirror and array. Based on the multi-branch tree structure of multiple reference features, and according to the copying logic and modeling process of the reference features, the hierarchical storage of copying matrix information is realized through a depth-first search algorithm. Thus, when traversing the modeling process, the detailed information of the reference features can be traced. It can effectively support the multiple nesting of copy features and the modeling design when copying depends on the original parameters. It supports the modeling process implementation and topology element naming of two types of copy features: mirror and array. It meets the needs of topology element naming maintenance and management, and realizes automatic naming of topology elements to improve naming efficiency.
[0022] The technical solutions of the embodiments of the present invention will be further illustrated in the following figures.
[0023] Reference Figures 1 to 3 , Figure 1 A flowchart illustrating a topological element naming method based on replication class features provided in an embodiment of the present invention. Figure 2 This is a schematic diagram of a multi-branch tree structure of a reference feature for a copy-type feature provided in another embodiment of the present invention. Figure 3 The following is a schematic diagram illustrating the calculation of the matrix chain in the first layer of the recursive hierarchy, provided in another embodiment of the present invention. This topological element naming method based on replication characteristics includes, but is not limited to, the following steps: S10, Initialize the result container based on a multi-way tree structure with multiple reference features, where the reference features are either copy-type features or non-copy-type features; It should be noted that, referring to Figure 2 , Figure 2 This includes a feature history tree and a multi-branch tree structure for the replicated feature M3, where M3 is any replicated feature. The multi-branch tree structure represents the referencing relationships of replicated features. Since all referencing features of replicated features have a tree structure, the parent nodes of the multi-branch tree structure are replicated features, and the leaf nodes are non-replicated features. The operation on replicated feature M3 involves nested selection of replicated features; that is, replicated feature M3 selects replicated features M1 and M2, and replicated feature M2 selects replicated feature M1. In the multi-branch tree structure of replicated feature M3, M1, M2, and M3 are replicated features, C1 is a non-replicated feature, and E1, E2, and E3 are referencing features. The arrows in the multi-branch tree structure represent the referencing relationships, i.e., selection relationships, between replicated features, non-replicated features, and referencing features. Since M1 and M2 are both replication features, replication features M1 and M2 are used as parent nodes to construct subtrees. The child nodes at the same level of the multi-branch tree structure are strictly arranged from left to right according to the order in the feature history tree of replication features.
[0024] It should be noted that the structure container is initialized based on the multi-branch tree structure. The number of result containers is equal to the number of levels in the multi-branch tree structure. The result containers are used to store the matrix chain information of each level. The matrix chain information of each reference feature at the same level of the multi-branch tree structure is stored in the result container of the corresponding level.
[0025] S20: Based on the multi-branch tree structure, the copy matrices of each reference feature are traversed layer by layer to obtain matrix chain information. The matrix chain information is then saved to the result container. The copy matrices of non-copyable features are matrix chains, while the copy matrices of copyable features are sets of matrix chains obtained by recursive calculation based on depth-first search.
[0026] It should be noted that the matrix chain information refers to the path of the leaf nodes after traversing the path using a depth-first search, as shown in the reference. Figure 3 E1, C1, E2, and E3 are all leaf nodes. Taking leaf node E1 as an example, one of the matrix chains of leaf node E1 is E1+Matrix1+Matrix3, representing the matrix chain information corresponding to the replication-type features traversed by leaf node E1. E1+Matrix1 is the set of matrix chains obtained by recursively calculating the replication matrix of replication-type feature M1 based on depth-first search. Figures 2 to 6 In Chinese, Matrix is abbreviated as Mtx.
[0027] S30: Traverse the result container layer by layer to remove duplicate information from the matrix chain.
[0028] It should be noted that by traversing all matrix chain information in the result container and performing deduplication, the matrix chain information of each level without redundancy is obtained, that is, the modeling information of each level without redundancy is obtained.
[0029] S40: The model generator of the geometric modeling engine traverses each matrix chain of the result container layer by layer, and constructs the model entity corresponding to the copying feature based on the corresponding matrix chain information and the feature parameters of the referenced feature. The model entity includes the topological elements corresponding to the copying feature.
[0030] It should be noted that the modeling process involves traversing the matrix chain information of the result container to construct the model entity and naming the topological elements of the model entity. During the modeling process, different modeling logics are executed based on the different original characteristics of the reference dependencies, and the topological elements of the resulting model entity are named.
[0031] It should be noted that, starting from the first level of the result container, the replication-type features in each level of the result container are traversed layer by layer. Modeling is performed on the referenced features at each level of the result container to design the model. Based on the matrix chain information and feature parameters, various feature APIs are executed and Brep entities are constructed to obtain the modeled entity. The parameters of the modeled entity are the same as the feature parameters.
[0032] S50, determine the element name of each topological element during the modeling process of the modeling entity. When the copying class feature corresponding to the topological element is a base feature, the element name is determined when modeling is performed based on the position of the final transformation matrix calculated by the corresponding matrix chain. Alternatively, when the copying class feature corresponding to the topological element is a decoration feature, the element name is generated when modeling is performed after finding the reference name of the reference element of the corresponding copying class feature and then finding the decoration element based on the reference name.
[0033] It should be noted that matrix features are non-modified features, including copy-type features such as stretching, rotation, and sweeping; modified features include copy-type features such as rounded corners or flattened corners. Topological elements are named based on the type of copy-type feature corresponding to them.
[0034] It should be noted that, based on the multi-branch tree structure of the referenced features of the copying class, and combined with the feature parameters used in the modeling process, the topology elements are named. The name information of the topology element includes at least the following fields: the coordinate number of the copied feature, the name information of the corresponding element in the source feature body, the nesting level when nesting is selected, the feature number, the feature type, and the element type. For the base feature, the naming method of the copied topology of the base feature is determined by the feature parameters; for the modification feature, the naming method of the copied topology of the modification feature is determined by the naming information of the referenced feature.
[0035] It should be noted that the result container is used to store the modeling information of the copy class features corresponding to the referenced features, i.e., matrix chain information.
[0036] It should be noted that this invention is applied to two types of copy features: mirror and array. Based on a multi-branch tree structure of multiple reference features, and according to the copying logic and modeling process of the reference features, a depth-first search algorithm is used to realize the hierarchical storage of copying matrix information. Thus, when traversing the modeling process, the detailed information of the reference features can be traced. This can effectively support the multiple nesting of copy features and the modeling design when copying depends on the original parameters. It supports the modeling process implementation and topology element naming of both mirror and array copy features, while also meeting the needs of topology element naming maintenance and management.
[0037] It should be noted that the result container is initialized based on a hierarchical multi-branch tree structure. The multi-branch tree structure is traversed layer by layer, and the matrix chain information of all referenced features in each level of the multi-branch tree structure is calculated. The matrix chain information is stored in the corresponding level of the result container. The matrix chain information of each level in the result container is traversed and deduplicated, and duplicate matrix chains are merged. The geometry engine model generator is used to traverse all deduplicated matrix chain information. The matrix chain information and feature parameters are combined to generate a model entity with duplicate features, and the topological elements of the model entity are named.
[0038] In another embodiment, the method is applied to replication-type features, including mirroring, arrays, and other matrix transformation-based replication features.
[0039] It should be noted that common copy-type features in parametric modeling systems include mirroring, linear arrays, circular arrays, and sketch-driven arrays. The difference between mirroring and array features lies in the fact that mirroring performs a symmetrical copy operation based on a reference element; logically, only one symmetrical transformation is applied to the selected reference element in a single operation. Array features, on the other hand, copy a geometry along one or more directions at certain intervals and in a repetitive pattern, applying multiple matrix transformations to the selected geometry. This invention categorizes these two logically similar features as copy-type features, and the topological element naming method based on copy-type features in this invention is applied to copy-type features including mirroring and arrays.
[0040] In another embodiment, the naming format of the element name is {coordinate number + source element topology name + recursion level + feature type + feature number}, where the expression for the coordinate number is: x & y, the coordinate number is used to record the matrix coordinate index position of the replication-type feature, the expression for the source element topology name is: OrigNameRef, the expression for the recursion level is: NLevel, the expression for the feature type is: FeatType, and the expression for the feature number is: FFeatID; where, when the replication-type feature is a linear array, the linear array consists of N*M matrix transformations, x∈[0,N-1], y∈[0,M-1].
[0041] It should be noted that topological elements include point elements, edge elements, and face elements. The topological elements are named to obtain the element name, which must include at least the following fields: the coordinate number of the copied feature, the name information of the corresponding element in the source feature body, the nesting level when nesting selection, the feature number, the feature type, and the element type.
[0042] In another embodiment, the reference feature is the feature that the copying feature depends on; the matrix chain information is obtained by encapsulating the reference feature, geometric transformation information and calculation method by defining an abstract data structure class, wherein the matrix chain information is the geometric transformation information calculated by the copying feature based on the reference feature it depends on, the geometric transformation information of the non-copying feature is a matrix chain, and the geometric transformation information of the copying feature is a set of matrix chains; the result container is an associated container that stores the matrix chain information, wherein the retrieval of the result container is implemented through key-value pairs, and the instantiation of the result container retrieval is based on the abstract data structure class.
[0043] It should be noted that the reference feature is either a non-copying feature or a copying feature, so the reference feature on which the copying feature depends is represented by a multi-branch tree structure.
[0044] Additionally, refer to Figures 2 to 5 , Figure 4 This is a schematic diagram illustrating the calculation of the matrix chain in the second layer of the recursive hierarchy, provided in another embodiment of the present invention. Figure 5A schematic diagram of the calculation of the matrix chain of the third layer of the recursive hierarchy provided in another embodiment of the present invention. In one embodiment, in Figure 1 Step S20 as shown also includes, but is not limited to, the following steps: S21. Based on any copying feature, extract all reference features of the first level of the multi-branch tree structure of the reference features of the copying feature. Initialize i=1. The multi-branch tree structure of the reference features of the copying feature includes LevelTotal1 levels. The number of reference features in the first level of the multi-branch tree structure is FeatNum. i is a positive integer, and i is less than or equal to LevelTotal1. S22, initialize j=1, extract the j-th reference feature of the i-th level of the multi-branch tree structure. When the reference feature is a non-copying feature, the matrix chain information includes the reference feature and the matrix chain. The expression of the matrix chain information is FeatureA+Matrix(FeatCur). Alternatively, when the reference feature is a copying feature, the matrix chain set is recursively calculated using the depth-first search method. The expression of the matrix chain set is FeatureM+Matrix(FeatCur), where j is a positive integer, j is less than or equal to FeatNum, FeatureA is a non-copying feature, Matrix(FeatCur) is the transformation matrix of the copying feature, FeatCur is the copying feature, and FeatureM is the copying feature. S23, j increments by 1, determines the matrix chain information based on the reference features until j=FeatNum, obtains the matrix chain information of all reference features of the i-th level of the multi-branch tree structure, and stores all matrix chain information in the i-th level of the result container. S24, i increments by 1, determines the matrix chain information of all reference features of the i-th level of the multi-branch tree structure until i = LevelTotal1, obtains the matrix chain information of all reference features of the multi-branch tree structure, and stores all matrix chain information in the result container.
[0045] It should be noted that, referring to Figure 3 Starting from the lower child node of the root node in the multi-branch tree structure as the first level, the system traverses level by level, with child nodes at the same level traversed from left to right. The order of traversing child nodes at the same level from left to right is the same as the order of traversing the referenced features that the copy class feature M3 directly depends on. The system calculates the matrix chain information of all referenced features and stores it in the result container.
[0046] It should be noted that, referring to Figure 3When calculating the matrix chain information of a single reference feature, for a replication-type feature, taking replication-type feature M1 as an example, the matrix chain information of replication-type feature M1 needs to be obtained by recursively searching the path from replication-type feature M1 to the leaf node using a depth-first search method. A path from a leaf node to replication-type feature M3 is a matrix chain. Then, the Mtx3 matrix is added to all matrix chains to obtain the set of matrix chains for replication-type feature M1. Figure 3 The matrix chain information is {E1+Mtx1+Mtx3, C1+Mtx1+Mtx3}. For the replication-type feature M2, the calculation process for its matrix chain information is similar to that of the replication-type feature M1, resulting in {E1+Mtx1+Mtx2+Mtx3, C1+Mtx1+Mtx2+Mtx3, E2+Mtx2+Mtx3, E3+Mtx2+Mtx3}. The specific steps are not detailed here. Where Mtx1 is the transformation matrix of the replication-type feature M1, Mtx2 is the transformation matrix of the replication-type feature M2, and Mtx3 is the transformation matrix of the replication-type feature M3.
[0047] It should be noted that, referring to Figure 3 When calculating the matrix chain information of a single reference feature, for non-copyable features, taking non-copyable feature E3 as an example, a matrix chain is directly generated, such as... Figure 3 E3 +Mtx3 is shown.
[0048] It should be noted that by using the depth-first search method to transform the transformation of the copy-type features into a series of transformations of the reference features, the modeling process of the copy-type features is completely related to the parameters of the reference features. Once the reference features are edited and modified and the features are reconstructed, the copy-type features that reference the reference features will be updated synchronously.
[0049] It should be noted that, referring to Figure 4 and Figure 5 Using the same method and steps as traversing the first level of the multi-branch tree structure, the second and third levels of the multi-branch tree structure are traversed to obtain the matrix chain information of all copy-type features of the second and third levels of the multi-branch tree structure.
[0050] Additionally, refer to Figure 6 , Figure 6 This is a schematic diagram of the calculation result after deduplication of all matrix chain information provided in another embodiment of the present invention. In one embodiment, in Figure 1 Step S30 shown also includes, but is not limited to, the following steps: S31, traverse the result container layer by layer, compare the matrix chain information at any level in the result container, remove duplicate matrix chain information to achieve local deduplication, compare the matrix chain information at any two levels in the result container, remove duplicate matrix chain information to achieve global deduplication. S32, or, based on any reference feature, obtain the matrix chain information and traverse the result container layer by layer to perform a uniqueness check.
[0051] It should be noted that to remove duplicate matrix chain information in the result container, we can first traverse the layers of the result container layer by layer and compare the matrix chain information within each layer to complete the local deduplication identification. Then, we can compare the matrix chain information between any two layers of the result container to complete the global deduplication identification, thus obtaining the non-redundant modeling information of each layer in the result container.
[0052] It should be noted that the matrix chain information is stored in a result container in ascending order of hierarchical index. After obtaining a new matrix chain information, the matrix chain information is compared with all the matrix chain information already stored in the result container to perform a uniqueness check. If the information of the matrix chain to be added is the same as the matrix chain information already stored in the result container, it is not added.
[0053] It should be noted that the matrix chain information in the result container is deduplicated to avoid repeated execution when traversing the matrix chain information later. The deduplicated matrix chain information is as follows: Figure 6 As shown.
[0054] In another embodiment, the geometric modeling engine is a geometric modeling library based on BRep boundary representation and having geometric and topological data structures. The geometric modeling engine can provide APIs for feature modeling.
[0055] It should be noted that the geometric modeling library includes modeling libraries such as ACIS, ParaSolid, and OpenCASCADE. Boundary Representation (BRep) is a boundary representation based on boundary representation.
[0056] Additionally, refer to Figure 7 and Figure 8 , Figure 7 This is a schematic diagram of the modeling and naming process based on matrix chain information, provided in another embodiment of the present invention. Figure 8 This is a schematic diagram illustrating the field information of the element name of a topological element with a mirrored replication class feature, provided as another embodiment of the present invention. In one embodiment, in Figure 1 Step S50 as shown also includes, but is not limited to, the following steps: S51, Based on any replication class feature, determine the multi-branch tree structure of the replication class feature, set m=1, extract the m-th level of the result container and obtain the size of the m-th level of the result container, where the number of levels of the multi-branch tree structure is LevelTotal2; S52, set n=1, retrieve the nth matrix chain information of the mth level of the result container, parse the feature information in the matrix chain information to obtain the reference feature, where the reference feature is the original feature of the current reference dependency resolution; S53, when the referenced feature is the base feature, transform to the position of the final transformation matrix determined based on the matrix chain calculation, and obtain the copied entity when performing modeling using the feature parameters of the referenced feature, name the topological elements of the copied entity, perform Boolean operation between the copied entity and the historical result entity, and name the topological elements of the result body. S54, or, when the reference feature is a modification feature, obtain the naming information of the referenced element of the reference feature, determine the target element that matches the naming information in the historical result entity, complete the modification modeling by referencing the target element to obtain the modification element, and perform topological naming on the modification element. S55, n increments by 1, iterates through all matrix chain information of the m-th level of the result container one by one, determines the element name of each topological element until n=Length, completes the shaping of all reference features and naming of topological elements of the m-th level of the result container, where Length is the size of Map(m) and Map(m) is the m-th level of the result container. S56, m increments by 1, traversing the result container level by level to complete the shaping of all referenced features and the naming of topological elements, until m = LevelTotal2.
[0057] It should be noted that when the copying feature is the base feature, the position of the final transformation matrix is calculated and determined based on the matrix chain information. The feature parameters of the reference feature are used to perform modeling to obtain the copying entity. The copying entity is named with topological elements. The copying entity is then compared with the named historical result entity with Boolean operations. Finally, the result body after the Boolean operations is named with topological elements.
[0058] It should be noted that, referring to Figure 7 and Figure 8 For elements with copy-type characteristics, the naming depends on elements stable during modeling. Topological element f2 is obtained by mirroring element f1. The semantic interpretation of the element name of element f2 is shown in the table below:
[0059] Semantic explanation of element names in Table 1f2 The fields Position_I and Position_J together represent the position indices of the mirror and array matrices. For mirror transformations, there is only one matrix, while for array features, most parameterization systems have both direction 1 and direction 2. The RefOrig field represents the original naming information of the source topology element, i.e., the naming information of the referenced feature. Since the transformation of the feature in this invention involves multiple matrix transformations of the referenced feature, the field information of the element name corresponds to the information of the referenced feature.
[0060] like Figure 9 As shown, Figure 9 This is a structural diagram of a topology element naming device based on replication-class features according to an embodiment of the present invention. The present invention also provides a topology element naming device based on replication-class features, comprising: The processor 601 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 602 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 602 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 602 and is called and executed by the processor 601 to execute the topology element naming method based on replication characteristics of the embodiments of this application. The input / output interface 603 is used to implement information input and output; The communication interface 604 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 605 transmits information between various components of the device (e.g., processor 601, memory 602, input / output interface 603, and communication interface 604); The processor 601, memory 602, input / output interface 603, and communication interface 604 are connected to each other within the device via bus 605.
[0061] This application embodiment also provides a storage medium, which is a computer-readable storage medium, storing a computer program that, when executed by a processor, implements the above-described topological element naming method based on replication class characteristics.
[0062] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof. The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate, and may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0063] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0064] The above provides a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of the present invention.
Claims
1. A method for naming topological elements based on replication characteristics, characterized in that, include: The result container is initialized based on a multi-way tree structure with multiple reference features, wherein the reference features are either copy-type features or non-copy-type features; Based on the multi-branch tree structure, the copy matrices of each of the referenced features are traversed layer by layer to obtain matrix chain information, and the matrix chain information is saved to the result container. The copy matrix of the non-copyable features is a matrix chain, and the copy matrix of the copyable features is a set of matrix chains obtained by recursive calculation based on depth-first search. The result container is traversed layer by layer to remove duplicates from the matrix chain information; The model generator of the geometric modeling engine traverses each matrix chain of the result container layer by layer, and constructs the model entity corresponding to the copying feature based on the corresponding matrix chain information and the feature parameters of the reference feature. The model entity includes the topological element corresponding to the copying feature. The element names of each of the topological elements are determined during the modeling process of the modeling entity. Specifically, when the copying feature corresponding to the topological element is a base feature, the element name is determined during modeling based on the position of the final transformation matrix calculated by the corresponding matrix chain. Alternatively, when the copying feature corresponding to the topological element is a modification feature, the element name is generated during modeling after finding the reference name of the reference element of the corresponding copying feature and then finding the modification element based on the reference name.
2. The topological element naming method based on replication class features according to claim 1, characterized in that: The method is applied to the replication-type features, including mirroring and arrays, which are implemented based on matrix transformations.
3. The topological element naming method based on replication class features according to claim 1, characterized in that: The naming format of the element name is {coordinate number + source element topology name + recursion level + feature type + feature number}, where the expression for the coordinate number is: x & y, and the coordinate number is used to record the matrix coordinate index position of the replicated feature; the expression for the source element topology name is: OrigNameRef; the expression for the recursion level is: NLevel; the expression for the feature type is: FeatType; and the expression for the feature number is: FFeatID. Wherein, when the replication class feature is a linear array, the linear array consists of N*M matrix transformations, x∈[0,N-1], y∈[0,M-1].
4. The topological element naming method based on replication class features according to claim 1, characterized in that: The reference feature is the feature upon which the copy class feature depends; The matrix chain information is obtained by encapsulating the reference features, geometric transformation information and calculation methods by defining an abstract data structure class. The matrix chain information is the geometric transformation information calculated by the copying feature based on the reference feature it depends on. The geometric transformation information of the non-copying feature is the matrix chain. The geometric transformation information of the copying feature is the set of matrix chains. The result container is an associated container that stores the matrix chain information. The retrieval of the result container is achieved through key-value pairs, and the instantiation of the result container retrieval is based on the abstract data structure class.
5. The topological element naming method based on replication class features according to claim 1, characterized in that: Based on the multi-branch tree structure, the copy matrices of each of the referenced features are traversed layer by layer to obtain matrix chain information, and the matrix chain information is saved to the result container, including: Based on any of the aforementioned copy-type features, extract all the reference features of the first level of the multi-branch tree structure of the reference features of the copy-type features, initialize i=1, wherein the multi-branch tree structure of the reference features of the copy-type features includes LevelTotal1 levels, the number of reference features of the first level of the multi-branch tree structure is FeatNum, i is a positive integer, and i is less than or equal to LevelTotal1. Initialize j=1, extract the j-th reference feature of the i-th level of the multi-branch tree structure. When the reference feature is the non-copying feature, the matrix chain information includes the reference feature and the matrix chain. The expression of the matrix chain information is FeatureA+Matrix(FeatCur). Alternatively, when the reference feature is the copying feature, the matrix chain set is recursively calculated using a depth-first search method. The expression of the matrix chain set is FeatureM+Matrix(FeatCur), where j is a positive integer, j is less than or equal to FeatNum, FeatureA is the non-copying feature, Matrix(FeatCur) is the transformation matrix of the copying feature, FeatCur is the copying feature, and FeatureM is the copying feature. j is incremented by 1, and the matrix chain information is determined based on the reference feature until j=FeatNum, so as to obtain the matrix chain information of all the reference features of the i-th level of the multi-branch tree structure, and all the matrix chain information is stored in the i-th level of the result container. Incrementing i by 1, the matrix chain information of all the reference features of the i-th level of the multi-branch tree structure is determined until i = LevelTotal1, thus obtaining the matrix chain information of all the reference features of the multi-branch tree structure, and storing all the matrix chain information in the result container.
6. The topological element naming method based on replication class features according to claim 1, characterized in that: The result container is traversed layer by layer to remove duplicates from the matrix chain information, including: The result container is traversed layer by layer. The matrix chain information is compared at any level in the result container. Duplicate matrix chain information is deduplicated to achieve local deduplication identification. The matrix chain information is compared at any two levels in the result container. Duplicate matrix chain information is deduplicated to achieve global deduplication identification. Alternatively, the matrix chain information can be obtained based on any of the aforementioned reference features, and the result container can be traversed layer by layer to perform a uniqueness check.
7. The topological element naming method based on replication class features according to claim 1, characterized in that: The geometric modeling engine is a geometric modeling library based on BRep boundary representation and having geometric and topological data structures. The geometric modeling engine can provide APIs for feature modeling.
8. The topological element naming method based on replication class features according to claim 1, characterized in that: The element names of each of the topological elements are determined during the modeling process of the physical entity, including: Based on any one of the replication-class features, determine the multi-branch tree structure of the replication-class features, set m=1, extract the m-th level of the result container and obtain the size of the m-th level of the result container, wherein the number of levels of the multi-branch tree structure is LevelTotal. 2; Set n=1, extract the nth matrix chain information of the mth level of the result container, parse the feature information in the matrix chain information to obtain the reference feature, wherein the reference feature is the original feature of the current reference dependency resolution; When the referenced feature is a base feature, it is transformed to the position of the final transformation matrix determined based on the matrix chain. When modeling is performed using the feature parameters of the referenced feature, a copy entity is obtained. The copy entity is named with topological elements. The copy entity and the historical result entity are subjected to Boolean operation. The result body is named with topological elements. Alternatively, when the reference feature is a modification feature, the naming information of the referenced element of the reference feature is obtained, the target element that matches the naming information is determined in the historical result entity, the target element is referenced to complete the modification shape to obtain the modification element, and the modification element is topologically named. Incrementing n by 1, traversing all the matrix chain information of the m-th level of the result container one by one, determining the element name of each topological element until n = Length, completing the shaping of all the reference features and the naming of the topological elements of the m-th level of the result container, where Length is the size of Map(m) and Map(m) is the m-th level of the result container; m is incremented by 1, and the result container is traversed layer by layer to complete the shaping of all the referenced features and the naming of the topology elements, until m = LevelTotal2.
9. A topological element naming device based on copy-type features, characterized in that, It includes at least one control processor and a memory for communicatively connecting to the at least one control processor; the memory stores instructions executable by the at least one control processor, which, when executed by the at least one control processor, enable the at least one control processor to perform the topology element naming method based on replication class features as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the topological element naming method based on replication class features as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Concurrency control method for replicated collaborative CAD system
CN104142813A
Facilitated editing of generative design geometry in computer aided design user interface
US10467807B1
Regular grid recognition in a CAD model
US20210081581A1