Method, device and equipment for automatically reading model information based on three-dimensional engine and medium
Through intelligent identification and dynamic call of the three-dimensional software SDK, combined with the quad-tree algorithm, the compatibility and efficiency problems in three-dimensional model reading are solved, fast and accurate model information reading is achieved, and work efficiency and compatibility are improved.
Patent Information
- Application Number
- CN202411173691.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-11-15
AI Technical Summary
The prior art has poor compatibility in three-dimensional model reading, single type recognition, and high overhead for reading complex models, resulting in high program crashes, and UV information processing is inconsistent, affecting office efficiency.
By intelligently identifying the source of the three-dimensional model file, dynamically retrieve the SDK of the corresponding three-dimensional software, using dependency injection to build a lightweight system framework, reading the ini file configuration information, using the quad-tree algorithm to obtain the model topology relationship and geometric information, and exporting XML Files to improve read efficiency.
Improves model reading speed, increases compatibility, reduces the probability of system crash, saves working time, improves work efficiency, and reduces memory consumption.
Smart Images

Figure CN118967941A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of three-dimensional model technology, and specifically to a method, device, equipment and medium for automatically reading three-dimensional model information through a three-dimensional engine based on digital twin requirements. Background Art
[0002] Models, data, connections, and services always play the most important roles in digital twins, and these four parts are also the core of digital twins.
[0003] The fidelity of digital twins is used to describe the proximity between digital virtual models and physical entities. An important feature of digital twins is that they require virtual and physical entities to not only maintain a high degree of simulation of the geometric structure, but also to simulate in terms of state, phase and tense. For each physical object, there is a "digital mirror" that exists in the virtual world and "works" with it throughout its life cycle. The model of a digital twin is not just a 3D model that people can see, it also includes geometric dimensions, physical properties and behaviors, and has the characteristics of real-time synchronization, reliable mapping and high fidelity. The information of the digital twin model system needs to correspond one-to-one with the real world. The construction of the digital twin model system plays a fundamental and decisive role in the digital twin to a large extent.
[0004] Different digital twin model systems need to be established for different needs. The establishment of twin models will contain a lot of information. The information of real-world objects needs to be converted into model information of three-dimensional virtual space, which usually includes length, width, height, position information, coordinate information, child-parent relationship, texture information, UV information, model center point information and other various model information that needs to be established. This plays an irreplaceable role in the subsequent digital twin process. Only by reading this information can we better simulate in the three-dimensional engine and make narrative correspondence.
[0005] In the current model reading, the compatibility of model categories is not friendly enough, the type recognition is single, and the reading overhead of complex models is too high, which greatly increases the probability of program crashes. At the same time, since the three-dimensional model goes through two different systems to the three-dimensional engine, there will also be confusion on the UV, which greatly affects office efficiency. Summary of the invention
[0006] To solve the above problems, the present invention proposes a method, device, equipment and medium for automatically reading model information based on a three-dimensional engine. The method can quickly read relevant information of the model, thereby efficiently processing file information, greatly saving working time and improving work efficiency.
[0007] In a first aspect, the present application discloses a method for automatically reading model information based on a three-dimensional engine, comprising the following steps: Step 1: Upload or import the 3D model file; Step 2: Intelligently identify and locate the source of the uploaded or imported 3D model file to determine which 3D software the 3D model file was produced from; Step 3: Based on the determined 3D software, dynamically call the official software development kit SDK of the relevant 3D software; Step 4: Use dependency injection to inject the service modules of the required 3D software SDK into the core components of the application in a decoupled manner, thereby building a lightweight system framework and significantly accelerating the reading process of 3D model files; Step 5: Read the ini file configuration information and parse it, define and adjust the extraction rules in the ini file according to different needs, and obtain different levels of information of the model; Step 6: Based on the read ini file configuration information, use the advanced functions of the injection SDK to obtain the relevant information you want to extract.
[0008] Furthermore, in step 2, the suffixes of the 3D model files, such as ".obj", ".fbx", ".stl", etc., are identified and classified through the intelligent recognition module built into the 3D engine, and then the 3D model files are accurately identified by which 3D modeling software, such as Autodesk Maya, 3ds Max, SolidWorks, etc., is generated.
[0009] Furthermore, in step 3, after determining the specific source of the 3D model file, based on the integrated SDK, the official software development kit SDK provided by the corresponding 3D software is dynamically linked and called through the high-precision screening rule of full byte matching within the 3D engine to ensure seamless connection with the data formats and functional interfaces of various 3D software.
[0010] Furthermore, in step 6, the system starts to traverse the triangular patch data of the model with the specified reference point as the starting point; on this basis, with the help of the quadtree space segmentation and search algorithm, topological query is performed, based on the basic geometric principle of "two points determine an edge, and three edges form a face" on each triangle of the model, so as to accurately obtain the topological relationship and related geometric information of the points, edges, and faces of the model.
[0011] Furthermore, during the information extraction process of step 6, the system temporarily stores the temporarily collected information in the memory. After all the required information is extracted, the data is standardized, organized and serialized in the format of XML tag language, and finally exported as an XML file.
[0012] In a second aspect, the present application discloses a device for automatically reading model information based on a three-dimensional engine, which is used to implement the aforementioned method for automatically reading model information based on a three-dimensional engine, comprising: Upload or import module, used to upload or import 3D model files; The identification and positioning module is used to intelligently identify and locate the source of the 3D model file and determine which 3D software the 3D model file was produced from; A calling module, used for dynamically calling the official software development kit SDK of the relevant 3D software based on the determined 3D software; The injection module is used to inject the service modules of the required 3D software SDK into the core components of the application in a decoupled manner by means of dependency injection, thereby building a lightweight system framework and significantly accelerating the reading process of 3D model files; The parsing module is used to read and parse the ini file configuration information, define and adjust the extraction rules in the ini file according to different needs, and obtain different levels of information of the model; The acquisition module is used to obtain the relevant information you want to extract based on the read ini file configuration information through the advanced functions of the injection SDK.
[0013] In a third aspect, the present application discloses an electronic device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the aforementioned method for automatically reading model information based on a three-dimensional engine.
[0014] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein when the computer program is executed by a processor, the aforementioned method of automatically reading model information based on a three-dimensional engine is implemented.
[0015] The present invention is a method for reading three-dimensional model file information based on digital twin requirements, including automatic reading of the type, version number, module name, hierarchical relationship, material map, UV, center point, spatial position and other information of the three-dimensional model in the engine. The method increases the recognition type of the model, increases compatibility, reduces memory consumption for model reading, increases reading speed, and reduces the probability of system crashes. Configuration filtering further increases the degree of freedom in model reading, can quickly read relevant information of the model, and export tag language files, so that file information can be efficiently processed, greatly saving working time and improving work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a flow chart of a method for automatically reading model information based on a three-dimensional engine according to Embodiment 1; Figure 2This is a schematic diagram of the structure of a device for automatically reading model information based on a three-dimensional engine according to Embodiment 1. DETAILED DESCRIPTION
[0017] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but cannot be used to limit the scope of the present invention.
[0018] Embodiment 1 The present embodiment is a method for automatically reading model information based on a three-dimensional engine based on a cloud platform, and its process is as follows: Figure 1 As shown, the following steps are included: Step 1: Import 3D model file Select an *.obj file to be imported; Step 2: Intelligently identify and locate files Decompile the imported *.obj file first to get the internal special header file information, such as "g V (**, **, **); vt (**, **, **); f ** / ** / **", and then through the file extension *.obj, you can determine that the *.obj file is the file output by the modeling software 3D MAYA; Step 3: Get the SDK For the core SDK of 3D MAYA, perform a byte-by-byte intelligent search inside the 3D engine to find the location of the relevant software development kit SDK in the device and load it into the program cache; Step 4: Program Injection The program is initialized and the virtual container is automatically opened. The integrated and optimized interface is first extracted, and the 3D MAYA function SDK class library is found and bound and registered with the relevant interface. The container instantiates the SDK so that the interface can dynamically call different types of scripts. Step 5: Read and parse the configuration file After the container is initialized, the ini configuration file is read. For example, the ini configuration file contains "<Layerobjects=”All” Points=”Center”> "Wall" gets all models and center point coordinate information at the wall level; Step 6: Extract model information According to the provisions of step 5, the SDK script method obtained in step 4 is called to obtain relevant information and output an XML file, thereby speeding up the processing of model levels and center points by R&D personnel.
[0019] Embodiment 2 This embodiment proposes a device based on a cloud platform and a 3D engine to automatically read model information, and its structure is as follows: Figure 2 As shown, including: Upload or import module, used to upload or import 3D model files; The identification and positioning module is used to intelligently identify and locate the source of the 3D model file and determine which 3D software the 3D model file was produced from; A calling module, used for dynamically calling the official software development kit SDK of the relevant 3D software based on the determined 3D software; The injection module is used to inject the service modules of the required 3D software SDK into the core components of the application in a decoupled manner by means of dependency injection, thereby building a lightweight system framework and significantly accelerating the reading process of 3D model files; The parsing module is used to read and parse the ini file configuration information, define and adjust the extraction rules in the ini file according to different needs, and obtain different levels of information of the model; The acquisition module is used to obtain the relevant information you want to extract based on the read ini file configuration information through the advanced functions of the injection SDK.
[0020] Embodiment 3 The embodiment also proposes an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the method for automatically reading model information based on a three-dimensional engine as described in the first embodiment.
[0021] Embodiment 4 This embodiment also proposes a computer-readable storage medium for storing a computer program; wherein when the computer program is executed by a processor, the method for automatically reading model information based on a three-dimensional engine as described in the first embodiment is implemented.
[0022] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A method for automatically reading model information based on a three-dimensional engine, characterized in that: The following steps are involved: Step 1: Upload or import the 3D model file; Step 2: Intelligently identify and locate the source of the 3D model file to determine which 3D software the 3D model file was produced from; Step 3: Based on the determined 3D software, dynamically call the official software development kit SDK of the relevant 3D software; Step 4: Use dependency injection to inject the service modules of the required 3D software SDK into the core components of the application in a decoupled manner, thereby building a lightweight system framework and significantly accelerating the reading process of 3D model files; Step 5: Read the ini file configuration information and parse it, define and adjust the extraction rules in the ini file according to different needs, and obtain different levels of information of the model; Step 6: Based on the read ini file configuration information, use the advanced functions of the injection SDK to obtain the relevant information you want to extract.
2. A method for automatically reading model information based on a three-dimensional engine as claimed in claim 1, characterized in that: In step 2: The 3D engine's built-in intelligent recognition module is used to identify and classify the suffixes of the 3D model files, and then accurately identify which 3D modeling software generated the 3D model files.
3. A method for automatically reading model information based on a three-dimensional engine as claimed in claim 1, characterized in that: In step 3: After determining the specific source of the 3D model file, based on the integrated SDK, the 3D engine uses a high-precision screening rule of full byte matching to dynamically link and call the official software development kit SDK provided by the corresponding 3D software to ensure seamless connection with the data formats and functional interfaces of various 3D software.
4. A method for automatically reading model information based on a three-dimensional engine as claimed in claim 1, characterized in that: In step 6: Taking the specified reference point as the starting point, the system begins to traverse the triangular patch data of the model; on this basis, with the help of the quadtree space segmentation and search algorithm, topological query is performed, based on the basic geometric principle of "two points determine an edge, and three edges form a face" on each triangle of the model, so as to accurately obtain the topological relationship and related geometric information of the model's points, edges, and faces.
5. A device for automatically reading model information based on a three-dimensional engine for implementing the method according to any one of claims 1 to 4, characterized in that: include: Upload or import module, used to upload or import 3D model files; The identification and positioning module is used to intelligently identify and locate the source of the 3D model file and determine which 3D software the 3D model file was produced from; A calling module, used for dynamically calling the official software development kit SDK of the relevant 3D software based on the determined 3D software; The injection module is used to inject the service modules of the required 3D software SDK into the core components of the application in a decoupled manner by means of dependency injection, thereby building a lightweight system framework and significantly accelerating the reading process of 3D model files; The parsing module is used to read and parse the ini file configuration information, define and adjust the extraction rules in the ini file according to different needs, and obtain different levels of information of the model; The acquisition module is used to obtain the relevant information you want to extract based on the read ini file configuration information through the advanced functions of the injection SDK.
6. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the method for automatically reading model information based on a three-dimensional engine as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein when the computer programs are executed by a processor, the method for automatically reading model information based on a three-dimensional engine as described in any one of claims 1 to 4 is implemented.
