Grid parameterization method and device, equipment, storage medium and program product
By optimizing mesh parameterization through dual graph segmentation and preset parameterization algorithm, the time-consuming problem of traditional methods is solved, and fast and efficient mesh parameterization is achieved, which is suitable for mesh parameterization in 3D modeling.
Patent Information
- Application Number
- CN202510928175.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-10-21
AI Technical Summary
In the existing technology, mesh parameterization methods are mainly used for texture mapping. By optimizing the seam length during the segmentation process and pursuing angle-preserving or distance-preserving properties in parameterization, mesh parameterization is time-consuming and inefficient.
By segmenting the first target grid based on the dual graph, it is determined whether the second target grid meets the preset conditions. If so, its distortion is determined, and the third target grid is determined based on the distortion. A preset parameterization algorithm is used for parameterized mapping and arrangement, abandoning the setting of angle-preserving or distance-preserving mapping and the shortest segmentation boundary. The Tutte embedding method and balanced maximum difference technology are used to optimize the grid parameterization.
It achieves fast segmentation and parameterization of mesh parameterization, improves efficiency, meets the requirements of physically differentiable rendering, allows moderate distortion and ensures that bijective mapping has no flipping and overlap.
Smart Images

Figure CN120823340A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of three-dimensional modeling technology, and in particular to a grid parameterization method, apparatus, device, storage medium and program product. Background Art
[0002] The goal of physically based differentiable rendering is to efficiently compute the gradients of rendered image pixel values with respect to scene parameters. This calculated gradient information is fed into a gradient descent optimization algorithm, which iteratively optimizes the scene parameters, ultimately reconstructing a 3D model. In 3D reconstruction driven by physically based differentiable rendering (PBDR), triangle mesh parameterization is a key step in generating the computational basis for scene gradients.
[0003] Currently, traditional methods for mesh parameterization are mainly used for texture mapping. By optimizing the seam length during the segmentation process, pursuing angle-preserving or distance-preserving properties in parameterization, and adhering to local affine transformation constraints during arrangement, mesh parameterization is time-consuming and inefficient. Summary of the Invention
[0004] The present application provides a mesh parameterization method, apparatus, equipment, storage medium and program product to solve the technical problems in the prior art of mesh parameterization, in which traditional methods are mainly used for texture mapping, optimizing the seam length during the segmentation process, pursuing angle-preserving / distance-preserving properties in parameterization, and adhering to local affine transformation constraints during arrangement, resulting in a long time-consuming and low-efficiency mesh parameterization.
[0005] In a first aspect, the present application provides a grid parameterization method, comprising:
[0006] Acquire a first target mesh; the first target mesh is a topological structure to be parameterized; the first target mesh includes a plurality of facets;
[0007] Segmenting the first target grid based on the dual graph to obtain a second target grid;
[0008] Determining whether the second target grid meets a preset condition;
[0009] If the second target grid meets the preset condition, determining the distortion of the second target grid, and determining a third target grid based on the distortion of the second target grid;
[0010] Performing parameterized mapping on the third target grid using a preset parameterized algorithm to obtain initial parameterized coordinates corresponding to the third target grid;
[0011] The initial parameterized coordinates corresponding to the third target grid are arranged in a preset parameterized space to obtain target parameterized coordinates corresponding to the third target grid.
[0012] In one possible design, segmenting the first target grid based on the dual graph to obtain a second target grid includes:
[0013] Determine a grid bounding box corresponding to the first target grid;
[0014] Determining a first seed surface of the first target mesh based on the mesh bounding box;
[0015] Determining a first preset number of second seed surfaces based on the first seed surface of the first target grid using a preset distance function corresponding to the dual graph;
[0016] determining the first seed surface and the second seed surface as target seed surfaces;
[0017] Calculating the distance between each of the face patches and each of the target seed faces in the first target network;
[0018] The target mesh is segmented based on the distances between each of the face patches and each of the target seed faces to obtain the second target mesh.
[0019] In one possible design, the second target grid includes a plurality of first subgrids; the first subgrid includes a plurality of facets;
[0020] The determining whether the second target grid meets a preset condition includes:
[0021] Calculating the corresponding Euler characteristic for each of the first sub-grids;
[0022] If it is determined that the Euler characteristic corresponding to each of the first sub-grids is equal to a preset value, it is determined that the second target grid meets the preset condition.
[0023] In one possible design, the method further includes:
[0024] If it is determined that the Euler characteristic corresponding to any of the first sub-grids is not equal to the preset value, the following loop operation is performed until the Euler characteristic corresponding to each of the first sub-grids is equal to the preset value, then the loop is exited, and it is determined that the second target grid meets the preset condition;
[0025] The loop operation is as follows:
[0026] calculating a boundary length corresponding to the first sub-grid whose Euler characteristic is not equal to a preset value, and determining a target boundary based on the boundary length;
[0027] determining a second preset number of third subsurfaces from the target boundary;
[0028] Segmenting the first subgrid whose Euler characteristic is not equal to a preset value based on the third seed surface to obtain a segmented first subgrid;
[0029] Calculating the Euler characteristic corresponding to the first sub-grid after the segmentation;
[0030] If there is an Euler characteristic corresponding to the first sub-grid after segmentation that is not equal to the preset value, the loop operation is continued to be performed on the first sub-grid after segmentation corresponding to the Euler characteristic that is not equal to the preset value.
[0031] In one possible design, determining the distortion of the second target grid and determining the third target grid based on the distortion of the second target grid includes:
[0032] Obtaining a first area of each of the facets in the second target grid;
[0033] Performing a parameterization operation on the second target grid in the preset parameterized space using the preset parameterized algorithm to obtain first parameterized coordinates;
[0034] Calculating a second area of each of the facets in the second target grid in the preset parameterized space based on the first parameterized coordinates;
[0035] Calculating a ratio of the first area to the second area corresponding to each patch to obtain a degree of distortion of each patch;
[0036] Comparing the distortion of each of the facets with a preset distortion threshold;
[0037] If it is determined that the distortion of the patch is greater than the preset distortion threshold, the first sub-grid corresponding to the patch is divided to obtain a third target grid.
[0038] In one possible design, the third target grid includes a plurality of second subgrids;
[0039] Arranging the initial parameterized coordinates corresponding to the third target grid in a preset parameterized space to obtain target parameterized coordinates corresponding to the third target grid includes:
[0040] Calculating the ratio of the area of each second sub-grid to the area of the third target grid to obtain the target scaling ratio corresponding to each second sub-grid;
[0041] The balanced maximum difference technique is adopted and the initial parameterized coordinates corresponding to the third target grid are arranged in the preset parameterized space based on the target scaling ratio corresponding to each second subgrid to obtain the target parameterized coordinates corresponding to the third target grid.
[0042] In a second aspect, the present application provides a grid parameterization device, comprising:
[0043] An acquisition module is configured to acquire a first target mesh; the first target mesh is a topological structure to be parameterized; the first target mesh includes a plurality of facets;
[0044] a segmentation module, configured to segment the first target grid based on the dual graph to obtain a second target grid;
[0045] A determination module, configured to determine whether the second target grid satisfies a preset condition;
[0046] The determining module is further configured to determine a distortion degree of the second target grid if the second target grid satisfies the preset condition, and determine a third target grid based on the distortion degree of the second target grid;
[0047] A mapping module, configured to perform parameterized mapping on the third target grid using a preset parameterized algorithm to obtain initial parameterized coordinates corresponding to the third target grid;
[0048] An arrangement module is used to arrange the initial parameterized coordinates corresponding to the third target grid in a preset parameterized space to obtain target parameterized coordinates corresponding to the third target grid.
[0049] In a third aspect, the present application provides a system comprising: a processor, and a memory communicatively connected to the processor;
[0050] The memory stores computer-executable instructions;
[0051] The processor executes the computer-executable instructions stored in the memory to implement the method as described in any one of the first aspects.
[0052] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the first aspects.
[0053] In a fifth aspect, the present application provides a computer program product, comprising a computer program, which implements the method described in the first aspect when executed by a processor.
[0054] The mesh parameterization method, apparatus, device, storage medium and program product provided by the present application, since the goal of Physics-Based Differentiable Rendering (PBDR) is to efficiently calculate the gradient of the rendered image pixel value relative to the scene parameter, moderate distortion is allowed, but bijective mapping (no flipping, no overlap) is required. Therefore, when performing mesh parameterization, a first target mesh is obtained. The first target mesh is the topological structure to be parameterized. The first target mesh includes multiple facets. Then, the first target mesh is segmented based on the dual graph to obtain a second target mesh. The second target mesh includes multiple sub-meshes. In order to ensure that the sub-meshes in the second target mesh are topologically homeomorphic to the disk, it is determined whether the second target mesh meets the preset conditions. If the second target mesh meets the preset conditions, the distortion of the second target mesh is determined, and the third target mesh is determined based on the distortion of the second target mesh, thereby optimizing the high-protrusion area, and further In the first step, the third target grid is parameterized and mapped by using a preset parameterization algorithm, thereby obtaining the initial parameterized coordinates corresponding to the third target grid. In order to improve space utilization, the initial parameterized coordinates corresponding to the third target grid are arranged in the preset parameterization space to obtain the target parameterized coordinates corresponding to the third target grid. By no longer pursuing angle-preserving or distance-preserving mapping and the setting of the shortest segmentation boundary, the first target grid is quickly segmented, and parameterization is quickly achieved using the preset parameterization algorithm, and the grid is quickly arranged in the preset parameterization space, thereby achieving rapid parameterization of the grid and improving the efficiency of grid parameterization. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0056] Figure 1 An application scenario diagram of the grid parameterization method provided in one embodiment of the present application;
[0057] Figure 2 A flowchart of a grid parameterization method provided in one embodiment of the present application;
[0058] Figure 3 A schematic diagram of the geometric interpretation of variables in the elastic coefficient provided in one embodiment of the present application;
[0059] Figure 4 A visual segmentation effect diagram of a target grid provided in an embodiment of the present application;
[0060] Figure 5 A visualization diagram of the mesh parameterization provided in one embodiment of the present application;
[0061] Figure 6 A schematic diagram of the structure of a grid parameterization device provided in one embodiment of the present application;
[0062] Figure 7 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application.
[0063] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0064] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0065] In order to clearly understand the technical solution of the present application, the solution of the prior art is first introduced in detail.
[0066] Parameterizing a mesh with arbitrary topology typically requires three steps: segmentation, parameterization, and layout. Physically-based differentiable rendering (PBDR) aims to efficiently compute the gradients of rendered image pixel values with respect to scene parameters. This gradient information is then fed into a gradient descent optimization algorithm, which iteratively optimizes the scene parameters to ultimately reconstruct a 3D model. The core of PBDR is the rapid computation of gradients to optimize the model, thus allowing for slight deformations and long segmentation lines. Mesh parameterization performs two core functions: establishing a continuous mapping from 3D mesh vertices to a 2D parameter domain during forward rendering, enabling material sampling at ray intersections through barycentric interpolation, and propagating vertex displacements to the material space via the Jacobian matrix during the backward gradient propagation phase, directly impacting the numerical reliability of gradient chain terms. Currently, mesh segmentation methods are primarily designed for texture mapping applications. Therefore, minimizing the distortion of the parameterized sub-meshes and minimizing the total length of the segmentation lines are crucial optimization objectives. Because existing technologies optimize seam length during segmentation, pursue angle-preserving or distance-preserving properties during parameterization, and adhere to local affine transformation constraints during arrangement, mesh parameterization takes a long time and is inefficient.
[0067] Figure 1 This is an application scenario diagram of the grid parameterization method provided in one embodiment of the present application, such as Figure 1 As shown. The system corresponding to the grid parameterization method in the embodiment of the present application may include: a client device 101 and a server device 102. Among them, the client device 101 may have an operation interface, and the user may trigger a grid parameterization request through the operation interface. The client device 101 sends the grid parameterization request to the server device 102. After receiving the grid parameterization request, the server device 102 may obtain a first target grid, wherein the first target grid is a topological structure to be parameterized. The first target grid is segmented based on the dual graph to obtain a second target grid. It is determined whether the second target grid meets the preset conditions. If the second target grid meets the preset conditions, the distortion of the second target grid is determined, and a third target grid is determined based on the distortion of the second target grid. Furthermore, the third target grid is parameterized and mapped using a preset parameterization algorithm to obtain the initial parameterized coordinates corresponding to the third target grid. The initial parameterized coordinates corresponding to the third target grid are then arranged in a preset parameterized space to obtain the target parameterized coordinates corresponding to the third target grid. The server device 102 sends the target parameterized coordinates corresponding to the third target grid to the client device 101 .
[0068] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0069] Figure 2 A flowchart of a grid parameterization method provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the execution subject of this embodiment is a grid parameterization device, which is located in an electronic device. The grid parameterization method provided in this embodiment includes the following steps:
[0070] S201: Acquire a first target grid.
[0071] The first target mesh is a topological structure to be parameterized and includes a plurality of facets.
[0072] The first target mesh is a triangular mesh. A triangular mesh is a discrete geometric representation consisting of multiple triangular patches connected by shared edges and vertices. In a triangular mesh, a patch refers to the basic unit of the mesh, namely a triangle. Each patch consists of three vertices and three edges.
[0073] Specifically, in this embodiment, the server device obtains the first target grid from a preset database.
[0074] It is understandable that when the first target grid is obtained, the area, edge length, center coordinates, etc. of each facet in the first target grid are also obtained.
[0075] S202 : Segment the first target grid based on the dual graph to obtain a second target grid.
[0076] A triangular mesh can be viewed as a graph G(V,E), where the vertex set V of the graph G consists of all vertices of the mesh, and the edge set E connecting each vertex in the graph G is defined by the adjacency relationship between the corresponding vertices in the mesh.
[0077] Among them, the dual graph (dual graph) G1(V1,E1) of the triangular mesh regards the facets of the triangular mesh as abstract points and the adjacency relationship between the facets as edges. Therefore, the vertex set V1 of the dual graph G1 is composed of all the facets in the mesh, and the edge set E1 connecting each vertex is defined by the adjacency relationship between the facets in the mesh.
[0078] As an optional implementation, the following steps can be used to segment the first target mesh based on the dual graph to obtain a second target mesh: determine a mesh bounding box corresponding to the first target mesh; determine a first seed surface of the first target mesh based on the mesh bounding box; use a preset distance function corresponding to the dual graph and determine a first preset number of second seed surfaces based on the first seed surface of the first target mesh; determine the first seed surface and the second seed surface as target seed surfaces; calculate the distance between each facet in the first target network and each target seed surface; segment the target mesh based on the distance between each facet and each target seed surface to obtain a second target mesh.
[0079] The mesh bounding box (MBB) is a simple geometric object, typically a cuboid, that encloses a 3D mesh model. A seed surface is a specific facet used as a starting point or reference point during mesh segmentation. The first seed surface is the first seed surface selected based on the MBB. The second seed surface is the seed surface determined based on the first seed surface. The target seed surface is the combination of the first and second seed surfaces.
[0080] The grid bounding box is an axis-aligned bounding box. An axis-aligned bounding box is a cuboid parallel to the coordinate axes, with its six faces perpendicular to the three coordinate axes.
[0081] Specifically, in this embodiment, the eight vertex coordinates of the mesh bounding box corresponding to the first target mesh are determined based on the minimum and maximum coordinate values of the first target mesh in the three coordinate axes. The center coordinates of the mesh bounding box are then calculated by averaging the minimum and maximum values in each coordinate axis. The vertex coordinates of each facet are then read, and the plane equations of each triangular facet are calculated using the vertex coordinates. The distance from the center coordinates of the mesh bounding box to each triangular facet is then calculated using the point-to-plane distance formula based on the center coordinates of the mesh bounding box and the plane equations of each triangular facet. The facet with the farthest distance from the center of the mesh bounding box is then selected as the first seed facet. The distance between each adjacent facet is calculated using a preset distance function corresponding to the dual graph. The shortest path from the first seed facet to any facet is determined using the Dijkstra algorithm. The distance from the first seed facet to any facet is then calculated using the distance between each adjacent facet and the shortest path from the first seed facet to any facet. The facet with the farthest distance from the first seed facet is then selected as the second seed facet. When the number of seed faces is greater than two, the Dijkstra algorithm is used to determine the shortest path from each seed face to any face patch, and the distance from each seed face to any face patch is calculated based on the distance between each adjacent face patch and the shortest path from the seed face to any face patch. For the same face patch, the shortest distance to the face patch among various sub-faces is used as the distance from the seed face (the seed face can be regarded as a whole) to the face patch, and then the face patch farthest from the seed face is selected as the second seed face, and so on, until a preset number of second seed faces are selected, and the first seed face and the second seed face are determined as the target seed faces.
[0082] Furthermore, after determining the target seed surface, the distances between various sub-surfaces and arbitrary patches in the target seed surface are calculated respectively, and any patch with the shortest distance to various sub-surfaces is attributed to the corresponding seed surface, thereby segmenting the target grid and obtaining the second target grid.
[0083] Dijkstra's algorithm is a classic algorithm for finding the shortest path from a single source in a weighted graph. The core idea of this algorithm is to gradually expand the set of nodes with known shortest paths through a greedy strategy until the shortest path from the source to all other nodes is found.
[0084] The formula for the distance function between two adjacent patches in the dual graph is as follows:
[0085]
[0086] Among them, ‖e i,k ‖ are two patches f i 、fi,k The length of the common side, is the average value of the auxiliary distance function between all adjacent patches in the grid. i ,f i,k ) is the auxiliary distance function between two adjacent patches.
[0087] Among them, any one patch f in the first target grid i , and the three adjacent faces are denoted as f i,k ,k=0,1,2.
[0088] The formula of the auxiliary distance function between two adjacent patches in the dual graph is as follows:
[0089]
[0090] Among them, dihedral (f i ,f i,k ) are two patches f i 、f i,k The dihedral angle between i 、n i,k They are respectively i 、f i,k The unit normal vector of .
[0091] Optionally, the first preset number can be set according to demand and is not limited in this embodiment.
[0092] The first preset number is affected by the number of grid protrusion areas in the first target grid.
[0093] For example, suppose that a total of n seed surfaces need to be selected on the grid, and the first m seed surfaces s have been determined. i ,i∈{0,…,m-1}, the triangle face farthest from the existing seed face is selected as the m+1th seed face s m , the specific selection method is determined by the following formula:
[0094]
[0095] Where F is the set of all facets in the first target mesh. D(f j ,s i ) represents the two vertices f in the dual graph G1 j 、s i The shortest distance between. j For any patch, s i For the seed surface.
[0096] Furthermore, after the target seed faces are determined, the first target mesh is segmented according to the determined target seed faces. Assuming that the number of target seed faces is n, the number of first sub-meshes included in the second target mesh is n. The number of determined target seed faces is equal to the number of first sub-meshes after segmentation. The formula for all triangular facets contained in the i-th sub-mesh is as follows:
[0097]
[0098] The second target grid includes a plurality of first subgrids, and the first subgrid includes a plurality of facets.
[0099] The first sub-grid is a partial grid in the second target grid.
[0100] S203: Determine whether the second target grid meets a preset condition.
[0101] The preset condition is a pre-set condition for indicating whether the second target grid needs to be segmented again.
[0102] As an optional implementation, the following steps can be used to determine whether the second target grid meets the preset conditions: calculate the corresponding Euler characteristic for each first sub-grid respectively; if it is determined that the Euler characteristic corresponding to each first sub-grid is equal to the preset value, then it is determined that the second target grid meets the preset conditions.
[0103] Among them, the Euler characteristic is an important invariant in topology, which is used to describe the shape characteristics of polyhedrons or topological spaces.
[0104] The calculation formula of Euler characteristic number χ is as follows:
[0105] χ=#V-#E+#F=2c-2g-b Formula (5)
[0106] Where #V is the number of vertices in the submesh, #E is the number of edges in the submesh, and #F is the number of faces in the submesh. c is the number of connected regions in the first submesh, g is the genus of the first submesh, and b is the number of edges in the first submesh.
[0107] Among them, the number of connected regions refers to the number of independent regions composed of interconnected vertices, edges and faces in the sub-mesh. The genus number is a topological invariant used to describe the number of "holes" in the first sub-mesh. Specifically, the genus number indicates how many holes the first sub-mesh can be obtained topologically by digging on the sphere. The number of boundaries refers to the number of boundary edges of the first sub-mesh. Boundary edges are edges in the first sub-mesh that are adjacent to only one facet, and they constitute the "edge" of the sub-mesh. The number of vertices of the first sub-mesh is the number of vertices in the first sub-mesh that contain facets, and two adjacent facets have only 4 vertices. The number of edges of the first sub-mesh is the number of edges in the first sub-mesh that contain facets, and overlapping edges are counted as one. The number of patches of the first sub-mesh is the number of patches contained in the first sub-mesh.
[0108] Specifically, in this embodiment, the corresponding number of vertices, edges and faces in each first sub-mesh is obtained, and the Euler characteristic corresponding to each first sub-mesh is calculated. If the Euler characteristic corresponding to each first sub-mesh is equal to 1, it is determined that the second target mesh meets the preset conditions.
[0109] It can be understood that if the preset conditions are met, it means that the Euler characteristic numbers corresponding to each first sub-grid are equal to 1, which means that all first sub-grids in the second target grid are topologically homeomorphic to the disk. If the preset conditions are not met, it means that there are first sub-grids whose corresponding Euler characteristic numbers are not equal to 1, which means that all first sub-grids in the second target grid are not topologically homeomorphic to the disk, and the first sub-grids corresponding to the Euler characteristic numbers not equal to 1 need to be split again.
[0110] Among them, the preset value is 1.
[0111] As an optional implementation, the following steps can be used: if it is determined that the Euler characteristic corresponding to the first sub-grid is not equal to the preset value, the following loop operation is performed until the Euler characteristic corresponding to each first sub-grid is equal to the preset value, then the loop is jumped, and it is determined that the second target grid meets the preset conditions; the loop operation is as follows: calculate the boundary length corresponding to the first sub-grid whose Euler characteristic is not equal to the preset value, and determine the target boundary based on the boundary length; determine a second preset number of third seed surfaces from the target boundary; based on the third seed surfaces, split the first sub-grid whose Euler characteristic is not equal to the preset value to obtain the split first sub-grid; calculate the Euler characteristic corresponding to the split first sub-grid; if there is a split first sub-grid whose Euler characteristic is not equal to the preset value, continue to perform the loop operation on the split first sub-grid corresponding to the Euler characteristic not equal to the preset value.
[0112] The third seed surface is a seed surface determined when the first sub-grid whose Euler characteristic number is not equal to the preset value is divided twice.
[0113] Specifically, in this embodiment, if it is determined that a first submesh has an Euler characteristic number that is not equal to a preset value, the length of the boundary corresponding to the first submesh with an Euler characteristic number that is not equal to the preset value is calculated, and the boundary with the shortest perimeter among the boundaries corresponding to the first submesh with an Euler characteristic number that is not equal to the preset value is determined. The boundary with the shortest perimeter corresponding to the first submesh with an Euler characteristic number that is not equal to the preset value is determined as the target boundary of the first submesh with an Euler characteristic number that is not equal to the preset value. A point is randomly selected on the target boundary, and the vertex farthest from this point is selected as a second point on the target boundary. The triangular facets containing these two points and adjacent to the boundary are respectively selected as two seed faces of the submesh, i.e., a second preset number of third seed faces. The distances between the facets in the submesh and each of the third seed faces are then calculated, and any facet with the shortest distance to each of the third seed faces is assigned to the corresponding seed face. This achieves a secondary segmentation of the first submesh with an Euler characteristic number that is not equal to the preset value, thereby segmenting the first submesh with an Euler characteristic number that is not equal to the preset value into two submeshes, thereby obtaining a segmented first submesh. The Euler characteristic of the submeshes included in the first submesh after segmentation is calculated again. If the Euler characteristic of the submeshes included in the first submesh after segmentation is all equal to 1, it indicates that the first submesh is topologically homeomorphic to a disk. If the Euler characteristic of the submeshes included in the first submesh after segmentation is not all equal to 1, the boundary lengths of the submeshes included in the first submesh after segmentation whose Euler characteristic is not all equal to 1 are calculated again, thereby executing the loop step and continuing the segmentation until the Euler characteristic of the submeshes is all equal to 1. The above loop operation is executed for each first submesh whose Euler characteristic is not equal to a preset value until the Euler characteristic corresponding to each first submesh included in the second target grid is all equal to the preset value. Then, the loop is exited, and it is determined that the second target grid meets the preset conditions, indicating that all submeshes in the second target grid are homeomorphic to a disk.
[0114] When all subgrids in the second target grid are homeomorphic to the disk, the steps of determining the distortion of the second target grid and determining the third target grid based on the distortion of the second target grid are continued.
[0115] S204: If the second target grid meets a preset condition, determine the distortion of the second target grid, and determine a third target grid based on the distortion of the second target grid.
[0116] Mesh distortion (or Mesh Quality) is an indicator that measures the shape and quality of mesh cells. Mesh distortion generally describes the degree to which a mesh cell deviates from its ideal shape.
[0117] The third target grid refers to a target grid determined according to the distortion.
[0118] As an optional implementation, the following steps can be used to determine the distortion of the second target grid, and determine the third target grid based on the distortion of the second target grid: obtain the first area of each facet in the second target grid; use a preset parameterization algorithm to perform parameterization operations on the second target grid in a preset parameterization space to obtain first parameterization coordinates; calculate the second area of each facet in the second target grid in the preset parameterization space based on the first parameterization coordinates; calculate the ratio of the first area and the second area corresponding to each facet to obtain the distortion of each facet; compare the distortion of each facet with a preset distortion threshold; if it is determined that the distortion of a facet is greater than the preset distortion threshold, segment the first sub-mesh corresponding to the facet to obtain the third target grid.
[0119] The first area is the area of the patch in the second target mesh. The second area is the area of the patch in the two-dimensional parameterized region [0,1) 2 The first parameterized coordinate is the parameterized coordinate obtained by mapping the third target grid to the preset parameterized space.
[0120] The default parameterization algorithm is Tutte Embedding, which is an algorithm for embedding a planar graph into a plane. The default parameterization space is a two-dimensional parameterized area [0,1) 2 .
[0121] Specifically, in this embodiment, the first area of each facet in the second target grid is obtained from the preset database, and the second target grid is embedded in the two-dimensional parameterized area [0,1) by using the Tufts embedding method. 2 , thereby obtaining first parameterized coordinates, and calculating the second area of each facet in the second target mesh using a two-dimensional area formula based on the first parameterized coordinates. The ratio of the first area to the second area is calculated, and the ratio of the first area to the second area corresponding to each facet is used as the distortion of each facet. The distortion of each facet is compared with a preset distortion threshold. If it is determined that the distortion of a facet is greater than the preset distortion threshold, the first sub-mesh corresponding to the facet having a distortion greater than the preset distortion threshold is split into two along the "diameter" to obtain a third target mesh.
[0122] Optionally, the preset distortion threshold can be independently set according to needs and is not limited in this embodiment.
[0123] The two-dimensional area formula is as follows:
[0124]
[0125] Among them, (x1, y1), (x2, y2) and (x3, y3) are the vertex coordinates of each patch in the preset parameterized space.
[0126] Specifically, dividing the first sub-grid corresponding to the patch with a distortion greater than a preset distortion threshold into two along the "diameter" refers to dividing the sub-grid into two along the center point of the sub-grid.
[0127] Specifically, the target seed surface is determined according to the distance, verified by Euler characteristic, and the mesh protrusion area in the second target mesh is segmented by distortion, so as to ensure that all sub-grids in the third target mesh are homeomorphic to the disk, and the distortion of each sub-grid is within the preset range, thereby achieving rapid segmentation of the first target mesh, abandoning the shortest boundary optimization, and thus improving segmentation efficiency and reducing segmentation time.
[0128] S205, performing parameterized mapping on the third target grid using a preset parameterized algorithm to obtain initial parameterized coordinates corresponding to the third target grid;
[0129] Among them, in order to meet the requirements of physically based differentiable rendering, the two-dimensional parameterization result of the third target mesh must be within the preset parameterization space, without local flipping and global overlapping. That is, the mapping between the constructed two-dimensional parameterized space and the three-dimensional triangular mesh must be a strict bijection, that is, the points in the three-dimensional space correspond one to one with the points in the two-dimensional space.
[0130] Among them, the Tutte embedding method uses the spring oscillator physical model to model and solve the third target mesh parameterization problem. In summary, the Tutte embedding method treats the edges of the triangular mesh as ideal springs, with the two endpoints of the spring being the two vertices on the corresponding edge. Therefore, a spring network can be obtained based on the topological connection between the edges and points in the mesh. If the boundary of this spring network is fixed on a certain shape boundary in the two-dimensional parameterized plane, the network will spontaneously adjust the position of each spring endpoint so that the energy of the entire spring network reaches the minimum after stabilization. At this time, the position of each spring endpoint in the two-dimensional parameterized plane is the parameterized coordinate of each mesh vertex, and these coordinates can be quickly obtained by solving the corresponding sparse linear equations. In other words, by solving the sparse linear equations that describe the stable state of the spring network, the two-dimensional parameterized coordinates of each sub-mesh can be obtained.
[0131] Among them, the elastic coefficient λ of the spring between each vertex ij As shown in the following formula:
[0132] λ ij =(tan(α ij / 2)+tan(β ji / 2))r ijFormula (7)
[0133] in, Figure 3 Schematic diagram of the geometric interpretation of the variables in the elastic coefficient. Figure 3 It can be seen that α ij , β ij and r ij The geometric meaning of .
[0134] Specifically, in this embodiment, the Tufts embedding method is used to perform parameterized mapping on the third target grid, thereby obtaining initial parameterized coordinates corresponding to the third target grid.
[0135] The initial parameterized coordinates are parameterized coordinates obtained by performing parameterized mapping on the third target grid.
[0136] S206 , arranging the initial parameterized coordinates corresponding to the third target grid in a preset parameterized space to obtain target parameterized coordinates corresponding to the third target grid.
[0137] The target parameterized coordinates are parameterized coordinates obtained by arranging the initial parameterized coordinates.
[0138] As an optional implementation, the following steps can be used to arrange the initial parameterized coordinates corresponding to the third target grid in a preset parameterized space to obtain the target parameterized coordinates corresponding to the third target grid: calculate the ratio of the area of each second sub-grid to the area of the third target grid to obtain the target scaling ratio corresponding to each second sub-grid; use the balanced maximum difference technique and arrange the initial parameterized coordinates corresponding to the third target grid in the preset parameterized space based on the target scaling ratio corresponding to each second sub-grid to obtain the target parameterized coordinates corresponding to the third target grid.
[0139] The third target grid includes a plurality of second subgrids, and the second subgrids are subgrids included in the third target grid. Balanced Largest Differencing Method (BLDM) is an algorithm for grid generation and optimization.
[0140] Specifically, in this embodiment, the areas of the facets included in the corresponding second sub-grids in the third target grid are summed to obtain the area corresponding to each second sub-grid, and the areas corresponding to each second sub-grid are summed to obtain the total area of the third target grid. The ratio of the area of each second sub-grid to the total area of the third target grid is calculated to obtain the ratio of each second sub-grid to the third target grid, and the ratio of each second sub-grid to the third target grid is determined as the target scaling ratio corresponding to each second sub-grid.
[0141] Furthermore, the balanced maximum difference technique is used to arrange the initial parameterized coordinates corresponding to the third target grid in the preset parameterized space based on the target scaling ratio corresponding to each second subgrid. Specifically, the target scaling ratios corresponding to each second subgrid are grouped into a set R, where R = {r0, r1, …, r N-1}, where N is the number of second subgrids and r0 is the scaling ratio of the corresponding second subgrid. The balanced maximum difference technique is used to partition the set R consisting of the target scaling ratios corresponding to each second subgrid into R0 and R1, and the sum of the elements of the two subsets, sum0 and sum1, is calculated. sum0 and sum1 are the sums of the scaling ratios in the corresponding subsets. The two-dimensional parameterized space [0,1) is vertically divided into 2 The area is divided into two subregions: [0, sum0)×[0,1) and [sum0,1)×[0,1). The balanced maximum difference technique is then applied again to each of the subsets R0 and R1. The sum of the elements in each subset is calculated to determine the scale and position of this division. The area [0, sum0)×[0,1) and [sum0,1)×[0,1) obtained in the previous step is then divided horizontally to obtain four new subregions. This division process is repeated until the positions and shapes of the two-dimensional parameterized regions of all second subgrids are determined. If only one second subgrid exists in a subset, the division of that subset is terminated.
[0142] In this embodiment, the shape of each second sub-grid parameterized area is no longer determined first, and then the final parameterized result is obtained through subsequent arrangement. Instead, the two-dimensional parameterized space [0,1) is calculated based on the number of second sub-grids and their scaling ratio. 2 Perform an iterative partitioning process, gradually determining the parameterized regions of each second sub-grid during the partitioning process, so that after the partitioning is completed, the area of each parameterized region of the second sub-grid exactly matches the respective scaling ratio. The goals of the partitioning are: first, after the partitioning arrangement is completed, the area of the parameterized region assigned to each second sub-grid exactly matches the corresponding scaling ratio. Second, the shape of the rectangular parameterized region assigned to each second sub-grid should not be too narrow or long, that is, the aspect ratio of the corresponding rectangular region should be as close to 1 as possible.
[0143] Specifically, because the position of each dividing line is determined by the sum of the target scaling ratios of the second subgrids on either side of the dividing line, the area of the two-dimensional parameterized region ultimately allocated to each second subgrid precisely matches the corresponding scaling ratio. Furthermore, by continuously swapping the division direction in successive division steps, the aspect ratio of the rectangular parameterized region ultimately allocated to each second subgrid remains close to 1, avoiding overly narrow and elongated shapes.
[0144] Specifically, after obtaining the third target grid, the symmetric Dirichlet energy calculation formula can be used to calculate the isometric distortion of each facet after parameterization, thereby calculating the average isometric distortion of all faces in the third target grid: with maximum isometric distortion To evaluate the quality of sub-grids generated by different segmentation methods.
[0145] The calculation formula of the symmetric Dirichlet energy is as follows:
[0146]
[0147] Where J is the Jacobian matrix corresponding to the local parameterized mapping of the patch, ‖J‖ F is the Frobenius norm. E iso Isometric distortion.
[0148] Specifically, after calculating the isometric distortion, the average isometric distortion of all the patches can be calculated. with maximum isometric distortion It can be used to evaluate the quality of sub-grids generated by each segmentation method.
[0149] Among them, Table 1 is a comparison table of the effects of different segmentation algorithms. As shown in Table 1, Table 1 shows the comparison of the effects of Least Squares Conformal Maps (LSCMs), Optimal Cuts, Greedy Cuts and the segmentation algorithm proposed in this application on 19 different mesh models. As can be seen from Table 1, the first column is the name of each mesh model. For example, Hippo refers to a hippopotamus-shaped model, Cow refers to a cow-shaped model, Elephant refers to an elephant-shaped model, Horse refers to a horse-shaped model, etc.; the second column is the number of vertices and facets of the sub-meshes in each mesh model, and the third column records the running time (in seconds) of the least squares conformal mapping algorithm, the average isometric distortion, and the average isometric distortion. with maximum isometric distortion The fourth column records the running time of the optimal cutting algorithm (in seconds), the average isometric distortion with maximum isometric distortion The fifth column records the running time of the greedy cutting algorithm (in seconds), the average isometric distortion with maximum isometric distortion The sixth column records the running time (in seconds) of the segmentation algorithm of this application, the average isometric distortion with maximum isometric distortion If a segmentation algorithm takes more than one hour to run, it is marked as timeout. If the segmentation method does not support high-genus grids or fails to run, it is marked as failure.
[0150] Table 1 Comparison of the effects of different segmentation algorithms
[0151]
[0152] It can be seen from the table that in terms of the quality of sub-grid segmentation, the grid segmentation algorithm proposed in this invention is superior to other comparison algorithms in terms of average isometric distortion. with maximum isometric distortion The performance of the indicators is basically consistent, concentrated around 1.07, indicating that the sub-meshes generated by the segmentation algorithm of this application are of high quality. In terms of the robustness of the segmentation algorithm, LSCMs and the segmentation algorithm proposed in this application both show the highest robustness, and can stably process mesh models with different numbers of facets and topological defects; in terms of the running speed of the algorithm, the segmentation algorithm proposed in this application has significant performance advantages over other comparison algorithms, with the lowest time acceleration factor being 9.85 times, the highest being 45.42 times, and the average being 26.14 times. For a triangular mesh model with about 50,000 facets, the segmentation algorithm of this application only takes 0.5 seconds to complete the segmentation task and obtain high-quality sub-meshes, which can meet the running time requirements of the mesh segmentation algorithm for physically based differentiable rendering applications.
[0153] For example, Figure 4 The following is a visualization of the target mesh segmentation results. The first column shows the segmentation results using Least Squares Conformal Maps (LSCMs), the second column shows the segmentation results using Optimal Cuts, the third column shows the segmentation results using Greedy Cut, and the fourth column shows the segmentation results using the segmentation algorithm proposed in this application. The red line indicates the segmentation boundary. Figure 4 Also shown are the running time (in seconds) of each algorithm, the average isometric distortion with maximum isometric distortion
[0154] Furthermore, to quantify the effect of the target parameterized coordinates of the third target mesh, Table 2 shows a comparison of the layout algorithm of this embodiment with three existing layout algorithms: UV Atlas, Box Cutter, and X Atlas, on 19 mesh models with varying numbers of facets and genus.
[0155] Table 2 Effect display of target parameterized coordinates
[0156]
[0157] As can be seen from Table 2, the first column is the name of each mesh model, the second column is the number of vertices and faces in each mesh model's submeshes, the third column records the running time (in milliseconds) of the UV atlas generator, the layout efficiency, and the number of submeshes after layout, the fourth column records the running time (in milliseconds) of the box cutting tool, the layout efficiency, and the number of submeshes after layout, the fifth column records the running time (in milliseconds) of the X atlas generator, the layout efficiency, and the number of submeshes after layout, and the sixth column records the running time (in milliseconds) of the balanced maximum difference technique, the layout efficiency, and the number of submeshes after layout. If the layout algorithm runs for more than ten minutes, it is marked as Timeout; if the layout method fails, it is marked as Fail.
[0158] As can be seen from Table 2, in terms of the layout efficiency of the parameterized area, the balanced maximum difference technology is significantly ahead of other comparison algorithms, with the lowest layout efficiency improvement of 5.80%, the highest of 25.09%, and an average of 16.03%. In terms of the robustness of the layout algorithm, UVAtlas, XAtlas and the balanced maximum difference technology proposed in this application all show the highest stability, and can stably handle mesh models with different numbers of facets and topological defects; in terms of the running speed of the algorithm, the balanced maximum difference technology proposed in this application has significant performance advantages over other comparison algorithms, with the lowest time acceleration of 110 times, the highest of 1530 times, and an average of 708 times. For a triangular mesh model with about 80,000 facets, the balanced maximum difference technology proposed in this application only takes 0.4 milliseconds to complete the layout task and generate high-quality layout results, which can meet the requirements of physically based differentiable rendering applications for the running time of the parameterized area layout algorithm.
[0159] For example, Figure 5 This is a visualization diagram of the mesh parameterization, such as Figure 5 As shown, the parameterization results, the number of facets in the mesh model, and the running time of the mesh model in which the first target mesh is a cow are shown.
[0160] The mesh parameterization method provided in this embodiment, since the goal of Physics-Based Differentiable Rendering (PBDR) is to efficiently calculate the gradient of the rendered image pixel value relative to the scene parameters, allows moderate distortion, but requires bijective mapping (no flipping, no overlap). Therefore, when performing mesh parameterization, a first target mesh is obtained. The first target mesh is the topological structure to be parameterized. The first target mesh includes multiple facets. Then, the first target mesh is segmented based on the dual graph to obtain a second target mesh. The second target mesh includes multiple sub-meshes. In order to ensure that the sub-meshes in the second target mesh are topologically homeomorphic to the disk, it is determined whether the second target mesh meets the preset conditions. If the second target mesh meets the preset conditions, the distortion of the second target mesh is determined, and based on the distortion of the second target mesh, a third target mesh is determined, thereby optimizing the high-protrusion area, and further In the first step, the third target grid is parameterized and mapped by using a preset parameterization algorithm, thereby obtaining the initial parameterized coordinates corresponding to the third target grid. In order to improve space utilization, the initial parameterized coordinates corresponding to the third target grid are arranged in the preset parameterization space to obtain the target parameterized coordinates corresponding to the third target grid. By no longer pursuing angle-preserving or distance-preserving mapping and the setting of the shortest segmentation boundary, the first target grid is quickly segmented, and parameterization is quickly achieved using the preset parameterization algorithm, and the grid is quickly arranged in the preset parameterization space, thereby achieving rapid parameterization of the grid and improving the efficiency of grid parameterization.
[0161] Figure 6 A schematic diagram of the structure of a grid parameterization device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the grid parameterization device provided in this embodiment is located in an electronic device, and the grid parameterization device 60 provided in this embodiment includes: an acquisition module 61, a segmentation module 62, a determination module 63, a mapping module 64, and an arrangement module 65.
[0162] Among them, the acquisition module 61 is used to obtain the first target grid; the first target grid is a topological structure to be parameterized; the first target grid includes multiple patches; the segmentation module 62 is used to segment the first target grid based on the dual graph to obtain the second target grid; the determination module 63 is used to determine whether the second target grid meets the preset conditions; the determination module 63 is also used to determine the distortion of the second target grid if the second target grid meets the preset conditions, and determine the third target grid based on the distortion of the second target grid; the mapping module 64 is used to parameterize the third target grid using a preset parameterization algorithm to obtain the initial parameterized coordinates corresponding to the third target grid; the arrangement module 65 is used to arrange the initial parameterized coordinates corresponding to the third target grid in the preset parameterized space to obtain the target parameterized coordinates corresponding to the third target grid.
[0163] The grid parameter determination device provided in this embodiment can be executed Figure 2 The specific implementation principles and technical effects of the method embodiments shown are similar and will not be repeated here.
[0164] Optionally, the segmentation module 62, when segmenting the first target mesh based on the dual graph to obtain the second target mesh, is specifically used to: determine a mesh bounding box corresponding to the first target mesh; determine a first seed surface of the first target mesh based on the mesh bounding box; use a preset distance function corresponding to the dual graph and determine a first preset number of second seed surfaces based on the first seed surface of the first target mesh; determine the first seed surface and the second seed surface as target seed surfaces; calculate the distance between each facet in the first target network and each target seed surface; and segment the target mesh based on the distance between each facet and each target seed surface to obtain the second target mesh.
[0165] Optionally, the second target grid includes multiple first subgrids; and the first subgrid includes multiple patches.
[0166] Accordingly, when determining whether the second target grid meets the preset conditions, the determination module 63 is specifically used to: calculate the corresponding Euler characteristic for each first sub-grid respectively; if it is determined that the Euler characteristic corresponding to each first sub-grid is equal to the preset value, then it is determined that the second target grid meets the preset conditions.
[0167] Optionally, the grid parameterization device provided in this embodiment further includes a circulation module.
[0168] Correspondingly, the loop module is used to: if it is determined that the Euler characteristic number corresponding to the first sub-grid is not equal to the preset value, then execute the following loop operation until the Euler characteristic numbers corresponding to each first sub-grid are equal to the preset value, then jump out of the loop, and determine that the second target grid meets the preset conditions; the loop operation is as follows: calculate the boundary length corresponding to the first sub-grid whose Euler characteristic number is not equal to the preset value, and determine the target boundary based on the boundary length; determine a second preset number of third seed surfaces from the target boundary; based on the third seed surfaces, split the first sub-grid whose Euler characteristic number is not equal to the preset value to obtain the split first sub-grid; calculate the Euler characteristic number corresponding to the split first sub-grid; if there is a split first sub-grid whose Euler characteristic number is not equal to the preset value, then continue to execute the loop operation on the split first sub-grid corresponding to the Euler characteristic number not equal to the preset value.
[0169] Optionally, when determining the distortion of the second target grid and determining the third target grid based on the distortion of the second target grid, the determination module 63 is specifically used to: obtain the first area of each facet in the second target grid; perform parameterization operations on the second target grid in a preset parameterized space using a preset parameterized algorithm to obtain first parameterized coordinates; calculate the second area of each facet in the preset parameterized space based on the first parameterized coordinates; calculate the ratio of the first area and the second area corresponding to each facet to obtain the distortion of each facet; compare the distortion of each facet with a preset distortion threshold; if it is determined that the distortion of a facet is greater than the preset distortion threshold, segment the first sub-grid corresponding to the facet to obtain the third target grid.
[0170] Optionally, the third target grid includes multiple second sub-grids.
[0171] Correspondingly, the arrangement module 65, when arranging the initial parameterized coordinates corresponding to the third target grid in the preset parameterized space to obtain the target parameterized coordinates corresponding to the third target grid, is specifically used to calculate the ratio of the area of each second sub-grid to the area of the third target grid to obtain the target scaling ratio corresponding to each second sub-grid; and adopts the balanced maximum difference technology and arranges the initial parameterized coordinates corresponding to the third target grid in the preset parameterized space based on the target scaling ratio corresponding to each second sub-grid to obtain the target parameterized coordinates corresponding to the third target grid.
[0172] The grid parameterization device provided in this embodiment can execute any of the method embodiments shown above. The specific implementation principles and technical effects are similar and will not be repeated here.
[0173] Figure 7 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application is shown in FIG. Figure 7As shown, the electronic device 70 provided in this embodiment includes: a processor 71 and a memory 72 communicatively connected to the processor.
[0174] Memory 72 stores computer-executable instructions; processor 71 executes the computer-executable instructions stored in memory 72 to implement the mesh parameterization method provided in any of the above-described embodiments. For further explanation, please refer to the corresponding descriptions and effects of the steps in the accompanying drawings, and detailed descriptions are omitted here.
[0175] The program may include program code, which includes computer-executable instructions. The memory 72 may include a high-speed RAM memory, or may also include a non-volatile memory, such as at least one disk memory.
[0176] In this embodiment, the memory 72 is connected to the processor 71 via a bus. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0177] The present application also provides a computer-readable storage medium storing computer-executable instructions. When executed by a processor, the computer-executable instructions implement the mesh parameterization method provided in any of the above-described embodiments. For example, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device.
[0178] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the grid parameterization method provided in any one of the above embodiments.
[0179] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all optional embodiments, and the actions and modules involved are not necessarily required by this application.
[0180] It should be further noted that, although the various steps in the flowchart are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps may be performed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but may be performed at different times. The execution order of these sub-steps or stages is not necessarily to be performed in sequence, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0181] It should be understood that the above-described device embodiments are merely illustrative, and the device of the present application may also be implemented in other ways. For example, the division of units / modules in the above-described embodiments is merely a logical functional division, and actual implementations may employ other division methods. For example, multiple units, modules, or components may be combined or integrated into another system, or some features may be omitted or not implemented.
[0182] In addition, unless otherwise specified, the functional units / modules in the various embodiments of the present application may be integrated into a single unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The aforementioned integrated units / modules may be implemented in the form of hardware or software program modules.
[0183] If the integrated unit / module is implemented in hardware, the hardware may be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the artificial intelligence processor may be any appropriate hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC. Unless otherwise specified, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), etc.
[0184] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0185] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a particular embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined in any way. To keep the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0186] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0187] It should be understood that the present application is not limited to the exact structure described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A grid parameterization method, characterized in that: include: Get the first target grid; The first target mesh is a topological structure to be parameterized; the first target mesh includes a plurality of facets; Segmenting the first target grid based on the dual graph to obtain a second target grid; Determining whether the second target grid meets a preset condition; The preset condition is used to indicate whether the second target grid needs to be segmented again; If the second target grid meets the preset condition, determining the distortion of the second target grid, and determining a third target grid based on the distortion of the second target grid; Performing parameterized mapping on the third target grid using a preset parameterized algorithm to obtain initial parameterized coordinates corresponding to the third target grid; The initial parameterized coordinates corresponding to the third target grid are arranged in a preset parameterized space to obtain target parameterized coordinates corresponding to the third target grid.
2. The method according to claim 1, characterized in that The step of segmenting the first target grid based on the dual graph to obtain a second target grid includes: Determine a grid bounding box corresponding to the first target grid; Determining a first seed surface of the first target mesh based on the mesh bounding box; Determining a first preset number of second seed surfaces based on the first seed surface of the first target grid using a preset distance function corresponding to the dual graph; determining the first seed surface and the second seed surface as target seed surfaces; Calculating the distance between each of the face patches and each of the target seed faces in the first target network; The target mesh is segmented based on the distance between each of the face patches and each of the target seed faces to obtain the second target mesh.
3. The method according to claim 1, characterized in that The second target grid includes a plurality of first subgrids; the first subgrid includes a plurality of facets; The determining whether the second target grid meets a preset condition includes: Calculating the corresponding Euler characteristic for each of the first sub-grids; If it is determined that the Euler characteristic corresponding to each of the first sub-grids is equal to a preset value, it is determined that the second target grid meets the preset condition.
4. The method according to claim 3, characterized in that The method further comprises: If it is determined that the Euler characteristic corresponding to any of the first sub-grids is not equal to the preset value, the following loop operation is performed until the Euler characteristic corresponding to each of the first sub-grids is equal to the preset value, then the loop is exited, and it is determined that the second target grid meets the preset condition; The loop operation is as follows: calculating a boundary length corresponding to the first sub-grid whose Euler characteristic is not equal to a preset value, and determining a target boundary based on the boundary length; determining a second preset number of third subsurfaces from the target boundary; Segmenting the first subgrid whose Euler characteristic is not equal to a preset value based on the third seed surface to obtain a segmented first subgrid; Calculating the Euler characteristic corresponding to the first sub-grid after the segmentation; If there is an Euler characteristic corresponding to the first sub-grid after segmentation that is not equal to the preset value, the loop operation is continued to be performed on the first sub-grid after segmentation corresponding to the Euler characteristic that is not equal to the preset value.
5. The method according to claim 3, characterized in that The determining of the distortion of the second target grid and determining a third target grid based on the distortion of the second target grid includes: Obtaining a first area of each of the facets in the second target grid; Performing a parameterization operation on the second target grid in the preset parameterized space using the preset parameterized algorithm to obtain first parameterized coordinates; Calculating a second area of each of the facets in the second target grid in the preset parameterized space based on the first parameterized coordinates; Calculating a ratio of the first area to the second area corresponding to each patch to obtain a degree of distortion of each patch; Comparing the distortion of each of the facets with a preset distortion threshold; If it is determined that the distortion of the patch is greater than the preset distortion threshold, the first sub-grid corresponding to the patch is divided to obtain a third target grid.
6. The method according to claim 1, characterized in that The third target grid includes a plurality of second subgrids; Arranging the initial parameterized coordinates corresponding to the third target grid in a preset parameterized space to obtain target parameterized coordinates corresponding to the third target grid includes: Calculating the ratio of the area of each second sub-grid to the area of the third target grid to obtain the target scaling ratio corresponding to each second sub-grid; The balanced maximum difference technique is adopted and the initial parameterized coordinates corresponding to the third target grid are arranged in the preset parameterized space based on the target scaling ratio corresponding to each second subgrid to obtain the target parameterized coordinates corresponding to the third target grid.
7. A grid parameterization device, characterized in that: include: An acquisition module, configured to acquire a first target grid; The first target mesh is a topological structure to be parameterized; the first target mesh includes a plurality of facets; a segmentation module, configured to segment the first target grid based on the dual graph to obtain a second target grid; A determination module, configured to determine whether the second target grid satisfies a preset condition; The determining module is further configured to determine a distortion degree of the second target grid if the second target grid satisfies the preset condition, and determine a third target grid based on the distortion degree of the second target grid; A mapping module, configured to perform parameterized mapping on the third target grid using a preset parameterized algorithm to obtain initial parameterized coordinates corresponding to the third target grid; An arrangement module is used to arrange the initial parameterized coordinates corresponding to the third target grid in a preset parameterized space to obtain target parameterized coordinates corresponding to the third target grid.
8. An electronic device, characterized in that: include: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.
10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.