Geological cavity model reconstruction method based on mesh repair and UV reordering
By performing layer-by-layer traversal and dynamic mesh reconstruction on the geological cavity model, rendering defects and display issues of complex models were resolved. This enabled mesh repair, rendering optimization, and dynamic switching of display modes during engine runtime, thereby improving the automation of model processing and rendering efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHONGKE HUIZHI (BEIJING) TECH CO LTD
- Filing Date
- 2026-05-07
- Publication Date
- 2026-06-02
AI Technical Summary
Existing technologies suffer from defects when processing complex geological cavity models, such as inconsistent triangular facet order, incomplete normals or tangents, abnormal UVs, duplicate indexes, and zero-area triangles. These defects lead to rendering flaws and display problems, and make it difficult to achieve mesh repair, rendering optimization, and dynamic switching of display modes during engine operation.
By traversing the loading hierarchy of the geological cavity model, identifying mesh components, constructing dynamic meshes, performing triangle filtering and subdivision, updating vertex normals, reconstructing static meshes, and classifying them according to material slots, mesh repair and rendering optimization are achieved, supporting dynamic switching of display modes and real-time adjustment of surface parameters.
The engine automatically performs mesh repair, rendering optimization, dynamic switching of display modes, and real-time adjustment of surface parameters during runtime, improving the versatility and automation of model data processing, and enhancing rendering efficiency and visual effects.
Smart Images

Figure CN122134965A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method for reconstructing geological cavity models based on mesh restoration and UV reordering. Background Technology
[0002] Mesh repair refers to the process of detecting and correcting geometric and topological defects in a 3D geological model. UV reordering is the operation of recalculating and optimizing the allocation of texture coordinates during mesh subdivision or reconstruction. Geological cavity model reconstruction is the process of rebuilding static mesh assets that can be directly used by the rendering engine based on the dynamic mesh data processed by mesh repair and UV reordering.
[0003] In systems such as industrial digital twins, online assembly, and distributed scene editors, the loading and rendering efficiency of models at runtime is extremely critical. This is especially true when dealing with complex models such as industrial equipment, pipelines, containers, mechanical housings, valves, and assemblies. FBX or glTF models exported from CAD or various DCC tools often suffer from data defects due to their complex origins, including inconsistent triangle winding order, incomplete or unstable normals or tangents, UV anomalies, duplicate indexes, and degenerate triangles with zero or near-zero area. These defects, along with abnormal normals or tangents, can lead to rendering flaws such as localized black spots, broken shadows, specular jitter, and flickering. Disordered winding order can even cause localized flipping, resulting in "see-through" or internally incorrectly visible issues. Furthermore, digital twin applications in industrial scenarios are often unsuitable for processing pipelines relying on offline retopology or rebaking. Equipment models require dynamic switching of display strategies during maintenance, internal observation, and regular display, necessitating flexible switching between visible and invisible interiors (backface culling). However, single and double faces are typically controlled by material compilation properties, and simply modifying scalar parameters at runtime often fails to guarantee a genuine change in the culling strategy. Therefore, how to automatically perform mesh repair, rendering optimization, dynamic switching of display modes, and real-time adjustment of surface parameters during engine operation is an urgent technical problem to be solved. Summary of the Invention
[0004] This invention provides a method for reconstructing a geological cavity model based on mesh repair and UV reordering, and a computer-readable storage medium. Its main purpose is to automatically realize mesh repair, rendering optimization, dynamic switching of display mode, and real-time adjustment of surface parameters during engine operation.
[0005] To achieve the above objectives, this invention provides a method for reconstructing geological cavity models based on mesh repair and UV reordering, comprising: Once the geological cavity model is identified, the loading hierarchy of the geological cavity model is traversed to obtain the cavity model module set. Then, the mesh module identification operation is performed on the cavity model module set to obtain the mesh component list. Perform the following operation on each grid component in the grid component list: An initial 3D model mesh image is obtained based on a mesh component, wherein the initial 3D model mesh image includes multiple initial triangles; A dynamic mesh is constructed based on the initial 3D model mesh image, wherein the dynamic mesh includes multiple dynamic triangles; A preliminary degenerate triangle filtering operation is performed on the dynamic mesh to obtain an optimized triangle list, which includes multiple optimized triangles. Once the number of subdivisions is determined, a controlled subdivision operation is performed on each optimized triangle in the optimized triangle list based on the number of subdivisions to obtain a subdivided triangle list. The subdivided triangle list is then subjected to a secondary degenerate filtering to obtain an initial qualified triangle list. Finally, the initial qualified triangle list is subjected to a same vertex classification operation to obtain a set of triangles with the same category vertex. The category vertex triangle set is updated by performing a category vertex normal vector update operation to obtain an updated category vertex triangle set. Based on the updated category vertex triangle set, a static mesh reconstruction operation is performed to obtain a reconstructed static mesh. Summarize the reconstructed static meshes to obtain the reconstructed static mesh set corresponding to the mesh component list. Each reconstructed static mesh in the reconstructed static mesh set corresponds to a material slot. A visual geological cavity model is constructed based on the reconstructed static mesh set.
[0006] Optionally, the construction of the dynamic mesh based on the initial 3D model mesh image includes: The model parameters of multiple initial triangles in the initial 3D model mesh image are analyzed to obtain the 3D model mesh image parameters. The 3D model mesh image parameters include: 3D vertex coordinate set, triangle index set, UV 2D coordinate set, vertex normal vector set, and triangle material information set. The triangle index and triangle material information correspond one-to-one. Create an empty dynamic mesh data structure, which includes: a vertex list, a triangle list, and a material grouping mapping table; The three-dimensional vertex coordinate set, UV two-dimensional coordinate set and vertex normal vector set in the three-dimensional model mesh image parameters are all mapped to the vertex list in the empty dynamic mesh data structure to obtain the dynamic mesh vertex list. Based on the triangle index set and triangle material information set, multiple initial triangles are mapped to the triangle list to obtain the dynamic mesh triangle list; A dynamic mesh is constructed based on a dynamic mesh vertex list and a dynamic mesh triangle list.
[0007] Optionally, the preliminary degenerate triangle filtering operation on the dynamic mesh to obtain an optimized triangle list includes: Dynamic triangles are extracted sequentially from the dynamic mesh, and the extracted dynamic triangles are subjected to a winding consistency correction operation to obtain the dynamic triangles to be filtered. Based on the dynamic triangle to be filtered, the vertex index group of the triangle is identified; Randomly extract the vertex index of the target triangle from the triangle vertex index group, and remove the target triangle vertex index from the triangle vertex index group to obtain the updated triangle vertex index group; If there is an updated triangle vertex index in the updated triangle vertex index group that is equal to the extracted target triangle vertex index, or if two updated triangle vertex indices in the updated triangle vertex index group are equal, then the dynamic triangle to be filtered is removed from the dynamic mesh triangle list to obtain the remaining triangle list. The remaining triangle list is then used to replace the dynamic mesh triangle list in the dynamic mesh to obtain the updated dynamic mesh. If there is no updated triangle vertex index in the updated triangle vertex index group that is equal to the extracted target triangle vertex index, and the two updated triangle vertex indices in the updated triangle vertex index group are not equal, then the dynamic mesh is used as the updated dynamic mesh. Update the dynamic mesh as a dynamic mesh, and return to the step of extracting dynamic triangles from the dynamic mesh sequentially until all dynamic triangles in the dynamic mesh have been extracted; By integrating the remaining triangle list, we obtain the optimized triangle list, which includes multiple optimized triangles.
[0008] Optionally, the step of performing a sequence consistency correction operation on the extracted dynamic triangles to obtain the dynamic triangles to be filtered includes: Based on the extracted dynamic triangle, obtain the set of vertex coordinates and the set of normal vectors of the dynamic triangle, and calculate the surface normal vector based on the set of vertex coordinates of the dynamic triangle; The vertex average normal vector is calculated based on the dynamic triangle normal vector set. The face normal vector and the vertex average normal vector are normalized to obtain the normalized face normal vector and the normalized vertex average normal vector. The calibration surface value is obtained by performing a dot product operation on the normal vector of the normalized surface and the average normal vector of the normalized vertex; If the calibration surface value is less than the preset zero value, the extracted dynamic triangle is subjected to a rewinding operation to obtain the corrected dynamic triangle; If the calibration surface value is not less than zero, the extracted dynamic triangle is taken as a normal dynamic triangle. The dynamic triangle to be filtered is identified based on the corrected dynamic triangle or the normal dynamic triangle.
[0009] Optionally, the controlled subdivision operation is performed on each optimized triangle in the optimized triangle list according to the number of subdivisions to obtain a subdivided triangle list, including: Optimized triangles are extracted sequentially from the list of optimized triangles. The extracted optimized triangles are then subjected to controlled subdivision operations based on the number of subdivisions to obtain a set of newly added triangles. Remove the extracted optimized triangles from the optimized triangle list to obtain an updated optimized triangle list. Use the updated optimized triangle list as the optimized triangle list and return to the previous step of extracting optimized triangles from the optimized triangle list sequentially until all optimized triangles in the optimized triangle list have been extracted. Summarize the newly added triangle sets to obtain multiple newly added triangle sets. Create a blank subdivision triangle list and import the multiple newly added triangle sets into the blank subdivision triangle list to obtain a subdivision triangle list, which contains multiple subdivision triangles.
[0010] Optionally, the controlled subdivision operation on the extracted optimized triangles to obtain a set of newly added triangles includes: Based on the extracted optimized triangles, the set of triangle side lengths is determined. Then, the triangle side lengths are extracted from the set of triangle side lengths in turn. Based on the extracted triangle side lengths, the set of vertex coordinates, the set of UV coordinates of the vertex, and the set of normal vectors of the vertex are determined. The midpoint parameters of the side length are calculated based on the subdivision degree, the set of edge vertex coordinates, the set of edge vertex UV coordinates, and the set of edge vertex normal vectors. The midpoint parameters of the side length include: the midpoint coordinates of the edge vertex, the midpoint coordinates of the edge vertex UV, and the midpoint normal vector of the edge vertex. Summarize the midpoint parameters of the side lengths to obtain the set of midpoint parameters of the side lengths corresponding to the set of triangle side lengths, and identify the newly added triangle set based on the set of midpoint parameters of the side lengths. Based on the extracted optimized triangles, the material information of the target triangles is identified. The newly added triangle set is then identified according to the material information of the target triangles, resulting in the identified newly added triangle set.
[0011] Optionally, the step of updating the category vertex normal vector of the category vertex triangle set to obtain the updated category vertex triangle set includes: Extract category vertex triangle groups sequentially from the category vertex triangle group set, calculate the category triangle face normal vector of each category vertex triangle in the extracted category vertex triangle group, and obtain the category triangle face normal vector set; Perform a weighted average operation on the normal vector set of the class triangle face to obtain the initial normal vector of the class vertex, and calculate the normal vector length based on the initial normal vector of the class vertex; If the length of the normal vector is greater than the preset length threshold, then determine whether the initial normal vector of the category vertex meets the preset normal vector parameter conditions. If the initial normal vector of a category vertex meets the normal vector parameter condition, then the initial normal vector of the category vertex is normalized to obtain the normalized category vertex normal vector. If the length of the normal vector is not greater than the length threshold, then the preset default normal vector will be used as the normalized class vertex normal vector. The extracted category vertex triangle group is replaced with the normalized category vertex normal vector to obtain the updated category vertex triangle group. Summarize and update the vertex triangle sets of the category to obtain the updated vertex triangle sets of the category corresponding to the vertex triangle set.
[0012] Optionally, the step of constructing a visualized geological cavity model based on a reconstructed static mesh set includes: For each reconstructed static mesh in the reconstructed static mesh set, perform the following operations: Determine the display mode parameters, where the display mode parameters are either single-sided display mode or double-sided display mode; Based on the reconstructed static mesh, the target material control parameters and target material slots are identified. The target material control parameters include: scalar parameter set, vector parameter set and texture parameter set, wherein the scalar parameter set includes roughness. Based on the scalar parameter set in the display mode parameters and target material control parameters, the basic material template for reconstructing the static mesh is identified. A dynamic material instance is created based on the reconstructed static mesh base material template. The target material control parameters are copied to the dynamic material instance to obtain the updated dynamic material instance. The updated dynamic material instance is used to replace the component material in the target material slot of the reconstructed static mesh, resulting in an updated material component; Surface reflectance parameters are obtained from the reconstructed static mesh. Roughness factor is calculated based on the surface reflectance parameters. The roughness factor is used to replace the roughness in the scalar parameter set to obtain the updated scalar parameter set. Based on the updated scalar parameter set and updated material components, optimized material components are identified, and the optimized material components are summarized to obtain an optimized material component set; A visual geological cavity model is constructed based on an optimized set of material components.
[0013] Optionally, the step of determining the basic material template for reconstructing the static mesh based on the scalar parameter set in the display mode parameters and target material control parameters includes: The material transparency parameter is determined based on the scalar parameter set in the target material control parameters. The material transparency parameter is either transparent or opaque. If the display mode parameter is set to single-sided display mode and the material transparency parameter is set to material opaque, then a single-sided opaque template is confirmed. If the display mode parameter is set to single-sided display mode and the material transparency parameter is set to material transparent, then a single-sided transparent template is confirmed. If the display mode parameter is set to double-sided display mode and the material transparency parameter is set to material opaque, then a double-sided opaque template is confirmed. If the display mode parameter is set to double-sided display mode and the material transparency parameter is set to material transparent, then the double-sided transparent template is confirmed. The basic material template for reconstructing the static mesh is identified based on a single-sided opaque template, a single-sided transparent template, a double-sided opaque template, or a double-sided transparent template.
[0014] To achieve the above objectives, the present invention also provides a geological cavity model reconstruction system based on mesh repair and UV reordering, comprising: The grid component list construction module is used to identify the geological cavity model, perform a hierarchical traversal on the geological cavity model to obtain the cavity model module set, and perform a grid module identification operation on the cavity model module set to obtain the grid component list. The dynamic mesh construction module performs the following operations on each mesh component in the mesh component list: obtain an initial 3D model mesh image based on the mesh component, wherein the initial 3D model mesh image includes multiple initial triangles; and construct a dynamic mesh based on the initial 3D model mesh image, wherein the dynamic mesh includes multiple dynamic triangles. The controlled subdivision module is used to perform a preliminary degenerate triangle filtering operation on the dynamic mesh to obtain an optimized triangle list. The optimized triangle list includes multiple optimized triangles. The number of subdivisions is determined, and a controlled subdivision operation is performed on each optimized triangle in the optimized triangle list according to the number of subdivisions to obtain a subdivided triangle list. The subdivided triangle list is then subjected to a second degenerate filtering to obtain an initial qualified triangle list. The initial qualified triangle list is then subjected to a same vertex classification operation to obtain a set of triangles with the same category vertex. The model reconstruction module is used to update the category vertex normal vector of the category vertex triangle set to obtain the updated category vertex triangle set. Based on the updated category vertex triangle set, a static mesh reconstruction operation is performed to obtain the reconstructed static mesh. The reconstructed static meshes are summarized to obtain the reconstructed static mesh set corresponding to the mesh component list. Each reconstructed static mesh in the reconstructed static mesh set corresponds to a material slot. A visualized geological cavity model is constructed based on the reconstructed static mesh set.
[0015] To address the above problems, the present invention also provides an electronic device, the electronic device comprising: Memory, storing at least one instruction; The processor executes the instructions stored in the memory to implement the geological cavity model reconstruction method based on mesh repair and UV reordering described above.
[0016] To address the aforementioned problems, the present invention also provides a computer-readable storage medium storing at least one instruction, which is executed by a processor in an electronic device to implement the above-described method for reconstructing geological cavity models based on grid repair and UV reordering.
[0017] To address the problems described in the background art, this invention identifies a geological cavity model, performs a hierarchical traversal of the geological cavity model to obtain a cavity model module set, and performs a mesh module identification operation on the cavity model module set to obtain a mesh component list. This invention can automatically traverse the model structure and accurately extract mesh components without manual preprocessing, adapting to cavity models of different sources and structures, improving the versatility and automation of model data processing. For each mesh component in the mesh component list, the following operations are performed: An initial 3D model mesh image is obtained based on the mesh component, wherein the initial 3D model mesh image includes multiple initial triangles; a dynamic mesh is constructed based on the initial 3D model mesh image, wherein the dynamic mesh includes multiple dynamic triangles. This invention adopts a dynamic mesh structure, supporting real-time editing and modification of triangle, vertex, and normal vector data during runtime; a preliminary degenerate triangle filtering operation is performed on the dynamic mesh to obtain an optimized triangle list, wherein the optimized triangle list includes multiple optimized triangles. This invention avoids rendering black spots, shadow fragmentation, and other problems caused by abnormal triangles by pre-eliminating invalid degenerate triangles with areas close to zero or overlapping vertices, improving the stability of subsequent processing; and the number of subdivisions is identified. Controlled subdivision is performed on each optimized triangle in the optimized triangle list based on the number of subdivisions, resulting in a subdivided triangle list. A secondary degradation filter is then applied to this subdivided triangle list to obtain an initial qualified triangle list. A classification operation for identical vertices is then performed on this initial qualified triangle list to obtain a set of vertex triangles of the same category. This invention achieves refined subdivision while maintaining topological continuity and preserving the original model structure, resulting in a smoother model surface and improved visual effects. The category vertex triangle sets are then updated with newer vertex normal vectors to obtain updated category vertex triangle sets. Static mesh reconstruction is then performed based on these updated category vertex triangle sets to obtain reconstructed static meshes. This invention converts dynamically edited meshes into static meshes, improving rendering efficiency and reducing runtime performance consumption while ensuring correct topology and normal vectors. The reconstructed static meshes are then aggregated to obtain a set of reconstructed static meshes corresponding to the mesh component list. Each reconstructed static mesh in the set corresponds to a material slot. This invention categorizes meshes by material slot, achieving precise binding between materials and meshes, facilitating subsequent dynamic switching of display modes, transparency, roughness, and other parameters. A visualized geological cavity model is then constructed based on the reconstructed static mesh set. Therefore, the present invention can automatically perform mesh repair, rendering optimization, dynamic switching of display modes, and real-time adjustment of surface parameters during engine operation. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating a geological cavity model reconstruction method based on mesh repair and UV reordering according to an embodiment of the present invention. Figure 2A functional block diagram of a geological cavity model reconstruction system based on mesh repair and UV reordering provided in an embodiment of the present invention; Figure 3 A schematic diagram of the structure of an electronic device for implementing the geological cavity model reconstruction method based on mesh repair and UV reordering, according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the triangular winding sequence of a geological cavity model reconstruction method based on mesh repair and UV reordering provided in an embodiment of the present invention.
[0019] Explanation of reference numerals in the attached figures: 10. Electronic device; 11. Processor; 12. Memory; 13. Bus.
[0020] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0021] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0022] This application provides a method for reconstructing a geological cavity model based on mesh repair and UV reordering. The execution entity of this method includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application: a server, a terminal, etc. In other words, the method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster.
[0023] Reference Figure 1 The diagram shown is a flowchart illustrating a geological cavity model reconstruction method based on mesh repair and UV reordering according to an embodiment of the present invention. In this embodiment, the geological cavity model reconstruction method based on mesh repair and UV reordering includes: S1. Identify the geological cavity model, perform a hierarchical traversal on the geological cavity model to obtain the cavity model module set, and perform a mesh module identification operation on the cavity model module set to obtain a list of mesh components.
[0024] It should be explained that a geological cavity model is a 3D digital model of underground natural or artificial cavities (such as caves, mine shafts, underground tunnels, oil and gas reservoir cavities, etc.). The mounting hierarchy traversal uses a stack-based depth-first non-recursive traversal algorithm, starting from a preset root node, to sequentially visit all hierarchical nodes contained in the geological cavity model, obtaining the processing of each hierarchical node and its mounting relationships. The traversal process includes: storing the root node as the starting node in a list to be visited, and then repeatedly recursively retrieving a node from the list to be visited, recording it, and adding all its child nodes to the list, repeating this process until the list is empty. The purpose of the mounting hierarchy traversal is to ensure that no component module is missed, guaranteeing that subsequent repair or processing covers the entire geological cavity model. The mesh module identification operation for the cavity model module set involves performing a mesh existence check on each cavity model module in the cavity model module set to determine whether the cavity model module is associated with a static mesh component. The mesh existence detection process includes: accessing the component list of the cavity model module, traversing all its components, identifying whether the component type is a static mesh component. If at least one static mesh component exists, the module unit is determined to be a mesh module; otherwise, if no static mesh components exist, the module unit is determined to be a non-mesh module, and non-mesh modules are removed from the cavity model module set. Through the above identification operation, all cavity model modules with actual geometric data are selected from the cavity model module set, forming a mesh component list. The mesh component list is a collection of all cavity model modules determined to be mesh modules.
[0025] S2. Perform the following operations on each grid component in the grid component list.
[0026] It should be explained that the mesh component is the cavity model module that is identified as a mesh module.
[0027] S3. Obtain the initial 3D model mesh image based on the mesh component, wherein the initial 3D model mesh image includes multiple initial triangles.
[0028] It should be explained that the initial 3D model mesh image is an image of the 3D geometric topology obtained through the mesh component's geometric data reading interface, without any restoration processing. The geometric data reading interface is a program interface configured by the rendering engine for the mesh component, used to extract raw data related to the 3D model's geometric topology from the mesh component's underlying data carrier. The initial triangle is the smallest geometric topological unit constituting the initial 3D model mesh image. This initial triangle is formed by combining three non-collinear vertices in the initial 3D model mesh image in a specific index order. Each initial triangle possesses independent geometric attributes (such as vertex coordinates, face normal direction, and vertex normal set) and topological attributes (such as triangle face index identifier, material grouping, and UV texture coordinate mapping relationship).
[0029] S4. Construct a dynamic mesh based on the initial 3D model mesh image, wherein the dynamic mesh includes multiple dynamic triangles.
[0030] Specifically, the construction of the dynamic mesh based on the initial 3D model mesh image includes: The model parameters of multiple initial triangles in the initial 3D model mesh image are analyzed to obtain the 3D model mesh image parameters. The 3D model mesh image parameters include: 3D vertex coordinate set, triangle index set, UV 2D coordinate set, vertex normal vector set, and triangle material information set. The triangle index and triangle material information correspond one-to-one. Create an empty dynamic mesh data structure, which includes: a vertex list, a triangle list, and a material grouping mapping table; The three-dimensional vertex coordinate set, UV two-dimensional coordinate set and vertex normal vector set in the three-dimensional model mesh image parameters are all mapped to the vertex list in the empty dynamic mesh data structure to obtain the dynamic mesh vertex list. Based on the triangle index set and triangle material information set, multiple initial triangles are mapped to the triangle list to obtain the dynamic mesh triangle list; A dynamic mesh is constructed based on a dynamic mesh vertex list and a dynamic mesh triangle list.
[0031] It should be explained that the process of parsing the model parameters of multiple initial triangles in the initial 3D model mesh image involves traversing each initial triangle in the initial 3D model mesh image and sequentially extracting the original data associated with that initial triangle, including vertex spatial coordinates, vertex index sequence, UV texture coordinates, vertex normal vectors, and material attribution information. The 3D vertex coordinate set is a collection of the spatial coordinate data of the vertices of all initial triangles in the initial 3D model mesh image in a 3D Cartesian coordinate system. The triangle index set is a collection of the triangle indices corresponding to each initial triangle in the initial 3D model mesh image. The UV 2D coordinate set is a collection of the 2D texture coordinate data corresponding to all vertices in the initial 3D model mesh image. 2D texture coordinate data is a set of data used to establish the mapping relationship between the vertices of the 3D model mesh surface and the pixels of the 2D texture image. The vertex normal vector set is a collection of the normal vector data corresponding to all vertices in the initial 3D model mesh image. The triangle material information set is a collection of the material attribution information corresponding to each initial triangle in the initial 3D model mesh image. It should be noted that each initial triangle corresponds to a unique material identifier (such as material ID, material name, material slot number, etc.). The empty dynamic mesh data structure is a standardized data storage framework pre-created for building editable dynamic meshes. It comprises three core data storage units: a vertex list, a triangle list, and a material grouping map. The vertex list stores the attributes of the vertices in the dynamic mesh. The triangle list stores the topological information of the triangles in the dynamic mesh. The material grouping map stores the material relationships between triangles. It records the material affixation of each triangle in the dynamic mesh, using a unique triangle identifier as the key and a material identifier as the value.
[0032] Understandably, the dynamic mesh vertex list is a list formed by mapping the 3D vertex coordinate set, UV 2D coordinate set, and vertex normal vector set from the 3D model mesh image parameters to the vertex list of an empty dynamic mesh data structure. The step of mapping multiple initial triangles to the triangle list based on the triangle index set and triangle material information set is as follows: traverse each initial triangle in the initial 3D model mesh image, extract the three associated vertex identifiers from the dynamic mesh vertex list based on its corresponding triangle index value, construct the topological association information of the triangle, and simultaneously extract the corresponding material information (from the triangle material information set). Integrate the topological association information and material information into a complete triangle data entry, and record the complete triangle data entry into the triangle list of the empty dynamic mesh data structure. The dynamic mesh triangle list is a list that records the dynamic mesh topology, formed by mapping initial triangles to the triangle list of an empty dynamic mesh data structure based on the triangle index set and triangle material information set. The steps for constructing a dynamic mesh based on a dynamic mesh vertex list and a dynamic mesh triangle list are as follows: Bind the vertex index corresponding to each triangle data in the dynamic mesh triangle list to the unique identifier of the vertex in the vertex list; based on the material information of each triangle data in the dynamic mesh triangle list, complete the material grouping mapping table in the empty dynamic mesh data structure, clarify the relationship between each triangle and the material, ensure that the material distribution of the dynamic mesh is consistent with the geological cavity model, call the dynamic mesh construction interface of the rendering engine, take the dynamic mesh vertex list, dynamic mesh triangle list, and material grouping mapping table as input parameters, and integrate the vertex data and triangle topology data into a unified three-dimensional mesh topology structure, i.e., the dynamic mesh, according to the rendering engine's preset dynamic mesh topology integration rules. The dynamic mesh topology integration rules include: the rendering engine establishes a mapping relationship between vertex data and primitives by parsing the vertex index values in the triangle list. According to the mapping relationship, the rendering engine extracts the vertex data corresponding to the vertex index values from the vertex buffer (the vertex buffer is a memory buffer used to store the original data of all vertices of the 3D model). According to the preset primitive topology structure (e.g., triangle list), the vertex data corresponding to the vertex index is organized into geometric primitives (e.g., every three vertices form a triangle) to generate a vertex sequence that can be processed by the graphics pipeline. At the same time, the rendering engine binds specific data streams (including attributes such as position offset and texture coordinate offset) in the vertex buffer to the input semantics of the shader through predefined vertex attribute pointers to complete the integration of topology data.
[0033] S5. Perform a preliminary degenerate triangle filtering operation on the dynamic mesh to obtain an optimized triangle list, which includes multiple optimized triangles.
[0034] In detail, the preliminary degenerate triangle filtering operation on the dynamic mesh to obtain an optimized triangle list includes: Dynamic triangles are extracted sequentially from the dynamic mesh, and the extracted dynamic triangles are subjected to a winding consistency correction operation to obtain the dynamic triangles to be filtered. Based on the dynamic triangle to be filtered, the vertex index group of the triangle is identified; Randomly extract the vertex index of the target triangle from the triangle vertex index group, and remove the target triangle vertex index from the triangle vertex index group to obtain the updated triangle vertex index group; If there is an updated triangle vertex index in the updated triangle vertex index group that is equal to the extracted target triangle vertex index, or if two updated triangle vertex indices in the updated triangle vertex index group are equal, then the dynamic triangle to be filtered is removed from the dynamic mesh triangle list to obtain the remaining triangle list. The remaining triangle list is then used to replace the dynamic mesh triangle list in the dynamic mesh to obtain the updated dynamic mesh. If there is no updated triangle vertex index in the updated triangle vertex index group that is equal to the extracted target triangle vertex index, and the two updated triangle vertex indices in the updated triangle vertex index group are not equal, then the dynamic mesh is used as the updated dynamic mesh. Update the dynamic mesh as a dynamic mesh, and return to the step of extracting dynamic triangles from the dynamic mesh sequentially until all dynamic triangles in the dynamic mesh have been extracted; By integrating the remaining triangle list, we obtain the optimized triangle list, which includes multiple optimized triangles.
[0035] It should be explained that a dynamic triangle is the smallest geometric unit of a dynamic mesh. The detailed steps for performing a sequence consistency correction operation on the extracted dynamic triangles to obtain the dynamic triangles to be filtered will be given later. The triangle vertex index group is a set of index values corresponding to the three vertices of the dynamic triangle to be filtered. For example, if the dynamic triangle to be filtered is ABC, then points A, B, and C form the triangle vertex index group. The target triangle vertex index is the index value of a vertex randomly selected from the triangle vertex index group. The updated triangle vertex index group is a set containing the index values of the remaining two vertices after removing the target triangle vertex index from the triangle vertex index group. The updated triangle list is a list of dynamic mesh triangles formed after performing a degradation judgment on a single dynamic triangle to be filtered. The steps for integrating the remaining triangle lists are as follows: First, an empty temporary triangle list is constructed as the integration carrier. Then, according to the extraction order of the dynamic triangles, the triangle data from the updated triangle list generated after the degradation judgment of each dynamic triangle is entered into the temporary triangle list (if the updated triangle list is the list after removing degenerate triangles, only the remaining valid triangles are entered; if the updated triangle list is the original dynamic mesh triangle list, the corresponding triangle data is completely retained). After iteratively summarizing all the remaining triangle lists, redundant data cleaning is performed on the temporary triangle list to remove duplicate triangle data. The optimized triangle list is the triangle set obtained by integrating and deduplicating the updated triangle lists generated in each iteration after all dynamic triangles have undergone degradation judgment.
[0036] It should be noted that if there is an updated triangle vertex index in the updated triangle vertex index group that is equal to the extracted target triangle vertex index, or if two updated triangle vertex indices in the updated triangle vertex index group are equal, it means that at least two of the three vertex indices of the dynamic triangle to be filtered are exactly the same, i.e., the triangle has duplicate vertices. Similarly, if two of the three vertex indices of the dynamic triangle to be filtered are the same, it also indicates that the triangle has duplicate vertices. In both cases, the three vertices of the dynamic triangle to be filtered do not form a valid triangulation topology (at least two vertices overlap). Such triangles have no actual geometric area and cannot be rendered normally; they are invalid degenerate triangles that need to be removed. Therefore, the dynamic triangle to be filtered needs to be removed from the dynamic mesh triangle list. If there is no updated triangle vertex index in the updated triangle vertex index group that is equal to the extracted target triangle vertex index, and two updated triangle vertex indices in the updated triangle vertex index group are not equal, it means that all three vertex indices of the dynamic triangle to be filtered are unique and do not overlap. The three vertices can form a triangulation topology with effective geometric area, and are valid triangles that can be rendered normally, so they do not need to be removed.
[0037] Specifically, the step of performing a sequence consistency correction operation on the extracted dynamic triangles to obtain the dynamic triangles to be filtered includes: Based on the extracted dynamic triangle, obtain the set of vertex coordinates and the set of normal vectors of the dynamic triangle, and calculate the surface normal vector based on the set of vertex coordinates of the dynamic triangle; The vertex average normal vector is calculated based on the dynamic triangle normal vector set. The face normal vector and the vertex average normal vector are normalized to obtain the normalized face normal vector and the normalized vertex average normal vector. The calibration surface value is obtained by performing a dot product operation on the normal vector of the normalized surface and the average normal vector of the normalized vertex; If the calibration surface value is less than the preset zero value, the extracted dynamic triangle is subjected to a rewinding operation to obtain the corrected dynamic triangle; If the calibration surface value is not less than zero, the extracted dynamic triangle is taken as a normal dynamic triangle. The dynamic triangle to be filtered is identified based on the corrected dynamic triangle or the normal dynamic triangle.
[0038] It needs to be explained that the dynamic triangle vertex coordinate set is the set of spatial coordinates of the dynamic triangle in a three-dimensional Cartesian coordinate system. The dynamic triangle normal vector set is the set bound to the extracted dynamic triangle, consisting of the vertex normal vectors corresponding to each of the three vertices of the triangle. The step of calculating the vertex average normal vector based on the dynamic triangle normal vector set is as follows: add the dynamic triangle normal vectors in the dynamic triangle normal vector set to obtain the summed vector, count the number of dynamic triangle normal vectors in the dynamic triangle normal vector set, and divide the summed vector by this count to obtain the vertex average normal vector. The normalization of both the face normal vector and the vertex average normal vector involves calculating the magnitude of the face normal vector and the magnitude of the vertex average normal vector, respectively, and dividing the X, Y, and Z components of the face normal vector and the vertex average normal vector by their corresponding magnitudes. The normalized face normal vector and the normalized vertex average normal vector are the unit vectors obtained after normalizing the face normal vector and the vertex average normal vector of the dynamic triangle, respectively.
[0039] For example, the set of dynamic triangle vertex coordinates is {(0,0,0), (10,0,0), (0,10,0)}. Subtracting (0,0,0) from the dynamic triangle vertex coordinates (10,0,0) in the set of dynamic triangle vertex coordinates gives (10,0,0), and subtracting (0,0,0) from the dynamic triangle vertex coordinates (0,10,0) in the set of dynamic triangle vertex coordinates gives (0,10,0). Multiplying (10,0,0) and (0,10,0) gives (0,0,100) as the face normal vector.
[0040] Understandably, the calibration facet value is the value obtained after the dot product calculation operation. The calibration facet value indicates the consistency of the direction of the normalized surface normal vector and the normalized vertex average normal vector: the closer the value is to 1, the more consistent the directions of the two vectors; the closer the value is to -1, the more opposite the directions of the two vectors. The zero value is 0. If the calibration facet value is less than the preset zero value, it means that the direction of the normalized surface normal vector and the normalized vertex average normal vector are opposite (the included angle is greater than 90°), which means that the vertex rotation direction of the dynamic triangle does not conform to the preset external normal orientation requirement of the geological cavity model. At this time, the front of the triangle faces the inside of the model and the back faces the outside, which will cause problems such as internal visibility errors or abnormal lighting during rendering. Therefore, it is necessary to perform a rotation correction operation on the dynamic triangle. The rotation operation on the extracted dynamic triangle is the operation of swapping the vertex order of the extracted dynamic triangle. For example, if the vertices of the extracted dynamic triangle are (0, 2, 3), after performing the rotation operation on the vertices of the extracted dynamic triangle, the vertices of the corrected dynamic triangle are (0, 3, 2). It should be noted that in 3D graphics, the winding order of a triangle determines the orientation of its front face. When the dot product of the average directions of the face normal and the vertex normal is less than zero, it indicates that the current front face of the triangle is pointing in the opposite direction to the desired direction. The winding order needs to be reversed by swapping vertex indices. The reason for choosing to swap 2 and 3 instead of 0 and 2 is that swapping 0 and 2 cannot change the winding direction (for example, when the original order (0, 2, 3) is counter-clockwise, swapping 0 and 2 to get (2, 0, 3) still maintains the counter-clockwise direction; it only changes the starting point and does not achieve a true reversal of the front and back faces). However, swapping 2 and 3 to get (0, 3, 2) can change the counter-clockwise direction to clockwise, such as... Figure 4 As shown, this achieves effective flipping of the front and back faces. Similarly, swapping 0 and 3 achieves the same effect, but in engineering practice, swapping 2 and 3 is chosen to keep the first vertex 0 as the reference point, which facilitates code implementation and debugging. If the calibration face value is not less than zero, it means that the direction of the normal vector of the normalized face is consistent with the direction of the average normal vector of the normalized vertex (the included angle is less than or equal to 90°). This means that the vertex rotation direction of the dynamic triangle conforms to the preset external normal orientation requirements of the geological cavity model and can be rendered normally without performing rotation correction. A normal dynamic triangle is a dynamic triangle with a calibration face value not less than zero that does not require rotation correction. The dynamic triangle to be filtered is the dynamic triangle obtained after the rotation consistency correction operation.
[0041] S6. Determine the number of subdivisions. Perform controlled subdivision operations on each optimized triangle in the optimized triangle list according to the number of subdivisions to obtain a subdivided triangle list. Perform secondary degenerate filtering on the subdivided triangle list to obtain an initial qualified triangle list. Perform same vertex classification operations on the initial qualified triangle list to obtain a set of triangles with the same category vertex.
[0042] It should be explained that the method for performing secondary degenerate filtering on the subdivided triangle list is the same as the method for performing preliminary degenerate triangle filtering on the dynamic mesh to obtain the optimized triangle list, and will not be repeated here. The initial qualified triangle list is a list of triangles obtained after performing secondary degenerate filtering on the subdivided triangle list. The step of performing the same vertex classification operation on the initial qualified triangle list to obtain the category vertex triangle set is as follows: extract the vertex indices of all initial qualified triangles in the initial qualified triangle list; using a single vertex index as the classification criterion, group all initial qualified triangles containing that vertex into the same group, forming a category vertex triangle group with the shared vertex as the core; after traversing all vertex indices to complete the classification, summarize all category vertex triangle groups to finally obtain the category vertex triangle set.
[0043] It should be noted that during the controlled subdivision process, when the optimized triangle is split into multiple subdivision triangles, new degenerate triangles may be generated due to overlapping vertex coordinates, side lengths approaching zero, etc. (Degenerate triangles are triangles with repeated indices, collinear three points, or geometric areas of zero or near zero. These degenerate triangles are not identified by the initial degeneracy filter, and retaining them will lead to abnormal mesh processing and rendering defects in subsequent processes). Therefore, this invention performs secondary degeneracy filtering on the subdivision triangle list. Through secondary degeneracy filtering, newly added degenerate triangles can be accurately removed, preventing them from entering the initial qualified triangle list and affecting the accuracy of subsequent classification of the same vertex and the update of the normal vector of the category vertex. This ensures the topological integrity and data validity of the category vertex triangle set.
[0044] Specifically, the controlled subdivision operation is performed on each optimized triangle in the optimized triangle list according to the number of subdivisions to obtain a subdivided triangle list, including: Optimized triangles are extracted sequentially from the list of optimized triangles. The extracted optimized triangles are then subjected to controlled subdivision operations based on the number of subdivisions to obtain a set of newly added triangles. Remove the extracted optimized triangles from the optimized triangle list to obtain an updated optimized triangle list. Use the updated optimized triangle list as the optimized triangle list and return to the previous step of extracting optimized triangles from the optimized triangle list sequentially until all optimized triangles in the optimized triangle list have been extracted. Summarize the newly added triangle sets to obtain multiple newly added triangle sets. Create a blank subdivision triangle list and import the multiple newly added triangle sets into the blank subdivision triangle list to obtain a subdivision triangle list, which contains multiple subdivision triangles.
[0045] Understandably, the number of subdivisions is a user-preset parameter used to determine the number of subdivision triangles into which a single optimized triangle is broken down. Optimized triangles are valid triangles extracted from the optimized triangle list that have undergone order consistency correction and initial degradation filtering. Detailed steps for performing controlled subdivision operations on the extracted optimized triangles based on the number of subdivisions to obtain the set of newly identified triangles will be given later. Updating the optimized triangle list involves removing individual optimized triangles that have undergone subdivision from the original optimized triangle list. The set of newly identified triangles is a collection of all newly subdivided triangles generated after performing controlled subdivision operations on a single optimized triangle at a preset number of subdivisions. The blank subdivision triangle list is a pre-created list without any triangle data to summarize all newly identified triangle sets. The subdivision triangle list is a list containing all subdivision triangles formed by importing multiple newly identified triangle sets generated after subdividing all optimized triangles into the blank subdivision triangle list. A subdivision triangle is the smallest geometric topological unit newly generated after performing controlled subdivision operations on a single optimized triangle, constituting the subdivision triangle list.
[0046] Specifically, the controlled subdivision operation on the extracted optimized triangles to obtain a set of newly added triangles includes: Based on the extracted optimized triangles, the set of triangle side lengths is determined. Then, the triangle side lengths are extracted from the set of triangle side lengths in turn. Based on the extracted triangle side lengths, the set of vertex coordinates, the set of UV coordinates of the vertex, and the set of normal vectors of the vertex are determined. The midpoint parameters of the side length are calculated based on the subdivision degree, the set of edge vertex coordinates, the set of edge vertex UV coordinates, and the set of edge vertex normal vectors. The midpoint parameters of the side length include: the midpoint coordinates of the edge vertex, the midpoint coordinates of the edge vertex UV, and the midpoint normal vector of the edge vertex. Summarize the midpoint parameters of the side lengths to obtain the set of midpoint parameters of the side lengths corresponding to the set of triangle side lengths, and identify the newly added triangle set based on the set of midpoint parameters of the side lengths. Based on the extracted optimized triangles, the material information of the target triangles is identified. The newly added triangle set is then identified according to the material information of the target triangles, resulting in the identified newly added triangle set.
[0047] It should be explained that the triangle side length set is a set consisting of the three geometric sides of the extracted optimized triangle. A triangle side length is a single geometric side of the optimized triangle. The edge vertex coordinate set is a set of 3D spatial coordinates of the two endpoints (vertices) of that edge, determined based on the extracted single triangle side length. The edge vertex UV coordinate set is a set of 2D texture coordinates corresponding to the two endpoints of that edge, bound to the extracted triangle side length. The edge vertex normal vector set is a set of vertex normal vectors corresponding to the two endpoints of that edge, determined based on the extracted triangle side length. The steps for calculating the midpoint parameter of the triangle side length based on the subdivision number, vertex coordinate set, UV coordinate set, and normal vector set are as follows: First, sum the x, y, and y coordinates of the vertex coordinates in the vertex coordinate set, then divide each sum by 2 raised to the power of n (where n is the subdivision number) to obtain the midpoint coordinates. Second, sum the UV coordinates of the vertex coordinates in the UV coordinate set, then divide each sum by 2 raised to the power of n (where n is the subdivision number) to obtain the UV midpoint coordinates. Third, calculate the normal vector of the midpoint of the triangle side length by performing an arithmetic mean on the normal vectors of the two endpoints in the normal vector set. The midpoint parameter set is a collection of midpoint parameters. The newly added triangle set is a collection of all new triangles generated by disassembling the optimized triangle according to a preset subdivision rule based on the midpoint parameter set. The target triangle material information is the material attribution information corresponding to the optimized triangle, including material ID, material slot number, and material parameter configuration. The step of identifying the newly added triangle set based on the target triangle material information is as follows: assign each newly added triangle in the newly added triangle set a material attribute (such as material ID, material slot number, material parameter configuration) that is consistent with the target triangle material information.
[0048] It should be noted that in the above steps of this invention, since the geometric, texture, and orientation features of a triangle are all determined by vertex attributes, extracting the vertex-related set of the edges is the basis for subsequent calculation of the edge midpoint parameters. This ensures that the midpoint parameters fit the basic features of the original triangle. Then, based on the number of subdivisions, linear interpolation or arithmetic mean calculations are performed on the three types of vertex sets of the edges to obtain the three types of edge midpoint parameters: 3D coordinates, UV coordinates, and normal vectors. The number of subdivisions determines the calculation accuracy and degree of subdivision of the midpoint. The midpoint parameters calculated according to the number of subdivisions ensure that the newly added vertices after subdivision are continuously connected to the original triangle in terms of spatial position, texture mapping, and surface orientation, avoiding cracks, texture misalignment, or lighting anomalies. Finally, the midpoint parameters of all edges of the optimized triangle are summarized to form the edge midpoint parameter set. Based on this parameter set, the original optimized triangle is decomposed into multiple new triangles, forming a new set of triangles. The new triangles are constructed based on the midpoint parameter because the midpoint parameter completely preserves the topological and attribute characteristics of the original triangle. Decomposition based on this ensures that the geometric shape of the new triangles is highly consistent with the original triangles, achieving controllable and refined subdivision. Finally, the corresponding material attribution information is extracted from the original optimized triangles, and this material information is used to uniformly identify all the new triangles in the new set of triangles, assigning them the same material attributes as the original triangles. Since the subdivided new triangles are topological derivative units of the original triangles, binding the same material information can ensure the consistency of the overall material distribution of the model, avoid material confusion after subdivision, and the material identification can also make the material attributes of the new triangles traceable.
[0049] S7. Perform a category vertex normal vector update operation on the category vertex triangle set to obtain an updated category vertex triangle set. Perform a static mesh reconstruction operation based on the updated category vertex triangle set to obtain a reconstructed static mesh.
[0050] It should be explained that the static mesh reconstruction operation based on the updated category vertex triangle set involves traversing each updated category vertex triangle in the updated category vertex triangle set, extracting the position coordinates of its three vertices, the updated normalized category vertex normal vector, UV coordinates, and the recalculated tangent vector. This vertex data is written to the vertex buffer (a memory area in the rendering engine used to store all attribute data of the mesh vertices) according to the format required by the rendering engine. Simultaneously, the vertex indices of the triangles are sequentially written to the index buffer (a memory area in the rendering engine used in conjunction with the vertex buffer). Finally, the static mesh creation interface (the entry point exposed by the rendering engine) is called to encapsulate the buffer data into a complete static mesh, and the corresponding material slot identifier is bound to this mesh. This results in a reconstructed static mesh whose geometry remains unchanged but whose normal vectors have been corrected and can be directly used for rendering. The rendering engine is a software module (such as Unreal Engine, Unity, etc.) with core functions such as 3D model data processing, geometric calculation, lighting rendering, and image output. The steps of the above static mesh reconstruction operation can be implemented using existing technologies and will not be elaborated further here.
[0051] In detail, the step of updating the category vertex normal vector of the category vertex triangle set to obtain the updated category vertex triangle set includes: Extract category vertex triangle groups sequentially from the category vertex triangle group set, calculate the category triangle face normal vector of each category vertex triangle in the extracted category vertex triangle group, and obtain the category triangle face normal vector set; Perform a weighted average operation on the normal vector set of the class triangle face to obtain the initial normal vector of the class vertex, and calculate the normal vector length based on the initial normal vector of the class vertex; If the length of the normal vector is greater than the preset length threshold, then determine whether the initial normal vector of the category vertex meets the preset normal vector parameter conditions. If the initial normal vector of a category vertex meets the normal vector parameter condition, then the initial normal vector of the category vertex is normalized to obtain the normalized category vertex normal vector. If the length of the normal vector is not greater than the length threshold, then the preset default normal vector will be used as the normalized class vertex normal vector. The extracted category vertex triangle group is replaced with the normalized category vertex normal vector to obtain the updated category vertex triangle group. Summarize and update the vertex triangle sets of the category to obtain the updated vertex triangle sets of the category corresponding to the vertex triangle set.
[0052] It should be explained that the method for calculating the normal vector of each category vertex triangle in the extracted category vertex triangle group is the same as the method for calculating the surface normal vector based on the dynamic triangle vertex coordinate set, and will not be repeated here. The category triangle surface normal vector set is a collection composed of category triangle surface normal vectors. The step of performing a weighted average operation on the category triangle surface normal vector set to obtain the initial normal vector of the category vertex is as follows: calculate the average value of the X, Y, and Z components corresponding to the category triangle surface normal vectors in the category triangle surface normal vector set, and the resulting vector is the initial normal vector of the category vertex. The normal vector length is the magnitude of the initial normal vector of the category vertex. The length threshold is a pre-set threshold used to distinguish between valid and invalid normal vectors. The length threshold is set by calculating the average side length and the standard deviation of the side length of all triangles in the geological cavity model, and subtracting three times the standard deviation of the side length from the average side length to obtain the length threshold.
[0053] Importantly, if the normal vector length is greater than a preset length threshold, it indicates that the initial normal vector of the category vertex is not a zero vector with all components equal to 0. It avoids vector collapse due to calculation errors and still possesses the effective characteristic of accurately representing the surface orientation of the corresponding vertex, and is not an invalid vector without practical meaning. Normal vector parameter conditions include non-numerical or non-infinite values. If the initial normal vector of the category vertex meets the normal vector parameter conditions, it means that the initial normal vector of the category vertex does not contain abnormal components such as non-numerical or infinite values, and its mathematical expression is complete and valid. The method for normalizing the initial normal vector of the category vertex is the same as the method for normalizing both the surface normal vector and the vertex average normal vector, and will not be repeated here. The normalized category vertex normal vector is the normalized initial normal vector of the category vertex. If the normal vector length is not greater than the length threshold, it indicates that the initial normal vector of the category vertex is an invalid vector, exhibiting vector collapse anomalies, unable to effectively represent the vertex orientation, and does not meet the normal vector validity condition, and cannot be used for subsequent normalization processing. The default normal vector is a pre-set normal vector. For example, the default normal vector is (0,1,0). The vertex normal vector replacement operation is the process of uniformly replacing the original normal vectors of the target vertices in the category vertex triangle group with normalized category vertex normal vectors. Updating the category vertex triangle group is the triangle group obtained after performing the vertex normal vector replacement operation on the category vertex triangle group. The updated category vertex triangle group set is a set composed of the updated category vertex triangle groups.
[0054] S8. Summarize the reconstructed static meshes to obtain the reconstructed static mesh set corresponding to the mesh component list. Each reconstructed static mesh in the reconstructed static mesh set corresponds to a material slot.
[0055] It should be explained that a reconstructed static mesh set is a collection composed of reconstructed static meshes. A material slot is a standardized storage unit in the rendering engine used to bind mesh materials.
[0056] S9. Construct a visual geological cavity model based on the reconstructed static mesh set.
[0057] In detail, the construction of a visualized geological cavity model based on a reconstructed static mesh set includes: For each reconstructed static mesh in the reconstructed static mesh set, perform the following operations: Determine the display mode parameters, where the display mode parameters are either single-sided display mode or double-sided display mode; Based on the reconstructed static mesh, the target material control parameters and target material slots are identified. The target material control parameters include: scalar parameter set, vector parameter set and texture parameter set, wherein the scalar parameter set includes roughness. Based on the scalar parameter set in the display mode parameters and target material control parameters, the basic material template for reconstructing the static mesh is identified. A dynamic material instance is created based on the reconstructed static mesh base material template. The target material control parameters are copied to the dynamic material instance to obtain the updated dynamic material instance. The updated dynamic material instance is used to replace the component material in the target material slot of the reconstructed static mesh, resulting in an updated material component; Surface reflectance parameters are obtained from the reconstructed static mesh. Roughness factor is calculated based on the surface reflectance parameters. The roughness factor is used to replace the roughness in the scalar parameter set to obtain the updated scalar parameter set. Based on the updated scalar parameter set and updated material components, optimized material components are identified, and the optimized material components are summarized to obtain an optimized material component set; A visual geological cavity model is constructed based on an optimized set of material components.
[0058] It needs to be explained that single-sided display mode, during the rendering process of reconstructing a static mesh, only performs lighting calculations and image rendering on the front side of the triangles that the rendering engine deems visible, while the opposite side (the back side of the triangle) is not rendered, making it transparent or invisible. Double-sided display mode performs lighting calculations and image rendering on both the front and back sides of the triangles in the reconstructed static mesh, ensuring that both sides of the mesh are displayed correctly. The target material slot is the material slot corresponding to the reconstructed static mesh. The scalar parameter set is a collection of numerical parameters used to control the physical rendering effect of the material surface. Optionally, the scalar parameter set includes, but is not limited to, roughness, metallicity, emissivity, and opacity. The vector parameter set is a collection used to characterize the material's base color, specular color, and normal offset. The texture parameter set is a collection of parameters used to control material texture mapping. The texture parameter set includes, but is not limited to, texture map index and texture offset. Roughness characterizes the roughness of the material surface. The smaller the roughness, the smoother the surface and the stronger the reflection; the larger the roughness, the matte the surface and the weaker the reflection. A dynamic material instance is an editable material object whose parameters can be independently set, created at runtime based on a specific material template. Updating a dynamic material instance involves completely assigning the target material control parameters to the dynamic material instance, resulting in a dynamically material instance with complete parameter configuration that can be directly used for mesh rendering.
[0059] Understandably, replacing the component material in the target material slot of the reconstructed static mesh using the updated dynamic material instance involves replacing the original material in the reconstructed static mesh with the updated dynamic material instance through the target material slot. The updated material component is the reconstructed static mesh component that has been bound to the updated dynamic material instance after the component material replacement operation is completed. The surface reflectivity parameter is a user-adjustable parameter used to describe the intensity of light reflection on the material surface. The step of calculating the roughness factor based on the surface reflectivity parameter is as follows: subtracting the surface reflectivity parameter from 1 yields the roughness factor. The updated scalar parameter set is the set of new scalar parameters obtained after performing a replacement operation on the original roughness in the scalar parameter set using the roughness factor. The optimized material component is the static mesh component obtained after updating the parameters of the material instance of the updated material component based on the updated scalar parameter set. The optimized material component set is a collection composed of optimized material components. The steps for constructing a visualized geological cavity model based on the optimized material component set are as follows: all optimized material components in the optimized material component set are combined and spliced according to their corresponding spatial coordinates, topological structure and material slot relationships. These components are then uniformly loaded into the scene of the rendering engine. The rendering configuration is completed according to the set single-sided or double-sided display mode, roughness, texture and other parameters. Then, the rendering engine performs unified drawing, lighting calculation and texture mapping on all components. Finally, all optimized material components are integrated into a complete three-dimensional geological cavity model.
[0060] Specifically, the determination of the basic material template for reconstructing the static mesh based on the scalar parameter set in the display mode parameters and target material control parameters includes: The material transparency parameter is determined based on the scalar parameter set in the target material control parameters. The material transparency parameter is either transparent or opaque. If the display mode parameter is set to single-sided display mode and the material transparency parameter is set to material opaque, then a single-sided opaque template is confirmed. If the display mode parameter is set to single-sided display mode and the material transparency parameter is set to material transparent, then a single-sided transparent template is confirmed. If the display mode parameter is set to double-sided display mode and the material transparency parameter is set to material opaque, then a double-sided opaque template is confirmed. If the display mode parameter is set to double-sided display mode and the material transparency parameter is set to material transparent, then the double-sided transparent template is confirmed. The basic material template for reconstructing the static mesh is identified based on a single-sided opaque template, a single-sided transparent template, a double-sided opaque template, or a double-sided transparent template.
[0061] It should be explained that "material transparency" is a parameter used to characterize the semi-transparent or fully transparent display characteristics of the reconstructed static mesh material. "Material opacity" means the material corresponding to the scalar parameter set is completely opaque. A single-sided opaque template is the base material template selected when the display mode is single-sided and the material is opaque. A single-sided transparent template is the base material template determined when the display mode is single-sided and the material is transparent. A double-sided opaque template is the base material template corresponding to the display mode is double-sided and the material is opaque. A double-sided transparent template is the base material template corresponding to the display mode is double-sided and the material is transparent. The reconstructed static mesh base material template is a template determined by matching the display mode parameters and material transparency parameters from the single-sided opaque template, single-sided transparent template, double-sided opaque template, and double-sided transparent template.
[0062] To address the problems described in the background art, this invention identifies a geological cavity model, performs a hierarchical traversal of the geological cavity model to obtain a cavity model module set, and performs a mesh module identification operation on the cavity model module set to obtain a mesh component list. This invention can automatically traverse the model structure and accurately extract mesh components without manual preprocessing, adapting to cavity models of different sources and structures, improving the versatility and automation of model data processing. For each mesh component in the mesh component list, the following operations are performed: An initial 3D model mesh image is obtained based on the mesh component, wherein the initial 3D model mesh image includes multiple initial triangles; a dynamic mesh is constructed based on the initial 3D model mesh image, wherein the dynamic mesh includes multiple dynamic triangles. This invention adopts a dynamic mesh structure, supporting real-time editing and modification of triangle, vertex, and normal vector data during runtime; a preliminary degenerate triangle filtering operation is performed on the dynamic mesh to obtain an optimized triangle list, wherein the optimized triangle list includes multiple optimized triangles. This invention avoids rendering black spots, shadow fragmentation, and other problems caused by abnormal triangles by pre-eliminating invalid degenerate triangles with areas close to zero or overlapping vertices, improving the stability of subsequent processing; and the number of subdivisions is identified. Controlled subdivision is performed on each optimized triangle in the optimized triangle list based on the number of subdivisions, resulting in a subdivided triangle list. A secondary degradation filter is then applied to this subdivided triangle list to obtain an initial qualified triangle list. A classification operation for identical vertices is then performed on this initial qualified triangle list to obtain a set of vertex triangles of the same category. This invention achieves refined subdivision while maintaining topological continuity and preserving the original model structure, resulting in a smoother model surface and improved visual effects. The category vertex triangle sets are then updated with newer vertex normal vectors to obtain updated category vertex triangle sets. Static mesh reconstruction is then performed based on these updated category vertex triangle sets to obtain reconstructed static meshes. This invention converts dynamically edited meshes into static meshes, improving rendering efficiency and reducing runtime performance consumption while ensuring correct topology and normal vectors. The reconstructed static meshes are then aggregated to obtain a set of reconstructed static meshes corresponding to the mesh component list. Each reconstructed static mesh in the set corresponds to a material slot. This invention categorizes meshes by material slot, achieving precise binding between materials and meshes, facilitating subsequent dynamic switching of display modes, transparency, roughness, and other parameters. A visualized geological cavity model is then constructed based on the reconstructed static mesh set. Therefore, the present invention can automatically perform mesh repair, rendering optimization, dynamic switching of display modes, and real-time adjustment of surface parameters during engine operation.
[0063] like Figure 2 The diagram shown is a functional block diagram of a geological cavity model reconstruction system based on mesh repair and UV reordering provided in an embodiment of the present invention.
[0064] The geological cavity model reconstruction system 100 based on mesh repair and UV reordering described in this invention can be installed in an electronic device. Depending on the functions implemented, the geological cavity model reconstruction system 100 may include a mesh component list construction module 101, a dynamic mesh construction module 102, a triangle controlled subdivision module 103, and a model reconstruction completion module 104. The module described in this invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and which are stored in the memory of the electronic device. The grid component list construction module 101 is used to identify the geological cavity model, perform a hierarchical traversal of the geological cavity model to obtain a cavity model module set, and perform a grid module identification operation on the cavity model module set to obtain a grid component list. The dynamic mesh construction module 102 is used to perform the following operations on each mesh component in the mesh component list: obtain an initial three-dimensional model mesh image based on the mesh component, wherein the initial three-dimensional model mesh image includes multiple initial triangles; and construct a dynamic mesh based on the initial three-dimensional model mesh image, wherein the dynamic mesh includes multiple dynamic triangles. The controlled subdivision module 103 is used to perform a preliminary degenerate triangle filtering operation on the dynamic mesh to obtain an optimized triangle list. The optimized triangle list includes multiple optimized triangles. The number of subdivisions is determined, and a controlled subdivision operation is performed on each optimized triangle in the optimized triangle list according to the number of subdivisions to obtain a subdivided triangle list. The subdivided triangle list is then subjected to a secondary degenerate filtering operation to obtain an initial qualified triangle list. The initial qualified triangle list is then subjected to a same vertex classification operation to obtain a set of triangles with the same category vertex. The model reconstruction completion module 104 is used to perform a category vertex normal vector update operation on the category vertex triangle set to obtain an updated category vertex triangle set, perform a static mesh reconstruction operation based on the updated category vertex triangle set to obtain a reconstructed static mesh, summarize the reconstructed static meshes to obtain a reconstructed static mesh set corresponding to the mesh component list, wherein the reconstructed static mesh in the reconstructed static mesh set corresponds to a material slot, and construct a visualized geological cavity model based on the reconstructed static mesh set.
[0065] In detail, the modules in the geological cavity model reconstruction system 100 based on mesh repair and UV reordering described in this embodiment of the invention employ the same methods as described above. Figure 1 The geological cavity model reconstruction method based on grid repair and UV reordering described in the article uses the same technical means and can produce the same technical effect, so it will not be elaborated here.
[0066] like Figure 3The diagram shown is a schematic diagram of an electronic device for implementing a geological cavity model reconstruction method based on mesh repair and UV reordering, according to an embodiment of the present invention.
[0067] The electronic device 1 may include a processor 10, a memory 11 and a bus 12, and may also include a computer program stored in the memory 11 and capable of running on the processor 10, such as a geological cavity model reconstruction method program based on grid repair and UV reordering.
[0068] The memory 11 includes at least one type of readable storage medium, such as flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of the electronic device 1, such as the portable hard drive of the electronic device 1. In other embodiments, the memory 11 can be an external storage device of the electronic device 1, such as a plug-in portable hard drive, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the electronic device 1. Furthermore, the memory 11 includes both internal storage units and external storage devices of the electronic device 1. The memory 11 can be used not only to store application software and various types of data installed on the electronic device 1, such as the code of a geological cavity model reconstruction method program based on grid repair and UV reordering, but also to temporarily store data that has been output or will be output.
[0069] In some embodiments, the processor 10 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control unit of the electronic device, connecting various components of the entire electronic device through various interfaces and lines. It executes programs or modules stored in the memory 11 (e.g., a geological cavity model reconstruction method program based on grid repair and UV reordering), and calls data stored in the memory 11 to perform various functions of the electronic device 1 and process data.
[0070] The bus 12 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 12 can be divided into an address bus, a data bus, a control bus, etc. The bus 12 is configured to realize the connection and communication between the memory 11 and at least one processor 10, etc.
[0071] Figure 3 Only electronic devices with components are shown; it will be understood by those skilled in the art that... Figure 3 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0072] For example, although not shown, the electronic device 1 may also include a power supply (such as a battery) to power the various components. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, thereby enabling functions such as charging management, discharging management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.
[0073] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a Wi-Fi interface, a Bluetooth interface, etc.), which is typically used to establish communication connections between the electronic device 1 and other electronic devices.
[0074] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), and optionally, a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device 1 and to display a visual user interface.
[0075] The program for reconstructing a geological cavity model based on grid repair and UV reordering, stored in the memory 11 of the electronic device 1, is a combination of multiple instructions. When run in the processor 10, it can achieve the following: Once the geological cavity model is identified, the loading hierarchy of the geological cavity model is traversed to obtain the cavity model module set. Then, the mesh module identification operation is performed on the cavity model module set to obtain the mesh component list. Perform the following operation on each grid component in the grid component list: An initial 3D model mesh image is obtained based on a mesh component, wherein the initial 3D model mesh image includes multiple initial triangles; A dynamic mesh is constructed based on the initial 3D model mesh image, wherein the dynamic mesh includes multiple dynamic triangles; A preliminary degenerate triangle filtering operation is performed on the dynamic mesh to obtain an optimized triangle list, which includes multiple optimized triangles. Once the number of subdivisions is determined, a controlled subdivision operation is performed on each optimized triangle in the optimized triangle list based on the number of subdivisions to obtain a subdivided triangle list. The subdivided triangle list is then subjected to a secondary degenerate filtering to obtain an initial qualified triangle list. Finally, the initial qualified triangle list is subjected to a same vertex classification operation to obtain a set of triangles with the same category vertex. The category vertex triangle set is updated by performing a category vertex normal vector update operation to obtain an updated category vertex triangle set. Based on the updated category vertex triangle set, a static mesh reconstruction operation is performed to obtain a reconstructed static mesh. Summarize the reconstructed static meshes to obtain the reconstructed static mesh set corresponding to the mesh component list. Each reconstructed static mesh in the reconstructed static mesh set corresponds to a material slot. A visual geological cavity model is constructed based on the reconstructed static mesh set.
[0076] Specifically, the processor 10's implementation method for the above instructions can be found in [reference needed]. Figures 1 to 4 The descriptions of the relevant steps in the corresponding embodiments are not repeated here.
[0077] Furthermore, if the modules / units integrated in the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).
[0078] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor of an electronic device, can perform the following: Once the geological cavity model is identified, the loading hierarchy of the geological cavity model is traversed to obtain the cavity model module set. Then, the mesh module identification operation is performed on the cavity model module set to obtain the mesh component list. Perform the following operation on each grid component in the grid component list: An initial 3D model mesh image is obtained based on a mesh component, wherein the initial 3D model mesh image includes multiple initial triangles; A dynamic mesh is constructed based on the initial 3D model mesh image, wherein the dynamic mesh includes multiple dynamic triangles; A preliminary degenerate triangle filtering operation is performed on the dynamic mesh to obtain an optimized triangle list, which includes multiple optimized triangles. Once the number of subdivisions is determined, a controlled subdivision operation is performed on each optimized triangle in the optimized triangle list based on the number of subdivisions to obtain a subdivided triangle list. The subdivided triangle list is then subjected to a secondary degenerate filtering to obtain an initial qualified triangle list. Finally, the initial qualified triangle list is subjected to a same vertex classification operation to obtain a set of triangles with the same category vertex. The category vertex triangle set is updated by performing a category vertex normal vector update operation to obtain an updated category vertex triangle set. Based on the updated category vertex triangle set, a static mesh reconstruction operation is performed to obtain a reconstructed static mesh. Summarize the reconstructed static meshes to obtain the reconstructed static mesh set corresponding to the mesh component list. Each reconstructed static mesh in the reconstructed static mesh set corresponds to a material slot. A visual geological cavity model is constructed based on the reconstructed static mesh set.
[0079] In the embodiments provided by this invention, it should be understood that the disclosed devices, systems, and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative, and actual implementations may have other classification methods.
[0080] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0081] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.
[0082] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0083] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for reconstructing geological cavity models based on mesh repair and UV reordering, characterized in that, The method includes: Once the geological cavity model is identified, the loading hierarchy of the geological cavity model is traversed to obtain the cavity model module set. Then, the mesh module identification operation is performed on the cavity model module set to obtain the mesh component list. Perform the following operation on each grid component in the grid component list: An initial 3D model mesh image is obtained based on a mesh component, wherein the initial 3D model mesh image includes multiple initial triangles; A dynamic mesh is constructed based on the initial 3D model mesh image, wherein the dynamic mesh includes multiple dynamic triangles; A preliminary degenerate triangle filtering operation is performed on the dynamic mesh to obtain an optimized triangle list, which includes multiple optimized triangles. Once the number of subdivisions is determined, a controlled subdivision operation is performed on each optimized triangle in the optimized triangle list based on the number of subdivisions to obtain a subdivided triangle list. The subdivided triangle list is then subjected to a secondary degenerate filtering to obtain an initial qualified triangle list. Finally, the initial qualified triangle list is subjected to a same vertex classification operation to obtain a set of triangles with the same category vertex. The category vertex triangle set is updated by performing a category vertex normal vector update operation to obtain an updated category vertex triangle set. Based on the updated category vertex triangle set, a static mesh reconstruction operation is performed to obtain a reconstructed static mesh. Summarize the reconstructed static meshes to obtain the reconstructed static mesh set corresponding to the mesh component list. Each reconstructed static mesh in the reconstructed static mesh set corresponds to a material slot. A visual geological cavity model is constructed based on the reconstructed static mesh set.
2. The geological cavity model reconstruction method based on mesh repair and UV reordering as described in claim 1, characterized in that, The construction of a dynamic mesh based on the initial 3D model mesh image includes: The model parameters of multiple initial triangles in the initial 3D model mesh image are analyzed to obtain the 3D model mesh image parameters. The 3D model mesh image parameters include: 3D vertex coordinate set, triangle index set, UV 2D coordinate set, vertex normal vector set, and triangle material information set. The triangle index and triangle material information correspond one-to-one. Create an empty dynamic mesh data structure, which includes: a vertex list, a triangle list, and a material grouping mapping table; The three-dimensional vertex coordinate set, UV two-dimensional coordinate set and vertex normal vector set in the three-dimensional model mesh image parameters are all mapped to the vertex list in the empty dynamic mesh data structure to obtain the dynamic mesh vertex list. Based on the triangle index set and triangle material information set, multiple initial triangles are mapped to the triangle list to obtain the dynamic mesh triangle list; A dynamic mesh is constructed based on a dynamic mesh vertex list and a dynamic mesh triangle list.
3. The geological cavity model reconstruction method based on mesh repair and UV reordering as described in claim 2, characterized in that, The preliminary degenerate triangle filtering operation on the dynamic mesh yields an optimized triangle list, including: Dynamic triangles are extracted sequentially from the dynamic mesh, and the extracted dynamic triangles are subjected to a winding consistency correction operation to obtain the dynamic triangles to be filtered. Based on the dynamic triangle to be filtered, the vertex index group of the triangle is identified; Randomly extract the vertex index of the target triangle from the triangle vertex index group, and remove the target triangle vertex index from the triangle vertex index group to obtain the updated triangle vertex index group; If there is an updated triangle vertex index in the updated triangle vertex index group that is equal to the extracted target triangle vertex index, or if two updated triangle vertex indices in the updated triangle vertex index group are equal, then the dynamic triangle to be filtered is removed from the dynamic mesh triangle list to obtain the remaining triangle list. The remaining triangle list is then used to replace the dynamic mesh triangle list in the dynamic mesh to obtain the updated dynamic mesh. If there is no updated triangle vertex index in the updated triangle vertex index group that is equal to the extracted target triangle vertex index, and the two updated triangle vertex indices in the updated triangle vertex index group are not equal, then the dynamic mesh is used as the updated dynamic mesh. Update the dynamic mesh as a dynamic mesh, and return to the step of extracting dynamic triangles from the dynamic mesh sequentially until all dynamic triangles in the dynamic mesh have been extracted; By integrating the remaining triangle list, we obtain the optimized triangle list, which includes multiple optimized triangles.
4. The geological cavity model reconstruction method based on mesh repair and UV reordering as described in claim 3, characterized in that, The step of performing a sequence consistency correction operation on the extracted dynamic triangles to obtain the dynamic triangles to be filtered includes: Based on the extracted dynamic triangle, obtain the set of vertex coordinates and the set of normal vectors of the dynamic triangle, and calculate the surface normal vector based on the set of vertex coordinates of the dynamic triangle; The vertex average normal vector is calculated based on the dynamic triangle normal vector set. The face normal vector and the vertex average normal vector are normalized to obtain the normalized face normal vector and the normalized vertex average normal vector. The calibration surface value is obtained by performing a dot product operation on the normal vector of the normalized surface and the average normal vector of the normalized vertex; If the calibration surface value is less than the preset zero value, the extracted dynamic triangle is subjected to a rewinding operation to obtain the corrected dynamic triangle; If the calibration surface value is not less than zero, the extracted dynamic triangle is taken as a normal dynamic triangle. The dynamic triangle to be filtered is identified based on the corrected dynamic triangle or the normal dynamic triangle.
5. The geological cavity model reconstruction method based on mesh repair and UV reordering as described in claim 4, characterized in that, The controlled subdivision operation is performed on each optimized triangle in the optimized triangle list according to the number of subdivisions, resulting in a subdivided triangle list, including: Optimized triangles are extracted sequentially from the list of optimized triangles. The extracted optimized triangles are then subjected to controlled subdivision operations based on the number of subdivisions to obtain a set of newly added triangles. Remove the extracted optimized triangles from the optimized triangle list to obtain an updated optimized triangle list. Use the updated optimized triangle list as the optimized triangle list and return to the previous step of extracting optimized triangles from the optimized triangle list sequentially until all optimized triangles in the optimized triangle list have been extracted. Summarize the newly added triangle sets to obtain multiple newly added triangle sets. Create a blank subdivision triangle list and import the multiple newly added triangle sets into the blank subdivision triangle list to obtain a subdivision triangle list, which contains multiple subdivision triangles.
6. The geological cavity model reconstruction method based on mesh repair and UV reordering as described in claim 5, characterized in that, The controlled subdivision operation on the extracted optimized triangles to obtain a set of newly added triangles includes: Based on the extracted optimized triangles, the set of triangle side lengths is determined. Then, the triangle side lengths are extracted from the set of triangle side lengths in turn. Based on the extracted triangle side lengths, the set of vertex coordinates, the set of UV coordinates of the vertex, and the set of normal vectors of the vertex are determined. The midpoint parameters of the side length are calculated based on the subdivision degree, the set of edge vertex coordinates, the set of edge vertex UV coordinates, and the set of edge vertex normal vectors. The midpoint parameters of the side length include: the midpoint coordinates of the edge vertex, the midpoint coordinates of the edge vertex UV, and the midpoint normal vector of the edge vertex. Summarize the midpoint parameters of the side lengths to obtain the set of midpoint parameters of the side lengths corresponding to the set of triangle side lengths, and identify the newly added triangle set based on the set of midpoint parameters of the side lengths. Based on the extracted optimized triangles, the material information of the target triangles is identified. The newly added triangle set is then identified according to the material information of the target triangles, resulting in the identified newly added triangle set.
7. The geological cavity model reconstruction method based on mesh repair and UV reordering as described in claim 6, characterized in that, The step of updating the category vertex normal vector of the category vertex triangle set to obtain the updated category vertex triangle set includes: Extract category vertex triangle groups sequentially from the category vertex triangle group set, calculate the category triangle face normal vector of each category vertex triangle in the extracted category vertex triangle group, and obtain the category triangle face normal vector set; Perform a weighted average operation on the normal vector set of the class triangle face to obtain the initial normal vector of the class vertex, and calculate the normal vector length based on the initial normal vector of the class vertex; If the length of the normal vector is greater than the preset length threshold, then determine whether the initial normal vector of the category vertex meets the preset normal vector parameter conditions. If the initial normal vector of a category vertex meets the normal vector parameter condition, then the initial normal vector of the category vertex is normalized to obtain the normalized category vertex normal vector. If the length of the normal vector is not greater than the length threshold, then the preset default normal vector will be used as the normalized class vertex normal vector. The extracted category vertex triangle group is replaced with the normalized category vertex normal vector to obtain the updated category vertex triangle group. Summarize and update the vertex triangle sets of the category to obtain the updated vertex triangle sets of the category corresponding to the vertex triangle set.
8. The geological cavity model reconstruction method based on mesh repair and UV reordering as described in claim 7, characterized in that, The construction of a visualized geological cavity model based on a reconstructed static mesh set includes: For each reconstructed static mesh in the reconstructed static mesh set, perform the following operations: Determine the display mode parameters, where the display mode parameters are either single-sided display mode or double-sided display mode; Based on the reconstructed static mesh, the target material control parameters and target material slots are identified. The target material control parameters include: scalar parameter set, vector parameter set and texture parameter set, wherein the scalar parameter set includes roughness. Based on the scalar parameter set in the display mode parameters and target material control parameters, the basic material template for reconstructing the static mesh is identified. A dynamic material instance is created based on the reconstructed static mesh base material template. The target material control parameters are copied to the dynamic material instance to obtain the updated dynamic material instance. The updated dynamic material instance is used to replace the component material in the target material slot of the reconstructed static mesh, resulting in an updated material component; Surface reflectance parameters are obtained from the reconstructed static mesh. Roughness factor is calculated based on the surface reflectance parameters. The roughness factor is used to replace the roughness in the scalar parameter set to obtain the updated scalar parameter set. Based on the updated scalar parameter set and updated material components, optimized material components are identified, and the optimized material components are summarized to obtain an optimized material component set; A visual geological cavity model is constructed based on an optimized set of material components.
9. The geological cavity model reconstruction method based on mesh repair and UV reordering as described in claim 8, characterized in that, The scalar parameter set based on the display mode parameters and target material control parameters determines the basic material template for reconstructing the static mesh, including: The material transparency parameter is determined based on the scalar parameter set in the target material control parameters. The material transparency parameter is either transparent or opaque. If the display mode parameter is set to single-sided display mode and the material transparency parameter is set to material opaque, then a single-sided opaque template is confirmed. If the display mode parameter is set to single-sided display mode and the material transparency parameter is set to material transparent, then a single-sided transparent template is confirmed. If the display mode parameter is set to double-sided display mode and the material transparency parameter is set to material opaque, then a double-sided opaque template is confirmed. If the display mode parameter is set to double-sided display mode and the material transparency parameter is set to material transparent, then the double-sided transparent template is confirmed. The basic material template for reconstructing the static mesh is identified based on a single-sided opaque template, a single-sided transparent template, a double-sided opaque template, or a double-sided transparent template.
10. A geological cavity model reconstruction system based on mesh repair and UV reordering, characterized in that, The system includes: The grid component list construction module is used to identify the geological cavity model, perform a hierarchical traversal on the geological cavity model to obtain the cavity model module set, and perform a grid module identification operation on the cavity model module set to obtain the grid component list. The dynamic mesh construction module performs the following operations on each mesh component in the mesh component list: obtain an initial 3D model mesh image based on the mesh component, wherein the initial 3D model mesh image includes multiple initial triangles; and construct a dynamic mesh based on the initial 3D model mesh image, wherein the dynamic mesh includes multiple dynamic triangles. The controlled subdivision module is used to perform a preliminary degenerate triangle filtering operation on the dynamic mesh to obtain an optimized triangle list. The optimized triangle list includes multiple optimized triangles. The number of subdivisions is determined, and a controlled subdivision operation is performed on each optimized triangle in the optimized triangle list according to the number of subdivisions to obtain a subdivided triangle list. The subdivided triangle list is then subjected to a second degenerate filtering to obtain an initial qualified triangle list. The initial qualified triangle list is then subjected to a same vertex classification operation to obtain a set of triangles with the same category vertex. The model reconstruction module is used to update the category vertex normal vector of the category vertex triangle set to obtain the updated category vertex triangle set. Based on the updated category vertex triangle set, a static mesh reconstruction operation is performed to obtain the reconstructed static mesh. The reconstructed static meshes are summarized to obtain the reconstructed static mesh set corresponding to the mesh component list. Each reconstructed static mesh in the reconstructed static mesh set corresponds to a material slot. A visualized geological cavity model is constructed based on the reconstructed static mesh set.