Three-dimensional model conversion method, system and equipment and storage medium

By converting the OBJ model to the M3D model, and using a flow transmission mode and the tree -shaped data structure to divide the triangle network, the problem of low transmission and analytical efficiency of the OBJ model on the browser is solved, and the rapid visualization and large of the three -dimensional model data are realized. Effective processing of large -scale scene data.

CN119339038APending Publication Date: 2025-01-21WUHAN ZHONGDI DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411384333.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

OBJ model files are inefficient in network transmission and parsing and rendering on the browser side, especially when loading large-scale scenario models, it is easy to cause the browser to crash and cannot load all data at once.

Method used

By converting the OBJ model into an M3D model, using the streaming mode, using the preset tree data structure to segment the triangulation network, generating multiple sub-model files, converting them into M3D tile files, and finally generating an M3D three-dimensional model file .

Benefits of technology

It improves the application capabilities of the OBJ model on the browser side, realizes rapid visualization of 3D model data, and solves the problem of transmission and visualization of large-scale scene data in the Web GIS visualization platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119339038A_ABST
    Figure CN119339038A_ABST
Patent Text Reader

Abstract

The invention relates to a three-dimensional model conversion method and system, computer equipment and a storage medium, and the method comprises the steps: reading an OBJ three-dimensional model file, analyzing the OBJ three-dimensional model file, and obtaining a triangulation network of an OBJ three-dimensional model; segmenting the triangulation network of the OBJ three-dimensional model according to a preset tree data structure to obtain a plurality of sub-model files; performing format conversion on each sub-model file to obtain each corresponding M3D tile file; and generating an M3D three-dimensional model file according to each M3D tile file. According to the method and the device, the OBJ three-dimensional model can be converted into the M3D three-dimensional model, so that quick visualization of three-dimensional model data at a browser end is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of three-dimensional geographic information, and specifically to a three-dimensional model conversion method, system, computer equipment and storage medium. Background Art

[0002] OBJ model file is a standard 3D model file format, mainly used in workstation-based 3D modeling and animation software, and suitable for mutual import between 3D software models. However, OBJ model is not conducive to network transmission and is slow to parse and render on the browser side. When loading large-scale scene models, it cannot load all the data at once, and even causes the browser to crash.

[0003] The Specification of data format and service API for pan-spatial 3D model data (M3D for short) is a data exchange format for massive 3D data network applications. It uses a streaming transmission mode to achieve efficient parsing and rendering of multiple terminals. The M3D 3D data format is suitable for the transmission and parsing, storage, drawing, publishing, sharing and interoperation of multi-source heterogeneous 3D geographic spatial data in online and offline environments. It is also suitable for 3D geographic information system-related applications of large-scale pan-spatial 3D spatial data on different terminals. Therefore, it is necessary to study how to convert OBJ models into M3D models to improve the application capabilities of OBJ models on the browser side. Summary of the invention

[0004] Based on the above description, the present application provides a three-dimensional model conversion method, system, device and storage medium to solve how to convert the OBJ model into an M3D model and improve the application capability of the OBJ model on the browser side.

[0005] According to a first aspect, the present application provides a three-dimensional model conversion method, comprising:

[0006] Reading an OBJ three-dimensional model file, parsing the OBJ three-dimensional model file, and obtaining a triangulated network of the OBJ three-dimensional model;

[0007] According to the preset tree data structure, the triangulated network of the OBJ 3D model is segmented to obtain multiple sub-model files;

[0008] Convert the sub-model files into corresponding M3D tile files.

[0009] Generate an M3D three-dimensional model file based on the various M3D tile files.

[0010] In one or more embodiments, the triangulated network of the OBJ three-dimensional model is segmented according to a preset tree data structure to obtain multiple sub-model files, including:

[0011] Calculating the bounding box of the OBJ three-dimensional model according to the parsed data of the OBJ three-dimensional model file; the triangulated network of the OBJ three-dimensional model is located within the bounding box of the OBJ three-dimensional model;

[0012] According to the preset tree data structure, the bounding box of the OBJ three-dimensional model is used as the initial node and the first segmentation is performed to obtain the first tree model;

[0013] Reconstructing the triangulated mesh corresponding to each terminal node of the first tree model, and simplifying the triangulated mesh in the terminal nodes of the reconstructed first tree model according to a triangle folding algorithm to obtain a second tree model;

[0014] If the second tree model does not meet the preset stop segmentation condition, recursively operate on each terminal node of the second tree model, and so on, until the obtained target tree model meets the preset stop segmentation condition;

[0015] According to the model information contained in each terminal node of the target tree model, a corresponding sub-model file is generated.

[0016] In one or more embodiments, the tree data structure is any one of a quadtree, an octree and a KD tree; and / or

[0017] The stop segmentation condition is that the recursive depth of the current tree model reaches a preset depth threshold, or the stop segmentation condition is that the number of triangles contained in any end node of the current tree model exceeds a preset number threshold; and / or

[0018] The method of simplifying the triangular network in the terminal nodes of the reconstructed first tree model according to the triangle folding algorithm includes: using the triangle folding algorithm to calculate the folding cost of each triangle corresponding to each terminal node in the reconstructed first tree model, and simplifying the triangles whose folding cost is less than a preset cost threshold.

[0019] In one or more embodiments, the method further includes: using MapGIS desktop software to convert the coordinate system of the initial OBJ three-dimensional model into a target coordinate system to obtain an OBJ three-dimensional model file; wherein the target coordinate system is used for the M3D three-dimensional model file.

[0020] In one or more embodiments, parsing the OBJ three-dimensional model file to obtain a triangulated network of the OBJ three-dimensional model includes:

[0021] A variety of model parameters and spatial topological relationships are parsed from the OBJ three-dimensional model file to construct a triangulated network of the OBJ three-dimensional model; wherein the model parameters include vertex coordinates, texture coordinates and normals.

[0022] In one or more embodiments, converting the formats of the sub-model files to obtain corresponding M3D tile files includes:

[0023] Parsing the model information contained in each of the sub-model files to generate corresponding target node information;

[0024] Convert the format of each target node information, and generate a tile data file as the M3D tile file according to the converted target node information;

[0025] Wherein, each target node information includes geometric information, texture information and attribute information.

[0026] In one or more embodiments, the method further comprises: obtaining index parameters of each tile through MapGIS desktop software to generate a tile index file;

[0027] The step of generating an M3D three-dimensional model file according to each of the M3D tile files comprises:

[0028] Using the tile index file, the various M3D tile files are organized according to a preset tree data structure to generate M3D tile files at various levels;

[0029] Data assembly is completed based on the M3D tile files at each level to obtain an M3D three-dimensional model file.

[0030] According to a second aspect, the present application provides a three-dimensional model conversion system, comprising:

[0031] A parsing module is used to read an OBJ three-dimensional model file, parse the OBJ three-dimensional model file, and obtain a triangulated network of the OBJ three-dimensional model;

[0032] A segmentation module is used to segment the triangulated network of the OBJ three-dimensional model according to a preset tree data structure to obtain multiple sub-model files;

[0033] A format conversion module, used for converting the formats of the sub-model files to obtain corresponding M3D tile files;

[0034] The generating module is used to generate an M3D three-dimensional model file according to each of the M3D tile files.

[0035] According to a third aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the method described in any of the foregoing embodiments when executing the computer program.

[0036] According to a fourth aspect, the present application provides a 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 described in any of the aforementioned embodiments are implemented.

[0037] Compared with the prior art, the technical solution of this application has the following beneficial technical effects:

[0038] The three-dimensional model conversion method of the embodiment of the present application divides the triangulated network of the OBJ three-dimensional model according to a preset tree data structure to obtain multiple sub-model files, so that the OBJ three-dimensional model has the ability to express in blocks and multiple levels of detail; then each sub-model file is format converted to obtain a corresponding M3D tile file, and then an M3D three-dimensional model file is generated based on each M3D tile file, thereby completing the conversion between the OBJ three-dimensional model and the M3D three-dimensional model, which helps to realize the rapid visualization of the three-dimensional model data on the browser side. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A schematic diagram of a process of a three-dimensional model conversion method provided in an embodiment of the present application;

[0040] Figure 2 for Figure 1 Specific flow diagram of step S12;

[0041] Figure 3 This is a schematic diagram of the principle of segmenting an OBJ three-dimensional model in a specific embodiment of the present application;

[0042] Figure 4 This is a schematic diagram of the principle of triangle folding of a triangulated network in a specific embodiment of the present application;

[0043] Figure 5 for Figure 1 Specific flow diagram of step S13;

[0044] Figure 6 for Figure 1 Specific flow diagram of step S14;

[0045] Figure 7 A schematic diagram of the principle of a three-dimensional model conversion system provided in an embodiment of the present application;

[0046] Figure 8 A schematic diagram of the principles of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. Embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.

[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0049] See also Figure 1 , Figure 1 A schematic diagram of a process flow of a three-dimensional model conversion method provided in an embodiment of the present application is shown. A three-dimensional model conversion method provided in an embodiment of the present application comprises the following steps:

[0050] S11, reading the OBJ three-dimensional model file, parsing the OBJ three-dimensional model file, and obtaining a triangulated network of the OBJ three-dimensional model.

[0051] S12. According to a preset tree data structure, the triangulated network of the OBJ three-dimensional model is segmented to obtain a plurality of sub-model files.

[0052] S13, converting the formats of the sub-model files to obtain the corresponding M3D tile files.

[0053] S14. Generate an M3D three-dimensional model file according to each M3D tile file.

[0054] In the above embodiment, the OBJ 3D model file can be read and parsed by a text editor, special software or programming language to obtain the geometric information, texture information and spatial information of the OBJ 3D model, so as to construct a triangulated network of the OBJ 3D model. The triangulated network refers to the triangular mesh on the surface of the OBJ 3D model.

[0055] According to the preset tree data structure, the triangulated network of the OBJ three-dimensional model is segmented to obtain multiple sub-model files, so as to have the expression ability of block division and multiple levels of detail. Further, each sub-model file is traversed, each sub-model file is read and parsed, and the parsed information is converted into a format to obtain a corresponding M3D tile file, which contains tile data. Further, each M3D tile file is organized and data assembled to obtain an M3D three-dimensional model file.

[0056] The three-dimensional model conversion method of the embodiment of the present application segments the OBJ three-dimensional model, which is equivalent to segmenting the triangulated network, and obtains multiple sub-model files, so that the OBJ three-dimensional model has the ability to express blocks and multiple levels of detail; then each sub-model file is format converted to obtain a corresponding M3D tile file, and then an M3D three-dimensional model file is generated based on each M3D tile file, thereby completing the conversion between the OBJ three-dimensional model and the M3D three-dimensional model, which helps to achieve rapid visualization of the three-dimensional model data on the browser side.

[0057] In some embodiments, before step S11, the method of the embodiment of the present application also includes: using MapGIS desktop software to convert the coordinate system of the initial OBJ three-dimensional model into a target coordinate system to obtain an OBJ three-dimensional model file; wherein the target coordinate system is used for the M3D three-dimensional model file.

[0058] Specifically, the initial OBJ 3D model is opened in MapGIS desktop software, and the coordinate system of the initial OBJ 3D model is converted into the target coordinate system supported by the M3D 3D model file, which includes the WGS84 coordinate system or the CGCS2000 coordinate system. This facilitates subsequent data conversion and calculation, and is conducive to the generation of the M3D 3D model file.

[0059] In some embodiments, the OBJ three-dimensional model file is parsed to obtain the triangulated network of the OBJ three-dimensional model, including: parsing multiple model parameters and spatial topological relationships from the OBJ three-dimensional model file to construct the triangulated network of the OBJ three-dimensional model; wherein the model parameters include vertex coordinates, texture coordinates and normals.

[0060] Specifically, vertex coordinates, texture coordinates, normals and spatial topological relationships are extracted and stored from the OBJ 3D model file to construct a triangulated network of the entire OBJ 3D model. In this way, the OBJ 3D model can be segmented based on the triangulated network, which is conducive to the expression of multiple levels of detail.

[0061] In some embodiments, see Figure 2 In step S12, the OBJ three-dimensional model is segmented based on the triangulated network to obtain multiple sub-model files, including:

[0062] S21. Calculate the bounding box of the OBJ 3D model according to the parsed data of the OBJ 3D model file; the triangulated network of the OBJ 3D model is located within the bounding box of the OBJ 3D model. Specifically, in the process of parsing the OBJ 3D model file, the coordinates of each vertex of the OBJ 3D model are obtained, and the bounding box of the entire OBJ 3D model can be calculated according to the coordinates of each vertex, and the triangulated network of the OBJ 3D model is located within the bounding box of the OBJ 3D model.

[0063] S22, according to the preset tree data structure, the bounding box of the OBJ three-dimensional model is used as the initial node and the first segmentation is performed to obtain the first tree model. It should be noted that for each segmentation, the parent-child node relationship needs to be recorded, and each node stores a corresponding triangle index. The triangle index contains the vertex coordinates and index order of the triangle, so that the model can be correctly rendered and displayed.

[0064] In some embodiments, the preset tree data structure may be any one of a quadtree, an octree, and a KD tree. Figure 3 As shown in the figure, the bounding box of the entire OBJ 3D model is the first-level bounding box. According to the octree structure, the bounding box is the initial node of the octree, that is, the first parent node, and can also be regarded as the root node. The bounding box of the entire OBJ 3D model can be evenly divided into eight small bounding boxes. These eight small bounding boxes are the second-level bounding boxes and are also the child nodes of the initial node.

[0065] S23, reconstructing the triangulated mesh corresponding to each terminal node of the first tree model, and simplifying the triangulated mesh in the terminal nodes of the reconstructed first tree model according to a triangle folding algorithm to obtain a second tree model.

[0066] Specifically, since the entire triangulated network of the OBJ three-dimensional model is located in the overall bounding box, during the segmentation process, segmentation points and segmentation lines will be generated on some triangular surfaces of the overall triangulated network. The segmentation points, segmentation lines and original vertices are connected to reconstruct the triangulated network corresponding to each small bounding box, that is, to reconstruct the triangulated network corresponding to each end node of the first tree model.

[0067] Furthermore, the triangular network in the terminal nodes of the reconstructed first tree model is simplified according to the triangle folding algorithm, including: using the triangle folding algorithm to calculate the folding cost of each triangle contained in each terminal node in the reconstructed first tree model, and simplifying the triangles whose folding cost is less than a preset cost threshold.

[0068] Specifically, the triangle folding algorithm refers to calculating the folding cost based on the curvature and angle of the triangle. Each end node of the first tree model refers to a sub-model contained in a corresponding small bounding box. Using the triangle folding algorithm, the folding cost is calculated for each triangle contained in each end node in the first tree model, and the triangle with a folding cost less than a preset cost threshold is simplified to a vertex, and then all the adjacent points of the triangle are connected to the new vertex, and the triangles adjacent to the triangle are deleted to obtain the second tree model. Figure 4As shown in the figure, the triangle folding process is to replace a triangle face T0 in the triangulated network with a new vertex v0, delete vertices v1, v2, v3 and triangles T1, T2, T3, and connect vertices v4 to v9 to the new vertex v0. In this way, it has the advantages of higher simplification speed, more uniform simplification results, good detail feature preservation, etc. At the same time, the initial tree model is lightweight, which is conducive to the subsequent conversion of the OBJ 3D model into an M3D 3D model.

[0069] S24: If the second tree model does not meet the preset stop segmentation condition, recursively operate on each terminal node of the second tree model, and so on, until the obtained target tree model meets the preset stop segmentation condition.

[0070] In some embodiments, the stop segmentation condition is that the recursive depth of the current tree model reaches a preset depth threshold, which can be set according to actual conditions and is not limited in this embodiment. Alternatively, the stop segmentation condition is that the number of triangles contained in any end node of the current tree model exceeds a preset number threshold, which can be set according to actual conditions and is not limited in this embodiment.

[0071] In a specific embodiment, if the second tree model does not meet the preset stop segmentation condition, a recursive algorithm is used to continue to segment the bounding box corresponding to each terminal node of the second tree model into eight small bounding boxes according to the octree structure to obtain a third tree model, and record the parent-child node relationship, and each node stores a corresponding triangle index. Then the triangulated network corresponding to each terminal node of the third tree model is reconstructed and simplified, and so on, until the target tree model obtained meets the preset stop segmentation condition, so that the target tree model can achieve multi-level and multi-detail expression, and the farther away from the root node, the finer the expression of the target tree model.

[0072] It should be noted that each node of the octree has a corresponding unique code, and each child node of the octree corresponds to a part of the OBJ three-dimensional model. In order to achieve multi-level expression of the model, the bottom node of the octree (that is, the end node) is the most detailed three-dimensional model, and the sum of all the nodes at the bottom is the entire three-dimensional model, that is, the current tree model. The child nodes close to the root node should be rough three-dimensional models, and the closer to the root node, the lower the model resolution, so as to meet the requirements of multi-level expression of the three-dimensional model and help realize the design concept of the M3D three-dimensional model.

[0073] S25. Generate a corresponding sub-model file according to the model information contained in each terminal node of the target tree model.

[0074] Specifically, the hashed sub-model files are generated according to the model information contained in each terminal node in the target tree model. It should be noted that the model information includes model parameters, spatial topological relationships, and triangle indexes. This is conducive to the subsequent conversion of each sub-model file into corresponding M3D tile files.

[0075] In some embodiments, see Figure 5 In step S13, each sub-model file is converted into a format to obtain corresponding M3D tile files, including:

[0076] S51, parsing the model information contained in each sub-model file to generate corresponding target node information; wherein each target node information includes geometric information, texture information and attribute information.

[0077] Specifically, the hashed sub-model files are traversed, the model information contained in each sub-model file is read and parsed, and a corresponding target node information is generated, and the target node information includes geometric information, texture information and attribute information. This is conducive to the subsequent realization of the M3D three-dimensional model.

[0078] S52: Convert the format of each target node information, and generate a tile data file as an M3D tile file according to the converted target node information.

[0079] Specifically, the MapGIS desktop software is used to convert the geometric information in the target node information into a binary .glb file, the attribute information into a .json file, and the texture information into a .jpg file. Further, the geometric information, attribute information, and texture information of the tile are written according to the .m3d data structure to generate an M3D tile file, and the uri (uniform resource identifier) ​​of the M3D tile file is recorded. The suffix of the M3D tile file is .m3d.

[0080] Furthermore, the method of the embodiment of the present application also includes: obtaining the index parameters of each tile through MapGIS desktop software to generate a tile index file. Specifically, the index parameters of each tile are read or calculated through MapGIS desktop software, and the index parameters include information such as the geographic spatial position, rotation matrix, parent-child node relationship and spatial error of each tile, so as to generate a tile index file.

[0081] For further information, see Figure 6 In step S14, an M3D three-dimensional model file is generated according to each M3D tile file, including:

[0082] S61. Organize each M3D tile file according to a preset tree data structure by using the tile index file to generate M3D tile files of various levels.

[0083] Specifically, when the spatial structure of each M3D tile file is organized using a tile index file, the selection of a spatial data index tree will affect the efficiency of loading and rendering tiles. Generally, a tree structure such as a quadtree, an octree or a KD tree is used to organize each M3D tile file. It should be noted that, since a preset tree data structure is used when the OBJ three-dimensional model is segmented, a preset tree data structure is also used when organizing each M3D tile file to obtain M3D tile files at various levels. In a specific embodiment, an octree structure is used when the OBJ three-dimensional model is segmented, so an octree structure is also used when organizing each M3D tile file. The octree structure has been introduced in the OBJ three-dimensional model segmentation, and will not be elaborated on in detail here.

[0084] S62. Complete data assembly based on M3D tile files at all levels to obtain an M3D three-dimensional model file.

[0085] Specifically, the URI, bounding box, tile index file, etc. of each level of M3D tile files are written into the node information description file, and the suffix of the file is .json. The outer bounding box, spatial reference system information, tile organization structure type, URI of the root node description file, etc. of the entire model data are written into the data information description file, and the suffix of the file is .mcj. Further, the M3D tile files, node information description files, and data information description files of each level are assembled together to form M3D data, thereby obtaining an M3D three-dimensional model file.

[0086] In this embodiment, by meshing and organizing the OBJ three-dimensional model data into multiple levels of detail, the three-dimensional model data can be quickly visualized on the browser side, which helps to solve the problems of transmission, visualization, and sharing of large-scale scene data in the Web GIS visualization platform, and ensures that the OBJ three-dimensional model data can be shared and interoperable between different industries, different systems, and different levels.

[0087] In one embodiment, the present application provides a three-dimensional model conversion system, which corresponds one-to-one to a three-dimensional model conversion method in the above embodiment. Figure 7 As shown, the three-dimensional model conversion system 700 includes a parsing module 710, a segmentation module 720, a format conversion module 730 and a generation module 740. The functional modules are described in detail as follows:

[0088] The parsing module 710 is used to read the OBJ 3D model file, parse the OBJ 3D model file, and obtain the triangulated network of the OBJ 3D model.

[0089] The segmentation module 720 is used to segment the triangulated network of the OBJ three-dimensional model according to a preset tree data structure to obtain multiple sub-model files.

[0090] The format conversion module 730 is used to complete the format conversion of the triangle index of each sub-model file to obtain the corresponding M3D tile files.

[0091] The generation module 740 is used to generate an M3D three-dimensional model file according to each M3D tile file.

[0092] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as OBJ three-dimensional model files, sub-model files, M3D tile files and M3D three-dimensional model files. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps of a three-dimensional model conversion method in the above embodiment are implemented.

[0093] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of a three-dimensional model conversion method in the above embodiment are implemented.

[0094] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and 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-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0095] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A three-dimensional model conversion method, characterized in that: include: Reading an OBJ three-dimensional model file, parsing the OBJ three-dimensional model file, and obtaining a triangulated network of the OBJ three-dimensional model; According to the preset tree data structure, the triangulated network of the OBJ 3D model is segmented to obtain multiple sub-model files; Convert the sub-model files into corresponding M3D tile files. Generate an M3D three-dimensional model file based on the various M3D tile files.

2. The three-dimensional model conversion method according to claim 1, characterized in that: The triangulated network of the OBJ three-dimensional model is segmented according to the preset tree data structure to obtain multiple sub-model files, including: Calculating the bounding box of the OBJ three-dimensional model according to the parsed data of the OBJ three-dimensional model file; the triangulated network of the OBJ three-dimensional model is located within the bounding box of the OBJ three-dimensional model; According to the preset tree data structure, the bounding box of the OBJ three-dimensional model is used as the initial node and the first segmentation is performed to obtain the first tree model; Reconstructing the triangulated mesh corresponding to each terminal node of the first tree model, and simplifying the triangulated mesh in the terminal nodes of the reconstructed first tree model according to a triangle folding algorithm to obtain a second tree model; If the second tree model does not meet the preset stop segmentation condition, recursively operate on each terminal node of the second tree model, and so on, until the obtained target tree model meets the preset stop segmentation condition; According to the model information contained in each terminal node of the target tree model, a corresponding sub-model file is generated.

3. The three-dimensional model conversion method according to claim 2, characterized in that: The tree data structure is any one of a quadtree, an octree and a KD tree; and / or The stop segmentation condition is that the recursive depth of the current tree model reaches a preset depth threshold, or the stop segmentation condition is that the number of triangles contained in any end node of the current tree model exceeds a preset number threshold; and / or The method of simplifying the triangular network in the terminal nodes of the reconstructed first tree model according to the triangle folding algorithm includes: using the triangle folding algorithm to calculate the folding cost of each triangle contained in each terminal node in the reconstructed first tree model, and simplifying the triangles whose folding cost is less than a preset cost threshold.

4. The three-dimensional model conversion method according to claim 1, characterized in that: The method further comprises: using MapGIS desktop software to convert the coordinate system of the initial OBJ three-dimensional model into a target coordinate system to obtain an OBJ three-dimensional model file; wherein the target coordinate system is used for the M3D three-dimensional model file.

5. The three-dimensional model conversion method according to claim 1, characterized in that: The step of parsing the OBJ three-dimensional model file to obtain a triangulated network of the OBJ three-dimensional model includes: A variety of model parameters and spatial topological relationships are parsed from the OBJ three-dimensional model file to construct a triangulated network of the OBJ three-dimensional model; wherein the model parameters include vertex coordinates, texture coordinates and normals.

6. The three-dimensional model conversion method according to any one of claims 1 to 5, characterized in that: The format conversion of each sub-model file to obtain corresponding M3D tile files includes: Parsing the model information contained in each of the sub-model files to generate corresponding target node information; Convert the format of each target node information, and generate a tile data file as the M3D tile file according to the converted target node information; Wherein, each target node information includes geometric information, texture information and attribute information.

7. The three-dimensional model conversion method according to any one of claims 1 to 5, characterized in that: The method further comprises: obtaining index parameters of each tile through MapGIS desktop software to generate a tile index file; The step of generating an M3D three-dimensional model file according to each of the M3D tile files comprises: Using the tile index file, the various M3D tile files are organized according to a preset tree data structure to generate M3D tile files at various levels; Data assembly is completed based on the M3D tile files at each level to obtain an M3D three-dimensional model file.

8. A three-dimensional model conversion system, characterized in that: include: A parsing module is used to read an OBJ three-dimensional model file, parse the OBJ three-dimensional model file, and obtain a triangulated network of the OBJ three-dimensional model; A segmentation module is used to segment the triangulated network of the OBJ three-dimensional model according to a preset tree data structure to obtain multiple sub-model files; A format conversion module, used for converting the formats of the sub-model files to obtain corresponding M3D tile files; The generating module is used to generate an M3D three-dimensional model file according to each of the M3D tile files.

9. A computer 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 7 are implemented.

10. A 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 7 are implemented.