Three-dimensional geometric model conversion method, controller and storage medium

By using multi-threading technology to concurrently process data format conversion and optimization in three-dimensional geometric model conversion, the problem of low conversion efficiency of three-dimensional geometric model in the existing technology is solved, and efficient model conversion and higher scenario applicability are achieved.

CN119961212APending Publication Date: 2025-05-09ZHONGKE CHAOAN TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510030238.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

The existing three-dimensional geometric model conversion technology is relatively inefficient, especially when dealing with large-scale three-dimensional geometric models, it cannot complete the model conversion efficiently and cannot meet the user's usage needs.

Method used

Multithreading technology is used to convert the data format of the source format attribute data and geometric data concurrently, and optimize the geometric data according to the target application scenario, including vertex optimization, surface optimization, normal vector optimization and texture optimization. Finally, the model data of the target format is determined to obtain the target model file.

Benefits of technology

Through multi-threading technology, improve the utilization rate of computing resources, shorten the time of data analysis and optimization process, realize efficient conversion of three-dimensional geometric models, and meet the needs of various application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119961212A_ABST
    Figure CN119961212A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of three-dimensional modeling, particularly provides a three-dimensional geometric model conversion method, a controller and a storage medium, and aims to solve the problem of how to improve the model conversion efficiency of a three-dimensional geometric model. In order to achieve the purpose, the method comprises the steps that an original model file, containing model data in an active format, of the three-dimensional geometric model is obtained, a target application scene suitable for the three-dimensional geometric model obtained after model conversion is obtained, data mapping and data optimization are conducted on the original model file on the basis of the target application scene, and the three-dimensional geometric model is obtained. And obtaining a target model file containing the model data in the target format. According to the method, the target application scene of the three-dimensional geometric model is obtained in advance, invalid data and incomplete data in the original model file can be filtered, the model data in multiple source formats are converted into the model data adaptive to the target application scene, the data mapping and data optimization speed is increased, and the data mapping efficiency is improved. And the model conversion efficiency and the scene application degree of the three-dimensional geometric model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of three-dimensional modeling, and specifically provides a three-dimensional geometric model conversion method, a controller and a storage medium. Background Art

[0002] In practical applications, different applications or systems need to exchange and share three-dimensional geometric models. For example, a model created in a three-dimensional (3D) modeling software may need to be imported into a computer-aided design (CAD) software for further design or analysis, or exported from the CAD software to a 3D printing device for manufacturing.

[0003] Different applications or systems may use different model file formats. There are differences between various 3D model file formats (such as .sat, .step, .stl, .sab, and .obj file formats). Therefore, it is necessary to perform model conversion of 3D geometric models to realize the application of 3D geometric models in different systems or programs. However, most of the existing model conversion technologies use a single-threaded method to perform model conversion, which is relatively inefficient. Especially when processing large-scale 3D geometric models, it is impossible to complete the model conversion efficiently and cannot meet the user's demand for model conversion.

[0004] Therefore, this field needs a new technical solution to solve the above problems. Summary of the invention

[0005] The present application aims to solve the above technical problem, that is, to solve the problem of how to improve the efficiency of model conversion of three-dimensional geometric models.

[0006] In a first aspect, the present application provides a three-dimensional geometric model conversion method, comprising:

[0007] Acquire an original model file of a three-dimensional geometric model, wherein the original model file is a data file containing model data of the three-dimensional geometric model in a source format;

[0008] Obtaining a target application scenario, where the target application scenario is an application scenario that the three-dimensional geometric model after model conversion needs to be applicable to;

[0009] Based on the target application scenario, the original model file is subjected to data format conversion and data optimization to obtain a target model file, wherein the target model file is a data file containing model data in a target format of the three-dimensional geometric model after model conversion.

[0010] In one technical solution of the above three-dimensional geometric model conversion method,

[0011] The model data in the source format includes attribute data and geometric data;

[0012] Based on the target application scenario, the original model file is converted into a data format and optimized to obtain a target model file, including:

[0013] Based on multi-threading technology, data format conversion of the attribute data and the geometric data in the source format is performed concurrently to obtain the attribute data and the geometric data in the target format;

[0014] Based on the target application scenario, optimizing the geometric data in the target format and determining a geometric data optimization result;

[0015] Optimizing the model topology structure according to the geometric data in the target format to obtain a model topology structure optimization result;

[0016] The model data in the target format is determined according to the attribute data in the target format, the optimization result of the geometric data and the optimization result of the model topology structure to obtain the target model file.

[0017] In one technical solution of the above three-dimensional geometric model conversion method,

[0018] The step of optimizing the geometric data in the target format based on the target application scenario and determining the geometric data optimization result includes:

[0019] Determining a scene feature according to the target application scene, wherein the scene feature is a feature used to determine the detail accuracy of different positions of the three-dimensional geometric model after model conversion;

[0020] According to the scene characteristics, the geometric data in the target format is optimized to obtain a geometric data optimization result.

[0021] In one technical solution of the above three-dimensional geometric model conversion method,

[0022] The geometric data includes at least one of vertex coordinates, face indices, normal vectors and texture coordinates of the three-dimensional geometric model;

[0023] The step of optimizing the geometric data in the target format to obtain a geometric data optimization result includes:

[0024] Based on the vertex coordinates, determining the distance between adjacent vertices, and adjusting the number of vertices and vertex positions in the geometric data according to the distance between adjacent vertices to obtain a vertex optimization result; and / or,

[0025] Based on the index of the face, determine the vertices of each face in the three-dimensional geometric model to rearrange the vertex index sequence of each face to obtain a face optimization result; and / or,

[0026] According to the normal vectors of each vertex in the geometric data, the edge sharpness of the three-dimensional geometric model is adjusted to obtain a normal vector optimization result; and / or,

[0027] Based on the normal map baking technology or the light map baking technology, compressing the data amount of the texture coordinates to obtain a texture optimization result;

[0028] The geometric data optimization result is determined according to at least one of the vertex optimization result, the face optimization result, the normal vector optimization result, and the texture optimization result.

[0029] In one technical solution of the above three-dimensional geometric model conversion method,

[0030] The step of optimizing the model topology structure according to the geometric data in the target format to obtain the model topology structure optimization result includes:

[0031] Determining a topological structure of the three-dimensional geometric model according to the geometric data in the target format;

[0032] According to the topological structure, determining whether the three-dimensional geometric model has holes;

[0033] If yes, filling holes in the three-dimensional geometric model based on a hole filling algorithm; and / or,

[0034] According to the topological structure, it is determined whether the three-dimensional geometric model has overlapping surfaces; if so, the overlapping surfaces are removed.

[0035] In one technical solution of the above three-dimensional geometric model conversion method,

[0036] The step of obtaining the original model file of the three-dimensional geometric model comprises:

[0037] Acquire a current model data file of the three-dimensional geometric model, and determine the file format of the current model data file as the source format;

[0038] Based on the source format, feature parsing is performed on the current model data file to obtain model data in the source format of the three-dimensional geometric model;

[0039] Determining whether the model data in the source format meets the model data integrity and validity requirements;

[0040] If so, the original model file is determined according to the model data in the source format.

[0041] In one technical solution of the above three-dimensional geometric model conversion method,

[0042] The performing feature parsing on the current model data file to obtain model data in a source format of the three-dimensional geometric model includes:

[0043] Based on multi-threading technology, concurrently extracting geometric data and attribute data of the three-dimensional geometric model from the current model data file;

[0044] Obtaining the model data in the source format according to the attribute data and the geometric data of the three-dimensional geometric model;

[0045] Among them, the geometric data includes at least one of the vertex coordinates, face index values, normal vectors and texture coordinates of the three-dimensional geometric model; the attribute data includes at least one of the color parameters, material parameters, texture parameters and lighting parameters of the three-dimensional geometric model.

[0046] In one technical solution of the above three-dimensional geometric model conversion method,

[0047] The method further comprises using multithreading technology to concurrently extract geometric data and attribute data from the current model data file according to the following steps, including:

[0048] Dividing the current model data file into at least two data subsets that do not overlap each other;

[0049] Taking each of the data subsets as a task, and generating a data analysis task queue according to all the tasks;

[0050] Setting at least two threads so that each thread obtains tasks from the data analysis task queue to perform data analysis and data extraction on the data subset;

[0051] Based on the extraction data type, the extraction result of each thread is classified to obtain the geometric attributes and attribute data.

[0052] In a second aspect, a controller is provided, comprising at least one processor; and a memory communicatively connected to the at least one processor; wherein a computer program is stored in the memory, and when the computer program is executed by the at least one processor, the method described in any one of the technical solutions of the above-mentioned three-dimensional geometric model conversion method is implemented.

[0053] In a third aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored therein, wherein the program codes are suitable for being loaded and run by a processor to execute the method described in any one of the technical solutions of the above-mentioned three-dimensional geometric model conversion method.

[0054] The above one or more technical solutions of this application have at least one or more of the following Beneficial effects:

[0055] In the case of adopting the above technical solution, the present application can obtain the original model file of the three-dimensional geometric model containing the model data of the source format of the three-dimensional geometric model, and obtain the target application scenario required for the three-dimensional geometric model after the model conversion, and then based on the target application scenario, the original model file is data mapped and optimized to obtain the target model file containing the model data of the target format of the three-dimensional geometric model after the model conversion. Through the above configuration method, by pre-acquiring the target application scenario to which the three-dimensional geometric model is applied, the three-dimensional geometric models of various source formats are converted into models adapted to the target application scenario, which can improve the success rate of model conversion, so that the three-dimensional geometric model after the model conversion has a higher degree of scene applicability, and meets the conversion requirements of users for model conversion in various application scenarios. At the same time, according to the target application scenario, invalid data and incomplete data in the original model file can be filtered, the speed of data mapping and data optimization can be accelerated, and then the target model file can be accurately and quickly obtained, thereby improving the model conversion efficiency of the three-dimensional geometric model.

[0056] In addition, the use of multi-threading technology to concurrently perform data analysis and data extraction on model data in the source format, as well as multi-threaded parallel execution of data optimization and model structure optimization of model data in the target format, can improve the resource utilization of computing resources, thereby increasing the speed of model conversion processes such as data parsing and data optimization, and achieving efficient model conversion of 3D geometric models. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] The preferred embodiments of the present application are described below in conjunction with the accompanying drawings, in which:

[0058] Figure 1 is a schematic flow chart of the main steps of a three-dimensional geometric model conversion method according to an embodiment of the present application;

[0059] Figure 2 It is a schematic flow chart of the main steps of an implementation method of a three-dimensional geometric model conversion method according to an embodiment of the present application;

[0060] Figure 3 It is a schematic diagram of the main structure of a controller according to an embodiment of the present application.

[0061] Reference numerals:

[0062] 11: memory; 12: processor. DETAILED DESCRIPTION

[0063] Some embodiments of the present application are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present application and are not intended to limit the protection scope of the present application.

[0064] In the description of the present application, "module" and "processor" may include hardware, software or a combination of the two. A module may include hardware circuits, various suitable sensors, communication ports, memory, and may also include software parts, such as program code, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware or a combination of the two. Computer-readable storage media include any suitable medium that can store program code, such as a disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as only A, only B or A and B. The term "at least one A or B" or "at least one of A and B" has a similar meaning to "A and / or B" and may include only A, only B or A and B. The singular terms "one" and "the" may also include plural forms.

[0065] See attached Figure 1 , Figure 1 FIG. 1 is a flow chart showing the main steps of a three-dimensional geometric model conversion method according to an embodiment of the present application. Figure 1 As shown, the three-dimensional geometric model conversion method in the embodiment of the present application mainly includes the following steps S101 to S103.

[0066] Step S101: Obtain the original model file of the three-dimensional geometric model.

[0067] In this embodiment, the original model file is a data file containing model data in a source format of a three-dimensional geometric model.

[0068] In this embodiment, the three-dimensional geometric model refers to a model constructed by geometric elements in a three-dimensional space, which can be used to represent the shape, size and position relationship of an object.

[0069] In one implementation, step S101 may further include steps S1011 to S1014:

[0070] Step S1011: Acquire the current model data file of the three-dimensional geometric model, and determine the file format of the current model data file as the source format.

[0071] Step S1012: Based on the source format, feature analysis is performed on the current model data file to obtain model data in the source format of the three-dimensional geometric model.

[0072] Step S1013: Determine whether the model data in the source format meets the model data integrity and validity requirements. If so, proceed to step S1014.

[0073] Step S1014: Determine the original model file according to the model data in the source format.

[0074] In one implementation, step S1011 can be performed by completing the editing and parameter adjustment of the 3D geometric model in professional 3D modeling software, and then exporting the model file in the required format as the current model data file.

[0075] In other implementations, the required three-dimensional model and its model data file can also be obtained through some open source three-dimensional model resource websites, such as Sketchfab platform, TurboSquid platform or CGTrader platform. The three-dimensional model in the actual scene can also be scanned using 3D scanning technology to obtain the current model data file corresponding to the three-dimensional model, which will not affect the normal implementation of the embodiments of the present application.

[0076] Among them, the file formats of the current model data file may include obj format, stl format, fbx format, 3DS format, gltf format and Collada format, etc. Among them, the obj format is suitable for use in the initial stage of learning and development, the stl format and 3DS format are often used in 3D printing and game development, the fbx format and gltf format are often used in application scenarios that require complex animations and real-time rendering, and Collada is often used in applications in games and virtual reality.

[0077] In this embodiment, the source format is used to represent the data format in the current model data file, corresponding to the file format of the current model data file. For example, the source format can be any one or more of XML format, JSON format, Parquet format and other data formats.

[0078] In one embodiment, the model data in the source format may include attribute data and geometric data. Among them, attribute data is data used to describe various attributes and characteristics of the three-dimensional geometric model. Attribute data is a supplement and extension of geometric data, and may include parameters such as color, material, temperature, etc. In some embodiments, attribute data can be set and adjusted through a programming interface or three-dimensional modeling software. Geometric data is data that describes the shape and size of a three-dimensional geometric model, and may include information such as the shape, size, and position of an object. Geometric data usually exists in the form of points, lines, surfaces, and bodies, and may specifically include parameters such as vertex coordinates, normal vectors, patch information, and bounding boxes of objects.

[0079] In one implementation, step S1012 may further include steps S10121 to S10122:

[0080] Step S10121: Based on multi-threading technology, the geometric data and attribute data of the three-dimensional geometric model are concurrently extracted from the current model data file.

[0081] Step S10122: Obtain model data in source format based on the attribute data and geometric data of the three-dimensional geometric model.

[0082] In this embodiment, the geometric data includes at least one of vertex coordinates, face index values, normal vectors and texture coordinates of the 3D geometric model. The attribute data includes at least one of color parameters, material parameters, texture parameters and lighting parameters of the 3D geometric model.

[0083] In one implementation, the task of performing feature analysis on the current model data file may be divided into multiple subtasks, each of which is treated as a thread, and each subtask is executed using a concurrent mechanism of a controller or an operating system.

[0084] Specifically, step S10121 may further include steps S101211 to S101214:

[0085] Step S101211: Divide the current model data file into at least two data subsets that do not overlap with each other.

[0086] Step S101212: Treat each data subset as a task, and generate a data analysis task queue based on all tasks.

[0087] Step S101213: Set at least two threads so that each thread obtains tasks from the data analysis task queue to perform data analysis and data extraction on a data subset.

[0088] Step S101214: Based on the extraction data type, the extraction results of each thread are classified to obtain geometric attributes and attribute data.

[0089] In this embodiment, since the storage methods of attribute data and geometric data are generally different, attribute data is usually stored in the form of a two-dimensional relational table, while geometric data is mainly stored in vector data structures and raster data structures. Therefore, it is also possible to determine whether the extracted data is classified as geometric data or attribute data by extracting the storage method or data structure of the data.

[0090] In this embodiment, by using a concurrent mechanism for parallel computing, the parsing tasks of geometric data and attribute data can be executed concurrently, thereby speeding up the parsing speed of the current model data file and further speeding up the efficiency of model conversion.

[0091] In one implementation, in step S1013, if it is determined that the model data in the source format does not meet the model data integrity and validity requirements, the process may return to step S1011 to reacquire the current data model file.

[0092] Step S102: Acquire the target application scenario.

[0093] In this embodiment, the target application scenario is the application scenario required for the three-dimensional geometric model after the model conversion, which may include 3D printing and rapid prototyping, game development and 3D animation, CAD and engineering design, 3D content display on the Web, WebGL, AR / VR and game development.

[0094] In one implementation, a dialog box may be set to obtain the target application scenario. Specifically, multiple application scenario options may be set in the dialog box so that the user can input a user instruction to determine the target application scenario by clicking or selecting a corresponding application scenario option.

[0095] Step S103: Based on the target application scenario, the original model file is converted into a data format and optimized to obtain a target model file.

[0096] In this embodiment, the target model file is a data file containing model data in a target format of the three-dimensional geometric model after model conversion.

[0097] In one implementation, the data in the original model file can be rechecked to see whether it meets the data integrity and validity requirements based on the target application scenario, so as to reduce the processing of invalid data or missing data during data format conversion and data optimization, and improve the utilization of computing resources.

[0098] In one implementation, the model data in the source format may include attribute data and geometric data, and step S103 may further include:

[0099] Step S1031: Based on the multi-threading technology, data format conversion of attribute data and geometric data in the source format is performed concurrently to obtain attribute data in the target format and geometric data in the target format.

[0100] Step S1032: Based on the target application scenario, optimize the geometric data in the target format and determine the geometric data optimization result.

[0101] Step S1033: Optimize the model topology structure according to the geometric data in the target format to obtain the model topology structure optimization result.

[0102] Step S1034: Determine the model data in the target format according to the attribute data in the target format, the geometry data optimization result and the model topology structure optimization result to obtain the target model file.

[0103] In this implementation, the target application scenario can be used to determine the clarity and sharpness of different positions of the three-dimensional geometric model finally obtained after the model conversion.

[0104] For example, when the target scene is used for game development and 3D animation production, the clarity of the 3D geometric model only needs to ensure the basic core visual elements to improve the rendering speed of the 3D geometric model. At this time, geometric data optimization can include optimizing textures, simplifying geometric figures in non-key areas, and adjusting the complexity of the 3D geometric model using detail level technology.

[0105] In this embodiment, the target format attribute data and the target format geometry data refer to the data formats supported by the target model file.

[0106] In one implementation, step S1032 may further include steps S10321 to S10322:

[0107] Step S10321: Determine the scene characteristics according to the target application scene.

[0108] In this embodiment, the scene feature is a feature used to determine the detail accuracy of different positions of the three-dimensional geometric model after the model conversion.

[0109] Step S10322: Optimize the geometric data in the target format according to the scene characteristics to obtain the geometric data optimization result.

[0110] In this embodiment, the scene characteristics may include the range of polygon quantity, texture mapping material, surface number requirement specification, and other characteristics that limit the final accuracy of the three-dimensional geometric model.

[0111] In one implementation, step S10322 may further include steps S103221 to S103225:

[0112] Step S103221: Based on the vertex coordinates, determine the distance between adjacent vertices, and adjust the number of vertices and vertex positions in the geometric data according to the distance between adjacent vertices to obtain a vertex optimization result.

[0113] In this embodiment, vertices with close distances between adjacent vertices or multiple vertices with overlapping coordinate positions can be merged into one vertex to adjust the number of vertices in the geometric data. In order to optimize the wiring of a three-dimensional geometric model or reduce the number of polygons of a three-dimensional geometric model, the positions of adjacent vertices are adjusted by adjusting vertex coordinates or deleting folded edges of the three-dimensional geometric model.

[0114] Step S103222: Based on the face index, determine the vertices that make up each face in the three-dimensional geometric model to rearrange the vertex index sequence of each face to obtain a face optimization result.

[0115] In this embodiment, the face index is data used to describe the surface geometry of the three-dimensional geometric model, and the outline of the three-dimensional geometric model is formed by triangular faces or other polygonal faces. The face index may include multiple vertex numbers, which are used to indicate the sequential arrangement of the vertices of each face in the three-dimensional geometric model. For example, the face index data may be face 1: vertex 1; vertex 2; vertex 3.

[0116] In one embodiment, the shape and direction of the triangular face can be determined by resetting the index order of the vertices, thereby obtaining a face optimization result suitable for the target application scenario. In other embodiments, overlapping faces or faces that are too close can be found according to the face index, and the overlapping faces or faces that are too close can be deleted to reduce jump access when rendering the three-dimensional model.

[0117] Step S103223: According to the normal vectors of each vertex in the geometric data, the edge sharpness of the three-dimensional geometric model is adjusted to obtain a normal vector optimization result.

[0118] In this embodiment, the normal vector of each vertex is used to determine the orientation of the corresponding vertex and the lighting effect of the surface composed of the vertices.

[0119] In one implementation, it is possible to determine whether the normals of each vertex are consistent based on the normal vectors of each vertex. If they are inconsistent, the normal vectors of adjacent vertices can be averaged to make the normal vectors of these vertices consistent, so as to adjust the edge sharpness of the 3D geometric model and reduce the jagged phenomenon on the surface of the 3D geometric model.

[0120] Step S103224: Based on the normal map baking technology or the light map baking technology, compress the data volume of the texture coordinates to obtain a texture optimization result.

[0121] In this embodiment, texture baking technology is a process of integrating multiple material properties (such as color, roughness, normal and other properties) of a three-dimensional geometric model into one or more maps. By simplifying complex material information into one or more easy-to-manage maps, rendering efficiency can be improved. Among them, normal map baking technology is a technology that transfers the detail information of a high-polygon model to a low-polygon model, which can keep the model with a low polygon count while presenting the visual effect of a high polygon count. Light map baking technology is a technology that saves the lighting calculation results in a three-dimensional scene in the form of a two-dimensional texture, which can be used for lighting pre-calculation of static scenes to reduce the overhead of real-time lighting calculations, thereby improving the rendering performance of three-dimensional geometric models.

[0122] In this embodiment, compressing the data volume of texture coordinates can compress the size of texture files, improve the data processing efficiency of the data optimization process, and further speed up the model conversion.

[0123] Step S103225: Determine the geometry data optimization result according to at least one of the vertex optimization result, the face optimization result, the normal vector optimization result and the texture optimization result.

[0124] In one implementation, step S1033 may further include steps S10331 to S10335:

[0125] Step S10331: Determine the topological structure of the three-dimensional geometric model based on the geometric data in the target format.

[0126] In this embodiment, the topological structure of the three-dimensional geometric model refers to the layout, structure and connection between points, lines and surfaces of the three-dimensional geometric model. Therefore, the connection relationship between faces and faces, faces and edges, and edges and vertices in the three-dimensional geometric model can be determined based on the geometric data, thereby determining the topological structure.

[0127] Step S10332: Determine whether there are holes in the three-dimensional geometric model based on the topological structure. If so, proceed to step S10333; if not, proceed to step S10334.

[0128] In one implementation, the adjacency relationship of each triangle or facet in the three-dimensional geometric model may be traversed, and if there is a triangle or facet that is not adjacent to other triangles or facets, it is determined that there is a hole.

[0129] Step S10333: Fill holes in the three-dimensional geometric model based on a hole filling algorithm.

[0130] In this embodiment, the hole filling algorithm is an algorithm for filling holes in a three-dimensional geometric model. The hole filling algorithm can fill the holes by finding all holes in the three-dimensional model, sorting the half edges of each hole, calculating the angle and distance, and then gradually constructing new triangular facets to fill the holes.

[0131] Step S10334: Determine whether there are overlapping surfaces in the three-dimensional geometric model based on the topological structure. If so, proceed to step S10335.

[0132] In one implementation, a topology checking tool in professional modeling software may be used to determine whether there are overlapping surfaces in the three-dimensional geometric model corresponding to the topological structure.

[0133] Step S10335: Remove overlapping surfaces.

[0134] In this embodiment, while removing the overlapping surfaces, the index of the overlapping surfaces and the vertices constituting the overlapping surfaces may also be synchronously deleted from the geometric data.

[0135] In an application scenario according to an embodiment of the present application, please refer to the attached Figure 2 , attached Figure 2 FIG. 1 is a flow chart of the main steps of an implementation method of a three-dimensional geometric model conversion method according to an embodiment of the present application. Figure 2 As shown, this embodiment may further include the following steps S201 to S207:

[0136] Step S201: Detect the file format of the model file of the three-dimensional geometric model.

[0137] In this implementation, the file format of the model file is the same as the file format of the current model data file in the above implementation, and may include one or more file formats.

[0138] Step S202: Reading three-dimensional geometric model data in multiple file formats from the model file according to the detected file format.

[0139] Step S203: Check the validity and integrity of the 3D geometric model data.

[0140] In this embodiment, the small three-dimensional geometric model data with validity and integrity can be used as the background data of the three-dimensional geometric model.

[0141] In one embodiment, professional modeling software or an open source 3D geometry modeling kernel software package (OpenCASCADE, OCC) can be used to load the model file, and the integrity of the 3D geometry model data can be determined by detecting whether the file data structure of the model is correct through the application programming interface (Application Programming Interface, API) interface provided by the software. In other embodiments, the validity of the 3D geometry model data can also be determined by detecting whether the model file contains attribute information such as material or texture information.

[0142] Step S204: performing feature analysis of the three-dimensional geometric model data.

[0143] In this embodiment, the 3D geometric model data may include geometric data and attribute data. Figure 2 As shown, multi-threading technology can be used to perform data parsing processes of geometric data and attribute data concurrently.

[0144] Step S205: Determine the application scenario and perform data format conversion of the 3D geometric model data.

[0145] In this embodiment, the data format conversion is the same as the step of mapping the model data in the source format to the model data in the target format in the above embodiment.

[0146] In one implementation, the accuracy of the coordinate data in the three-dimensional geometric model data may be first detected according to the application scenario, and all vertices may be detected to be in the expected coordinate system to determine the validity of the three-dimensional geometric model data.

[0147] Step S206: Optimizing the three-dimensional geometric model data after the format conversion.

[0148] In this embodiment, if Figure 2 As shown, step S206 may include geometric data optimization and topology structure optimization.

[0149] In one implementation, multi-threading technology may be used to concurrently perform geometry data optimization and topology structure optimization.

[0150] As an example, the following steps S2061 to S2063 may be used to implement multi-threaded geometric data optimization:

[0151] Step S2061: Use static allocation to divide the geometric data of the model into several non-overlapping subsets.

[0152] The geometric data may include vertex coordinates, face indexes, normal vectors, texture coordinates, etc. Since the amount of 3D geometric model data is known, the data analysis of each subset can be regarded as a task, and the task can be allocated using a mixed static and dynamic allocation method.

[0153] Step S2062: multiple threads are set, and partial subsets are allocated to each thread, so that each thread executes a data analysis task of one subset or multiple subsets.

[0154] Step S2063: Generate a global task queue based on the data analysis tasks of the remaining subsets, so that after each thread completes the current task, it automatically obtains the data analysis tasks of the subset from the global task queue until all tasks are completed.

[0155] Step S207: Output the final three-dimensional geometric model data.

[0156] Based on the methods described in steps S101 to S103 above, the embodiment of the present application can convert 3D geometric models of various source formats into models adapted to the target application scenarios by pre-acquiring the target application scenarios to which the 3D geometric models are applied, thereby improving the success rate of model conversion, making the 3D geometric models after model conversion have a higher degree of scene applicability, and satisfying the conversion requirements of users for model conversion in various application scenarios. At the same time, according to the target application scenarios, invalid data and incomplete data in the original model files can be filtered, speeding up data mapping and data optimization, and then accurately and quickly obtaining the target model files, thereby improving the model conversion efficiency of the 3D geometric models.

[0157] Furthermore, the embodiments of the present application can use multi-threading technology to concurrently perform data analysis and data extraction on model data in the source format, as well as multi-threaded parallel execution of data optimization and model structure optimization of model data in the target format, thereby improving the resource utilization of computing resources, thereby increasing the speed of model conversion processes such as data parsing and data optimization, and achieving efficient model conversion of three-dimensional geometric models.

[0158] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effect of the present application, different steps do not have to be performed in such an order, they can be performed simultaneously or in other orders. These adjusted schemes are equivalent to the technical schemes described in this application, and therefore will also fall within the scope of protection of this application.

[0159] It is understood by those skilled in the art that the present application can implement all or part of the processes in the three-dimensional geometric model conversion method of any of the above embodiments, and can also be completed by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of each of the above method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc.

[0160] Another aspect of the present application also provides a computer-readable storage medium.

[0161] In an embodiment of a computer-readable storage medium according to the present application, the computer-readable storage medium can be configured to store a program for executing the three-dimensional geometric model conversion method of the above-mentioned method embodiment, and the program can be loaded and run by a processor to implement the above-mentioned three-dimensional geometric model conversion method. For ease of explanation, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application. The computer-readable storage medium can be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present application is a non-temporary computer-readable storage medium.

[0162] Another aspect of the present application also provides a controller.

[0163] In an embodiment of a controller according to the present application, the controller may include at least one processor; and a memory connected to the at least one processor in communication; wherein a computer program is stored in the memory, and when the computer program is executed by the at least one processor, the three-dimensional geometric model conversion method described in any of the above embodiments is implemented. Figure 3 , Figure 3 FIG. 4 exemplarily shows that the memory 11 and the processor 12 are communicatively connected via a bus.

[0164] So far, the technical solutions of the present application have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific embodiments. Without departing from the principles of the present application, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present application.

Claims

1. A three-dimensional geometric model conversion method, characterized in that: The method comprises: Acquire an original model file of a three-dimensional geometric model, wherein the original model file is a data file containing model data of the three-dimensional geometric model in a source format; Obtaining a target application scenario, where the target application scenario is an application scenario that the three-dimensional geometric model after model conversion needs to be applicable to; Based on the target application scenario, the original model file is subjected to data format conversion and data optimization to obtain a target model file, wherein the target model file is a data file containing model data in a target format of the three-dimensional geometric model after model conversion.

2. The three-dimensional geometric model conversion method according to claim 1, characterized in that: The model data in the source format includes attribute data and geometric data; Based on the target application scenario, the original model file is converted into a data format and optimized to obtain a target model file, including: Based on multi-threading technology, data format conversion of the attribute data and the geometric data in the source format is performed concurrently to obtain the attribute data and the geometric data in the target format; Based on the target application scenario, optimizing the geometric data in the target format and determining a geometric data optimization result; Optimizing the model topology structure according to the geometric data in the target format to obtain a model topology structure optimization result; The model data in the target format is determined according to the attribute data in the target format, the optimization result of the geometric data and the optimization result of the model topology structure to obtain the target model file.

3. The three-dimensional geometric model conversion method according to claim 2, characterized in that: The step of optimizing the geometric data in the target format based on the target application scenario and determining the geometric data optimization result includes: Determining a scene feature according to the target application scene, wherein the scene feature is a feature used to determine the detail accuracy of different positions of the three-dimensional geometric model after model conversion; According to the scene characteristics, the geometric data in the target format is optimized to obtain a geometric data optimization result.

4. The three-dimensional geometric model conversion method according to claim 3, characterized in that: The geometric data includes at least one of vertex coordinates, face indices, normal vectors and texture coordinates of the three-dimensional geometric model; The step of optimizing the geometric data in the target format to obtain a geometric data optimization result includes: Based on the vertex coordinates, determining the distance between adjacent vertices, and adjusting the number of vertices and vertex positions in the geometric data according to the distance between adjacent vertices to obtain a vertex optimization result; and / or, Based on the index of the face, determine the vertices of each face in the three-dimensional geometric model to rearrange the vertex index sequence of each face to obtain a face optimization result; and / or, According to the normal vectors of each vertex in the geometric data, the edge sharpness of the three-dimensional geometric model is adjusted to obtain a normal vector optimization result; and / or, Based on the normal map baking technology or the light map baking technology, compressing the data amount of the texture coordinates to obtain a texture optimization result; The geometric data optimization result is determined according to at least one of the vertex optimization result, the face optimization result, the normal vector optimization result, and the texture optimization result.

5. The three-dimensional geometric model conversion method according to claim 2, characterized in that: The step of optimizing the model topology structure according to the geometric data in the target format to obtain the model topology structure optimization result includes: Determining a topological structure of the three-dimensional geometric model according to the geometric data in the target format; According to the topological structure, determining whether the three-dimensional geometric model has holes; If yes, filling holes in the three-dimensional geometric model based on a hole filling algorithm; and / or, According to the topological structure, it is determined whether the three-dimensional geometric model has overlapping surfaces; if so, the overlapping surfaces are removed.

6. The three-dimensional geometric model conversion method according to claim 1, characterized in that: The step of obtaining the original model file of the three-dimensional geometric model comprises: Acquire a current model data file of the three-dimensional geometric model, and determine the file format of the current model data file as the source format; Based on the source format, feature parsing is performed on the current model data file to obtain model data in the source format of the three-dimensional geometric model; Determining whether the model data in the source format meets the model data integrity and validity requirements; If so, the original model file is determined according to the model data in the source format.

7. The three-dimensional geometric model conversion method according to claim 6, characterized in that: The performing feature parsing on the current model data file to obtain model data in a source format of the three-dimensional geometric model includes: Based on multi-threading technology, concurrently extracting geometric data and attribute data of the three-dimensional geometric model from the current model data file; Obtaining the model data in the source format according to the attribute data and the geometric data of the three-dimensional geometric model; Among them, the geometric data includes at least one of the vertex coordinates, face index values, normal vectors and texture coordinates of the three-dimensional geometric model; the attribute data includes at least one of the color parameters, material parameters, texture parameters and lighting parameters of the three-dimensional geometric model.

8. The three-dimensional geometric model conversion method according to claim 7, characterized in that: The method further comprises using multithreading technology to concurrently extract geometric data and attribute data from the current model data file according to the following steps, including: Dividing the current model data file into at least two data subsets that do not overlap each other; Taking each of the data subsets as a task, and generating a data analysis task queue according to all the tasks; Setting at least two threads so that each thread obtains tasks from the data analysis task queue to perform data analysis and data extraction on the data subset; Based on the extraction data type, the extraction result of each thread is classified to obtain the geometric attributes and attribute data.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the three-dimensional geometric model conversion method according to any one of claims 1 to 8 is executed when the program is run.

10. A controller comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the three-dimensional geometric model conversion method according to any one of claims 1 to 8 through the computer program.

Citation Information

Cited By

  • Monolithic three-dimensional model streaming loading method for Web side

    CN120976391A

  • A monolithic three-dimensional model streaming loading method for a web end

    CN120976391B