Method and apparatus for simplifying three-dimensional model, and storage medium

By converting the grid of the three-dimensional model into multiple connected graph sets and determining the simplified weight based on the vertex attributes and topological information, the problem of triangle degradation caused by simplification of the three-dimensional model is solved, and efficient simplification of the three-dimensional model and topological structure are achieved.

WO2025113690A1PCT designated stage expired Publication Date: 2025-06-05ARCSOFT CORP LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/135906
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-29
Filing Date
2024-11-29
Publication Date
2025-06-05

AI Technical Summary

Technical Problem

The existing three-dimensional model simplification method can easily lead to triangle degradation and destroy the original model topology.

Method used

By converting the mesh of the 3D model into multiple connected graph sets, the simplified weight of the triangle edges is determined based on the vertex attributes and topological information of the triangle face sheet, the triangle edges with high simplified weights are deleted to simplify the three-dimensional model, and the vertex attributes are adjusted when necessary to avoid topological changes.

Benefits of technology

Effectively simplify the three-dimensional model, reduce computing and storage requirements, while maintaining the topology of the original model, and avoiding triangle degradation and structural changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024135906_05062025_PF_FP_ABST
    Figure CN2024135906_05062025_PF_FP_ABST
Patent Text Reader

Abstract

A method and apparatus for simplifying a three-dimensional model, and a storage medium. The method comprises: converting the mesh of a three-dimensional model into a plurality of connected graph sets, each of the connected graph sets comprising a plurality of connected graphs; for each of the connected graphs in each of the connected graph sets, on the basis of vertex attributes of triangle facets in the connected graph and topological information of the triangle facets in the connected graph, determining simplification weights of the triangle edges of all of the triangle facets in the connected graph; and for the triangle edges of all of the triangle facets in all of the connected graph sets, on the basis of at least the simplification weights of all of the triangle edges and a basic simplification error, determining an edge to be simplified, and, on the basis of the edge to be simplified, simplifying the three-dimensional model.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device and storage medium for simplifying three-dimensional model

[0001] This application claims priority to the Chinese patent application filed on November 29, 2023, with application number 202311638796.9 and invention name “A method, device and storage medium for simplifying a three-dimensional model”, the contents of which should be understood as incorporated into this application by reference. Technical Field

[0002] The embodiments of the present disclosure relate to, but are not limited to, three-dimensional data processing technology, and in particular to a method, device, and storage medium for simplifying a three-dimensional model. Background Art

[0003] 3D models offer a greater sense of depth and realism than 2D models, but they also require a very large amount of data. This massive amount of data places significant challenges on computer computing, display, and hardware storage capabilities. Simplifying 3D models while ensuring 3D rendering and simulation requirements can reduce computer storage space and speed up processing.

[0004] In related technologies, the vertex clustering algorithm used to simplify three-dimensional models easily causes triangle degeneration and destroys the original model topology. Summary of the Invention

[0005] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.

[0006] The present disclosure provides a method, device, and storage medium for simplifying a three-dimensional model, which can ensure that the simplified three-dimensional model still maintains the original model topology.

[0007] An embodiment of the present disclosure provides a method for simplifying a three-dimensional model, the method comprising:

[0008] Converting a mesh of the three-dimensional model into a plurality of connected graph sets, wherein each connected graph set includes a plurality of connected graphs;

[0009] For each connected graph in each connected graph set, determining simplified weights of triangle edges of all triangles in the connected graph according to vertex attributes of the triangles in the connected graph and topological information of the triangles in the connected graph;

[0010] For all triangle edges of all triangular facets in the connected graph set, edges to be simplified are determined at least according to simplification weights of all triangle edges and basic simplification errors, and the three-dimensional model is simplified based on the edges to be simplified.

[0011] As an exemplary embodiment, determining the simplified weights of triangle edges of all triangular facets in the connected graph based on vertex attributes of the triangular facets in the connected graph and topological information of the triangular facets in the connected graph includes:

[0012] For each triangle edge of all triangle facets in the connected graph, the simplification weight of the triangle edge is determined according to the number of vertex attributes of the triangle edge in the connected graph, the correspondence of vertex attributes of two vertices of the triangle edge, and the number of adjacent triangle facets of the triangle edge.

[0013] As an exemplary embodiment, determining the simplified weights of triangle edges of all triangular facets in the connected graph based on vertex attributes of the triangular facets in the connected graph and topological information of the triangular facets in the connected graph includes:

[0014] For each triangular face in the connected graph, the type of each triangular edge of the triangular face is determined according to the vertex attributes of the triangular face in the connected graph and the topological information of the triangular face in the connected graph, and the simplified weight of the corresponding triangular edge is determined according to the type of each triangular edge.

[0015] As an exemplary embodiment, determining the type of each triangle edge of the triangular facet according to the vertex attributes of the triangular facet in the connected graph and the topological information of the triangular facet in the connected graph includes:

[0016] The type of the corresponding triangle edge is determined according to the number of vertex attributes of each triangle edge of the triangle face in the connected graph, the correspondence of vertex attributes of two vertices of each triangle edge, and the number of adjacent triangle facets of each triangle edge.

[0017] As an exemplary embodiment, determining the type of the corresponding triangle edge according to the number of vertex attributes of each triangle edge of the triangle face in the connected graph, the correspondence between the vertex attributes of two vertices of each triangle edge, and the number of adjacent triangle facets of each triangle edge includes:

[0018] For each triangle edge:

[0019] In the case where the triangle edge has only one adjacent triangle facet, the triangle edge is determined to be a physical edge;

[0020] If the triangle edge has two adjacent triangles and both vertices at the two ends of the triangle edge have a set of vertex attributes, the triangle edge is determined to be a simplified edge;

[0021] If the triangle edge has two adjacent triangles, both vertices at the two ends of the triangle edge have multiple sets of vertex attributes, and the multiple sets of vertex attributes at the two ends of the triangle edge correspond to each other in the geometric topology and the texture topology, the triangle edge is determined to be a texture edge;

[0022] When the triangle edge has two adjacent triangles, both end vertices of the triangle edge have multiple sets of vertex attributes, and the multiple sets of vertex attributes of the two end vertices cannot correspond sequentially in the geometric topology and the texture topology, the triangle edge is determined to be a hub edge.

[0023] As an exemplary embodiment, determining the simplified weight of the corresponding triangle edge according to the type of each triangle edge includes:

[0024] For each triangle edge:

[0025] When the triangle edge is a simplified edge or a texture edge, determining a simplified weight of the triangle edge within a first weight range;

[0026] When the triangle edge is a physical edge, determining a simplified weight of the triangle edge within a second weight range;

[0027] When the triangle edge is a hinge edge, determining that the simplified weight of the triangle edge is within a third weight range;

[0028] The simplified weights of the simplified edge and the texture edge are higher than the simplified weight of the physical edge, and the simplified weight of the physical edge is higher than the simplified weight of the hinge edge.

[0029] As an exemplary embodiment, the simplified weight of the physical edge is determined according to a preset coefficient and a proportional coefficient, wherein the proportional coefficient is determined according to the proportion of the physical edge in all triangle edges in the connected graph to which the physical edge belongs.

[0030] As an exemplary embodiment, the basic simplified error includes a geometric error; and a method for calculating the geometric error of each triangle edge includes:

[0031] For each connected graph set, generating a signed distance field of the connected graph set based on vertex geometry information and the geometric topology of triangles contained in the connected graph set;

[0032] Using the directed distance fields of all connected graph sets other than the connected graph set to which each triangle edge belongs as constraints of a quadratic error metric matrix for solving the geometric error;

[0033] The quadratic error metric matrix is ​​solved under the constraint conditions to obtain the geometric error of each triangle edge.

[0034] As an exemplary embodiment, after simplifying the three-dimensional model based on the edges to be simplified, the method further includes:

[0035] Determining whether a triangle face is flipped after simplification based on a change in an angle of a second-order adjacent face of a target vertex obtained after simplification corresponding to the edge to be simplified;

[0036] In the event of triangle face folding, the edge to be simplified replaced by the target vertex and the vertex attributes of the edge to be simplified are restored, and at least one of the operations of reducing the simplification weight of the edge to be simplified and increasing the basic simplification error of the edge to be simplified is performed.

[0037] As an exemplary embodiment, judging whether triangle face folding occurs after simplification based on a change in an angle of a second-order adjacent face of a target vertex obtained after simplification corresponding to the edge to be simplified includes:

[0038] When the angle change is greater than or equal to a preset angle threshold, it is determined that triangle facet folding occurs after simplification.

[0039] As an exemplary embodiment, after converting the mesh of the three-dimensional model into a plurality of connected graph sets, and before determining, for each connected graph in each connected graph set, simplified weights of triangle edges of all triangular facets in the connected graph based on vertex attributes of the triangular facets in the connected graph and topological information of the triangular facets in the connected graph, the method further includes:

[0040] In all connected graph sets, each connected graph whose number of triangles is less than or equal to an initial preset triangle number threshold is taken as a candidate connected graph;

[0041] The following steps are iteratively performed: among all the newly obtained candidate connected graphs, the connected graph with the smallest connected graph weight is deleted as the target connected graph, and the current preset triangle number threshold is updated according to the number of triangles in the target connected graph; new candidate connected graphs are screened out from the remaining candidate connected graphs according to the updated preset triangle number threshold until there are no candidate connected graphs to be selected.

[0042] As an exemplary embodiment, the initial preset triangle face number threshold is determined according to the total number of triangle facets of the three-dimensional model, the target simplification ratio and the coarse simplification ratio of the three-dimensional model.

[0043] As an exemplary embodiment, the method for calculating the connectivity graph weight includes:

[0044] For each connected graph, the connected graph weight of the connected graph in the connected graph set to which it belongs is determined based on the weight parameters of the connected graph, wherein the weight parameters of the connected graph include one or more of the area of ​​the connected graph, the sum of all vertex voxels, the number of vertices and the number of triangles.

[0045] As an exemplary embodiment, determining the connected graph weight of the connected graph in the connected graph set to which it belongs based on the weight parameter of the connected graph includes:

[0046] For each type of weight parameter value of the connected graph, determine the proportion of the weight parameter value of the type in the weight parameter values ​​of the type of all connected graphs included in the corresponding connected graph set;

[0047] Normalize the ratio of all types of weight parameter values;

[0048] The weight of the connectivity graph is determined according to the ratio of the normalized weight parameter values ​​of all types.

[0049] As an exemplary embodiment, determining the edges to be simplified based on at least the simplification weights of all triangle edges and the basic simplification errors includes:

[0050] Determine the target simplification error of the corresponding triangle edge according to the simplification weight of each triangle edge, the basic simplification error of each triangle edge, and the connectivity graph weight of the connectivity graph to which each triangle edge belongs;

[0051] The edges to be simplified are determined according to target simplification errors of all triangle edges.

[0052] As an exemplary embodiment, the method further includes:

[0053] After determining the edges to be simplified at least based on the simplification weights of all triangle edges and the basic simplification errors, in addition to simplifying the three-dimensional model based on the edges to be simplified, at least one of the bone binding data and the deformation animation data of the target vertex is determined, wherein the target vertex is used to replace the edges to be simplified.

[0054] As an exemplary embodiment, the bone binding data for determining the target vertex includes:

[0055] Determine the initial weights between the target vertex and the skeleton points corresponding to the two vertices of the edge to be simplified according to the distances between the target vertex and the two vertices of the edge to be simplified;

[0056] Determine the weight between the target vertex and any one of the skeleton points corresponding to the two vertices according to the initial weights between the skeleton points corresponding to the two vertices and the target vertex, the index weight of any one of the multiple skeleton points corresponding to the two vertices for the corresponding vertex, and the binding weight of any one of the multiple skeleton points corresponding to the two vertices for the corresponding vertex;

[0057] According to the weight of the target vertex to each skeleton point, data corresponding to a preset number of skeleton points are selected as the skeleton binding data of the target vertex.

[0058] As an exemplary embodiment, determining deformation animation data of a target vertex includes:

[0059] Superimposing deformation animation data on all vertices of the adjacent triangular facets of the edge to be simplified to obtain an updated edge of the adjacent triangular facets;

[0060] Generate simplified vertices with deformation animation data based on the updated edges of adjacent triangles;

[0061] Deformation animation data of the target vertex is determined according to a data difference between the target vertex and the simplified vertex.

[0062] As an exemplary embodiment, converting the mesh of the three-dimensional model into a plurality of connected graph sets includes:

[0063] Screening out non-two-dimensional manifold meshes in the three-dimensional model and retaining the two-dimensional manifold meshes;

[0064] A two-dimensional manifold mesh in the three-dimensional model is converted into a plurality of connected graph sets.

[0065] An embodiment of the present disclosure provides a non-transitory computer-readable storage medium, which stores one or more program instructions. The one or more program instructions can be executed by one or more processors to implement the method described in any of the previous embodiments.

[0066] The device for simplifying three-dimensional models provided by an embodiment of the present disclosure includes a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the program is read and executed by the processor, it implements the method described in any of the previous embodiments.

[0067] Compared with the related art, the technical solution disclosed in the present invention simplifies the three-dimensional model by deleting the edges to be simplified; and when determining the simplified edges, the vertex attributes of the triangle facets and the topological information of the triangle facets are taken into consideration, and the importance of all triangular edges is determined by the vertex attributes and topological information of the triangle facets. Since important triangular edges are usually related to factors such as the skeleton, contour, and surface continuity of the three-dimensional model, simplifying the three-dimensional model according to the importance of the triangular edges can avoid obvious changes in the structure of the three-dimensional model after simplification and maintain the original topology of the three-dimensional model.

[0068] Still other aspects will become apparent upon reading and understanding the accompanying drawings and detailed description.

[0069] Summary of the Figures

[0070] The accompanying drawings are used to provide an understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation to the technical solution of the present disclosure.

[0071] FIG1 is a simplified flowchart of a method for creating a three-dimensional model according to an embodiment of the present disclosure;

[0072] FIG2A is a schematic diagram of the geometric topology of a triangular facet provided by an embodiment of the present disclosure;

[0073] FIG2B is a schematic diagram of a texture image of a triangular facet provided by an embodiment of the present disclosure;

[0074] FIG2C is a rectangular texture topology diagram constructed from triangular facets with texture images provided by an embodiment of the present disclosure;

[0075] FIG3A is a schematic diagram of a simplified edge provided by an embodiment of the present disclosure;

[0076] FIG3B is a schematic diagram of a texture edge provided by an embodiment of the present disclosure;

[0077] FIG3C is a schematic diagram of a hub edge provided by an embodiment of the present disclosure;

[0078] FIG3D is a schematic diagram of a physical edge provided by an embodiment of the present disclosure;

[0079] FIG4A is a schematic diagram of a connectivity diagram before simplification provided by an embodiment of the present disclosure;

[0080] FIG4B is a simplified schematic diagram of a connectivity diagram provided by an embodiment of the present disclosure;

[0081] FIG5 is a schematic diagram of a simplified three-dimensional model provided by an embodiment of the present disclosure showing a fold;

[0082] FIG6 is a schematic diagram showing how skeletal binding data changes when a triangle facet changes according to an embodiment of the present disclosure;

[0083] FIG7 is a flowchart of determining deformation animation data of a target vertex according to an embodiment of the present disclosure;

[0084] FIG8 is a simplified device structure diagram of a three-dimensional model provided by an embodiment of the present disclosure;

[0085] FIG9 is a simplified device structure diagram of another three-dimensional model provided by an embodiment of the present disclosure.

[0086] Details

[0087] The present disclosure describes a number of embodiments, but this description is exemplary rather than restrictive, and it will be apparent to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present disclosure. Although many possible feature combinations are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.

[0088] The present disclosure includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features, and elements of the present disclosure may also be combined with any conventional features or elements to form a unique inventive solution defined by the claims. Any features or elements of any embodiment may also be combined with features or elements from other inventive solutions to form another unique inventive solution defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in this disclosure may be implemented individually or in any appropriate combination. Therefore, the embodiments are not subject to other limitations except as provided in the appended claims and their equivalents. In addition, various modifications and changes may be made within the scope of protection of the appended claims.

[0089] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps in the specific order described. As will be understood by those skilled in the art, other orders of steps are also possible. Therefore, the specific order of the steps set forth in the specification should not be interpreted as a limitation on the claims. In addition, the claims to the method and / or process should not be limited to performing their steps in the order written, and those skilled in the art can readily understand that these orders can be changed and still remain within the spirit and scope of the disclosed embodiments.

[0090] The present disclosure provides a method for simplifying a three-dimensional model, as shown in FIG1 , the method comprising:

[0091] Step S101, converting a mesh of a three-dimensional model into a plurality of connected graph sets; wherein each connected graph set includes a plurality of connected graphs;

[0092] In scenarios such as virtual character creation and animation production, 3D models composed of multiple triangular facets can be used to represent people and objects in the scene. When simplifying a 3D model, the 3D model can be divided into multiple mesh sets, and each mesh set can be simplified separately. For example, the body, hair, face, top, and pants of a 3D character model can be divided into different mesh sets; and a mesh set can be converted into a connected graph set, that is, a mesh set includes multiple connected graphs, and a connected graph includes multiple triangular facets;

[0093] Among them, the meaning of a connected graph is that there must be a path between any two vertices in the graph;

[0094] Step S102, for each connected graph in each connected graph set, determining simplified weights of triangle edges of all triangles in the connected graph according to vertex attributes of the triangles in the connected graph and topological information of the triangles in the connected graph;

[0095] The vertex attributes include: one or more of texture coordinates, normals, tangents, and colors, where texture coordinates refer to the mapping relationship between vertices and texture maps; normals refer to vectors perpendicular to the surface where the vertex is located. In 3D graphics, normal vectors are used to determine the orientation of the surface where the vertex is located, which can be used to calculate lighting effects during lighting and rendering; tangents refer to vectors parallel to the surface where the vertex is located, which are located in the tangent plane of the surface and along the local change direction of the surface. For triangles, the tangent vector of each vertex represents the local change direction of the surface where the vertex is located; in 3D graphics, color refers to the color value assigned to each vertex of a triangle. These color values ​​are used to determine the color distribution of the triangle surface and are an important part of the rendering process.

[0096] The topological information of a triangle patch includes: geometric topology and texture topology.

[0097] The geometric topology and texture topology of triangular facets describe the geometric structure and texture mapping structure of the three-dimensional model respectively. The geometric topology refers to the logical relationship of triangular facets composed of the three-dimensional space coordinate vertices in the model. This logical relationship describes the geometric structure of the three-dimensional model, including how vertices, edges and faces are connected and organized with each other. Figure 2A is an example of the geometric topology of triangular facets. A rectangle is composed of two triangular facets. The vertex logic of the two triangular facets that constitute this rectangle is the geometric topology, that is, when we use two triangular facets to construct a rectangle, how the vertices, edges and faces of the two triangular facets are connected and arranged constitutes the geometric topology structure of this rectangle.

[0098] Texture topology refers to the logical relationship between triangular facets formed by vertices in a two-dimensional texture space. Typically, this topology information focuses on how vertices are laid out in texture space via texture coordinates. Texture coordinates determine how the texture image is unfolded and mapped onto a three-dimensional model. Figure 2B shows an example of a triangular facet texture topology. After two triangles are constructed into a rectangle, the coordinates of the original texture image on each triangle are mapped to create a rectangular texture image. The mapped rectangular texture image is shown in Figure 2C.

[0099] Since geometric topology refers to the structure and shape of the 3D model itself, and texture topology refers to the arrangement of texture images on the surface of the 3D model, different parts of a 3D model may use different textures. This means that a vertex may correspond to multiple texture coordinates, each corresponding to a different texture image. The fact that each vertex corresponds to multiple texture coordinates means that the texture topology does not necessarily correspond completely to the geometric topology. Therefore, a connected geometric topology may have a disconnected texture topology.

[0100] The vertex attributes and topological information of a triangle can reflect the complexity of the relationship between the triangle and its surrounding triangles. This complexity can be used to determine the weight of the triangle during the simplification process, i.e., the simplification weight. For example, when the complexity is low, the corresponding triangle has a higher simplification weight.

[0101] Step S103 , determining edges to be simplified for all triangle edges of all triangular facets in the connected graph set at least according to the simplification weights of all triangle edges and the basic simplification error; and simplifying the three-dimensional model based on the edges to be simplified.

[0102] For example, as mentioned above, each triangle edge of a triangular face corresponds to a simplification weight; and the basic simplification error of the triangle edge is determined according to the error that occurs during the simplification process based on the attribute characteristics of the triangle edge itself, and the basic simplification error includes geometric error; in addition, the basic simplification error can also include one or more of normal error, texture coordinate error, color error and tangent error.

[0103] This embodiment selects one or more triangle edges as edges to be simplified based on the simplification weights and basic simplification errors of all triangle edges. The number of edges to be simplified is not limited. For example, a higher simplification weight indicates a higher priority for deletion and a higher likelihood of being determined as an edge to be simplified.

[0104] In this embodiment, the simplification of the three-dimensional model can be achieved by deleting the edges to be simplified. The three-dimensional model simplification method recorded in the embodiment of the present disclosure takes into account the vertex attributes of the triangle facets and the topological information of the triangle facets when determining the simplified edges, and determines the importance of all triangle edges through the vertex attributes and topological information of the triangle facets. Since important triangle edges are usually related to factors such as the skeleton, contour, and surface continuity of the three-dimensional model, simplifying the three-dimensional model according to the importance of the triangle edges can avoid obvious changes in the structure of the three-dimensional model after simplification and maintain the original topology of the three-dimensional model.

[0105] In an exemplary embodiment, simplification of the three-dimensional model based on the edges to be simplified can be a step-by-step simplification process. The step-by-step simplification process can control the speed and degree of simplification. By gradually reducing the number of edges, the simplification process of the three-dimensional model can be managed more meticulously, avoiding vertex aggregation and collapse caused by one-time over-simplification, overcoming the deficiency that vertex aggregation easily causes triangle degeneration and thus destroys the original three-dimensional model topology, and ensuring that the simplified three-dimensional model can still maintain the original model topology.

[0106] In an exemplary embodiment, determining the simplified weights of triangle edges of all triangular facets in the connected graph based on vertex attributes of the triangular facets in the connected graph and topological information of the triangular facets in the connected graph includes:

[0107] For each triangle edge of all triangles in the connected graph, a simplification weight for the triangle edge is determined based on the number of vertex attributes of the triangle edge in the connected graph, the correspondence between the vertex attributes of the two vertices of the triangle edge, and the number of adjacent triangles of the triangle edge. For example, if a vertex has a position, color, texture, and normal vector, the vertex has four sets of attributes.

[0108] Exemplarily, the importance of the corresponding triangle edge can be determined based on the number of vertex attributes of each triangle edge in the connected graph, the correspondence of the vertex attributes of the two vertices of each triangle edge, and the number of adjacent triangles of each triangle edge; the lower the importance of a triangle edge, the greater the simplification weight of the triangle edge, and the greater the probability of the triangle edge being simplified; conversely, the higher the importance of a triangle edge, the smaller the simplification weight of the triangle edge, and the smaller the probability of the triangle edge being simplified.

[0109] Exemplarily, determining the importance of a corresponding triangle edge based on the number of vertex attributes of each triangle edge in the connectivity graph, the correspondence between the vertex attributes of two vertices of each triangle edge, and the number of adjacent triangles of each triangle edge includes at least one of the following:

[0110] For each triangle edge:

[0111] The fewer the number of vertex attributes of the triangle edge, the lower the importance of determining the triangle edge;

[0112] The more the vertex attributes of the two vertices of the triangle edge correspond in the topological information of the triangle facet, the lower the importance of the triangle edge is determined;

[0113] The smaller the number of adjacent triangles of a triangle edge, the lower the importance of determining the triangle edge.

[0114] In actual implementation, the importance of the triangle edge can be comprehensively determined based on the number of vertex attributes of the triangle edge, the correspondence between the vertex attributes of the two vertices of the triangle edge in the topological information of the triangle facet in which it is located, and the number of adjacent triangle facets of the triangle edge.

[0115] In another exemplary embodiment, determining the simplified weights of triangle edges of all triangular facets in the connected graph based on vertex attributes of the triangular facets in the connected graph and topological information of the triangular facets in the connected graph includes:

[0116] For each triangular facet in the connected graph, determining the type of each triangular edge of the triangular facet based on the vertex attributes of the triangular facet in the connected graph and the topological information of the triangular facet in the connected graph; in the embodiment of the present disclosure, the type of the triangular edge may include: a physical edge, a simplified edge, a texture edge, or a hinge edge; the vertex attributes and topological information of the triangular facet where each type of triangular edge resides are different, so the type of the triangular edge of the triangular facet can be determined based on the vertex attributes and topological information of the triangular facet;

[0117] The simplification weight of the corresponding triangle edge is determined according to the type of each triangle edge; different types of triangle edges have different importance, so the simplification weight of the triangle edge can be determined according to the type of the triangle edge.

[0118] In this embodiment, the type of the triangle edge is first determined, and then the simplification weight thereof is determined based on the type of the triangle edge, which is more feasible.

[0119] In an exemplary embodiment, determining the type of each triangle edge of the triangular facet according to the vertex attributes of the triangular facet in the connected graph and the topological information of the triangular facet in the connected graph includes:

[0120] The type of the corresponding triangle edge is determined according to the number of vertex attributes of each triangle edge of the triangle face in the connected graph, the correspondence of vertex attributes of two vertices of each triangle edge, and the number of adjacent triangle facets of each triangle edge.

[0121] For example, the number of vertex attributes of the triangle edge, the correspondence between the vertex attributes of the two vertices of the triangle edge, and the number of adjacent triangles of the triangle edge have a constraint relationship with each other. The type of the triangle edge can be determined based on the number of vertex attributes of the triangle edge, the correspondence between the vertex attributes of the two vertices of the triangle edge, the number of adjacent triangles of the triangle edge and the constraint relationship.

[0122] In an exemplary embodiment, determining the type of the corresponding triangle edge according to the number of vertex attributes of each triangle edge of the triangle facet in the connectivity graph, the correspondence between the vertex attributes of two vertices of each triangle edge, and the number of adjacent triangle facets of each triangle edge includes:

[0123] For each triangle edge:

[0124] In the case where the triangle edge has only one adjacent triangle facet, the triangle edge is determined to be a physical edge;

[0125] If the triangle edge has two adjacent triangles and both vertices at the two ends of the triangle edge have a set of vertex attributes, the triangle edge is determined to be a simplified edge;

[0126] If the triangle edge has two adjacent triangles, both vertices at the two ends of the triangle edge have multiple sets of vertex attributes, and the multiple sets of vertex attributes at the two ends of the triangle edge correspond to each other in the geometric topology and the texture topology, the triangle edge is determined to be a texture edge;

[0127] When the triangle edge has two adjacent triangles, both end vertices of the triangle edge have multiple sets of vertex attributes, and the multiple sets of vertex attributes of the two end vertices cannot correspond sequentially in the geometric topology and the texture topology, the triangle edge is determined to be a hub edge.

[0128] Figures 3A to 3D respectively provide examples of simplified edges, texture edges, hinge edges, and physical edges. The simplified edge AB shown in Figure 3A has two adjacent triangles, and both vertices A and B of the simplified edge AB have a set of vertex attributes. The texture edge AB shown in Figure 3B has two adjacent triangles, and vertex A of texture edge AB has two attributes, uv0 and uv1, and vertex B has two attributes, uv2 and uv3. The same attributes uv0 and uv2 correspond to the geometric and texture properties of the left triangle, and the same attributes uv1 and uv3 correspond to the geometric and texture properties of the right triangle, that is, each vertex attribute can be sequentially mapped in the geometric topology and texture topology. The hinge edge AB shown in Figure 3C also has two adjacent triangles, and both vertices A and B of the hinge edge AB have two attributes, but the attribute uv1 of vertex A corresponds to the geometric and texture properties of the upper right triangle, and the attribute uv3 of vertex B corresponds to the geometric and texture properties of the lower right triangle, that is, each vertex attribute cannot be sequentially mapped in the geometric topology and texture topology. The physical edge AB shown in FIG3D has only one adjacent triangle, and both vertex A and vertex B have only one attribute.

[0129] In an exemplary embodiment, determining the simplified weight of each triangle edge according to the type of each triangle edge includes:

[0130] For each triangle edge:

[0131] When the triangle edge is a simplified edge or a texture edge, determining a simplified weight of the triangle edge within a first weight range;

[0132] When the triangle edge is a physical edge, determining a simplified weight of the triangle edge within a second weight range;

[0133] When the triangle edge is a hinge edge, determining that the simplified weight of the triangle edge is within a third weight range;

[0134] The simplified weights of the simplified edge and the texture edge are higher than the simplified weight of the physical edge, and the simplified weight of the physical edge is higher than the simplified weight of the hub edge; the first weight range, the second weight range and the third weight range are settable.

[0135] The disclosed embodiment assigns different simplification weights to different types of triangle edges. Simplified edges and texture edges are relatively "unimportant edges" and are therefore assigned higher simplification weights to increase the probability of being simplified. Hub edges are assigned smaller simplification weights to reduce the probability of being simplified, which can reduce the probability of texture confusion. Appropriate simplification of physical edges can avoid adverse effects such as excessive shrinkage of the three-dimensional model and excessive edge sharpening caused by over-simplification of physical edges.

[0136] In an exemplary embodiment, the simplification weight of the physical edge can also be determined based on a preset coefficient and a proportional coefficient, wherein the proportional coefficient is determined based on the proportion of physical edges among all triangle edges in the connected graph to which the physical edge belongs. Exemplarily, the proportional coefficient is the inverse of the proportion of physical edges among all triangle edges in the connected graph to which the physical edge belongs. Exemplarily, if the number of physical edges among all triangle edges in the connected graph to which the physical edge belongs is h, and the number of all triangle edges in the connected graph to which the physical edge belongs is x, then the proportional coefficient is x / h, that is, the more physical edges there are, the smaller the proportional coefficient, the smaller the simplification weight corresponding to the physical edge, and the lower the probability of the physical edge being simplified; conversely, the fewer physical edges there are, the larger the proportional coefficient, the larger the simplification weight corresponding to the physical edge, and the higher the probability of the physical edge being simplified. In this way, when there are too many physical edges in the connected graph, over-simplification of the physical edges can be avoided, reducing unfavorable phenomena such as excessive shrinkage and over-sharpening of edges in the 3D model during simplification.

[0137] In an exemplary embodiment, the basic simplified error of the triangle side includes at least: geometric error;

[0138] The calculation method of the geometric error of each triangle edge includes:

[0139] For each connected graph set, a signed distance field of the connected graph set is generated based on vertex geometric information and the geometric topology of the triangle facets contained in the connected graph set; wherein the vertex geometric information includes: three-dimensional coordinate information of the vertex;

[0140] Using the directed distance fields of all connected graph sets other than the connected graph set to which each triangle edge belongs as constraints of a quadric error metric (QEM) matrix for solving the geometric error;

[0141] The quadratic error metric matrix is ​​solved under the constraint conditions to obtain the geometric error of each triangle edge.

[0142] The disclosed embodiment uses a quadratic error metric matrix to calculate the geometric error of each triangle edge, which can optimize the metric error of the triangle edges, making it easier to distinguish different vertices in the three-dimensional model and more accurately describing the shape and surface details of the object; the matrix-based quadratic error metric method can effectively avoid problems such as disappearance of tip features and local oversimplification that exist in other quadratic error measurement algorithms, thereby better preserving the geometric characteristics of the three-dimensional model.

[0143] In addition, the embodiment of the present disclosure introduces a signed distance field as a constraint condition for calculating the geometric error, which can ensure that the three-dimensional geometric coordinates of the target vertex obtained after the triangle edge is simplified based on the geometric error will not overlap with the connected graph set other than the connected graph set to which the triangle edge belongs, thereby avoiding the occurrence of penetration phenomenon.

[0144] In an exemplary embodiment, the basic simplified error of the triangle edge may further include one or more of a normal error, a texture coordinate error, and a tangent error. The normal error, the texture coordinate error, and the tangent error may also be calculated using a quadratic error metric matrix.

[0145] The basic simplification error can be defined as follows: A set G is defined, consisting of all adjacent triangles at both ends of the edge to be simplified that do not contain the edge to be simplified. All basic simplification errors can be expressed as the sum of the distances from the target vertex corresponding to the edge to be simplified to each of the adjacent triangles in set G, such as the normal, texture coordinates, and tangent.

[0146] This embodiment also takes into account at least one of the normal error, texture error, and tangent error when calculating the basic simplified error of the triangle edge. This can better maintain the stability of the normal, texture, and tangent, and reduce the occurrence of texture creep.

[0147] Exemplarily, the basic simplification error of the triangle edge may also include a color error.

[0148] For example, the geometric error, normal error, texture coordinate error, tangent error, and color error can be used together as the basic simplification error of the triangle edge to calculate. For example, a quadratic error metric matrix is ​​constructed based on the vertex geometric coordinates, normal vectors, texture coordinates, tangent vectors, and color information of the triangle edge. Based on the geometric error, normal error, texture coordinate error, tangent error, and color error of the triangle edge, the simplification error of the triangle edge is calculated, and the data of the target vertex corresponding to the edge to be simplified is obtained, including the geometric coordinates, normal vectors, texture coordinates, tangent vectors, and color information.

[0149] After determining the simplification weight and basic simplification error of each triangle edge, in an exemplary embodiment, determining the edge to be simplified according to the simplification weight and basic simplification error of each triangle edge includes:

[0150] Determine the target simplification error of the corresponding triangle edge according to the simplification weight of each triangle edge and the basic simplification error;

[0151] The edges to be simplified are determined based on the target simplification errors of all triangle edges.

[0152] In an exemplary embodiment, determining a target simplification error for each triangle edge according to the simplification weight of each triangle edge and the basic simplification error includes:

[0153] The simplification weight of each triangle edge is multiplied by the basic simplification error as the target simplification error of the corresponding triangle edge.

[0154] In one exemplary embodiment, for simplified edges and texture edges, their target simplification error is equal to their base simplification error, that is, the simplification weight is equal to 1. For physical edges, their target simplification error is equal to the product of their simplification weight and their base simplification error, where the simplification weight of the physical edge is determined based on a preset coefficient and a scaling factor. For hinge edges, they are not involved in the simplification process, and their target simplification error is 0. In this embodiment, hinge edges are not involved in simplification, and simplified edges, texture edges, and physical edges are limitedly simplified, which can ensure the continuity of the 3D model's texture and geometry.

[0155] In an exemplary embodiment, determining the edges to be simplified according to the target simplification errors of all triangle edges includes:

[0156] In each connected graph set, the triangle edge with the smallest target simplification error is selected as the edge to be simplified.

[0157] In an exemplary embodiment, simplifying the three-dimensional model based on the edges to be simplified includes:

[0158] In each connected graph set, the edges to be simplified and the vertex data of the edges to be simplified are deleted and replaced with the target vertex, and the topological relationship of the vertices of the edges to be simplified is transferred to the target vertex. FIG4A shows a connected graph before simplification, where Vi and Vj are the two vertices of the edges to be simplified; FIG4B shows the connected graph after simplification, where the triangles filled with horizontal lines in FIG4A are replaced with the target vertex V'.

[0159] After the edge to be simplified and the vertex data of the edge to be simplified are replaced with the target vertex, it is determined whether the preset target simplification ratio is reached. If not, the following steps are performed: calculating the target simplification error of all triangle edges on the second-order adjacent surface of each vertex in each connected graph set, determining the edge to be simplified based on the target simplification error, deleting the edge to be simplified and the vertex data of the edge to be simplified in each connected graph set, replacing them with the target vertex, and transferring the topological relationship of the vertex of the edge to be simplified to the target vertex; continuing to determine whether the preset target simplification ratio is reached. If not, the steps are repeated until the preset target simplification ratio is reached. The target simplification ratio can be expressed as the ratio of the number of triangles after simplification to the number of triangles before simplification, or as the ratio of the number of triangle vertices after simplification to the number of triangle vertices before simplification.

[0160] In an exemplary embodiment, the method further comprises:

[0161] After converting the mesh of the three-dimensional model into a set of multiple connected graphs, and before determining, for each connected graph, the simplification weights of the triangle edges of all the triangles in the connected graph based on the vertex attributes of the triangles in the connected graph and the topological information of the triangles in the connected graph, the three-dimensional model may be roughly simplified, including:

[0162] In all connected graph sets, each connected graph whose number of triangles is less than or equal to an initial preset triangle number threshold is taken as a candidate connected graph;

[0163] The following steps are iteratively performed: among all the newly obtained candidate connected graphs, the connected graph with the smallest connected graph weight is deleted as the target connected graph, and the current preset triangle number threshold is updated according to the number of triangles in the target connected graph; new candidate connected graphs are screened out from the remaining candidate connected graphs according to the updated preset triangle number threshold, until there are no candidate connected graphs to be selected. The preset triangle number threshold (including the initial preset triangle number threshold and the updated preset triangle number threshold) is used to screen out a set of connected graphs that meet the requirements in the coarse simplification process, and the connected graph weight is determined according to the weight parameter of the connected graph, which includes one or more of the area of ​​the connected graph, the sum of the voxels of all vertices, the number of vertices, and the number of triangles.

[0164] Before simplifying the three-dimensional model according to the edges to be simplified, the embodiment of the present disclosure gradually deletes the triangular facets that meet the conditions so that the number of deleted triangular facets reaches the initial preset triangular facet number threshold, thereby completing the rough simplification of the three-dimensional model. The above-mentioned rough simplification process can improve the simplification efficiency.

[0165] In an exemplary embodiment, the initial preset triangle count threshold is determined based on the total number of triangles in the 3D model, the target simplification ratio, and the rough simplification ratio of the 3D model. The total number of triangles refers to the number of all triangles in the entire 3D model, the target simplification ratio refers to the preset ratio of triangles to be removed during the simplification process to the total number of triangles, and the rough simplification ratio refers to the preset ratio of triangles removed during the rough simplification process to the number of triangles determined by the target simplification ratio. Both the target simplification ratio and the rough simplification ratio can be set based on scenario requirements.

[0166] In an exemplary embodiment, the initial preset triangle face number threshold is determined based on the total number of triangle facets in the three-dimensional model, the target simplification ratio and the coarse simplification ratio of the three-dimensional model, including:

[0167] The initial preset triangle face quantity threshold is the product of the total number of triangle facets, the target simplification ratio, and the rough simplification ratio.

[0168] For example, assuming that the coarse simplification ratio is λ=10%, the total number of triangles is n=3000, and the target simplification ratio is 50%, which means that the goal is to screen out n*50%=1500 triangles from the total triangles, then the initial preset triangle number threshold is λ×n×50%=150, that is, coarse simplification requires screening out 150 triangles.

[0169] In an exemplary embodiment, the rough simplification process includes:

[0170] Select a connected graph with a number of triangles less than or equal to the initial preset triangle number threshold from all connected graph sets. At this time, multiple connected graphs will be obtained. All the obtained connected graphs will be used as candidate connected graphs. Then, among all the candidate connected graphs, the connected graph with the smallest connected graph weight will be selected as the target connected graph, and all the triangles of the target connected graph will be deleted.

[0171] The number of triangles in the target connected graph is subtracted from the initial preset triangle number threshold to obtain the updated triangle number threshold. Then, a connected graph with a number of triangles less than or equal to the updated triangle number threshold is selected from the remaining connected graph set as a new round of candidate connected graphs. Among the new round of candidate connected graphs, the connected graph with the smallest connected graph weight is selected for deletion, and the triangle number threshold is updated again. This cycle is repeated until there are no candidate connected graphs to be selected, and the coarse simplification process ends.

[0172] For example, assuming that the initial preset triangle number threshold is 150, then in all connected graph sets, each connected graph with less than 150 triangles is used as a candidate connected graph, and all triangles of the connected graph with the smallest weight among all candidate connected graphs are deleted. Assuming that the total number of deleted triangles is 100, the updated triangle number threshold is 50, and the connected graph with less than 50 triangles and the smallest weight is continuously selected from the remaining connected graph set, and all its triangles are deleted until no candidate connected graph can be selected based on the updated triangle number threshold, and the coarse simplification process ends. For example, after a certain cycle, the updated triangle number threshold is 10, but there is no connected graph with less than or equal to 10 triangles, and the coarse simplification process ends.

[0173] In an exemplary embodiment, the method for calculating the connectivity graph weight includes:

[0174] For each connected graph, the connected graph weight of the connected graph in the connected graph set to which it belongs is determined based on the weight parameter of the connected graph, wherein the weight parameter of the connected graph includes one or more of the area of ​​the connected graph, the sum of all vertex voxels, the number of vertices and the number of triangles; wherein the area of ​​the connected graph can be determined by the sum of the areas of all triangles in the connected graph, and the sum of all vertex voxels refers to the sum of the number of voxels of all vertices contained in the connected graph, wherein a voxel refers to a volume pixel in three-dimensional space, which is the basic unit constituting a three-dimensional image or a three-dimensional model, similar to a pixel in a two-dimensional image, and is represented by the volume of a cube in three-dimensional space.

[0175] In an exemplary embodiment, determining the connectivity graph weight of the connectivity graph in the connectivity graph set to which it belongs based on the weight parameter of the connectivity graph includes:

[0176] For each type of weight parameter value of the connected graph, determine the proportion of the weight parameter value of the type in the weight parameter values ​​of the type of all connected graphs included in the corresponding connected graph set;

[0177] Normalize the ratio of all types of weight parameter values;

[0178] The weight of the connectivity graph is determined according to the ratio of the normalized weight parameter values ​​of all types.

[0179] Exemplarily, determining the connectivity graph weight according to the normalized ratio of all types of weight parameter values ​​includes:

[0180] The result of weighted summation of the normalized proportions of all types of weight parameter values ​​is used as the connectivity graph weight.

[0181] For example, the weight parameters of the connected graph are: the area of ​​the connected graph, the sum of all vertex voxels, the number of vertices and the number of triangles;

[0182] The area of ​​the connected graph is divided by the area of ​​all connected graphs included in the connected graph set to which the connected graph belongs, to obtain a proportion p1 of the area of ​​the connected graph; the sum of all vertex voxels of the connected graph is divided by the sum of all vertex voxels included in the connected graph set to which the connected graph belongs, to obtain a proportion p2 of the sum of all vertex voxels; the number of vertices of the connected graph is divided by the number of vertices included in the connected graph set to which the connected graph belongs, to obtain a proportion p3 of the number of vertices; the number of triangles of the connected graph is divided by the number of triangles included in the connected graph set to which the connected graph belongs, to obtain a proportion p4 of the number of triangles;

[0183] Normalize p1, p2, p3, and p4 to obtain normalized p1', p2', p3', and p4', where p1' = p1 / (p1+p2+p3+p4); p2' = p2 / (p1+p2+p3+p4); p3' = p3 / (p1+p2+p3+p4); p4' = p4 / (p1+p2+p3+p4);

[0184] The weight of the connected graph is equal to the result of weighted summation of p1', p2', p3' and p4'. For example, the connected graph weight of the connected graph is α, α = α1×p1+α2×p2'+α3×p3'+α4×p4', α1, α2, α3 and α4 are the weights of the corresponding types of weight parameters, and all are configurable weights.

[0185] In a case where the connectivity graph weights of the connectivity graph to which the triangle edges belong are determined, in an exemplary embodiment, determining the edges to be simplified based on at least the simplification weights of all triangle edges and the basic simplification errors includes:

[0186] Determine the target simplification error of the corresponding triangle edge according to the simplification weight of each triangle edge, the basic simplification error of each triangle edge, and the connectivity graph weight of the connectivity graph to which each triangle edge belongs;

[0187] The edge to be simplified is determined according to the target simplification errors of all triangle edges. Exemplarily, the triangle edge with the smallest target simplification error is used as the edge to be simplified.

[0188] In an exemplary embodiment, determining a target simplification error for each triangle edge based on the simplification weight of each triangle edge, the basic simplification error of each triangle edge, and the connectivity graph weight of the connectivity graph to which each triangle edge belongs includes:

[0189] The result of multiplying the simplification weight of each triangle edge, the basic simplification error, and the connectivity graph weight of the connectivity graph to which the triangle edge belongs is used as the target simplification error of the corresponding triangle edge.

[0190] In an exemplary embodiment, after simplifying the three-dimensional model based on the edges to be simplified, the method further includes:

[0191] Based on the change in the angle of the second-order adjacent surface of the target vertex obtained after simplification corresponding to the edge to be simplified, it is determined whether the triangle face is folded after simplification; taking vertex A as an example, the second-order adjacent surface of vertex A can be understood as the triangle face where the first-order neighboring point B of vertex A is located and does not contain vertex A.

[0192] In the event of triangle face folding, the edge to be simplified replaced by the target vertex and the vertex attributes of the edge to be simplified are restored, and at least one of the operations of reducing the simplification weight of the edge to be simplified and increasing the basic simplification error of the edge to be simplified is performed.

[0193] Figure 5 shows a simplified 3D model with a fold. Before simplification, all vertices were in the same plane. After simplification, the target vertex P replaced the original triangle edge AB. Triangles S1 and S4, as well as S2 and S3, are no longer in the same plane, resulting in a fold, which disrupts the overall structure of the original 3D model.

[0194] When a flip occurs, it can be considered that the face reduction that caused the flip has failed. To avoid the flip, you can roll back to the mesh state before the face reduction and increase the target simplification error of the edge to be simplified that caused the flip (you can directly increase the target simplification error, or indirectly increase the target simplification error by increasing the basic simplification error), that is, reduce the probability of the triangle edge being determined as the edge to be simplified.

[0195] In an exemplary embodiment, judging whether triangle face folding occurs after simplification based on a change in an angle of a second-order adjacent face of a simplified target vertex corresponding to the edge to be simplified includes:

[0196] When the angle change is greater than or equal to a preset angle threshold, it is determined that triangle facet folding occurs after simplification.

[0197] In an exemplary embodiment, the angle change can be represented by the absolute value of the difference between θ and φ, where θ is the angle between the first-order adjacent surface and the second-order adjacent surface of the edge to be simplified before simplification, and φ is the angle between the first-order adjacent surface and the second-order adjacent surface of the target vertex after simplification. For example, the preset angle threshold is

[0198] In an exemplary embodiment, the method further includes: after determining the edges to be simplified based at least on the simplification weights of all triangle edges and the basic simplification error, in addition to simplifying the three-dimensional model based on the edges to be simplified, determining at least one of the bone binding data and deformation animation data of the target vertex, wherein the target vertex is used to replace the edges to be simplified.

[0199] With the development of three-dimensional animation and graphics rendering technology, three-dimensional models (especially three-dimensional character models) begin to have at least one of bone binding data and deformation animation data. When the triangle facets change, the bone binding data and deformation animation data will also change; Figure 6 shows a schematic diagram of the change of bone binding data with the change of triangle facets. The black thick line running through multiple triangle facets in the figure represents the bone structure, and the bone structure represents the hierarchy of bones and the mutual dependence of different bones; the vertices of the triangle facets in the figure and the black dots in the bone structure (i.e., bone points) have binding relationships of different strengths, which is similar to the fact that after the human skeleton undergoes rotational displacement, the muscles attached to the bones will also change with the spatial transformation of the bones; in this embodiment, the changes in bone binding data and deformation animation data are taken into account during the simplification process, thereby achieving the effect of retaining the bone binding and deformation animation of the original three-dimensional model.

[0200] In an exemplary embodiment, determining the skeleton binding data of the target vertex includes:

[0201] Determine, based on the distances between the target vertex and the two vertices of the edge to be simplified, the initial weights between the target vertex and the skeleton points corresponding to the two vertices; illustratively, the farther the distance between the target vertex and the vertex of the edge to be simplified, the smaller the initial weight between the skeleton point corresponding to the vertex of the edge to be simplified and the target vertex;

[0202] The weight between the target vertex and any one of the skeleton points corresponding to the two vertices is determined according to the initial weight between the skeleton points corresponding to the two vertices and the target vertex, the index weight of any one of the multiple skeleton points corresponding to the two vertices for the corresponding vertex, and the binding weight of any one of the multiple skeleton points corresponding to the two vertices for the corresponding vertex; wherein the index weight and the binding weight are settable; illustratively, the comprehensive weight of each vertex to the any one of the skeleton points can be obtained based on the result of multiplying the initial weight, the index weight, and the binding weight; then the comprehensive weights of the two vertices of the edge to be simplified are summed as the weight of the target vertex to the any one of the skeleton points;

[0203] According to the weight of the target vertex to each skeleton point, data corresponding to a preset number of skeleton points are selected as the skeleton binding data of the target vertex.

[0204] During the simplification process, the vertices of the edge being simplified already have bone binding data, including binding weights and index weights. This data can be directly used when calculating the bone binding data of the target vertex. Each vertex of the edge being simplified corresponds to a certain number of bone points. The bone points corresponding to two vertices of the edge being simplified can be the same or different.

[0205] For example, for an edge to be simplified, the two end vertices are M and N, the target vertex is P, and one of the skeleton points corresponding to the two vertices is S. Assume that the distance between P and M is 0.3, the distance between P and N is 0.7; the binding weight of M to S is 0.9, the index weight is 0.5, the binding weight of N to S is 0.2, and the index weight is 0. Then the weight of the target vertex P to the skeleton point S is:

[0206] The binding weight of M to S × (1-distance between P and M) × index weight of M to S + binding weight of N to S × (1-distance between P and N) × index weight of N to S; that is, 0.9 × (1-0.3) × 0.5 + 0.2 × (1-0.7) × 0.

[0207] As above, after calculating the weights of the target vertex to all bone points, several bone binding data corresponding to larger weights are selected according to the weight sizes as the bone binding data of the target vertex.

[0208] In an exemplary embodiment, determining the deformation animation data of the target vertex includes:

[0209] Superimposing deformation animation data on all vertices of the adjacent triangular facets of the edge to be simplified to obtain an updated edge of the adjacent triangular facets; the edge to be simplified is also an edge of the adjacent triangular facets before the update and also needs to be superimposed with deformation animation data;

[0210] Generate simplified vertices with deformation animation data based on the updated edges of adjacent triangles;

[0211] Determine the deformation animation data of the target vertex based on the data difference between the target vertex and the simplified vertex, wherein the data includes attributes such as geometry, normal, tangent, and texture coordinates of the vertex.

[0212] The flowchart for determining the deformation animation data of the target vertex is shown in FIG7 , where the edge to be simplified is the AB edge, and all vertices of the adjacent triangles of the AB edge are superimposed with the deformation animation data to obtain an updated triangle; the target vertex Q is determined based on the edge of the updated triangle; the target vertex P is determined based on the original edge to be simplified AB, the difference between the target vertex Q and the target vertex P is calculated, and the deformation animation data of the target vertex P is determined based on the difference.

[0213] In an exemplary embodiment, converting the mesh of the three-dimensional model into a plurality of connected graph sets includes:

[0214] Screening out non-two-dimensional manifold meshes in the three-dimensional model and retaining the two-dimensional manifold meshes;

[0215] A two-dimensional manifold mesh in the three-dimensional model is converted into a plurality of connected graph sets.

[0216] Among them, the judgment of the two-dimensional manifold mesh can be carried out through the following steps: first check whether each triangle edge is shared by more than two triangular facets. If the detection result is yes, it is determined that the two triangular facets are non-two-dimensional manifolds. After screening out the non-two-dimensional manifold meshes, the remaining ones are two-dimensional manifold meshes.

[0217] In an exemplary embodiment, simplifying the three-dimensional model based on the edges to be simplified includes:

[0218] Simplifying the two-dimensional manifold mesh based on the edges to be simplified;

[0219] The simplified two-dimensional manifold grid is integrated with the non-two-dimensional manifold grid to obtain a simplified three-dimensional model.

[0220] Since the non-two-dimensional manifold mesh is a discontinuous structure, there will be obvious structural changes after simplification. In the embodiment of the present disclosure, the non-two-dimensional manifold mesh is not simplified, and the topology of the original three-dimensional model can be maintained.

[0221] The following is an application example to illustrate the three-dimensional model simplification method described in the above embodiment of the present disclosure.

[0222] For 3D models, especially complex 3D models (such as those with complex triangular facet topology), the simplification steps may include:

[0223] Obtaining the geometric data and topological information of all mesh sets in the 3D model and all vertices on the triangles in each mesh set, the vertex binding weights for the bones, the vertex deformation animation data, and the vertex attribute data. The vertex geometric data may include the vertex's 3D coordinates, the vertex topological information may include texture topology and geometric topology, and the vertex attribute data may include texture coordinates, normals, tangents, and color information. Texture coordinates are the mapping relationship between vertices and texture maps.

[0224] Traverse the grid set, filter out non-two-dimensional manifold grids, retain the two-dimensional manifold grids, and convert the retained two-dimensional manifold grids into multiple connected graph sets;

[0225] Calculate the weight of each connected graph in each connected graph set based on the area of ​​the connected graph, the sum of all vertex voxels, the number of vertices and the number of triangles;

[0226] According to a predetermined threshold value of the number of triangles, all triangles in a connected graph with a low connected graph weight are eliminated so that the total number of eliminated triangles reaches the threshold value of the initial number of triangles, thereby achieving a rough simplification of the three-dimensional model;

[0227] In each roughly simplified connected graph, the simplification weight of each triangle edge is calculated based on the vertex attributes and topological information of the triangle patch. The basic simplification error of each triangle edge is calculated using the quadratic metric error matrix. The target simplification error of the corresponding triangle edge is calculated based on the simplification weight of each triangle edge, the basic simplification error of each triangle edge, and the connected graph weight of the connected graph to which each triangle edge belongs. The triangle edge with the smallest target simplification error is selected as the edge to be simplified.

[0228] Determine at least one of the bone binding data and the deformation animation data of the target vertex corresponding to the edge to be simplified;

[0229] The fine simplification process of the 3D model is performed based on the edges to be simplified, which is to delete the edges to be simplified and the vertex data on the edges, replace them with the target vertices, and transfer the topological relationship of the original edge vertices to the target vertices; the fine simplification process is iteratively performed until the number of triangle edges or vertices reaches the preset target simplification ratio of the 3D model;

[0230] After each deletion of the edge to be simplified, check whether the triangles in the fine simplification iteration are folded. If folding occurs, perform a rollback operation and double the target simplification error of the edge to be simplified.

[0231] After the iterative simplification is completed, a simplified two-dimensional manifold mesh is obtained. In the two-dimensional manifold mesh, the edges at the boundary with the non-two-dimensional manifold mesh are hub edges, so the edges here will not be simplified, and the original topological information is retained. Therefore, the simplified two-dimensional manifold mesh can be integrated with the screened non-two-dimensional manifold mesh to construct a simplified three-dimensional model.

[0232] The present disclosure also provides a simplified device for a three-dimensional model, as shown in FIG8 , wherein the device includes:

[0233] A conversion module 801 is configured to convert a mesh of a three-dimensional model into a plurality of connected graph sets, wherein each connected graph set includes a plurality of connected graphs;

[0234] In scenarios such as virtual character creation and animation production, 3D models composed of multiple triangular facets can be used to represent people and objects in the scene. When simplifying a 3D model, the 3D model can be divided into multiple mesh sets, and each mesh set can be simplified separately. For example, the body, hair, face, top, and pants of a 3D character model can be divided into different mesh sets. A mesh set can be converted into a connected graph set, that is, a mesh set includes multiple connected graphs, and a connected graph includes multiple triangular facets.

[0235] Among them, the meaning of a connected graph is that there must be a path between any two vertices in the graph;

[0236] The determining module 802 is configured to determine, for each connected graph in each connected graph set, simplified weights of triangle edges of all triangles in the connected graph according to vertex attributes of the triangles in the connected graph and topological information of the triangles in the connected graph;

[0237] The vertex attributes include: one or more of texture coordinates, normals, tangents, and colors, wherein texture coordinates refer to the mapping relationship between vertices and texture maps;

[0238] The topological information of the triangle patch includes: geometric topology and texture topology; the geometric topology refers to the logical relationship of the triangle patch formed by the three-dimensional space coordinate vertices in the model; the texture topology refers to the logical relationship of the triangle patch formed by the vertices in the two-dimensional texture space;

[0239] The vertex attributes and topological information of a triangle can reflect the complexity of the relationship between the triangle and other surrounding triangles, so the weight of the triangle in the simplification process can be determined according to the complexity, that is, the simplification weight. For example, when the complexity is low, the corresponding triangle has a higher simplification weight.

[0240] A simplification module 803 is configured to determine edges to be simplified for all triangle edges of all triangle facets in the connected graph set based on at least simplification weights of all triangle edges and a basic simplification error, and simplify the three-dimensional model based on the edges to be simplified;

[0241] For example, as described above, each triangle edge of each triangular face corresponds to a simplification weight; and the basic simplification error of the triangle edge is determined according to the error occurring during the simplification process based on the inherent attribute characteristics of the triangle edge, and the basic simplification error includes a geometric error; in addition, the basic simplification error may also include one or more of a normal error, a texture coordinate error, a color error, and a tangent error;

[0242] This embodiment selects one or more triangle edges as edges to be simplified based on the simplification weights and basic simplification errors of all triangle edges. The number of edges to be simplified is not limited.

[0243] In this embodiment, the simplification of the three-dimensional model can be achieved by deleting the edges to be simplified.

[0244] The three-dimensional model simplification device recorded in the embodiment of the present disclosure takes into account the vertex attributes of the triangle facets and the topological information of the triangle facets when determining the simplified edges, and determines the importance of all triangle edges through the vertex attributes and topological information of the triangle facets. Since important triangle edges are usually related to factors such as the skeleton, contour, and surface continuity of the three-dimensional model, simplifying the three-dimensional model according to the importance of the triangle edges can avoid obvious changes in the structure of the three-dimensional model after simplification and maintain the original topology of the three-dimensional model.

[0245] In an exemplary embodiment, simplification of the three-dimensional model based on the edges to be simplified can be a step-by-step simplification process, which can control the speed and degree of simplification. By gradually reducing the number of edges, the simplification process of the three-dimensional model can be managed more meticulously, avoiding vertex aggregation and collapse caused by one-time over-simplification, overcoming the deficiency that vertex aggregation easily causes triangle degeneration and destroys the original three-dimensional model topology, and ensuring that the simplified three-dimensional model can still maintain the original model topology.

[0246] An embodiment of the present disclosure also provides another device for simplifying three-dimensional models, as shown in Figure 9. The device includes: a memory 901 and a processor 902. The memory 901 stores a program. When the program is read and executed by the processor 902, it implements the three-dimensional model simplification method described in any of the previous embodiments.

[0247] The three-dimensional model simplification device described in the embodiment of the present disclosure can implement the three-dimensional model simplification method described in any of the previous embodiments, and therefore has the technical effects of the three-dimensional model simplification method described in any of the previous embodiments.

[0248] An embodiment of the present disclosure also provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the method for simplifying a three-dimensional model as described in any of the previous embodiments.

[0249] Those skilled in the art should understand that the technical solutions of the embodiments of the present disclosure may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present disclosure, and all should be included in the scope of the claims of the present disclosure.

[0250] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable, and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media generally embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

Claims

1. A method for simplifying a three-dimensional model, comprising: Converting a mesh of the three-dimensional model into a plurality of connected graph sets, wherein each of the connected graph sets includes a plurality of connected graphs; For each of the connected graphs in each of the connected graph sets, determining simplified weights of triangle edges of all triangles in the connected graph according to vertex attributes of the triangles in the connected graph and topological information of the triangles in the connected graph; For all triangle edges of all triangle facets in the connected graph set, edges to be simplified are determined at least according to simplification weights of all triangle edges and basic simplification errors, and the three-dimensional model is simplified based on the edges to be simplified.

2. The method according to claim 1, wherein: The step of determining the simplified weights of triangle edges of all triangles in the connected graph according to vertex attributes of the triangles in the connected graph and topological information of the triangles in the connected graph comprises: For each triangle edge of all triangle facets in the connected graph, the simplification weight of the triangle edge is determined according to the number of vertex attributes of the triangle edge in the connected graph, the correspondence of vertex attributes of two vertices of the triangle edge, and the number of adjacent triangle facets of the triangle edge.

3. The method according to claim 1, wherein: The step of determining the simplified weights of triangle edges of all triangles in the connected graph according to vertex attributes of the triangles in the connected graph and topological information of the triangles in the connected graph comprises: For each triangular patch in the connected graph, the type of each triangle edge of the triangular patch is determined according to the vertex attributes of the triangular patch in the connected graph and the topological information of the triangular patch in the connected graph, and the simplified weight of the corresponding triangle edge is determined according to the type of each triangle edge.

4. The method according to claim 3, wherein: The determining the type of each triangle edge of the triangular facet according to the vertex attributes of the triangular facet in the connected graph and the topological information of the triangular facet in the connected graph comprises: The type of the corresponding triangle edge is determined according to the number of vertex attributes of each triangle edge of the triangle face in the connected graph, the correspondence of vertex attributes of two vertices of each triangle edge, and the number of adjacent triangle facets of each triangle edge.

5. The method according to claim 4, wherein: Determining the type of the corresponding triangle edge according to the number of vertex attributes of each triangle edge of the triangle face in the connected graph, the correspondence between the vertex attributes of two vertices of each triangle edge, and the number of adjacent triangle facets of each triangle edge includes: For each triangle edge: When the triangle edge has only one adjacent triangle face, the triangle edge is determined to be a physical edge; When the triangle edge has two adjacent triangle facets and both end vertices of the triangle edge have a set of vertex attributes, the triangle edge is determined to be a simplified edge; When the triangle edge has two adjacent triangles, both vertices at the two ends of the triangle edge have multiple sets of vertex attributes, and the multiple sets of vertex attributes at the two ends of the triangle edge can correspond to each other in sequence in the geometric topology and the texture topology, the triangle edge is determined to be a texture edge; When the triangle edge has two adjacent triangle facets, both end vertices of the triangle edge have multiple sets of vertex attributes, and the multiple sets of vertex attributes of the two end vertices cannot correspond to each other in sequence in the geometric topology and the texture topology, the triangle edge is determined to be a hub edge.

6. The method according to claim 5, wherein: The determining, according to the type of each triangle edge, a simplified weight of the corresponding triangle edge comprises: For each triangle edge: When the triangle edge is a simplified edge or a texture edge, determining a simplified weight of the triangle edge within a first weight range; When the triangle edge is a physical edge, determining a simplified weight of the triangle edge within a second weight range; When the triangle edge is a hinge edge, determining that the simplified weight of the triangle edge is within a third weight range; The simplification weights of the simplified edge and the texture edge are higher than the simplification weight of the physical edge, and the simplification weight of the physical edge is higher than the simplification weight of the hinge edge.

7. The method according to claim 6, wherein: The simplified weight of the physical edge is determined according to a preset coefficient and a proportional coefficient, wherein the proportional coefficient is determined according to the proportion of the physical edge in all triangle edges in the connected graph to which the physical edge belongs.

8. The method according to claim 1, wherein: The basic simplified error includes a geometric error; The calculation method of the geometric error of each triangle edge includes: For each connected graph set, based on vertex geometry information and the geometric topology of triangle patches contained in the connected graph set, a signed distance field of the connected graph set is generated; Using the directed distance fields of all connected graph sets other than the connected graph set to which each triangle edge belongs as constraint conditions of a quadratic error metric matrix for solving the geometric error; The quadratic error metric matrix is ​​solved under the constraint conditions to obtain the geometric error of each triangle edge.

9. The method according to claim 1, further comprising: After simplifying the three-dimensional model based on the edge to be simplified, judging whether a triangular face is flipped after simplification according to a change in an angle of a second-order adjacent face of a target vertex obtained after simplification corresponding to the edge to be simplified; In the event of triangle patch folding, the edge to be simplified replaced by the target vertex and the vertex attributes of the edge to be simplified are restored, and at least one of the operations of reducing the simplification weight of the edge to be simplified and increasing the basic simplification error of the edge to be simplified is performed.

10. The method according to claim 9, wherein: The step of judging whether a triangle face is folded after simplification according to a change in an angle of a second-order adjacent face of a target vertex obtained after simplification corresponding to the edge to be simplified comprises: When the angle change is greater than or equal to a preset angle threshold, it is determined that a triangle face is folded after simplification.

11. The method according to claim 1, further comprising: After converting the mesh of the three-dimensional model into a plurality of connected graph sets, and before determining, for each connected graph in each connected graph set, the simplified weights of the triangle edges of all the triangles in the connected graph according to the vertex attributes of the triangles in the connected graph and the topological information of the triangles in the connected graph, in all connected graph sets, each connected graph whose number of triangles is less than or equal to an initially preset triangle number threshold is taken as a candidate connected graph; The following steps are iteratively performed: among all the newly obtained candidate connected graphs, the connected graph with the smallest connected graph weight is deleted as the target connected graph, and the current preset triangle face number threshold is updated according to the number of triangle facets of the target connected graph; new candidate connected graphs are screened out from the remaining candidate connected graphs according to the updated preset triangle face number threshold until there are no candidate connected graphs to be selected.

12. The method according to claim 11, wherein: The initial preset triangle face quantity threshold is determined according to the total number of triangle facets of the three-dimensional model, the target simplification ratio and the rough simplification ratio of the three-dimensional model.

13. The method according to claim 11, wherein: The method for calculating the weight of the connected graph includes: For each connected graph, the connected graph weight of the connected graph in the connected graph set to which it belongs is determined based on the weight parameters of the connected graph, wherein the weight parameters of the connected graph include one or more of the area of ​​the connected graph, the sum of all vertex voxels, the number of vertices and the number of triangles.

14. The method according to claim 13, wherein: The step of determining the connected graph weight of the connected graph in the connected graph set to which it belongs based on the weight parameter of the connected graph comprises: For each type of weight parameter value of the connected graph, determine the proportion of the weight parameter value of the type in the weight parameter values ​​of the type of all connected graphs included in the corresponding connected graph set; Normalize the ratio of all types of weight parameter values; The weight of the connectivity graph is determined according to the ratio of all types of weight parameter values ​​after normalization.

15. The method according to claim 13 or 14, wherein: The step of determining the edges to be simplified at least according to the simplification weights of all triangle edges and the basic simplification errors comprises: Determine the target simplification error of the corresponding triangle edge according to the simplification weight of each triangle edge, the basic simplification error of each triangle edge and the connectivity graph weight of the connectivity graph to which each triangle edge belongs; The edges to be simplified are determined according to target simplification errors of all triangle edges.

16. The method according to claim 1, further comprising: After determining the edges to be simplified at least based on the simplification weights of all triangle edges and the basic simplification errors, in addition to simplifying the three-dimensional model based on the edges to be simplified, at least one of the bone binding data and the deformation animation data of the target vertex is determined, wherein the target vertex is used to replace the edges to be simplified.

17. The method according to claim 16, wherein: The bone binding data for determining the target vertex includes: Determine the initial weights between the target vertex and the skeleton points corresponding to the two vertices and the target vertex according to the distances between the target vertex and the two vertices of the edge to be simplified; Determine the weight between the target vertex and any one of the skeleton points corresponding to the two vertices according to the initial weight between the skeleton points corresponding to the two vertices and the target vertex, the index weight of any one of the multiple skeleton points corresponding to the two vertices for the corresponding vertex, and the binding weight of any one of the multiple skeleton points corresponding to the two vertices for the corresponding vertex; According to the weight of the target vertex to each bone point, data corresponding to a preset number of bone points are selected as the bone binding data of the target vertex.

18. The method according to claim 16, wherein: Determine the target vertex's deformation animation data, including: Superimposing deformation animation data on all vertices of the adjacent triangular facets of the edge to be simplified to obtain an updated edge of the adjacent triangular facets; Generate simplified vertices with deformation animation data based on the updated edges of adjacent triangles; Determine the deformation animation data of the target vertex according to the data difference between the target vertex and the simplified vertex.

19. The three-dimensional model simplification method according to claim 1, wherein: The step of converting the mesh of the three-dimensional model into a plurality of connected graph sets comprises: Screening out non-two-dimensional manifold meshes in the three-dimensional model and retaining two-dimensional manifold meshes; The two-dimensional manifold mesh in the three-dimensional model is converted into a plurality of connected graph sets.

20. A non-transitory computer-readable storage medium storing one or more program instructions, wherein the one or more program instructions can be executed by one or more processors to implement the method according to any one of claims 1 to 19.

21. A device for simplifying a three-dimensional model, the device comprising a memory and a processor, the memory storing a computer program executable on the processor, the program implementing the method described in any one of claims 1 to 19 when read and executed by the processor.

Citation Information

Patent Citations

  • Mesh segmentation based simplification method for preserving details of textured model

    CN101853525A

  • Simplified method and device for edge collapse of 3D geometry graphics

    CN105006022A

  • Complex three-dimensional building model simplification method capable of maintaining appearance characteristics

    CN108961411A

  • Simplification method and device of three-dimensional model and storage medium

    CN117994478A

  • Method and apparatus for mesh simplification

    US20150379769A1