Model lightweight method and device, computer equipment, medium and program product
By performing part recognition and lightweight processing on the aircraft engine model, lightweight models are generated, and the configuration information of modified parts are rendered and modified in the rendering engine, the problem of inefficiency in the existing technology is solved, and efficient rendering and rapid iterative design are achieved.
Patent Information
- Application Number
- CN202411870474.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2044-12-18
AI Technical Summary
In the field of modeling and simulation of aircraft engines, the prior art needs to re-convert the FBX format and render the rendering engine after each modification of the CAD three-dimensional model, resulting in overall inefficiency.
By identifying the modified model part, generating configuration files, determining the modified parts in a differential comparison, performing lightweight processing, generating a lightweight model, and using the rendering engine to render the configuration information and lightweight model of the modified parts in the initial rendering model.
It reduces the amount of calculation during the rendering process, improves the rendering efficiency, reduces resource consumption, optimizes the user experience, and supports rapid iterative design and modification.
Smart Images

Figure CN120068358A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of aero-engine modeling and simulation, and particularly to a model lightweighting method, device, computer device, medium, and program product. Background Art
[0002] In industrial design, CAD software is widely used for high-precision three-dimensional model modeling. However, these three-dimensional models built based on CAD usually contain a large amount of geometric data and are difficult to be efficiently loaded in a conventional real-time rendering engine. Therefore, in the related art, it is usually necessary to perform lightweighting processing on the three-dimensional models built based on CAD and convert them into other formats recognizable by the rendering engine, such as the FBX format. When the rendering engine loads the model file in the FBX format, the efficiency will be significantly improved.
[0003] In the field of aero-engine modeling and simulation, on the one hand, the number of components of an aero-engine is large, and on the other hand, the three-dimensional model of an aero-engine needs to be iteratively modified multiple times. However, for files in the FBX format, after each modification of the three-dimensional model of CAD, it is necessary to re-convert the three-dimensional model of CAD into the FBX format to obtain a new model file in the lightweighted FBX format, and then the new model file is handed over to the rendering engine for rendering. Moreover, the rendering engine also needs to re-render each part in the three-dimensional model. Therefore, adopting the model lightweighting solution of the related technology in the field of aero-engine modeling and simulation will result in low overall efficiency.
[0004] Therefore, how to improve the efficiency of aero-engine modeling and simulation is an urgent problem to be solved. Summary of the Invention
[0005] Based on this, in view of the above technical problems, it is necessary to provide a model lightweighting method, device, computer device, medium, and program product that can improve the efficiency of aero-engine modeling and simulation.
[0006] In a first aspect, the present application provides a model lightweighting method, including:
[0007] After obtaining a modified model obtained by modifying an initial model, perform part recognition on the modified model to obtain a configuration file of the modified model, where the configuration file includes configuration information of various types of meta-parts, and the configuration information includes the dependency relationships, parameter information, and spatial positions of the repeated parts corresponding to each meta-part under the parent object it depends on; wherein, the meta-parts depending on the same parent object are not repeated;
[0008] Perform a difference comparison between the configuration files of the initial model and the modified model respectively, and determine the modified meta-parts as modified parts according to the comparison result;
[0009] Perform lightweight processing on the target model to obtain the lightweight model corresponding to the target model, where the target model is the part model corresponding to the modified part in the modified model;
[0010] Call the rendering engine, and use the rendering engine to render the configuration information of the modified part and the lightweight model in the initial rendering model to obtain the target rendering model corresponding to the modified model; where the initial rendering model is obtained by the rendering engine rendering the configuration file of the initial model and the lightweight models corresponding to each type of meta-part in the initial model.
[0011] In one embodiment, the process of determining duplicate parts includes:
[0012] Determine similar part pairs from the structure tree of the modified model, where the similar part pairs include two parts with the same structural parameters and / or a similarity of names exceeding the similarity threshold; the structure tree includes the names, structural parameters of each part, and the dependency relationships between the parts.
[0013] If it is determined that the two parts in the similar part pair both depend on the same parent object, then check the two parts in the similar part pair, and determine whether the two parts are duplicate parts according to the check result.
[0014] In one embodiment, checking the two parts in the similar part pair and determining whether the two parts are duplicate parts according to the check result includes:
[0015] Perform meshing processing on the two parts in the similar part pair respectively, and determine the check result according to the result of the meshing processing, where the check result indicates whether the number of mesh vertices corresponding to the two parts is the same or different;
[0016] If the check result indicates that the number of mesh vertices corresponding to the two parts is the same, then determine that the two parts are duplicate parts.
[0017] In one embodiment, performing lightweight processing on the target model to obtain the lightweight model corresponding to the target model includes:
[0018] Call the meshing component to perform meshing processing on the surfaces in the target model to obtain multiple sub-planes corresponding to the surfaces;
[0019] Perform lightweight processing on the multiple sub-planes to obtain the spliced lightweight surface, where the lightweight processing at least includes fitting and splicing and format conversion;
[0020] Replace the surface in the target model with the lightweight surface to obtain a lightweight model corresponding to the target model.
[0021] In one embodiment, the structure tree further includes the material, number, name, and lightweight accuracy of each part, and the method further includes:
[0022] Update the configuration information of each meta-part in the configuration file based on the structure tree of the modified model;
[0023] Among them, the updated configuration information further includes the material and lightweight accuracy.
[0024] In one embodiment, the using the rendering engine to render the configuration information of the modified part and the lightweight model in the initial rendering model to obtain a target rendering model corresponding to the modified model includes:
[0025] Use the updated configuration information corresponding to the modified part as rendering parameters, and use the lightweight model corresponding to the modified part as a rendering object to input into the rendering engine;
[0026] The rendering engine renders the rendering object in the initial rendering model based on the rendering parameters to obtain a target rendering model corresponding to the modified model.
[0027] In a second aspect, the present application further provides a model lightweighting device, which includes a part recognition module, a modified part determination module, a lightweighting processing module, and a rendering module, where:
[0028] The part recognition module is configured to, after obtaining a modified model obtained by modifying an initial model, perform part recognition on the modified model to obtain a configuration file of the modified model, where the configuration file includes the configuration information of various types of meta-parts, and the configuration information includes the dependency relationship, parameter information, and spatial position of each repeated part corresponding to the meta-part under the parent object it depends on; among them, each of the meta-parts depending on the same parent object is not repeated;
[0029] The modified part determination module is configured to compare the configuration files of the initial model and the modified model respectively, and determine the modified meta-part as a modified part according to the comparison result;
[0030] The lightweighting processing module is configured to perform lightweighting processing on a target model to obtain a lightweight model corresponding to the target model, where the target model is a part model corresponding to the modified part in the modified model;
[0031] A rendering module, configured to call a rendering engine and use the rendering engine to render the configuration information of the modified part and the lightweight model in an initial rendering model, so as to obtain a target rendering model corresponding to the modified model; wherein, the initial rendering model is obtained by the rendering engine rendering the configuration file of the initial model and the lightweight models corresponding to various types of meta-parts in the initial model.
[0032] In a third aspect, the present application further provides an electronic device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0033] After obtaining a modified model obtained by modifying an initial model, perform part recognition on the modified model to obtain a configuration file of the modified model. The configuration file includes configuration information of various types of meta-parts. The configuration information includes the dependency relationships, parameter information, and spatial positions of the repeated parts corresponding to the meta-parts under the parent objects they depend on; wherein, the meta-parts depending on the same parent object are not repeated;
[0034] Compare the configuration files of the initial model and the modified model respectively, and determine the modified meta-parts as modified parts according to the comparison result;
[0035] Perform lightweight processing on the target model to obtain a lightweight model corresponding to the target model. The target model is the part model corresponding to the modified part in the modified model;
[0036] Call a rendering engine and use the rendering engine to render the configuration information of the modified part and the lightweight model in an initial rendering model, so as to obtain a target rendering model corresponding to the modified model; wherein, the initial rendering model is obtained by the rendering engine rendering the configuration file of the initial model and the lightweight models corresponding to various types of meta-parts in the initial model.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0038] After obtaining a modified model obtained by modifying an initial model, perform part recognition on the modified model to obtain a configuration file of the modified model. The configuration file includes configuration information of various types of meta-parts. The configuration information includes the dependency relationships, parameter information, and spatial positions of the repeated parts corresponding to the meta-parts under the parent objects they depend on; wherein, the meta-parts depending on the same parent object are not repeated;
[0039] Perform a differential comparison on the configuration files of the initial model and the modified model respectively, and determine the modified meta-part as the modified part according to the comparison result;
[0040] Perform lightweight processing on the target model to obtain the lightweight model corresponding to the target model, where the target model is the part model corresponding to the modified part in the modified model;
[0041] Call the rendering engine, and use the rendering engine to render the configuration information of the modified part and the lightweight model in the initial rendering model to obtain the target rendering model corresponding to the modified model; wherein, the initial rendering model is obtained by the rendering engine rendering the configuration file of the initial model and the lightweight models corresponding to various types of meta-parts in the initial model.
[0042] In a fifth aspect, the present application further provides a computer program product, including a computer program, which when executed by a processor implements the following steps:
[0043] After obtaining the modified model obtained by modifying the initial model, perform part recognition on the modified model to obtain the configuration file of the modified model, where the configuration file includes the configuration information of various types of meta-parts, and the configuration information includes the dependency relationships, parameter information, and spatial positions of the repeated parts corresponding to the meta-parts under the parent objects they depend on; wherein, the meta-parts depending on the same parent object are not repeated;
[0044] Perform a differential comparison on the configuration files of the initial model and the modified model respectively, and determine the modified meta-part as the modified part according to the comparison result;
[0045] Perform lightweight processing on the target model to obtain the lightweight model corresponding to the target model, where the target model is the part model corresponding to the modified part in the modified model;
[0046] Call the rendering engine, and use the rendering engine to render the configuration information of the modified part and the lightweight model in the initial rendering model to obtain the target rendering model corresponding to the modified model; wherein, the initial rendering model is obtained by the rendering engine rendering the configuration file of the initial model and the lightweight models corresponding to various types of meta-parts in the initial model.
[0047] The above model lightweighting method, device, computer device, medium and program product, after each modification of the model, perform part recognition on the modified model to obtain a configuration file including the configuration information of various types of meta-parts, and by comparing the configuration files of the modified model and the initial model before modification, the modified parts, that is, the modified meta-parts, can be determined; further, perform lightweighting processing on the part models corresponding to the modified parts in the modified model to obtain the lightweight models corresponding to each modified part; thus, when re-rendering the model, there is no need to re-render all the meta-parts one by one, but only need to use the rendering engine to render the lightweight models of the determined modified parts in the initial rendering model corresponding to the initial model. Since the configuration file of the modified model contains the configuration information of various types of meta-parts, when the rendering engine renders the lightweight model corresponding to the modified part, it can obtain the configuration information corresponding to the modified part from the configuration file of the modified model as the rendering parameter, so as to achieve accurate rendering of the lightweight model; during the entire rendering process, since there is no need to render each part of each meta-part one by one, but only render the lightweight models of the modified parts, the computational amount in rendering can be reduced, thereby improving the rendering efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0049] Figure 1 It is a schematic flowchart of the model lightweighting method in an embodiment;
[0050] Figure 2 It is a schematic flowchart of determining duplicate parts in an embodiment;
[0051] Figure 3 It is a schematic flowchart of performing lightweighting processing on a target model in an embodiment;
[0052] Figure 4 It is a schematic flowchart of real-time display of a dynamic 3D model in an embodiment;
[0053] Figure 5 It is a structural block diagram of the model lightweighting device in an embodiment;
[0054] Figure 6 It is an internal structure diagram of an electronic device in an embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0055] In order to make the objectives, technical solutions, and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] The model lightweighting method provided by the embodiments of the present application is executed by a computer device; the computer device can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and Internet of Things devices, and can also be a server; among them, the server can be implemented by an independent server or a server cluster composed of multiple servers.
[0057] In an exemplary embodiment, as Figure 1 shown, a model lightweighting method is provided, including step 110-step 140, where:
[0058] Step 110, after obtaining a modified model obtained by modifying an initial model, perform part recognition on the modified model to obtain a configuration file of the modified model.
[0059] For the embodiments of the present application, the configuration file includes the configuration information of various types of meta-parts, and the configuration information includes the dependency relationships, parameter information, and spatial positions of the repeated parts corresponding to the meta-parts under the dependent parent objects; among them, the meta-parts depending on the same parent object are not repeated.
[0060] Specifically, the initial model is a relatively fine three-dimensional model constructed based on CAD (Computer-Aided Design) software and contains a large amount of geometric data. Taking the CAD three-dimensional model of an aero-engine as an example, the three-dimensional model contains tens of thousands of standard part models, such as screws and gaskets, and the engine rotor blades are also formed by an array of multiple models with the same shape. And when constructing the three-dimensional model of the aero-engine, based on relevant design requirements and specifications, a standardized name will be given to each part. The modified model is a three-dimensional model obtained by modifying each part on the basis of the initial model and is also a three-dimensional model constructed based on CAD software.
[0061] Part recognition is to identify the same parts under the same parent object, so as to obtain non-repeating meta-parts under the same parent object. Among them, the recognition of duplicate parts can adopt a recognition method based on parameter information and / or a recognition method based on name similarity, or adopt other methods that can determine that two parts are duplicate parts. In the embodiments of the present application, no specific limitation is made, as long as the non-repeating meta-parts under the same parent object can be determined. The configuration file contains the configuration information of each meta-part in the corresponding model, and the parameter information in the configuration information at least includes dimension parameters and assembly parameters; the dependency relationship represents the structural and spatial relationship between parts, and the spatial position represents the assembly position of the part in the parent object it depends on.
[0062] Step 120: Compare the configuration files of the initial model and the modified model respectively to determine the modified meta-part as the modified part.
[0063] For the embodiments of the present application, the initial model has undergone the step of part recognition in advance, and then the configuration file corresponding to the initial model is obtained. Among them, comparing the configuration file of the modified model with the configuration file of the initial model is specifically to compare each meta-part to determine whether there are new or deleted meta-parts in the modified model; for the meta-parts without duplicate parts, compare the configuration information of the corresponding meta-parts in the two configuration files to determine whether there are meta-parts with modified configuration information; for the meta-parts with duplicate parts, compare the number of duplicate parts of the corresponding meta-parts in the two configuration files and whether the configuration files of the duplicate parts are modified; through comparison, the modified meta-parts can be determined, and the modified meta-parts are marked as modified parts.
[0064] Step 130: Perform lightweight processing on the target model to obtain the lightweight model corresponding to the target model, where the target model is the part model corresponding to the modified part in the modified model.
[0065] For the embodiments of the present application, the configuration file also includes the identity identifiers of each meta-part. Among them, the identity identifier can be at least one of the name, number, and spatial position of the meta-part. Through the identity identifier of the meta-part, at least one matching part can be determined from the corresponding model.
[0066] The lightweight processing is to perform meshing processing. The processing logic of the meshing processing is to divide the continuous and smooth original surface of the model into multiple small planes, and then obtain a fitted surface by means of fitting connection or splicing of the multiple small planes, and replace the original surface with the fitted surface. Through this meshing processing, the fineness of the surface in the model can be reduced, thereby reducing the amount of calculation required for rendering. Among them, the more the number of small planes obtained by dividing a surface, the higher the accuracy of the fitted surface, that is, the closer the fitted surface is to the original surface.
[0067] The configuration file includes each meta-part in the determined modified model, and the part model corresponding to each meta-part in the modified model is used as the target model of the meta-part. Furthermore, lightweight processing is performed on the target model of each meta-part, that is, meshing processing is performed on the target model of each meta-part to obtain the lightweight model corresponding to each target model; wherein, the lightweight model corresponding to the target model is also the lightweight model of the meta-part corresponding to the target model. Among them, the lightweight processing can be implemented based on a preset meshing processing component, or can be implemented by using a trained image processing model, and this application embodiment does not specifically limit this.
[0068] Step 140, call the rendering engine, and use the rendering engine to render the configuration information of the modified part and the lightweight model in the initial rendering model to obtain the target rendering model corresponding to the modified model; wherein, the initial rendering model is obtained by the rendering engine rendering the configuration file of the initial model and the lightweight models corresponding to various types of meta-parts in the initial model.
[0069] For the embodiments of this application, the rendering of the rendering engine requires two parameters, one is the rendering object, and the other is the rendering parameter; wherein, in the process of rendering the corresponding target rendering model for the modified model, the rendering object corresponding to the rendering engine is the lightweight model corresponding to each modified part, and the rendering parameter is the configuration information corresponding to each modified part or the configuration information of the repeated part corresponding to the part, and the rendering parameter is the configuration information of the corresponding modified part extracted from the configuration file corresponding to the modified model. And since the modified model is modified based on the initial model, therefore, in the rendering process, only need to use the rendering engine to render the rendering object based on the rendering parameter in the initial rendering model corresponding to the initial model to obtain the corresponding target rendering model.
[0070] In the above model lightweighting method, after each modification of the model, part recognition is performed on the modified model to obtain a configuration file including the configuration information of various types of meta-parts. By comparing the configuration files of the modified model and the initial model before modification, the modified parts, that is, the modified meta-parts, can be determined. Further, lightweighting processing is performed on the part models corresponding to the modified parts in the modified model to obtain the lightweight models corresponding to each modified part. Thus, when re-rendering the model, it is not necessary to re-render each meta-part one by one, but only need to use the rendering engine to render the lightweight models of the determined modified parts in the initial rendering model corresponding to the initial model. Since the configuration file of the modified model contains the configuration information of various types of meta-parts, when the rendering engine renders the lightweight model corresponding to the modified part, it can obtain the configuration information corresponding to the modified part from the configuration file of the modified model as rendering parameters, thereby enabling accurate rendering of the lightweight model. During the entire rendering process, since it is not necessary to render each part of each meta-part one by one, but only render the lightweight models of the modified parts, the computational amount in rendering can be reduced, thereby improving the rendering efficiency.
[0071] In one embodiment, the process of complete lightweighting processing and rendering of a model in the embodiments of the present application is described first. Taking the initial model as an example, the process of lightweighting the three-dimensional model constructed based on CAD software can specifically include the process of part recognition and the process of model lightweighting.
[0072] The process of part recognition has the following specific steps:
[0073] 1) Traverse each component node in the initial model from the structure tree, and filter out standard part models and models with similar names through the node names.
[0074] 2) Determine whether the similar models are under the same parent object in the assembly relationship (dependency relationship).
[0075] 3) Use a surface subdivision algorithm with lower precision to perform meshing on the surfaces of each similar part, and record the number of mesh vertices generated by the part model.
[0076] 4) If there are two part models that meet the requirements of the above three steps, it is determined that these two parts are duplicate parts, which will be registered in the XML file. The XML file is the configuration file of the initial model. Each part in the XML file is grouped to obtain each meta-part. Record the configuration information (spatial position information, equipment structure information, number of mesh vertices) of each part and store it in the XML file.
[0077] Furthermore, the specific process of model lightweighting is as follows:
[0078] Based on the configuration file (XML file) obtained from the part recognition process, the part models corresponding to each meta-part in the initial model are meshed using a preset lightweight algorithm (mesh processing algorithm) (included in the XML). What is obtained after meshing the part models corresponding to the meta-parts in the initial model is a lightweight model. Further, each lightweight model is saved as a GLTF mesh file, and at the same time, information such as the name, number, spatial position, material, and lightweight accuracy corresponding to this meta-part is recorded in the configuration file (XML file).
[0079] The surface of each meta-part in the 3D model is divided into many small planes through parametric surface subdivision, and the number of small planes can be controlled by the accuracy parameter. The multiple planes obtained by dividing each meta-part are combined into a polygon mesh, and redundant vertices are removed and coincident vertices are welded. The mesh is converted into the GLTF format, including writing data such as vertices, normals, and texture coordinates into a JSON file.
[0080] For repeatedly occurring parts, only one GLTF mesh file will be formed, that is, there is a one-to-one correspondence between the GLTF mesh file and the meta-part. The configuration information of the meta-part in the configuration file (XML file) will include information such as the name, number, quantity, and position of each repeated part corresponding to this meta-part. The lightweight models of each meta-part in the initial model are stored in the database to construct an initial model library; that is, the initial model library contains the lightweight models corresponding to each meta-part in the initial model.
[0081] Furthermore, a material library is constructed. The material library can be a PBR (Physically Based Rendering) material library, which contains hundreds of materials and texture information commonly used in the aviation industry. The material is a rendering technology that simulates real-world materials and can achieve more realistic rendering effects. The present invention aims to present a realistic material rendering effect in real-time rendering.
[0082] Furthermore, the rendering engine is called to render the lightweight models corresponding to each meta-part in the initial model library based on the configuration file of the initial model, and a corresponding material is matched from the material library for each lightweight model, thereby completing the rendering of the initial model to obtain an initial rendered model. That is, the rendering engine loads all the GLTF-format lightweight models in the initial model library, adjusts the coordinate information of each meta-part according to the part number and spatial position information in the XML file, and combines them into a complete initial model. Next, the material information of each part in the XML is read and matched with the PBR material library to achieve a realistic rendering effect.
[0083] The above content is about the process of lightweight processing and re-rendering an initial model built based on CAD software to obtain an initial rendered model. The following content specifically elaborates on how to explain step by step the process of re-rendering for a modified model obtained by modifying the initial model on the basis of the initial rendered model.
[0084] In one embodiment, as Figure 2 shown, the process of determining duplicate parts in step 110 may specifically include step 111 and step 112, where.
[0085] Step 111: Determine similar part pairs from the structure tree of the modified model. The similar part pairs include two parts with the same structural parameters and / or a name similarity exceeding the similarity threshold; the structure tree includes the names, structural parameters of each part, and the dependency relationships between each part.
[0086] Step 112: If it is determined that the two parts in the similar part pair both depend on the same parent object, then check the two parts in the similar part pair, and determine whether the two parts are duplicate parts according to the check result.
[0087] The structure tree is a file formed when constructing the corresponding 3D model file, which represents the spatial relationship and / or assembly relationship between each part, that is, it represents the dependency relationship between each part; further, each part in the structure tree uses its name as the identity identifier, and each part is also associated with detailed structural parameters. Specifically, traverse the structure tree of the modified model. For each part, if there are dependent sub-objects under this part, then obtain the names and structural parameters of each sub-object, and compare the names and structural parameters of each sub-object. Determine two parts with the same structural parameters as a similar part pair, and determine two parts with a name similarity exceeding the set similarity threshold as a similar part pair. Among them, the similarity threshold is not specifically limited in the embodiments of the present application, but the similarity threshold cannot be lower than 80%.
[0088] Further, during the process of constructing the 3D model, each standard part can also be marked. Among them, the standard part is a component produced and used according to national standards, industry standards or enterprise standards, and they have unified specifications, dimensions, materials and performance requirements. As long as it is recognized that there are two standard parts with the same mark under the same parent object, then these two standard parts with the same mark are used as a group of similar part pairs.
[0089] Further, although it is highly probable to determine that the two parts in each pair of similar parts are duplicate parts through the identification of standard part markings, comparison of part name similarities, and comparison of structural parameters, in order to further confirm the accuracy of the result of duplicate part identification. In the embodiments of the present application, a step of verifying similar part pairs is also provided. Specifically, the verification step may include:
[0090] Perform grid processing on the two parts in the pair of similar parts respectively, and determine the verification result based on the result of the grid processing. The verification result indicates whether the number of grid vertices corresponding to the two parts is the same or different; if the verification result indicates that the number of grid vertices corresponding to the two parts is the same, then determine that the two parts are duplicate parts.
[0091] Specifically, for each pair of similar parts: use a preset grid processing algorithm to perform grid processing on the two parts. After performing grid processing on each part, obtain multiple small grid planes obtained by dividing the part, and calculate the number of grid vertices obtained after processing each part; use the number of grid vertices of the two parts respectively as the verification result of this pair of similar parts. If the two parts are duplicate parts, then the number of grid vertices corresponding to the two parts is the same; if the number of grid vertices corresponding to the two parts is different, then the two parts are non-duplicate parts.
[0092] In one example, there are a total of 6 dependent parts, namely A1(1), A2(1), A2(2), A3, A1(2), and A1(3) under the A structure in a model, and the parent object that these 6 parts depend on is the A structure. During the part identification process, A1(1) and A1(2) are a pair of similar parts, and A1(1) and A1(3), A1(2) and A1(3), as well as A2(1) and A2(2) are all pairs of similar parts. Finally, it is identified that A1, A2, and A3 are three types of meta-parts, A1 is one meta-part, and A1(1), A1(2), and A1(3) are duplicate parts of the A1 meta-part.
[0093] In one of the embodiments, referring to Figure 3 , in step 130, performing lightweight processing on the target model may specifically include steps 131 - 133, where:
[0094] Step 131: Invoke the grid component to perform grid processing on the surfaces in the target model to obtain multiple sub-planes corresponding to the surfaces;
[0095] Step 132: Perform lightweight processing on the multiple sub-planes to obtain the spliced lightweight surface. The lightweight processing includes at least fitting and splicing and format conversion;
[0096] Step 133: Replace the curved surfaces in the target model with lightweight curved surfaces to obtain a lightweight model corresponding to the target model.
[0097] Among them, the meshing component performs meshing processing on each target model. The processing logic of the meshing processing is to divide the continuous and smooth original curved surface of the model into multiple small planes, and then obtain a fitted curved surface (lightweight curved surface) by means of fitting connection or splicing of the multiple small planes, and replace the original curved surface with the fitted curved surface. Through this meshing processing, the fineness of the curved surfaces in the model can be reduced, thereby reducing the amount of calculation required for rendering.
[0098] Specifically, the meshing component performs meshing processing on each target model (the part model corresponding to the modified part in the modified model), so as to obtain a lightweight model corresponding to each target model. Further, each lightweight model is saved as a GLTF mesh file, and at the same time, information such as the name, number, spatial position, material, and lightweight accuracy of the meta-part corresponding to the modified part is recorded / updated in the configuration file (XML file). The configuration information of the meta-part in the configuration file (XML file) will include information such as the name, number, quantity, and position of each repeated part corresponding to the meta-part. Among them, the meshing component is constructed based on a preset mesh processing algorithm and can be called through an API (Application Programming Interface) interface.
[0099] Furthermore, the structure tree also includes the material, number, name, and lightweight accuracy of each part; and when performing lightweight processing on the target model, based on the structure tree of the modified model, the configuration information of each meta-part in the configuration file is updated; among them, the updated configuration information also includes the material and lightweight accuracy. Among them, the more the number of small planes obtained by dividing a curved surface, the higher the accuracy of the fitted curved surface, that is, the closer the fitted curved surface is to the original curved surface. The lightweight accuracy of the meshing component can be set by the user input.
[0100] Furthermore, the verification step of the similar part pairs in Step 110 can also be implemented by calling the meshing component; that is, the meshing component is called to perform meshing processing on the two parts in each similar part pair, and the number of mesh vertices of each part is determined based on the multiple small mesh planes obtained after the meshing processing. However, it should be noted that the lightweight accuracy set for the meshing component in Step 110 is less than the lightweight accuracy set for the meshing component in Step 130; since the two parts in the similar part pair are more likely to be repeated parts, therefore, even if lightweight meshing processing with a lower accuracy is used, a relatively accurate verification result can still be obtained, thereby further shortening the amount of calculation required to determine the repeated parts and improving the efficiency of part recognition.
[0101] In one embodiment, step 140 may specifically include: using the updated configuration information corresponding to the modified part as a rendering parameter, and using the lightweight model corresponding to the modified part as a rendering object to input into a rendering engine; the rendering engine renders the rendering object in the initial rendering model based on the rendering parameter to obtain a target rendering model corresponding to the modified model.
[0102] Specifically, in the process of rendering the modified model to obtain the corresponding target rendering model, the rendering object corresponding to the rendering engine is the lightweight model of each modified part, and the rendering parameter is the configuration information corresponding to each modified part or the configuration information of the duplicate part of the part. The rendering parameter is the configuration information of the corresponding modified part extracted from the configuration file of the modified model. Moreover, since the modified model is modified based on the initial model, during the rendering process, it only needs to use the rendering engine to render the rendering object in the initial rendering model corresponding to the initial model based on the rendering parameter to obtain the corresponding target rendering model.
[0103] For the lightweight models obtained from the modified parts of the modified model, update the lightweight models of each modified part to the initial model library of the initial model, so as to provide a reference basis for each subsequent modification of the model.
[0104] Furthermore, the rendering engine loads the lightweight models (GLTF mesh files) corresponding to each modified part in the initial model library, adjusts the part coordinate information according to the meta-part number and spatial position information corresponding to the modified part in the configuration file of the modified model, and combines them into a complete modified model. Furthermore, read the material information of the meta-parts corresponding to each modified part from the configuration file, match it with the PBR material library, and render the corresponding material texture for each modified part, so as to achieve a realistic rendering effect.
[0105] In the model lightweighting method provided by this application, it can be applied to models that need to be modified, iterated, and rendered multiple times in actual production. During the actual production process, the information of the 3D model built based on CAD software will be continuously adjusted and updated. In the traditional solution, the modified 3D model will be lightweighted again and re-imported into the rendering engine, resulting in a slow update speed. In the lightweighting method of this application, the configuration file of the modified model is compared with the configuration file of the initial model. For any meta-part, if it is found that the meta-part has not changed, the lightweighting step for this part is skipped. If any meta-part is found to be a modified part, only the part model of the modified part is lightweighted (meshed). At the same time, an update instruction is sent to the rendering engine to load the lightweighted models and configuration information corresponding to the updated modified parts, so as to realize the adjustment of the existing part parameters / positions in the initial rendering model corresponding to the initial model, and thus complete the rendering process of re-rendering the modified model.
[0106] In summary, for the initial model, the model lightweighting method of this application establishes an initial model library including the lightweighted models of each meta-part and a configuration file including the configuration information of each meta-part. When the modified model is obtained after each modification, the previous model is used as the initial model, the model modified this time is used as the modified model, and the configuration files of the initial model and the modified model are compared to determine the modified parts; thus, only the part models of the modified model are lightweighted once, and the changes are automatically detected. When rendering the model, only the parts corresponding to the modified parts need to be rendered. This method greatly improves the flexibility and efficiency of design, reduces resource consumption, optimizes the user experience, and provides an innovative solution for the interaction and visualization of complex industrial models.
[0107] Such as Figure 4As shown, after the 3D model containing CAD data enters this system, it will first undergo lightweight processing to be converted into mesh information, and the models of each component part in the CAD data will be saved as mesh files in GLTF format, thereby constructing a GLTF network model library (initial model library). At the same time, the assembly information of each component part will be saved as a configuration file in XML format. Next, the 3D visual scene program will load the lightweight models (GLTF network files) of the required component parts from the initial model library according to the assembly information provided by the configuration file and assemble them into a complete machine model. When the CAD data changes, the system can check for model differences, perform lightweight processing on the modified parts and reload them, realizing the fast update function of 3D rendering. After the model loading and assembly are completed, the PBR material library is called to perform rendering settings on the 3D model to present a realistic rendering effect. Users can roam and change perspectives in the scene through the human-computer interaction module, supporting large-screen display and head-mounted XR device display. Through GLTF format and lightweight model library management, the efficient loading and real-time rendering of complex CAD models (CAD data) are achieved, significantly improving the system performance. At the same time, only the changed parts are automatically detected and updated, reducing unnecessary calculations and improving the update speed and efficiency.
[0108] In the application aspect of this application, for complex mechanical design fields such as aeroengines, it supports rapid iterative design and modification, reducing the development cycle. The method of this application significantly improves the practicality and efficiency of complex industrial models in virtual reality, enabling the latest structural design results to be presented to designers automatically and completely, providing strong technical support for design and engineering applications.
[0109] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, these steps do not necessarily have to be executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages do not necessarily have to be executed at the same time, but can be executed at different times. The execution order of these steps or stages does not necessarily have to be sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0110] Based on the same inventive concept, an embodiment of the present application further provides a model lightweighting device for implementing the model lightweighting method involved above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the model lightweighting device provided below can refer to the limitations on the model lightweighting method in the above text, and will not be repeated here.
[0111] In an exemplary embodiment, as Figure 5 shown, a model lightweighting device is provided. The device includes a part recognition module 501, a modified part determination module 502, a lightweighting processing module 503, and a rendering module 504, where:
[0112] The part recognition module 501 is configured to, after obtaining a modified model obtained by modifying an initial model, perform part recognition on the modified model to obtain a configuration file of the modified model. The configuration file includes configuration information of various types of meta-parts. The configuration information includes the dependency relationship, parameter information, and spatial position of each repeated part corresponding to the meta-part under the dependent parent object; among them, the meta-parts depending on the same parent object are not repeated;
[0113] The modified part determination module 502 is configured to compare the configuration files of the initial model and the modified model respectively, and determine the modified meta-part as the modified part according to the comparison result;
[0114] The lightweighting processing module 503 is configured to perform lightweighting processing on a target model to obtain a lightweight model corresponding to the target model. The target model is the part model corresponding to the modified part in the modified model;
[0115] The rendering module 504 is configured to call a rendering engine, and use the rendering engine to render the configuration information of the modified part and the lightweight model in the initial rendering model to obtain a target rendering model corresponding to the modified model; among them, the initial rendering model is obtained by the rendering engine rendering the configuration file of the initial model and the lightweight models corresponding to various types of meta-parts in the initial model.
[0116] In one of the embodiments, the part recognition module 501 is specifically configured to:
[0117] Determine similar part pairs from the structure tree of the modified model. The similar part pairs include two parts with the same structural parameters and / or a similarity of names exceeding the similarity threshold; the structure tree includes the names, structural parameters of each part, and the dependency relationship between each part;
[0118] If it is determined that the two parts in the similar part pair both depend on the same parent object, then check the two parts in the similar part pair, and determine whether the two parts are repeated parts according to the check result.
[0119] In one embodiment, the part recognition module 501 is specifically configured to:
[0120] Perform grid processing on the two parts in the pair of similar parts respectively, and determine a verification result according to the results of the grid processing. The verification result indicates whether the number of grid vertices corresponding to the two parts is the same or different;
[0121] If the verification result indicates that the number of grid vertices corresponding to the two parts is the same, determine that the two parts are duplicate parts.
[0122] In one embodiment, the lightweight processing module 503 is specifically configured to:
[0123] Call the grid component to perform grid processing on the curved surface in the target model to obtain multiple sub-planes corresponding to the curved surface;
[0124] Perform lightweight processing on the multiple sub-planes to obtain a spliced lightweight curved surface. The lightweight processing includes at least fitting and splicing and format conversion;
[0125] Replace the curved surface in the target model with the lightweight curved surface to obtain a lightweight model corresponding to the target model.
[0126] In one embodiment, the structure tree further includes the material, number, name, and lightweight accuracy of each part. The device further includes an update module, and the update module is specifically configured to:
[0127] Update the configuration information of each meta-part in the configuration file based on the structure tree of the modified model;
[0128] Among them, the updated configuration information further includes the material and lightweight accuracy.
[0129] In one embodiment, the rendering module 504 is specifically configured to:
[0130] Use the updated configuration information corresponding to the modified part as rendering parameters, and use the lightweight model corresponding to the modified part as a rendering object and input it into the rendering engine;
[0131] The rendering engine renders the rendering object in the initial rendering model based on the rendering parameters to obtain a target rendering model corresponding to the modified model.
[0132] Each module in the above model lightweight device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the electronic device in hardware form or be independent of it, or can be stored in the memory in the electronic device in software form, so as to facilitate the processor to call and execute the operations corresponding to the above modules.
[0133] In an exemplary embodiment, an electronic device is provided. The electronic device may be a terminal, and its internal structure diagram may be as shown in Figure 6 . The electronic device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the electronic device is used for exchanging information between the processor and external devices. The communication interface of the electronic device is used for communicating with external terminals in a wired or wireless manner. The wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. The computer program, when executed by the processor, implements a model lightweighting method. The display unit of the electronic device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen may be a liquid crystal display screen or an electronic ink display screen. The input device of the electronic device may be a touch layer covering the display screen, or may also be a button, a trackball, or a touchpad provided on the housing of the electronic device, or may also be an external keyboard, a touchpad, or a mouse, etc.
[0134] Those skilled in the art can understand that Figure 6 the structure shown in is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0135] In an exemplary embodiment, an electronic device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above-mentioned model lightweighting method embodiment are implemented.
[0136] In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps in the above-mentioned model lightweighting method embodiment are implemented.
[0137] In an embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps in the above-mentioned model lightweighting method embodiment are implemented.
[0138] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0139] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., and are not limited thereto. The processors involved in the embodiments provided in this application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., and are not limited thereto.
[0140] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope described in this specification.
[0141] The above embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A model lightweight method, characterized in that: The method comprises: After obtaining a modified model obtained by modifying the initial model, parts recognition is performed on the modified model to obtain a configuration file of the modified model, wherein the configuration file includes configuration information of various types of element parts, and the configuration information includes dependency relationships, parameter information, and spatial positions of repeated parts corresponding to the element parts under the parent object on which they depend; wherein the element parts that depend on the same parent object are not repeated; Compare the differences between the configuration files of the initial model and the modified model, and determine the modified element part as the modified part according to the comparison result; Performing lightweight processing on the target model to obtain a lightweight model corresponding to the target model, wherein the target model is a part model corresponding to the modified part in the modified model; Calling a rendering engine, and using the rendering engine to render the configuration information of the modified part and the lightweight model in the initial rendering model to obtain a target rendering model corresponding to the modified model; wherein the initial rendering model is obtained by the rendering engine rendering the configuration file of the initial model and the lightweight models corresponding to the various types of the meta-parts in the initial model.
2. The method according to claim 1, characterized in that The process for determining duplicate parts includes: Determine similar part pairs from the structure tree of the modified model, wherein the similar part pairs include two parts having the same structural parameters and / or a name similarity exceeding a similarity threshold; the structure tree includes the name and structural parameters of each part and the dependency relationship between the parts; If it is determined that both of the two parts in the similar part pair are dependent on the same parent object, the two parts in the similar part pair are checked, and whether the two parts are duplicate parts is determined based on the checking result.
3. The method according to claim 2, characterized in that Verifying the two parts in the similar part pair and determining whether the two parts are duplicate parts according to the verification result includes: Performing meshing processing on the two parts of the similar part pair respectively, and determining a verification result according to the meshing processing result, wherein the verification result indicates whether the number of mesh vertices corresponding to the two parts is the same or different; If the verification result indicates that the numbers of mesh vertices corresponding to the two parts are the same, then the two parts are determined to be duplicate parts.
4. The method according to claim 2, characterized in that: The step of performing lightweight processing on the target model to obtain a lightweight model corresponding to the target model includes: Calling a meshing component to perform meshing processing on the surface in the target model to obtain a plurality of sub-planes corresponding to the surface; Performing lightweight processing on the multiple sub-planes to obtain a spliced lightweight surface, wherein the lightweight processing at least includes fitting splicing and format conversion; The curved surface in the target model is replaced by the lightweight curved surface to obtain a lightweight model corresponding to the target model.
5. The method according to any one of claims 2 to 4, characterized in that: The structure tree also includes the material, number, name and lightweight accuracy of each part, and the method further includes: Based on the structure tree of the modified model, updating the configuration information of each of the element parts in the configuration file; The updated configuration information also includes material and lightweight accuracy.
6. The method according to claim 5, characterized in that The step of rendering the configuration information of the modified part and the lightweight model in the initial rendering model using the rendering engine to obtain a target rendering model corresponding to the modified model includes: Using the updated configuration information corresponding to the modified part as a rendering parameter, and inputting the lightweight model corresponding to the modified part as a rendering object into the rendering engine; The rendering engine renders the rendering object in the initial rendering model based on the rendering parameters to obtain a target rendering model corresponding to the modified model.
7. A model lightweight method and device, characterized in that: The device includes a part recognition module, a modified part determination module, a lightweight processing module and a rendering module, wherein: After obtaining a modified model obtained by modifying the initial model, parts recognition is performed on the modified model to obtain a configuration file of the modified model, wherein the configuration file includes configuration information of various types of element parts, and the configuration information includes dependency relationships, parameter information, and spatial positions of repeated parts corresponding to the element parts under the parent object on which they depend; wherein the element parts that depend on the same parent object are not repeated; A modified part determination module, used for comparing the differences between the configuration files of the initial model and the modified model, and determining the modified element part as a modified part according to the comparison result; A lightweight processing module, used for performing lightweight processing on a target model to obtain a lightweight model corresponding to the target model, wherein the target model is a part model corresponding to the modified part in the modified model; A rendering module is used to call a rendering engine, and use the rendering engine to render the configuration information of the modified part and the lightweight model in the initial rendering model to obtain a target rendering model corresponding to the modified model; wherein the initial rendering model is obtained by the rendering engine rendering the configuration file of the initial model and the lightweight models corresponding to the various types of the element parts in the initial model.
8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Model processing method and device, computer equipment, storage medium and program product
CN117786866A
Lightening method, device and equipment for CAD model and medium
CN118133369A
Cited By
Three-dimensional model format conversion lightweight method, device and equipment
CN120257400A