Geometry engine attribute extension methods, systems, electronic devices, and storage media
By establishing unique identifiers and mapping relationships for topological entities in an external database of the 3D geometric modeling engine, the problems of cumbersome attribute expansion and poor query performance are solved, achieving agile attribute expansion and fast response, and enhancing the flexibility of attribute linkage.
Patent Information
- Application Number
- CN202611263630.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-11-17
AI Technical Summary
Existing 3D geometric modeling engines suffer from problems in attribute expansion and management, such as cumbersome attribute expansion processes, high coupling between attributes and geometric topology, and poor query performance under large-scale models. In particular, the response time is too long when retrieving attributes across entities and levels, which affects the smoothness of interaction.
In a database independent of the geometry engine kernel, a unique identifier is established for each topological entity in the geometric model, and attribute data is stored in key-value pairs through mapping relationships to achieve bidirectional addressing between attribute data and topological entities. When the topology changes, attribute data processing operations are performed based on the changed mapping relationships, and attribute linkage rules are implemented using callback functions.
It achieves agility in the attribute expansion process, shortens response time to the millisecond level, improves attribute query performance under large-scale models, and enhances the flexibility of the attribute linkage mechanism.
Smart Images

Figure CN123115156A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer-aided design, and in particular to a method, system, electronic device, and storage medium for extending the attributes of a geometry engine. Background Technology
[0002] Current mainstream 3D geometric modeling engines (such as ACIS, Parasolid, and OpenCascade) generally adopt boundary representation as their underlying data architecture. This architecture organizes the information of a 3D model into three levels: topology, geometry, and attributes. Topology defines the structural skeleton of the model; geometry describes the precise shape and spatial position of each topological element; and attributes are used to carry non-shape semantic data such as materials, colors, and costs. These three elements work together through the engine's built-in association mechanism, forming the foundation for 3D model representation in industrial software.
[0003] However, existing attribute extension mechanisms have significant shortcomings. On the one hand, whether it's ACIS's attribute derivation mechanism, Parasolid's predefined attribute patterns, or OpenCascade's OCAF framework, attributes are highly coupled with topology and geometry code. Adding or modifying attributes often requires deriving new classes, modifying the underlying data structure, and adjusting serialization logic, resulting in a cumbersome process and long development cycle, making it difficult to meet the rapid extension needs of frequently changing business attributes in engineering applications. On the other hand, in scenarios such as large-scale assemblies, digital twins, and BIM, the number of model entities can reach millions, and each entity can carry multiple attributes. Existing engines typically store attribute data in a scattered manner in the form of nested objects or linked lists, resulting in low query and traversal efficiency. Especially when it is necessary to retrieve attributes across entities and levels, the response time may degrade from milliseconds to seconds or even minutes, severely restricting the smoothness of interaction in upper-layer applications.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This application provides a method, system, electronic device, and storage medium for extending the attributes of a geometry engine, in order to at least solve the technical problems of existing 3D geometry modeling engines in terms of attribute extension and management, such as cumbersome attribute extension process, high coupling between attributes and geometric topology, low query performance under large-scale models, and lack of flexibility in attribute linkage mechanism.
[0006] According to a first aspect of the embodiments of this application, a method for extending the attributes of a geometry engine is provided, comprising: establishing a record for each topological entity of a geometry model in a database independent of the geometry engine kernel, wherein each record contains a unique identifier for the corresponding topological entity, and establishing a mapping relationship between the unique identifier and the topological entity; storing attribute data in key-value pairs associated with the record based on the unique identifier, and realizing bidirectional addressing between the attribute data and the topological entity through the mapping relationship; and performing processing operations on the attribute data in the database corresponding to the topological entity involved in the change in the topological structure when the geometry engine performs a topological change operation, based on the change mapping relationship between the original topological entity and the topological entity involved in the change, and according to attribute linkage rules.
[0007] Optionally, the records are stored in a main table, and the database further includes a predefined attribute table for storing predefined business attributes; the method further includes: in response to an attribute extension request, adding attribute fields by modifying the table structure of the predefined attribute table.
[0008] Optionally, the mapping relationship is implemented by maintaining a binding object for each topological entity, the binding object containing the handle of the topological entity and its corresponding unique identifier.
[0009] Optionally, the attribute linkage rule is implemented through a registered callback function, which is invoked after the topology change operation is completed.
[0010] Optionally, the input parameters of the callback function include the original topology entity identifier list, the new topology entity identifier list, and the change type, wherein the change type includes at least one of splitting, merging, trimming, and deleting.
[0011] Optionally, the record also includes a traceability identifier, which is used to record the direct predecessor identifier of the current topological entity before the topological change.
[0012] Optionally, the database is an in-memory database.
[0013] According to a second aspect of the embodiments of this application, a geometry engine attribute extension system is provided, comprising: a record and mapping establishment module, configured to establish a record for each topological entity of a geometry model in a database independent of the geometry engine kernel, wherein each record contains a unique identifier for the corresponding topological entity, and establish a mapping relationship between the unique identifier and the topological entity; an attribute storage and addressing module, configured to store attribute data in key-value pairs associated with the record based on the unique identifier, and realize bidirectional addressing between the attribute data and the topological entity through the mapping relationship; and an attribute linkage module, configured to perform processing operations on the attribute data corresponding to the topological entity involved in the change in the database according to attribute linkage rules when the geometry engine performs a topology change operation that causes a change in the topology structure.
[0014] According to a third aspect of the present application, an electronic device is provided, including a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described above.
[0015] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the method described above.
[0016] In this embodiment, by storing attribute data independently in a database outside the geometry engine kernel, and establishing a unique identifier for each topological entity and a mapping relationship between that identifier and the topological entity, the addition, deletion, and modification operations of attribute data are performed on the database side without modifying the geometry engine kernel or recompiling. This solves the technical problem of cumbersome and time-consuming attribute extension processes, achieving agile attribute extension at runtime. Furthermore, since each topological entity corresponds to an independent record in the database, and query operations can be completed on the database side using an index mechanism, there is no need to traverse the internal topology of the geometry engine. This solves the technical problem of low performance in cross-entity attribute queries under large-scale models, achieving a response time reduction to milliseconds. In addition, by performing processing operations on attribute data after topology changes based on the changed mapping relationship and attribute linkage rules, the attribute transfer logic during topology changes can be customized according to business needs, solving the technical problem of the lack of flexibility in the attribute linkage mechanism and achieving the technical effect of customizable attribute transfer logic. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.
[0018] Figure 1 A flowchart of the geometry engine attribute extension method provided in the embodiments of this application; Figure 2 A flowchart illustrating a specific implementation of the geometry engine attribute extension method provided in this application embodiment; Figure 3 A schematic diagram illustrating the database table structure and its mapping relationship with geometric topological entities provided in this application embodiment; Figure 4 This is a schematic diagram illustrating the relationship between the binding object, database record, and geometric entity provided in the embodiments of this application. Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0019] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While some embodiments of this application are shown in the drawings, it should be understood that embodiments of this application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the embodiments of this application. It should be understood that the accompanying drawings and embodiments are for illustrative purposes only and are not intended to limit the scope of protection of this application.
[0020] The following description of this application is based on a geometric model. This method is applicable to both two-dimensional and three-dimensional geometric models.
[0021] According to a first aspect of the embodiments of this application, a method for extending geometry engine attributes is provided. Figure 1 A flowchart of the geometry engine attribute extension method provided in the embodiments of this application is shown below. Figure 1 As shown, the method includes the following steps: Step S102: In a database independent of the geometry engine kernel, create a record for each topological entity of the geometric model. Each record contains a unique identifier for the corresponding topological entity, and establish a mapping relationship between the unique identifier and the topological entity.
[0022] When the geometry engine starts or loads a geometric model, a database instance independent of the geometry engine kernel is created in memory. After obtaining the geometric model to be processed, all the topological structures contained in the model are traversed, and each topological entity is identified. For each topological entity traversed, an independent record is created in the database, and each record contains a globally unique identifier for that topological entity. At the same time, a binding object is established for that topological entity within the geometry engine. This binding object stores the memory handle of the topological entity in the geometry engine and its corresponding unique identifier, establishing a mapping relationship between the unique identifier and the topological entity.
[0023] Step S104: Based on the unique identifier, the attribute data is associated with the record in the form of key-value pairs, and bidirectional addressing between the attribute data and the topological entity is realized through the mapping relationship.
[0024] After establishing records and mapping relationships for all topology entities, for attribute data that needs to be stored, it is first determined whether the attribute is a predefined standard business attribute. If the attribute belongs to a predefined type such as material, boundary condition, or port information, the attribute data is stored in the corresponding predefined attribute table and associated with the record in the main table through a foreign key. If the attribute is a temporary or highly customized extended attribute, it is stored in the extended attribute table in key-value pair form, where the key field stores the attribute name, the value field stores the attribute data, and the foreign key field stores the unique identifier of the corresponding topology entity. After the attributes are stored, when it is necessary to retrieve the attribute data of a certain topology entity from the database, a matching query is performed in the predefined attribute table and the extended attribute table using the unique identifier of the topology entity; when it is necessary to locate the topology entity corresponding to a certain attribute from the geometry engine, the corresponding topology entity handle is found in the bound object using the unique identifier associated in the attribute record, realizing bidirectional addressing between attribute data and topology entities.
[0025] Step S106: When the geometry engine performs a topology change operation that causes a change in the topology structure, based on the change mapping relationship between the original topology entity and the topology entity involved in the change, and according to the attribute linkage rules, the attribute data corresponding to the topology entity involved in the change in the database is processed.
[0026] During subsequent geometric modeling, after the geometry engine performs topology change operations such as Boolean operations, segmentation, and trimming, it outputs a change mapping table. This table records the correspondence between the original topological entities and the newly generated topological entities after the change, as well as the type identifier of this change. Upon receiving this change mapping table, based on the correspondence and change type recorded therein, and according to preset attribute linkage rules, the engine performs corresponding processing operations on the attribute data in the database corresponding to the topological entities involved in the change. After the processing operations are completed, the attribute data stored in the database maintains a correspondence with the changed geometric model topology.
[0027] In this embodiment, by establishing an independent database outside the geometry engine kernel to store attribute data, and using unique identifiers and binding objects to construct a bidirectional mapping between database records and geometric entities, the addition, deletion, and modification operations of attribute data are all performed on the database side, and the geometry engine does not need to be aware of the specific content of the attribute data. Simultaneously, by storing dynamically extended attributes in key-value pairs, newly added attribute fields can be added and stored at runtime without modifying the database table structure or the geometry engine's data structure.
[0028] In some embodiments, records are stored in a main table, and the database also includes a predefined attribute table for storing predefined business attributes; the method further includes: in response to an attribute extension request, adding attribute fields by modifying the table structure of the predefined attribute table.
[0029] In the attribute management database of the geometry engine, a master table is used to store general information about each topological entity. Each record in this master table corresponds to a topological entity and contains a unique identifier for that entity. Simultaneously, predefined attribute tables are established in the database to store attribute data with clear business meaning. For example, a material attribute table stores material names and numbers, a boundary attribute table stores boundary types, and a port attribute table stores engineering parameters such as port phase and amplitude. The predefined attribute tables are linked to records in the master table through foreign key fields.
[0030] When business requirements change and new predefined attribute fields need to be added to a certain type of topological entity, there is no need to modify the geometry engine's source code or recompile the engine program. Commands to modify the table structure can be submitted directly to the database, such as adding a new column to the predefined attribute table to store the new attribute data. This operation is performed during the geometry engine's runtime; once the column is added, the predefined attribute table can begin receiving and storing the new attribute's data values. A unique identifier stored in the engine kernel serves as the association link, ensuring that the relationship between the new attribute and existing topological entities remains valid after the table structure is modified. Upper-layer applications can retrieve the new attribute information by querying the database. During this process, the geometry kernel's topological structure and geometric data remain unaffected, and the attribute extension operation remains independent of the engine kernel.
[0031] In this embodiment of the application, by storing attribute data independently in a predefined attribute table in the database and adding attribute fields by modifying the table structure during runtime, the expansion of business attributes does not depend on the modification or recompilation of the geometry engine kernel, thus shortening the development time required for the expansion operation.
[0032] In some embodiments, a predefined attribute table establishes a relationship with records in the main table through foreign key fields.
[0033] In the geometry engine's attribute management database, the main table stores general information about each topology entity, while the predefined attribute table stores attribute data for specific business types. The predefined attribute table contains a foreign key field that corresponds to the unique identifier field in the main table.
[0034] When a predefined type of business attribute needs to be recorded for a topology entity, a new record is created in the predefined attribute table. The corresponding business attribute data is then entered into the attribute fields of this new record, and the unique identifier of the topology entity in the main table is entered into the foreign key field of this new record. Through the value of this foreign key field, the database can establish a relationship between the attribute record in the predefined attribute table and the corresponding topology entity record in the main table.
[0035] When retrieving predefined type attributes of a specific topological entity, the unique identifier of that topological entity is used as the query condition. A matching search is performed in the foreign key field of the predefined attribute table to obtain all predefined attribute records corresponding to that topological entity. After the geometry engine performs a topology change operation, when it is necessary for the new topological entity to inherit the predefined attributes of the original entity, the unique identifier of the original entity in the main table is used as the query condition. A matching search is performed in the foreign key field of the predefined attribute table to obtain all predefined attribute records associated with the original entity. Then, a corresponding attribute record is created in the predefined attribute table, and the unique identifier of the new topological entity is entered into the foreign key field of the new record, thus completing the copying or transfer of predefined attributes from the original entity to the new entity.
[0036] In this embodiment of the application, by setting a foreign key field in the predefined attribute table and establishing a relationship with the unique identifier of the main table, the correspondence between the predefined attribute data and the topological entity records is clearly expressed through the foreign key mechanism of the database. During the query, the foreign key field can be used to directly match and retrieve data without traversing all the predefined attribute records.
[0037] In some embodiments, the mapping relationship is implemented by maintaining a binding object for each topology entity, the binding object containing the handle of the topology entity and its corresponding unique identifier.
[0038] When the geometry engine parses or loads a geometry model, it iterates through all topological entities contained in the model. For each topological entity encountered, a binding object is created in memory. This binding object contains two core data members: one is a memory handle or reference pointing to the topological entity within the geometry engine, and the other is a globally unique identifier generated for that topological entity. After the binding object is constructed, the correspondence between this unique identifier and the topological entity handle within the geometry engine is recorded in the binding object.
[0039] When the geometry engine needs to perform an attribute query, if the handle of a topological entity is known, it iterates through the binding objects to find the binding object containing that handle, extracts the unique identifier from it, and then uses that identifier to retrieve the corresponding attribute data from the database. Conversely, if a unique identifier is obtained through a database query and the topological entity in the geometry engine needs to be located, it iterates through the binding objects to find the binding object containing that identifier, extracts the topological entity handle from it, and thus obtains a reference to that topological entity. Both of these bidirectional lookup processes rely on the binding objects maintained for each topological entity.
[0040] In this embodiment of the application, by establishing a binding object between the geometry engine kernel and the database, a unified data structure is used to carry the correspondence between topological entity handles and unique identifiers. This allows the mutual positioning between attribute data and geometric entities to be completed directly through the binding object, avoiding the need to traverse the topological structure of the geometry kernel or rely on the engine's built-in attribute traversal interface during each lookup.
[0041] In some embodiments, attribute linkage rules are implemented through a registered callback function, which is invoked after the topology change operation is completed.
[0042] During the geometry engine startup or initialization phase, a callback function is registered. This callback function is pre-written according to business requirements and includes custom attribute passing logic. When the geometry engine performs topology change operations such as Boolean operations, splitting, and trimming, it generates a change mapping table. This table records the correspondence between the original topology entities and the newly generated topology entities after the change. After the topology change operation is completed and the change mapping table is generated, the geometry engine automatically calls the previously registered callback function, passing the change mapping table as an input parameter. After the callback function is executed, it reads the original entity identifier and the new entity identifier from the change mapping table, and according to the business logic written therein, searches the database for the attribute records carried by the original entity, and performs operations such as copying, merging, converting, or deleting attribute data on the records corresponding to the new entity. If no callback function is registered, no additional attribute processing is performed after the topology change operation is completed, and the attribute records corresponding to the new entity remain empty or have default values.
[0043] In this embodiment of the application, attribute linkage rules are implemented by using a registered callback function, so that the attribute transmission logic in the topology change process can be defined according to the actual business scenario, rather than being limited by the fixed attribute processing strategy built into the geometry engine.
[0044] In some embodiments, the input parameters of the callback function include the original topology entity identifier list, the new topology entity identifier list, and the change type, whereby the change type includes at least one of splitting, merging, trimming, and deleting.
[0045] When registering attribute-linked callback functions, three input parameters can be declared in the callback function definition according to actual business needs: the original topology entity identifier list, the new topology entity identifier list, and the change type. The original topology entity identifier list is used to record the unique identifiers of all original entities participating in the topology change operation; the new topology entity identifier list is used to record the unique identifiers of all newly generated entities after the topology change operation is completed; the change type is used to identify the specific category of the current topology change operation, which can be selected from one or more of the four types: split, merge, trim, and delete.
[0046] After the geometry engine completes the topology change operation, when calling the callback function, it fills in the original topology entity identifier list with the identifiers of the original entities involved in the change, fills in the new topology entity identifier list with the identifiers of the entities generated by the change, and fills in the change type parameter with the type identifier corresponding to the change. After the callback function is called, it selects the attribute transfer strategy that matches the current change type based on the value of the change type parameter. For example, when the change type is split, the attributes of the original entities are copied to all new entities; when the change type is merge, the attributes of multiple original entities are merged and assigned to the new entities; when the change type is trim, the attributes of the original entities are filtered to determine whether to inherit them to the new entities; when the change type is delete, the attribute records of the original entities are archived or discarded.
[0047] In this embodiment, by setting three input parameters for the callback function—the original entity identifier list, the new entity identifier list, and the change type—the callback function can accurately distinguish the specific category of the topology change based on the change type parameter during execution, and then execute differentiated attribute passing logic for different change types.
[0048] In some embodiments, the record may further include a tracing identifier, which is used to record the direct predecessor identifier of the current topology entity before the topology change.
[0049] A tracing identifier field is added to the main table in the database. This field stores the unique identifier of the direct predecessor entity of the current topological entity before the topology change operation. After the geometry engine performs a topology change operation, for each original entity and each newly generated entity involved in the change, the predecessor-descendant relationship between them is recorded. For a newly generated topological entity, the unique identifier of its direct source original entity is obtained, and this identifier is written as the tracing identifier into the tracing identifier field of the corresponding record of the new entity. For example, when a face is divided into two new faces, the unique identifier of the original face is written into the tracing identifier field of the records corresponding to these two new face entities. When a body is deleted, the tracing identifier field of the record corresponding to the deleted body can record the identifier of the direct predecessor of the body before an earlier change, so as to preserve the evolution history information of the body. When a topology change involves merging multiple original entities into a new entity, the unique identifiers of all original entities participating in the merger are recorded in the tracing identifier field of the record corresponding to the new entity.
[0050] Through this traceability identifier field, the records of each topological entity stored in the database form a traceable evolution chain. In subsequent queries, the direct predecessor identifier of any current entity is obtained by retrieving the traceability identifier field, and then the predecessor identifier is used as a search condition to obtain an even earlier predecessor identifier, and so on, tracing back until the original record when the topological entity was first created is found.
[0051] In this embodiment of the application, by adding a traceability identifier field to the database record of the topological entity, the correspondence between the new entity and its direct predecessor entity after each topological change can be persistently saved in the database. Subsequently, the complete evolution path of any current topological entity can be traced back step by step through this field.
[0052] In some embodiments, the database is an in-memory database.
[0053] A database instance is created or established in computer memory. All data storage and read / write operations of this database instance are performed within memory space, without relying on external storage devices such as hard drives. All write, modification, query, and deletion operations involving attribute data during the geometry engine's operation are executed within this in-memory database instance. When attribute data needs to be written to the database, the data is directly stored in the data structure in memory; when attribute data needs to be queried, the database engine reads the data directly from memory and returns the query results. This in-memory database instance persists during the geometry engine's operation and releases the memory resources it occupies when the geometry engine exits.
[0054] While writing attribute data to the in-memory database, the database's internal mechanism persistently stores the data in memory onto disk as files. This persistence operation is decoupled from the read / write operations of the in-memory database; that is, the read / write operations of the in-memory database are not affected by the blocking or delay of the persistence process, and the persistence operation is executed independently in the background. When the geometry engine restarts, the previously persisted attribute data can be reloaded from the disk files into the in-memory database, restoring the complete attribute information of the geometric model.
[0055] In this embodiment of the application, by storing all attribute data in an in-memory database, attribute query and read / write operations can be completed directly in memory space, eliminating the need to access the disk for each operation, thus improving access speed.
[0056] In some embodiments, the above record also includes default values for the geometric parameters of the topological entity, which include at least one of view transparency, view color, and view visibility.
[0057] In the attribute management database of the geometry engine, multiple fields are set for each topological entity record in the main table to store the view display parameters of that topological entity in the geometric model. These view display parameters include a view transparency field, which records the transparency value of the topological entity in the view; a view color field, which records the color code value of the topological entity in the view; and a view visibility field, which records the status indicator of whether the topological entity is displayed in the view.
[0058] During the geometric model loading process, when creating a corresponding record for each topological entity in the main table, default values are simultaneously entered into the view display parameter fields of that record. The view transparency field is filled with a preset transparency baseline value, the view color field with a color code value from a preset color scheme, and the view visibility field with a default visible status indicator. When the geometry engine performs a topology change operation, for newly generated topological entities, a new record is created for it in the main table, and the view transparency, view color, and view visibility fields are filled with the same parameter values as the original entity or parameter values determined by preset rules. When the upper-layer application renders the model, it reads the values of the view transparency, view color, and view visibility fields of the corresponding record for each topological entity from the database, configures the geometry engine's graphics rendering parameters based on these values, and then displays the model.
[0059] In this embodiment, by setting view transparency, view color, and view visibility fields in the main table record, the view display parameters of the topological entity and the topological geometry data are stored in the same database record. The upper-layer application reads the display parameters and geometry data uniformly from the database during rendering, without the need to maintain independent display attribute configurations.
[0060] In some embodiments, the record may also include the name identifier of the model to which the topological entity belongs.
[0061] In the attribute management database of the geometry engine, a name identifier field is set for each topological entity record in the main table. This field stores the name identifier of the geometric model to which the topological entity belongs. When a geometric model is loaded or imported into the geometry engine, the name information of the model is obtained, and when creating database records for each topological entity contained in the model, the model name identifier is filled into the name field of each record. If multiple topological entities belong to the same geometric model, the name field values in the corresponding records of these entities will be the same. If the geometric model contains sub-models or nested assembly structures, the name field can record both the model name and the sub-model name, or use a hierarchical naming expression.
[0062] When retrieving all topological entities under a specific model name, the model name identifier is used as the query condition, and a matching search is performed on the name field to obtain all topological entity records contained in that model. When it is necessary to distinguish or process topological entities from different geometric models, the name field value in each topological entity record can be read to identify which geometric model each entity belongs to. In topology change operations, when a new entity is generated by merging multiple entities belonging to different original models, the model name identifiers of each original entity involved in the merger are recorded in the new entity's name field.
[0063] In this embodiment, by setting the name identifier field of the model to which the entity belongs in the topology entity record, topology entities from different geometric models can be directly distinguished and filtered by model name through database query, without having to re-identify the model affiliation of the entity from the topology structure of the geometry engine.
[0064] In some embodiments, attribute data in key-value pair form is stored in an extended attribute table, which is associated with records in the main table through foreign key fields.
[0065] In the geometry engine's attribute management database, an extended attribute table is created to store dynamic extended attribute data expressed in key-value pairs. The extended attribute table contains three core fields: the first field is a foreign key field, used to store the unique identifier of the topological entity in the main table; the second field is a key field, used to store the attribute's name; and the third field is a value field, used to store the specific data content corresponding to the attribute.
[0066] When adding dynamic extended attributes to a topology entity, first obtain the unique identifier of the topology entity in the main table. Then, create a new record in the extended attribute table, fill in the obtained unique identifier into the foreign key field of the new record, fill in the attribute name into the key field, and fill in the attribute data content into the value field. Through the value of the foreign key field, a relationship is established between the attribute record in the extended attribute table and the corresponding record of the topology entity in the main table. When adding multiple dynamic extended attributes to the same topology entity, create a new record for each attribute in the extended attribute table. Fill in the same unique identifier into the foreign key field of each record, fill in the different attribute names into the key field, and fill in the corresponding data content into the value field.
[0067] When retrieving all dynamic extended attributes of a specific topological entity, use the entity's unique identifier as the query condition and perform a matching search in the foreign key field of the extended attribute table to obtain all key-value pair attribute records corresponding to that topological entity. To add a previously undefined extended attribute, simply create a new record in the extended attribute table and populate it with the corresponding data; no modification to the main table or other predefined attribute tables is required. To delete an extended attribute, simply delete the corresponding record in the extended attribute table; this does not affect the integrity of the topological entity records in the main table. After the geometry engine performs a topology change operation, if the new topological entity needs to inherit some or all of the original entity's dynamic extended attributes, use the original entity's unique identifier as the query condition and perform a matching search in the foreign key field of the extended attribute table to obtain all key-value pair records associated with the original entity. Then, create a corresponding record in the extended attribute table, populate it with the new topological entity's unique identifier and the original entity's corresponding key and value, and the copying or transfer of the dynamic extended attributes will be completed.
[0068] In this embodiment, by storing key-value pair attribute data independently in an extended attribute table and establishing a relationship with the main table record using a foreign key field, the addition, deletion, or modification operations of dynamic extended attributes are completed only within the extended attribute table, which is independent of the main table structure and other predefined attribute tables. Adding new extended attributes does not require modifying the database table structure.
[0069] In some embodiments, the method further includes: in response to an attribute query request, retrieving records of the target topological entity from the database using a structured query statement, and locating the corresponding topological entity through a mapping relationship based on the retrieved unique identifier.
[0070] When executing attribute queries, the upper-layer application or algorithm module constructs a structured query statement based on the query requirements. This statement contains query conditions and target fields. Query conditions can be the type of a topological entity, the value of a certain attribute field, or a combination thereof. The constructed structured query statement is then submitted to the database for execution, and the database retrieves data from the corresponding tables based on the conditions in the query statement.
[0071] After the retrieval is complete, the database returns a set of all records that meet the query criteria. Each record contains a unique identifier for the corresponding topological entity. After obtaining this unique identifier, the database searches for the topological entity handle corresponding to that unique identifier within the bound objects using the established mapping relationships. This handle then retrieves the corresponding topological entity object from the geometry engine. When the query results contain multiple records, the unique identifier is extracted from each record, and the corresponding topological entity is located through the mapping relationships, ultimately yielding all topological entities that meet the query criteria.
[0072] In this embodiment, attribute retrieval is performed in the database using structured query statements, and the query matching and condition filtering are handled by the database. Then, the unique identifier in the query result is converted into the topological entity handle in the geometry engine through mapping relationship, so that the attribute query can utilize the database's indexing mechanism and query optimization capabilities without having to traverse all the attribute data of the topological entities inside the geometry engine.
[0073] In some embodiments, the change mapping relationship between the original topology entity and the topology entity involved in the change is obtained by reading the change mapping table output by the geometry engine after performing the topology change operation.
[0074] When performing topology modification operations such as Boolean operations, splitting, and trimming, the geometry engine internally records the correspondence between the original topology entities and the newly generated topology entities after the operation, and outputs this correspondence as a modification mapping table. After the topology modification operation is completed, this modification mapping table is read to extract the identification information of the original topology entities and the identification information of the newly generated topology entities.
[0075] The change mapping table records the identifier of each original topology entity participating in this topology change operation, as well as the identifier of the new topology entity generated from the original entity after the change. For example, when a face is split into two new faces, the change mapping table records the correspondence between the identifiers of the original face and the identifiers of the two new faces; when multiple bodies are merged into a new body, the change mapping table records the correspondence between the identifiers of all original bodies involved in the merge and the identifier of the new body; when an entity is deleted, the change mapping table records the identifier of the deleted entity and the corresponding deletion operation flag.
[0076] After reading the change mapping table, the complete correspondence between the original topology entities involved in this topology change and the changed topology entities can be obtained. This correspondence is then passed to the attribute linkage module or callback function to determine how attribute data should be transferred between the original entities and the new entities.
[0077] In this embodiment, the correspondence between the original entity and the new entity is obtained by reading the change mapping table output by the geometry engine after performing the topology change operation. This allows the attribute linkage module to directly determine the scope of the attribute transfer object based on the standard output data provided by the geometry engine, without having to analyze the type and result of the topology change operation itself.
[0078] In some embodiments, the attribute linkage rule is a default processing strategy or a custom processing strategy; when a custom processing strategy is registered, the update operation is performed using the custom processing strategy; when no custom processing strategy is registered, the update operation is performed or not performed using the default processing strategy.
[0079] In the attribute management module of the geometry engine, a default attribute processing strategy is pre-configured. This default strategy specifies how attribute data should be processed when various topology change operations occur. For example, in a split operation, the default strategy may specify that all attributes of the original entity are copied to each newly generated entity; in a merge operation, the default strategy may specify that one attribute from multiple original entities is selected as the attribute of the new entity, or that the average of multiple attribute values is used as the attribute of the new entity; in a trim operation, the default strategy may specify that all attributes of the original entity are inherited by the trimmed entity portion; and in a delete operation, the default strategy may specify that the attribute records of the original entity are removed from the database.
[0080] Simultaneously, a registration interface for custom processing strategies is provided. Based on an understanding of the attribute transfer requirements in the current business scenario, processing strategies containing custom attribute processing logic are written and registered to the attribute management module through this registration interface. During runtime, a strategy registry is maintained to record currently registered custom processing strategies and their corresponding change types.
[0081] After each topology change operation, the policy registry is checked to see if a custom processing policy matching the current change type exists. If a corresponding custom processing policy exists, it is invoked, and its custom logic determines how attributes are passed. If no corresponding custom processing policy exists, the pre-configured default processing policy is invoked, and attributes are processed according to its preset logic. When the default processing policy is also not applicable to the current change scenario, no attribute processing operation is performed, and the attribute records corresponding to the new topology entity generated by the change remain empty or in their initial state.
[0082] In this embodiment of the application, by configuring the attribute linkage rule as a combination of the default processing strategy and the custom processing strategy, the attribute transfer is automatically executed according to the default rule when no custom strategy is registered, and the custom logic is used first when a custom strategy is registered, so that the attribute processing method can be adaptively selected in different business scenarios.
[0083] In some embodiments, processing operations are performed on attribute data, including at least one of copying, merging, transforming, or deleting the attribute data.
[0084] After the geometry engine performs a topology change operation, when the attribute linkage rules are triggered, various types of processing operations are performed on the attribute data based on the correspondence between the original entity and the new entity recorded in the change mapping table.
[0085] When the change type is split, an original entity is split into multiple new entities. A copy operation is used to copy all the attribute data carried by the original entity to the corresponding database record of each new entity, so that each new entity has the same attribute information as the original entity.
[0086] When the change type is merge, multiple original entities are merged into a new entity. The merge operation generates a new set of attribute data from the attribute data of the multiple original entities according to preset merge rules, and writes the generated attribute data into the corresponding database record of the new entity. Merge rules may include taking the average, maximum, or minimum value for numeric attributes, concatenating text attributes, or selecting one attribute from multiple original entities as the merge result.
[0087] When the change type is trimming, a portion of the original entity is trimmed. A transformation operation is then performed, and the geometric parameters in the attribute data of the original entity are adjusted or filtered according to the changes in the geometric parameters of the trimmed entity. The adjusted attribute data is then written into the record corresponding to the new entity after trimming.
[0088] When the change type is deletion, the original entity is removed. The deletion operation removes all records of the original entity from the database in the main table and related attribute tables, or marks it as deleted and prevents it from participating in subsequent queries and rendering while retaining historical data.
[0089] The four operations described above—copy, merge, transform, and delete—can be used individually or in combination, depending on the specific change scenario. For example, in a complex topology change operation where some original entities are split, some are merged, and some are deleted, different operation types are used to process the attributes based on the correspondence between each original entity and the target entity in the change mapping table.
[0090] In the embodiments of this application, by performing copying, merging, conversion or deletion operations on attribute data, the attribute data can be processed in different ways according to the change type and business needs during the topology change process. The combination of different types of operations can adapt to the diverse attribute transfer needs in complex topology change scenarios.
[0091] The following is a detailed description of the geometry engine attribute extension method provided in the embodiments of this application.
[0092] Figure 2 A flowchart illustrating a specific implementation of the geometry engine attribute extension method provided in this application is shown below. Figure 2 As shown, the method includes the following steps: Step 1: Build a flat in-memory database storage structure.
[0093] First, create or connect to an SQLite database instance in memory to ensure all data operations are performed in memory. During storage, the memory data is directly synchronized to disk, improving data access efficiency. Within this database, based on the geometric topological components, establish multiple flattened data tables centered around "Solid," "Face," "Edge," and "Vertex."
[0094] Create a master table (e.g., named t_shape) to store common information for all topological entities. Its structure is as follows: id (TEXT): A globally unique identifier for the topological entity, serving as the primary key; pid (TEXT): The parent ID, used to record the hierarchical relationship between entities (e.g., which body a face belongs to); name (TEXT): The model name; type (TEXT): The model type, with enumeration values of FOLDER, SOLID, FACE, EDGE, VERTEX; view_transparency (REAL): The view transparency; view_color (TEXT): The view color; view_visible (INTEGER): The view visibility; props_materials_id (TEXT): A foreign key, associated with the material property table; props_boundary_id (TEXT): A foreign key, associated with the boundary condition table; props_port_id (TEXT): A foreign key, associated with the port property table; props_ext_id (TEXT): A foreign key, associated with the extended property table. Simultaneously, auxiliary tables are created to support dynamic expansion of attributes and complex business logic: Material attribute table (t_props_materials): stores information such as material name, color, and number; Boundary attribute table (t_props_boundary): stores information such as boundary type and number; Port attribute table (t_props_port): stores engineering parameters such as port type, phase, and amplitude; Extended attribute table (t_props_ext): adopts a key-value pair structure to store any undefined dynamic attributes, achieving completely schema-free expansion.
[0095] Step 2: Establish a two-way mapping between geometry engine topology entities and database records.
[0096] Taking OpenCascade as an example, internally, the geometry modeling engine creates a binding object (HtsCadBridgeItem) for each topological shape (TopoDS_Shape) that needs to be processed. This binding object contains at least the following members: a unique identifier (uuid) of string type, which strictly corresponds to the id field in the database table t_shape; a handle or reference to the original geometric topological entity (TopoDS_Shape); and a pointer to an in-memory database object (HtsCadDb).
[0097] When a geometric model is parsed for the first time, its complete topology is traversed (all volumes, faces, edges, and vertices are traversed), a new unique ID is generated for each topological entity, and information such as the entity's type, parent-child relationships, and geometric parameters (such as default values for color and transparency) is inserted as a new record into the t_shape table. This process completely transforms the original unstructured B-Rep tree structure into flattened relational table data.
[0098] The topological entities in the geometric kernel store only their geometry, topology, and unique ID. All attribute data is associated through this ID and stored independently in an external in-memory database. This forms the architectural foundation for decoupling and rapid expansion. Abandoning the traditional nested object tree structure of B-Rep, the complex geometric model is decomposed into four basic elements: volume, face, edge, and vertex. These are stored in a flat, row-based relational database table, utilizing the row-column structure of the database instead of a complex pointer network, thus laying the foundation for efficient querying.
[0099] Figure 3 A schematic diagram illustrating the database table structure and its mapping relationship with geometric topological entities provided in the embodiments of this application, as shown below. Figure 3 As shown, the geometric model contains a complete boundary representation topology, which is organized hierarchically by four basic elements: volume, face, edge, and vertices. A volume contains multiple faces, each face contains multiple edges, and each edge contains two vertices. After loading the geometric model into the geometry engine, each topological entity in this topology is traversed, and a corresponding database record is generated for each entity.
[0100] On the database side, the master table stores general information about each topological entity, with each record in the master table corresponding to a topological entity. Master table records contain a unique identifier field to store the globally unique identifier of the topological entity; a type identifier field to indicate whether the topological entity is a volume, face, edge, or vertex; and a parent identifier field to store the unique identifier of the topological entity's parent entity in the topological structure. For example, the parent identifier in a face record points to the unique identifier of the volume to which the face belongs. Through the parent identifier field, a hierarchical relationship corresponding to the geometric topology is formed between the records in the master table.
[0101] The main table record also includes view transparency, view color, and view visibility fields, used to store the display parameters of the topological entity in the view. In addition, the main table record includes several foreign key fields, each pointing to a different attribute table. Specifically, the material attribute table is linked to the main table record via a foreign key, used to store information such as material name, color, and number; the boundary attribute table is linked to the main table record via a foreign key, used to store information such as boundary type and number; and the port attribute table is linked to the main table record via a foreign key, used to store engineering parameters such as port type, phase, and amplitude. The extended attribute table is also linked to the main table record via a foreign key. This table uses a key-value pair structure, containing foreign key fields, attribute key fields, and attribute value fields, used to store any dynamically extended attributes that are not predefined, enabling completely free schema expansion.
[0102] Figure 4 This is a schematic diagram illustrating the relationship between the bound object, database records, and geometric entities provided in the embodiments of this application, as shown below. Figure 4 As shown, within the geometry engine, each topological entity corresponds to a binding object. This binding object establishes a one-to-one correspondence with the topological entity in the geometry engine and the record in the database.
[0103] The topological entities within the geometry engine are stored in the geometry kernel's memory space as topological data objects. These topological data objects contain the entity's geometric definition and topological structure information, but do not contain business attribute data. The master table record in the database contains the unique identifier of the topological entity and all attribute data. The attribute data is further distributed in predefined attribute tables and extended attribute tables, and is linked to the master table record through foreign keys.
[0104] The binding object acts as a bridge connecting the geometry engine and the database, containing two core data members. The first member is a handle to the geometry entity, which points to the memory address or reference of the corresponding topology data object within the geometry engine. This handle allows direct access to the geometry and topology of the topology entity. The second member is a unique identifier, whose value matches the unique identifier field of the corresponding record in the database's main table. This identifier allows retrieval of all attribute data for the topology entity from the database.
[0105] It should be noted that, Figure 4 The bound object in Figure 3 The records in the main table are mapped one-to-one using a unique identifier field.
[0106] Step 3: Enable rapid expansion of properties at runtime.
[0107] This method supports two attribute extension modes: static column extension and dynamic key-value pair extension. Static column extension allows developers to predefine columns in the `t_shape` main table or dedicated attribute table for highly generic business attributes (such as materials and ports). When adding such attributes, simply execute the SQLite `ALTER TABLE ADD COLUMN` command without recompiling the engine code. Dynamic key-value pair extension eliminates the need to modify the table structure for variable, temporary, or highly customized attributes. Simply insert the attribute to be extended into the `t_props_ext` table as a key-value pair and associate it with the main entity via `props_ext_id`. For example, to add a surface roughness attribute to a surface, simply create a new record in the extended attribute table, enter the surface's unique identifier in the foreign key field, enter the surface roughness in the key field, and enter the corresponding roughness value in the value field.
[0108] Static column extensions allow online modification of the table structure via ALTER TABLE, supporting the dynamic addition of predefined attributes; dynamic key-value pair extensions, through the t_props_ext general extension table, support the addition of any number and type of runtime attributes, achieving true schema-free operation.
[0109] Step 4: High-performance attribute query and association retrieval.
[0110] Utilizing the indexing mechanism of the SQLite in-memory database (creating indexes on commonly used query fields such as id, type, and props_materials_id), attribute queries can be executed. Upper-level applications or algorithm modules can then quickly retrieve target entities using standard SQL statements. For example, a structured query containing a join can be executed, linking the main table and the material attribute table via foreign key fields, and setting query conditions on the material name field to retrieve all topological entity identifiers for the specified material.
[0111] Because all data resides in memory and is indexed, this query returns results in milliseconds. After obtaining the list of entity IDs, the HtsCadBridgeItem mapping object quickly locates the TopoDS_Shape in memory, thus achieving a seamless switch from attribute to geometry.
[0112] Step 5: Linking topology change attributes based on historical relationships.
[0113] When the geometry engine performs topology modification operations such as Boolean operations, splitting, and pruning, the results generate a series of new topological entities (new bodies, new faces, new edges, and new vertices). These new entities have a definite historical relationship with the original entities before the operation. This relationship is used to achieve automatic inheritance and linkage of attributes.
[0114] First, before the geometry engine performs topology changes, a unique ID is obtained for each participating topology entity (TopoDS_Shape) through HtsCadBridgeItem, and the ID and its corresponding in-memory database attribute record are recorded.
[0115] After a topology change operation is completed, the geometry engine outputs a change mapping table, which records the correspondence between newly generated topological entities and original topological entities. For example, after a split operation, an original face (ID_old_face) may generate two new faces (ID_new_face1, ID_new_face2); after a Boolean union operation, some of the original bodies may be retained, some may be deleted, and some may be formed by merging multiple original faces.
[0116] This stage provides an attribute-linked callback interface, allowing users to register custom processing functions for different types of topology changes (splitting, merging, pruning, etc.). The input parameters for the callback functions include: a list of IDs of the original entities (vector). <string>old_ids); a list of IDs for the new entity (vector) <string>new_ids; change type (SPLIT, MERGE, TRIM, DELETE, etc.).
[0117] In the callback function, you can write any logic to determine how attributes are passed based on business needs. For example: direct inheritance: copy the material attributes of the original entity to all new entities (suitable for splitting operations); weighted merging: when multiple entities are merged into one, calculate the material attributes of the new entity based on the volume weight of the original entity; conditional discarding: if the new entity is part of the original entity and its area is less than a threshold, then the attribute is not inherited.
[0118] Inside the callback function, UPDATE or INSERT operations are performed on the t_shape table or related attribute tables by accessing the in-memory database (SQLite) to complete the copying, merging, or transformation of attribute records. Since all attribute operations are performed in the in-memory database, they are completely decoupled from the geometry kernel's calculation process, ensuring both performance and preventing attribute code from interfering with kernel stability.
[0119] This method also provides a default historical relationship tracking mechanism: an optional `source_id` field is added to the `t_shape` table to record the direct predecessor ID of the current entity. When a topology change occurs, the `source_id` of the new entity is automatically set to the ID of the original entity, thus forming a traceable attribute evolution chain. More complex attribute inheritance logic can be implemented by querying this chain.
[0120] By leveraging the historical mapping relationships of entities before and after topology changes (such as segmentation and merging tracing), and through custom callback functions, the inheritance, merging, splitting, or discarding of attributes can be flexibly controlled. Simultaneously, the evolution history of attributes is recorded through tracing fields such as `source_id`, supporting complete attribute chain tracing. Through `HtsCadBridgeItem` binding objects, a bidirectional, traceable mapping relationship between database records (in-memory rows) and geometric kernel entities (in-memory objects) is dynamically maintained at runtime, ensuring consistency and efficiency in attribute access and geometric operations.
[0121] Compared with existing technologies, this application has the following technical advantages: 1. True runtime-based rapid attribute expansion. Through dual support for dynamic key-value pairs (such as t_props_ext) and online DDL (ALTER TABLE ADD COLUMN), developers can add, delete, or modify business attribute fields for any topological entity at runtime without writing any C++ derived classes, recompiling the geometry engine, or modifying the engine's underlying data structure. Attribute expansion time is reduced from days to minutes using traditional methods, significantly improving the agile development capabilities of industrial software.
[0122] 2. Complete decoupling of geometry topology and attributes. The geometry engine kernel (such as TopoDS_Shape) only retains the topology, geometric definitions, and unique identifiers (IDs). All business attributes (view parameters, materials, boundary conditions, port information, custom extended fields, etc.) are independently stored in an external in-memory database (SQLite). This architecture makes the geometry kernel more lightweight and stable, unaffected by the ever-changing business requirements of upper layers; at the same time, the same geometric model can be equipped with different attribute sets to meet the data view requirements of different stages such as design, simulation, and manufacturing.
[0123] 3. Significant performance improvement in attribute querying. By adopting a flat relational table structure (treating volumes, faces, edges, and vertices as independent record rows) and utilizing the B-tree indexing mechanism of the in-memory database (creating indexes on fields such as id, type, and props_materials_id), the response time for complex attribute queries involving millions of entities with multiple conditions and across multiple levels (such as "finding all visible faces made of steel") is reduced from seconds or even minutes using traditional object traversal methods to milliseconds. This performance breakthrough has substantial significance for scenarios such as large-scale assemblies, digital twins, and urban environments.
[0124] 4. Flexible Attribute Linkage Based on Historical Relationships. This application allows for custom rules for attribute inheritance, merging, splitting, or discarding based on historical mapping relationships before and after topology changes (such as entity segmentation, merging, and trimming). Compared to existing engines that only provide fixed attribute preservation strategies (such as simple "follow face" or "discard"), this application offers greater flexibility and traceability. Furthermore, by adding traceability fields such as `source_id` to the data table, a complete attribute evolution chain can be formed, meeting the stringent requirements for data evolution history in professional fields such as CAE simulation parameter transfer and BIM construction progress tracking.
[0125] 5. Excellent cross-platform and cross-engine portability. Since this application only relies on SQLite, a lightweight, zero-configuration, cross-platform in-memory database engine, and the attribute storage scheme is independent of the proprietary APIs of specific geometry engines (ACIS, Parasolid, OpenCascade, domestic engines, etc.), this method can be easily ported to different CAD / CAE / CAM software projects, and can even be shared by multiple systems as an independent attribute management module.
[0126] 6. Low implementation cost and easy integration. The HtsCadBridgeItem binding class and its accompanying data table structure provided in this application are designed with simplicity and clear interfaces. They can be quickly integrated with existing geometry engines through either an encapsulation adaptation layer or source code-level modification. For existing large-scale projects, there is no need to overhaul the original architecture; simply adding a database query forwarding layer to the attribute access path is sufficient to obtain all the aforementioned benefits.
[0127] According to a second aspect of the embodiments of this application, a geometry engine attribute extension system is provided. This geometry engine attribute extension system includes: a record and mapping establishment module, an attribute storage and addressing module, and an attribute linkage module. The geometry engine attribute extension system will now be described in detail.
[0128] The record and mapping module is used to create a separate record for each topological entity in the geometric model within a database independent of the geometry engine kernel. Each record contains a unique identifier for the corresponding topological entity and establishes a mapping relationship between the unique identifier and the topological entity. This module is invoked when the geometry engine starts or loads the geometric model. First, it creates a database instance independent of the geometry engine kernel in memory. Then, it traverses the entire topological structure of the geometric model to be processed, identifying each topological entity. For each topological entity encountered, this module creates a separate record for it in the database, writes the globally unique identifier of the topological entity into the record, and establishes a binding object for the topological entity within the geometry engine. This binding object stores the memory handle of the topological entity and the corresponding unique identifier to establish a mapping relationship between the two.
[0129] The attribute storage and addressing module, based on the record and mapping relationships established by the record and mapping creation module, associates attribute data with records in key-value pairs using unique identifiers, and enables bidirectional addressing between attribute data and topological entities through mapping relationships. This module receives attribute data storage requests from upper-layer applications or the geometry engine. For attribute data to be stored, it first determines whether the attribute is a predefined standard business attribute. If the attribute belongs to a predefined type such as material, boundary condition, or port information, the module stores the attribute data in the corresponding predefined attribute table and associates it with a record in the main table through a foreign key. If the attribute is a temporary or highly customized extended attribute, the module stores the attribute in key-value pairs in the extended attribute table, where the key field stores the attribute name, the value field stores the attribute data, and the foreign key field stores the unique identifier of the corresponding topological entity. After the attribute data is stored, when it is necessary to retrieve the attribute data of a certain topological entity from the database, this module performs a matching query in the predefined attribute table and the extended attribute table using the unique identifier of the topological entity; when it is necessary to locate the topological entity corresponding to a certain attribute from the geometry engine, this module searches for the corresponding topological entity handle in the bound object using the unique identifier associated in the attribute record, thereby realizing bidirectional addressing between attribute data and topological entities.
[0130] The attribute linkage module, based on the record and mapping relationships established by the record and mapping creation module and the attribute data stored by the attribute storage and addressing module, processes the attribute data corresponding to the affected topological entities in the database when the geometry engine performs a topology change operation that alters the topology structure. This is done according to the attribute linkage rules and the change mapping relationship between the original topological entities and the affected topological entities. This module is triggered after the geometry engine performs topology change operations such as Boolean operations, segmentation, and trimming. First, the module reads the change mapping table output by the geometry engine after the topology change operation, extracting the identification information of the original topological entities and the newly generated topological entities after the change. Then, according to the correspondence and change type recorded in the change mapping table, and following preset attribute linkage rules, the module performs operations such as copying, merging, converting, or deleting on the attribute data corresponding to the affected topological entities in the database. After the processing is complete, the attribute data stored in the database maintains a correspondence with the changed geometric model topology.
[0131] It should be noted that the record and mapping establishment module, attribute storage and addressing module, and attribute linkage module mentioned above correspond to the steps in the method embodiments. The examples and application scenarios implemented by these modules and their corresponding steps are the same, but not limited to the content disclosed in the method embodiments. In the implementation of this system, each module can be implemented as a software functional module, or as a hardware circuit or a combination of hardware and software. During the operation of the computer device, when the above modules are loaded and executed, they can achieve the same function as the corresponding method steps and achieve the same technical effect. Since each module in this system corresponds to a step in the method embodiments, this system also possesses all the beneficial technical effects described in the method embodiments, which will not be repeated here.
[0132] According to a third aspect of the present application, an electronic device is provided, including a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described above.
[0133] refer to Figure 5 The present invention describes a structural block diagram of an electronic device that can serve as a server or client in embodiments of this application, which is an example of a hardware device that can be applied to various aspects of this application. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the application described and / or claimed herein.
[0134] like Figure 5 As shown, the electronic device includes a computing unit 501, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. The RAM 503 may also store various programs and data required for the operation of the electronic device. The computing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0135] Multiple components in the electronic device are connected to I / O interface 505, including: input unit 506, output unit 507, storage unit 508, and communication unit 509. Input unit 506 can be any type of device capable of inputting information into the electronic device. Input unit 506 can receive input digital or character information and generate key signal inputs related to the settings and / or function control of the electronic device. Output unit 507 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 508 may include, but is not limited to, disks and optical discs. Communication unit 509 allows the electronic device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, and wireless communication transceivers, such as Bluetooth devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0136] The computing unit 501 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, CPUs, graphics processing units (GPUs), various special-purpose artificial intelligence (AI) computing units, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any suitable processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above. For example, in some embodiments, the method embodiments of this application can be implemented as computer programs tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on an electronic device via ROM 502 and / or communication unit 509. In some embodiments, the computing unit 501 can be configured to perform the methods described above by any other suitable means (e.g., by means of firmware).
[0137] In one application scenario, the electronic device is an engineering workstation equipped with computer-aided design (CAD) software. The workstation's memory stores a computer program that implements a method for extending geometric engine attributes. When the engineer starts the CAD software, the workstation's processor reads the computer program from memory and executes it, thereby automatically performing the steps described in the above method embodiment during the CAD software's operation. A monitor connected to the workstation displays a view of the geometric model, and a mouse and keyboard receive the engineer's commands.
[0138] In another application scenario, the electronic device is a cloud server. The cloud server's memory stores a computer program that implements the geometry engine's attribute extension method. When a geometry model processing request is submitted to the cloud server via a local terminal, the cloud server's processor reads the computer program from memory and executes it. This completes operations such as loading the geometry model, storing and managing attribute data, and linking attributes during topology changes in the cloud, and then returns the processed results to the terminal. There is no need to install the geometry engine on the local terminal; the above method can be used to extend and manage the geometry model's attributes via the network.
[0139] When the processor executes the computer program, it first establishes records and mapping relationships for each topological entity in a database independent of the geometry engine kernel. Then, based on unique identifiers, it associates and stores attribute data with records in key-value pairs and establishes bidirectional addressing. Finally, when a topological change occurs, it performs processing operations on the attribute data based on the changed mapping relationship and attribute linkage rules. Since the processor of the electronic device fully implements all the steps of the above method embodiments when executing the computer program, the electronic device also possesses all the technical effects achieved by the above method embodiments.
[0140] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the method described above.
[0141] In specific embodiments, the computer-readable storage medium can be any physical medium capable of storing a computer program. For example, the storage medium can be a read-only memory, random access memory, disk storage medium, optical disk storage medium, flash memory device, solid-state drive, or other non-transitory storage medium. The computer program is stored in the storage medium in the form of binary code or executable instructions. When the storage medium is installed or connected to a computer device, the processor of the computer device can read and execute the computer program in the storage medium, thereby executing the geometry engine attribute extension method described in any of the above embodiments.
[0142] In one application scenario, software developers can store the computer program implementing the aforementioned geometry engine attribute extension method on an optical disc or a Universal Serial Bus (USB) flash drive, and then distribute the disc or flash drive to terminals. After the terminal connects the disc or flash drive to its computer device, it installs or loads the computer program into the computer device's memory, and the processor executes the program, thus implementing the geometry engine attribute extension function on the local computer device.
[0143] In another application scenario, the computer program is stored on a non-transitory storage medium on a remote server. The computer program can be downloaded remotely or invoked online via a computer network. The downloaded program can be executed by the processor of the local computer device, or the program can be executed by the processor of the remote server and the execution result can be returned to the local computer device. This can also achieve the steps of the geometry engine attribute extension method described above.
[0144] After the computer program is loaded into the computer device, when the processor of the computer device executes the program, it first establishes records and mapping relationships for each topological entity in a database independent of the geometry engine kernel. Then, based on unique identifiers, it associates and stores attribute data with records in key-value pairs and establishes bidirectional addressing. Finally, when a topological change occurs, it performs processing operations on the attribute data based on the changed mapping relationship and attribute linkage rules. Since the computer program, when executed by the processor, completely implements all the steps of the above method embodiments, the computer-readable storage medium also possesses all the technical effects achieved by the above method embodiments.
[0145] It should be noted that the term "comprising" and its variations used in the embodiments of this application are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; and the term "some embodiments" means "at least some embodiments". The modifications of "one" and "multiple" mentioned in the embodiments of this application are illustrative and not restrictive. Those skilled in the art should understand that, unless explicitly indicated otherwise in the context, they should be understood as "one or more".
[0146] The steps described in the method embodiments provided in this application can be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of protection of this application is not limited in this respect.
[0147] The term "embodiment" in this specification refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply independence or alternativeity from other embodiments. The various embodiments in this specification are described in a related manner, with reference to each other for similar or identical parts. In particular, for apparatus, device, and system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, and relevant details are referred to in the description of the method embodiments.
[0148] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.< / string> < / string>
Claims
1. A method for extending the attributes of a geometry engine, characterized in that, include: In a database independent of the geometry engine kernel, a record is created for each topological entity of the geometric model. Each record contains a unique identifier for the corresponding topological entity, and a mapping relationship is established between the unique identifier and the topological entity. Based on the unique identifier, the attribute data is associated with the record in the form of key-value pairs, and bidirectional addressing between the attribute data and the topological entity is realized through the mapping relationship; When the geometry engine performs a topology change operation that causes a change in the topology structure, based on the change mapping relationship between the original topology entity and the topology entity involved in the change, and according to the attribute linkage rules, the attribute data corresponding to the topology entity involved in the change in the database is processed.
2. The method according to claim 1, characterized in that, The records are stored in a main table, and the database also includes a predefined attribute table, which stores predefined business attributes; the method further includes: In response to an attribute extension request, attribute fields are added by modifying the table structure of the predefined attribute table.
3. The method according to claim 1, characterized in that, The mapping relationship is implemented through binding objects maintained for each topological entity. The binding objects contain the handle of the topological entity and its corresponding unique identifier.
4. The method according to claim 1, characterized in that, The attribute linkage rules are implemented through a registered callback function, which is invoked after the topology change operation is completed.
5. The method according to claim 4, characterized in that, The input parameters of the callback function include the original topology entity identifier list, the new topology entity identifier list, and the change type, wherein the change type includes at least one of split, merge, trim, and delete.
6. The method according to claim 1, characterized in that, The record also includes a traceability identifier, which is used to record the direct predecessor identifier of the current topology entity before the topology change.
7. The method according to claim 1, characterized in that, The database is an in-memory database.
8. A geometry engine attribute extension system, characterized in that, include: The record and mapping establishment module is used to establish a record for each topological entity of the geometric model in a database independent of the geometry engine kernel. Each record contains a unique identifier for the corresponding topological entity, and establishes a mapping relationship between the unique identifier and the topological entity. The attribute storage and addressing module is used to associate and store attribute data with the record in key-value pairs based on the unique identifier, and to realize bidirectional addressing between the attribute data and the topological entity through the mapping relationship; The attribute linkage module is used to process the attribute data corresponding to the topological entities involved in the change in the database based on the change mapping relationship between the original topological entities and the topological entities involved in the change, and according to the attribute linkage rules, when the geometry engine performs a topology change operation that causes a change in the topology structure.
9. An electronic device comprising a processor and a memory, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.
