Digital model processing method and device

By vertex collapse processing on the digital model, the number of model vertices is simplified, the problem of insufficient rendering performance of high-precision models is solved, and efficient rendering and dynamic switching of models of different precisions is achieved.

CN120030621APending Publication Date: 2025-05-23LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510124147.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-26
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

In virtual digital scenarios, while high-precision models can provide more realistic scenarios, due to hardware performance limitations, the rendering may occur slowly or even errors, and a method is needed to simplify high-precision models to ensure device performance.

Method used

By collapsing the vertices in the digital model, identify and delete the vertices with the least collapse cost and their connected edges, iteratively simplify the vertices until the simplification rate is reached, and a simplified geometric model is built.

Benefits of technology

It realizes that the number of vertices of the digital model is reduced without damaging the appearance quality of the model, thereby reducing rendering overhead, improving equipment performance, and meeting the model accuracy requirements at different observation distances.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120030621A_ABST
    Figure CN120030621A_ABST
Patent Text Reader

Abstract

The invention discloses a digital model processing method and device, and the method comprises the steps: determining the related data of a current vertex for each vertex in a digital model, the related data comprises vertex data and related surface data, and one vertex of a related surface is the current vertex; based on the vertex data and the related surface data, collapse data of the current vertex is determined, the collapse data comprises collapse cost and a collapse edge, the collapse edge represents the edge with the minimum collapse cost in all connecting edges of the current vertex, and the collapse cost is determined based on the collapse cost of all the connecting edges of the current vertex; a first vertex with the minimum collapse cost in all vertexes in the digital model is deleted, other vertexes originally connected to the first vertex are connected to a transfer vertex, and the transfer vertex is a vertex at the other end of the collapse edge of the first vertex.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of modeling technology, and more specifically, to a method and device for processing a digital model. Background Art

[0002] Smooth operation and clear and coherent images in virtual digital scenes can bring users a good perception and experience, which is the key to attracting users. High-precision models can make scenes more realistic, but will increase rendering costs. When hardware performance is insufficient, rendering will be slow or even wrong. Therefore, high-precision models can be simplified and rendered on the premise of meeting user viewing needs to ensure device performance. Summary of the invention

[0003] In view of this, this application provides the following technical solutions:

[0004] The first aspect of the present application provides a method for processing a digital model, the method comprising:

[0005] For each vertex in the digital model, determining relevant data of the current vertex, wherein the relevant data includes vertex data and relevant surface data, wherein a vertex of the relevant surface is the current vertex;

[0006] Determine collapse data of the current vertex based on the vertex data and the related surface data, the collapse data including collapse cost and collapse edge, the collapse edge represents the edge with the smallest collapse cost among all connected edges of the current vertex, and the collapse cost is determined based on the collapse cost of all connected edges of the current vertex;

[0007] The first vertex with the smallest collapse cost among all vertices in the digital model is deleted, and other vertices originally connected to the first vertex are connected to a transfer vertex, which is the vertex at the other end of the collapsed edge of the first vertex.

[0008] In a possible implementation, it also includes:

[0009] The steps of determining the collapse data and deleting the vertex with the smallest collapse cost are iterated until the number of remaining vertices in the digital model reaches a set value, which is determined based on the vertex simplification rate.

[0010] In a possible implementation, after the number of remaining vertices in the digital model reaches a set value, the method further includes:

[0011] A geometric model is constructed and stored based on the relevant data of the remaining vertices, wherein the geometric model is a simplified model of the digital model.

[0012] In a possible implementation, during the iteration process, only the collapsed data of the vertices whose connected edges have changed are updated.

[0013] In a possible implementation, determining the collapse data of the current vertex based on the vertex data and the related surface data includes:

[0014] Determine the collapse cost of each connected edge of the current vertex based on the vertex data and the related surface data;

[0015] The average of the collapsed costs of all the connected edges of the current vertex is determined as the collapsed cost of the current vertex;

[0016] The connected edge with the smallest collapse cost among all connected edges of the current vertex is determined as the collapsed edge of the current vertex.

[0017] In a possible implementation, determining the collapse cost of each connecting edge of the current vertex based on the vertex data and the related surface data includes:

[0018] Determine all connected edges of the current vertex based on the vertex data and the related surface data;

[0019] For each connection edge, determine the distance between two vertices of the current connection edge; determine the curvature value of the current connection edge; and determine the collapse cost of the current connection edge based on the distance and the curvature value.

[0020] In a possible implementation, determining the curvature value of the current connection edge includes:

[0021] For each plane where the current connected edge is located: determine the normal dot product of the current plane and the plane where the other current vertices are located; determine the minimum curvature corresponding to the current plane based on the maximum value of the normal dot product;

[0022] The maximum value of the minimum curvatures of all planes where the current connected edge is located is determined as the curvature value of the current connected edge.

[0023] In a possible implementation, the method of deleting a first vertex with the smallest collapse cost among all vertices in the digital model and connecting other vertices originally connected to the first vertex to the transfer vertex further includes:

[0024] The vertex data of the transferred vertex is updated, wherein the vertex data includes a normal and a tangent.

[0025] In a possible implementation, updating the vertex data of the transfer vertex includes:

[0026] Adding the normal vector of the first vertex and the normal vector of the transfer vertex and normalizing them to obtain the normal vector of the transfer vertex;

[0027] The tangent vector of the first vertex is added to the tangent vector of the transfer vertex and normalized to obtain the tangent vector of the transfer vertex.

[0028] A second aspect of the present application provides a digital model processing device, the device comprising:

[0029] Vertex data determination data, used to determine relevant data of the current vertex for each vertex in the digital model, wherein the relevant data includes vertex data and relevant surface data, wherein a vertex of the relevant surface is the current vertex;

[0030] A collapse data determination module, configured to determine collapse data of a current vertex based on the vertex data and the related surface data, wherein the collapse data includes a collapse cost and a collapse edge, wherein the collapse edge represents an edge with the smallest collapse cost among all connected edges of the current vertex, and the collapse cost is determined based on the collapse costs of all connected edges of the current vertex;

[0031] The vertex processing module is used to delete the first vertex with the smallest collapse cost among all vertices in the digital model, and connect other vertices originally connected to the first vertex to a transfer vertex, where the transfer vertex is the vertex at the other end of the collapsed edge of the first vertex. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0033] Figure 1 A flowchart of a method for processing a digital model disclosed in an embodiment of the present application;

[0034] Figure 2 is an example diagram of a digital model;

[0035] Figure 3 This is an example diagram for comparing models with different levels of precision;

[0036] Figure 4 A flowchart of determining the collapsed data of a vertex disclosed in an embodiment of the present application;

[0037] Figure 5 An example diagram showing normal vectors for a triangle surface is shown;

[0038] Figure 6 This is an example diagram of the normal vectors of two three-dimensional planes;

[0039] Figure 7 This is an example diagram of the corresponding relationship between the dot product and the vector angle disclosed in the embodiment of the present application;

[0040] Figure 8 This is an example diagram of the process of moving the vertex A disclosed in the embodiment of the present application;

[0041] Fig. 9 This is an example diagram of a model comparison of surface reduction processing and random surface reduction processing in the solution of the present application disclosed in the embodiment of the present application;

[0042] Fig.10 A schematic diagram of the structure of a digital model processing device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0043] For the purpose of reference and clarity, the descriptions, abbreviations or acronyms of the technical terms used below are summarized as follows:

[0044] Mesh: In 3D rendering, the Mesh model is the basic rendering unit, which is drawn and rendered through the mesh filter (MeshRenderer) to achieve highly realistic three-dimensional scenes and interactive objects.

[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0046] Figure 1 This is a flow chart of a digital model processing method disclosed in an embodiment of the present application. Figure 2 The digital model processing method may include:

[0047] Step 101: for each vertex in the digital model, determine the relevant data of the current vertex, wherein the relevant data includes vertex data and relevant surface data, wherein a vertex of the relevant surface is the current vertex.

[0048] The digital model may be a network mesh model, which is a model composed of triangles (faces) stitched together, as shown in the example Figure 2 As shown. Combined Figure 2, all vertex coordinates of the digital model are grouped into three to form a triangle, and multiple groups of vertices form multiple triangles, which can be used to simulate the surface of an object. Digital models have different display requirements in application scenarios. Therefore, this application aims to load only one high-precision digital model, and then quickly and conveniently process and display the digital model at different precisions based on the scenario requirements.

[0049] Combination Figure 2 As shown, the digital model includes many vertices. When reducing faces or vertices of the digital model, it is necessary to select the vertex that has the least impact on the overall contour of the model after reducing the vertex from all vertices. In the field of digital models, the process of reducing vertices can be called vertex collapse. Before performing face processing or vertex reduction processing of the digital model, it is first necessary to obtain relevant data of all vertices in the digital model, and the relevant data includes vertex data and relevant face data, and the relevant face is a triangle with the current vertex as a vertex. The vertex data can include but is not limited to position, normal, tangent, etc.

[0050] After the relevant data of each vertex of the digital model are determined, the collapse data of each vertex can be calculated and determined based on the relevant data, and then which vertex to reduce can be determined based on the collapse data of each vertex.

[0051] Step 102: Determine collapse data of the current vertex based on the vertex data and the related surface data, the collapse data including collapse cost and collapse edge, the collapse edge represents the edge with the smallest collapse cost among all connected edges of the current vertex, and the collapse cost is determined based on the collapse cost of all connected edges of the current vertex.

[0052] Because in a digital model, a vertex may have multiple connected edges, and two adjacent connected edges may be two edges of the related surface. After the vertex is collapsed (reduced), it will have an impact on its connected edges and related surfaces. The greater the impact, the higher the collapse cost of the vertex.

[0053] In this application, subtracting a vertex actually subtracts a connecting edge of the vertex, that is, the collapsed edge. The specific implementation of determining the collapse cost and the collapsed edge will be described in detail in the following embodiments, and will not be described in detail here.

[0054] Step 103: Delete the first vertex with the smallest collapse cost among all vertices in the digital model, and connect other vertices originally connected to the first vertex to a transfer vertex, where the transfer vertex is a vertex on the collapsed edge of the first vertex.

[0055] After determining the collapse data of all vertices, the first vertex with the smallest collapse cost can be selected as the vertex to be deleted to ensure that the deletion of the vertex has the least impact on the overall contour of the model. After deleting the first vertex, the connecting edge originally connected to the first vertex will not be deleted, but will be connected to the vertex at the other end of the collapsed edge (transfer vertex). That is, assuming that the first vertex is A, one vertex of the collapsed edge is A, and the other vertex is B, then B is the transfer vertex. After the first vertex is deleted, the related faces of the first vertex are also deleted.

[0056] In actual applications, only one high-precision model can be loaded in the application, and during use, the distance between the digital model and the observation point is processed to display models of different precisons. Figure 3 The following are examples of models with different degrees of precision, with the precision of the models increasing from left to right. The higher the precision of the model, the more triangles it contains. When the observer is far away from the model, a model with relatively low precision can be displayed; when the observer is close to the model, a model with relatively high precision can be displayed. The present application provides a simplified processing solution for digital models that is simple and accurate, and meets the different needs of users for viewing digital models in virtual digital scenes without occupying too many hardware resources.

[0057] The digital model processing method described in this embodiment deletes vertices and their triangular faces according to the principle of minimum vertex collapse cost. This solution can simply and efficiently complete the lightweight face reduction of the digital model. Compared with the traditional solution of manual face reduction, it can save a lot of time and labor costs. In addition, the solution can be deployed programmatically to achieve automatic face reduction. In the application scenario, models of different precisions can be displayed according to the distance between the digital model and the observation point. Compared with the traditional solution, the solution of pre-loading models of different precisions can also reduce resource loading.

[0058] Different simplification rates can be configured for digital models with different precisions. For example, if the high-precision model is the original digital model, when the application needs to display the medium- and high-precision digital model, the corresponding simplification rate can be 15%; when the application needs to display the medium-precision digital model, the corresponding simplification rate can be 30%. When the simplification rate is 15%, 15% of the total number of all vertices of the high-precision model needs to be subtracted. Similarly, when the simplification rate is 30%, 30% of the total number of all vertices of the high-precision model needs to be subtracted. The number of simplified vertices (the number of deleted vertices) = the total number of vertices * simplification rate.

[0059] When performing face reduction processing on a digital model, the processing method described in the above embodiment can be used to iteratively determine the collapse data and delete the vertices with the smallest collapse cost until the number of remaining vertices in the digital model reaches a set value, which is determined based on the vertex simplification rate.

[0060] For example, the original high-precision model has 1000 vertices and the simplification rate is 20%. The number of vertices to be reduced is 1000*20%=200, and the set value (referred to as the first set value for ease of distinction) is 1000-200=800.

[0061] Alternatively, the steps of determining the collapse data and deleting the vertex with the smallest collapse cost are iterated until the number of vertices removed from the digital model reaches a set value (referred to as a second set value), which can also be determined based on the simplification rate.

[0062] For example, if the simplification rate is 20%, the number of vertices to be reduced is 200, and the second setting value is 200. In implementation, the user can customize the degree of model reduction based on scene requirements, and different degrees of reduction correspond to different model accuracies.

[0063] After the remaining vertices in the digital model reach a first set value, or the number of vertices removed from the digital model reaches a second set value, the method may further include: constructing and storing a geometric model based on relevant data of the remaining vertices, wherein the geometric model is a simplified model of the digital model.

[0064] Among them, the simplified model can be any digital model with lower accuracy than the original high-precision model, and different simplification rates correspond to models of different accuracy. In the application scenario, the accuracy of the model to be displayed can be determined based on the distance between the observation point and the model. For example, in a virtual auto show application scenario, the distance between the observation point (corresponding to the user's eyes) and the target vehicle model is 20 meters, then a medium-precision vehicle model can be displayed. When the distance between the observation point and the target vehicle model is close to 10 meters, the medium- and high-precision vehicle models can be switched to display. Vehicle models of different accuracy contain different numbers of vertices. Therefore, on the basis of the original high-precision model, when processing models of different accuracy, the number of vertices that need to be subtracted is different.

[0065] It should be noted that when the observation point moves closer to the digital model, the accuracy of the digital model becomes higher and higher, and each time the digital model needs to be switched for display, it needs to be processed based on the original high-precision model. For example, a medium-precision model is first obtained based on the high-precision model. As the observation point approaches the digital model, it is necessary to switch to a medium-to-high precision model, and then the medium-to-high precision model is obtained based on the high-precision model. Alternatively, in a possible implementation, in the process of generating a medium-precision model, the relevant data of each subtracted vertex can be retained. When a medium-to-high precision model with better accuracy is subsequently generated, a rollback process can be performed based on the obtained medium-precision model and the relevant data of each subtracted vertex recorded during the generation of the medium-precision model, until the number of vertices of the digital model increases to meet the requirements of the medium-to-high precision model.

[0066] When the observation point moves away from the digital model, the accuracy of the digital model becomes lower and lower. Each time the display needs to be switched, the digital model does not need to be processed based on the original high-precision model. For example, a medium-high accuracy model is first processed based on the high-precision model. As the observation point moves away from the digital model, it is necessary to switch to the medium-precision model. Then, the medium-high accuracy model is continuously processed based on the high-precision model.

[0067] When the number of remaining vertices in the digital model reaches the first set value or the number of subtracted vertices reaches the second set value, a geometric model can be constructed based on the relevant data of the remaining vertices and stored, and then displayed. In the process of constructing the geometric model, it is also necessary to perform processing such as mapping and color determination. Since these are not directly related to the technical logic of the present application solution, they will not be introduced in detail here.

[0068] In the process of iteratively deleting vertices, since the position, direction and connected vertices of the connected edges of the deleted vertices have changed after the vertices have been deleted, the collapse data of the vertices whose connected edges have changed needs to be updated during the iteration process. The collapse data of other vertices that are not related to the deleted vertices, or vertices that have no connection relationship with the deleted vertices, will not change, so they can be left unchanged and the previously determined collapse data can continue to be used.

[0069] Therefore, when reducing vertices or faces of a digital model, only the vertex data of all the vertices of the digital model, i.e., the collapsed data, needs to be determined initially. In the subsequent processing, one vertex is deleted in each iteration, and only the collapsed data of the vertices that were originally connected to the deleted vertex is updated. This processing method takes up relatively few resources and can ensure the rate of face processing of the digital model.

[0070] Figure 4 This is a flowchart of determining the collapsed data of a vertex disclosed in an embodiment of the present application. Figure 4 As shown, in one implementation, determining the collapse data of the current vertex based on the vertex data and the related surface data may include:

[0071] Step 401: Determine the collapse cost of each connecting edge of the current vertex based on the vertex data and the related surface data.

[0072] Specifically, the collapse cost of the connecting edge can be determined by first determining all the connecting edges of the current vertex based on the vertex data and the related surface data; then, for each connecting edge, determining the distance between the two vertices of the current connecting edge; then determining the curvature value of the current connecting edge; and finally, determining the collapse cost of the current connecting edge based on the distance and the curvature value.

[0073] Among them, determining the curvature value of the current connecting edge may include: for each plane where the current connecting edge is located: determining the normal dot product of the current plane and the planes where other current vertices are located; determining the minimum curvature corresponding to the current plane based on the maximum value in the normal dot product; and determining the maximum value among the minimum curvatures of all planes where the current connecting edge is located as the curvature value of the current connecting edge.

[0074] Step 402: Determine the average of the collapsed costs of all the connected edges of the current vertex as the collapsed cost of the current vertex.

[0075] The current vertex has multiple connecting edges, and the collapse costs of different connecting edges need to be calculated separately. The collapse cost of the current vertex needs to be determined based on the collapse costs of all the connecting edges associated with it. In this embodiment, the average of the collapse costs of all connecting edges of the current vertex is determined as the collapse cost of the current vertex. Of course, in other implementations, the collapse cost of the current vertex is also determined in other ways, such as performing a weighted average calculation on the collapse costs of all connecting edges of the current vertex, and determining the obtained weighted average as the collapse cost of the current vertex; the longer the length of the connecting edge, the larger the weight that can be configured.

[0076] Step 403: Determine the connection edge with the smallest collapse cost among all the connection edges of the current vertex as the collapse edge of the current vertex.

[0077] The smaller the collapse cost, the smaller the impact of the connection edge on the entire digital model outline after collapse. Therefore, in order to retain the appearance outline of the digital model to the greatest extent, the connection edge with the smallest collapse cost among all the connection edges of the current vertex is determined as the collapsed edge of the current vertex.

[0078] In a specific implementation, calculating the collapse cost of a vertex includes the following steps:

[0079] A. Taking vertex U as an example, calculate the collapse cost of the connecting edge UV;

[0080] The calculation formula for the connection edge collapse cost is:

[0081]

[0082] Among them, ||uv|| represents the modulus of the connecting edge UV; n represents all triangular faces with uv as edges; f represents all edges starting from vertex u, and normal is the normal vector (also called normal vector). Figure 5 An example diagram of normal vectors of a triangle face is shown, where the thorn-like lines in each triangle face are the normal vectors.

[0083] Specifically, calculate the distance d between vertex U and vertex V:

[0084]

[0085] Find all SideFaces with UV as edges, the number of triangles > 1;

[0086] The curvature value of the edge UV is obtained by comparing the dot product of the normals of adjacent faces.

[0087] Regarding the determination of curvature value:

[0088] For the triangle face sideFace1 on the UV side, calculate the dot product between its normal vector and the normal vector of each triangle face where the vertex U is located, and use the maximum dot product value to get the minimum curvature Curvature1;

[0089] For the triangle face sideFace2 on the UV side, calculate the dot product between its normal vector and the normal vector of each triangle face where the vertex U is located, and use the maximum dot product value to get the minimum curvature Curvature2;

[0090] Assuming the length of SideFaces is N (the number of triangles containing vertex u is N), the loop calculation obtains [Curvature1, Curvature2, ..., CurvatureN];

[0091] Take the maximum curvature as Curvature. The connecting edge with the maximum curvature has the smallest collapse cost.

[0092] Specifically, the angle between the normal vectors of two three-dimensional planes can roughly tell the curvature of the two planes. Figure 6 As shown, there are two examples of normal vectors of three-dimensional planes;

[0093] The angle between two vectors can be obtained by multiplying the two vectors. As shown in the figure, there are normal vector N1 (x1, y1, z1) and normal vector N2 (x2, y2, z2).

[0094] The result of a vector dot product is a number, which is essentially a combination of a series of additions and multiplications. The calculation formula is as follows:

[0095] N1·N2=x1*x2+y1*y2+z1*z2

[0096] N1·N2=|N1|*|N2|*cosθ

[0097] Among them, |N1| refers to the length of vector N1, |N2| refers to the length of vector N2, and the angle θ in cosθ is exactly the angle between the two vectors. Then the calculation formula of θ is:

[0098] θ=arccos(N1·N2 / |N1|*|N2|)

[0099] When N1 and N2 are unit vectors (ie, |N1|=1, |N2|=1), θ=arccos(N1·N2).

[0100] Figure 7 This is an example of the relationship between the dot product and the vector angle. Figure 7 As shown, when the angle between two vectors is smaller, the value of the dot product is closer to 1;

[0101] As the angle increases, the dot product value becomes smaller;

[0102] When two vectors are perpendicular and the angle between them is 90 degrees, the dot product is 0;

[0103] As the angle continues to increase, the dot product begins to become negative, until the two directions are opposite and the dot product is -1.

[0104] B. Calculate the collapse cost of all edges starting from vertex U, and finally express the collapse cost of vertex U as the mean value, and record the connected edge with the smallest collapse cost; collapse cost = the sum of the collapse costs of all connected edges / the number of connected edges.

[0105] C. Calculate the collapse cost of all vertices according to the above method and record the connecting edge with the minimum collapse cost.

[0106] Select the vertex with the smallest collapse cost and start the collapse process from the edge with the smallest collapse cost; assuming that the vertex with the smallest collapse cost is A, and the edge with the smallest collapse cost is AB:

[0107] Move vertex A to B to collapse edge AB, recalculate the normal and tangent of point B to avoid distortion after the collapse.

[0108] Normal vector of point B: The normal vector of point B (the normal vector of vertex B before it moves) and the normal vector of point A (the normal vector of vertex A before it moves) are added and normalized; normalization is required because the unit length of the vector changes after the addition.

[0109] Tangent vector at point B: The tangent vector at point B is added to the tangent vector at point A and normalized.

[0110] Delete the triangle on edge AB and replace vertex A on the remaining triangle with vertex B. The process of moving vertex A is as follows: Figure 8 shown.

[0111] Recalculate the collapse cost of the adjacent points before vertex A is deleted (moved) to Figure 8 For example, the recalculated adjacent points include B, C, D, E, F, and G.

[0112] After a vertex is collapsed, the next vertex with the smallest collapse cost is collapsed until the simplification requirement is met. Finally, a new geometric model can be reconstructed based on the simplified vertex data and triangle surface data, that is, the simplified digital model.

[0113] Based on the above, after deleting the first vertex with the smallest collapse cost among all vertices in the digital model and connecting other vertices originally connected to the first vertex to the transfer vertex, the method may further include: updating the vertex data of the transfer vertex, wherein the vertex data includes a normal and a tangent. The method of updating the vertex data of the transfer vertex may include: adding the normal vector of the first vertex to the normal vector of the transfer vertex and normalizing them to obtain the normal vector of the transfer vertex; adding the tangent vector of the first vertex to the tangent vector of the transfer vertex and normalizing them to obtain the tangent vector of the transfer vertex.

[0114] In practical applications, there may also be an implementation of randomly deleting vertices, but compared with the implementation of iteratively deleting vertices with the smallest collapse cost in this application, the implementation of randomly deleting vertices may cause a large change in the original outline of the digital model, causing the model to be distorted. Fig. 9 This is a model comparison example diagram of the surface reduction processing and random surface reduction processing of the solution disclosed in the embodiment of this application. Fig. 9 As shown, in the face reduction effect of the present application on the left, the number of model vertices from left to right are: 453, 200, 100; in the random face reduction effect on the right, the front feet of the rabbit model are missing.

[0115] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0116] The method is described in detail in the embodiments disclosed in the above-mentioned application. The method of the application can be implemented by various forms of devices. Therefore, the application also discloses a device, and a specific embodiment is given below for detailed description.

[0117] Fig.10 This is a schematic diagram of the structure of a digital model processing device disclosed in an embodiment of the present application. Fig.10 As shown, the digital model processing device 100 may include:

[0118] Vertex data determination data 1001 is used to determine relevant data of the current vertex for each vertex in the digital model, wherein the relevant data includes vertex data and relevant surface data, wherein a vertex of the relevant surface is the current vertex.

[0119] The collapse data determination module 1002 is used to determine the collapse data of the current vertex based on the vertex data and the related surface data, the collapse data includes a collapse cost and a collapse edge, the collapse edge represents the edge with the smallest collapse cost among all connected edges of the current vertex, and the collapse cost is determined based on the collapse costs of all connected edges of the current vertex.

[0120] The vertex processing module 1003 is used to delete the first vertex with the smallest collapse cost among all vertices in the digital model, and connect other vertices originally connected to the first vertex to a transfer vertex, where the transfer vertex is the vertex at the other end of the collapsed edge of the first vertex.

[0121] The digital model processing device described in this embodiment deletes vertices and their triangular faces according to the principle of minimum vertex collapse cost. This scheme can simply and efficiently complete the lightweight face reduction of the digital model. Compared with the traditional scheme of manual face reduction, it can save a lot of time and labor costs. In addition, the scheme can be deployed programmatically to achieve automatic face reduction. In the application scenario, models of different precisions can be displayed according to the distance between the digital model and the observation point. Compared with the traditional scheme of pre-loading models of different precisions, the scheme can also reduce resource loading.

[0122] In one implementation, the apparatus may further include: an iterative control module for iteratively performing the steps of determining collapse data and deleting vertices with the smallest collapse cost until the number of remaining vertices in the digital model reaches a set value, wherein the set value is determined based on a vertex simplification rate.

[0123] In one implementation, the device may further include: a model construction module, which is used to construct and store a geometric model based on relevant data of the remaining vertices after the number of remaining vertices in the digital model reaches a set value, wherein the geometric model is a simplified model of the digital model.

[0124] In one implementation, the apparatus further includes a data updating module for updating collapsed data for vertices whose connecting edges change during the iteration process.

[0125] In one implementation, the collapsed data determination module includes: an edge collapse cost determination module, which is used to determine the collapse cost of each connecting edge of the current vertex based on the vertex data and the related surface data; a vertex collapse cost determination module, which is used to determine the average of the collapse costs of all connecting edges of the current vertex as the collapse cost of the current vertex; and a collapsed edge determination module, which is used to determine the connecting edge with the smallest collapse cost among all connecting edges of the current vertex as the collapsed edge of the current vertex.

[0126] In one implementation, the edge collapse cost determination module is specifically used to: determine all the connecting edges of the current vertex based on the vertex data and the related surface data; for each connecting edge, determine the distance between the two vertices of the current connecting edge; determine the curvature value of the current connecting edge; and determine the collapse cost of the current connecting edge based on the distance and the curvature value.

[0127] In one implementation, the edge collapse cost determination module can be used to: for each plane where the current connecting edge is located: determine the normal dot product of the current plane and the planes where other current vertices are located; determine the minimum curvature corresponding to the current plane based on the maximum value in the normal dot product; determine the maximum value among the minimum curvatures of all planes where the current connecting edge is located as the curvature value of the current connecting edge.

[0128] In one implementation, the device may also include: a data updating module, used to delete the first vertex with the smallest collapse cost among all vertices in the digital model, and after connecting other vertices originally connected to the first vertex to the transfer vertex, update the vertex data of the transfer vertex, wherein the vertex data includes normals and tangents.

[0129] In one implementation, the data update module can be specifically used to: add the normal vector of the first vertex and the normal vector of the transfer vertex and normalize them to obtain the normal vector of the transfer vertex; add the tangent vector of the first vertex and the tangent vector of the transfer vertex and normalize them to obtain the tangent vector of the transfer vertex.

[0130] The specific implementation of the processing device of the above digital model and the modules it contains can be found in the corresponding parts of the method embodiment, which will not be repeated here.

[0131] Any one of the digital model processing devices described in the above embodiments comprises a processor and a memory. The vertex data determination module, collapse data determination module, vertex processing module, iteration control module, model construction module, etc. in the above embodiments are all stored in the memory as program modules, and the processor executes the above program modules stored in the memory to realize corresponding functions.

[0132] The processor includes a kernel, which retrieves the corresponding program module from the memory. One or more kernels can be set, and the processing of the access data can be realized by adjusting the kernel parameters.

[0133] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0134] In an exemplary embodiment, a computer-readable storage medium is also provided, which can be directly loaded into the internal memory of a computer and contains software code. After being loaded and executed by a computer, the computer program can implement the steps shown in any embodiment of the above-mentioned digital model processing method.

[0135] In an exemplary embodiment, a computer program product is also provided, which can be directly loaded into the internal memory of a computer and contains software codes. After being loaded and executed by a computer, the computer program can implement the steps shown in any embodiment of the digital model processing method described above.

[0136] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0137] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0138] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0139] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for processing a digital model, the method comprising: For each vertex in the digital model, determining relevant data of the current vertex, wherein the relevant data includes vertex data and relevant surface data, wherein a vertex of the relevant surface is the current vertex; Determine collapse data of the current vertex based on the vertex data and the related surface data, the collapse data including collapse cost and collapse edge, the collapse edge represents the edge with the smallest collapse cost among all connected edges of the current vertex, and the collapse cost is determined based on the collapse cost of all connected edges of the current vertex; The first vertex with the smallest collapse cost among all vertices in the digital model is deleted, and other vertices originally connected to the first vertex are connected to a transfer vertex, which is the vertex at the other end of the collapsed edge of the first vertex.

2. The method for processing a digital model according to claim 1, further comprising: The steps of determining the collapse data and deleting the vertex with the smallest collapse cost are iterated until the number of remaining vertices in the digital model reaches a set value, which is determined based on the vertex simplification rate.

3. The method for processing a digital model according to claim 2, further comprising: after the number of remaining vertices in the digital model reaches a set value: A geometric model is constructed and stored based on the relevant data of the remaining vertices, wherein the geometric model is a simplified model of the digital model.

4. The method for processing a digital model according to claim 2, wherein: During the iteration process, only the vertices whose connected edges have changed are updated with collapsed data.

5. The method for processing a digital model according to claim 1, wherein the step of determining the collapse data of the current vertex based on the vertex data and the related surface data comprises: Determine the collapse cost of each connected edge of the current vertex based on the vertex data and the related surface data; The average of the collapsed costs of all the connected edges of the current vertex is determined as the collapsed cost of the current vertex; The connected edge with the smallest collapse cost among all connected edges of the current vertex is determined as the collapsed edge of the current vertex.

6. The method for processing a digital model according to claim 5, wherein the step of determining the collapse cost of each connecting edge of the current vertex based on the vertex data and the related surface data comprises: Determine all connected edges of the current vertex based on the vertex data and the related surface data; For each connecting edge, determine the distance between the two vertices of the current connecting edge; Determine the curvature value of the current connection edge; A collapse cost of the current connected edge is determined based on the distance and the curvature value.

7. The method for processing a digital model according to claim 6, wherein determining the curvature value of the current connecting edge comprises: For each plane where the current connected edge is located: determine the normal dot product of the current plane and the other planes where the current vertex is located; Determine the minimum curvature corresponding to the current plane based on the maximum value in the normal dot product; The maximum value of the minimum curvatures of all planes where the current connected edge is located is determined as the curvature value of the current connected edge.

8. The method for processing a digital model according to claim 1, wherein the first vertex with the smallest collapse cost among all vertices in the digital model is deleted, and other vertices originally connected to the first vertex are connected to the transfer vertex, and further comprises: The vertex data of the transferred vertex is updated, wherein the vertex data includes a normal and a tangent.

9. The method for processing a digital model according to claim 8, wherein updating the vertex data of the transferred vertex comprises: Adding the normal vector of the first vertex and the normal vector of the transfer vertex and normalizing them to obtain the normal vector of the transfer vertex; The tangent vector of the first vertex is added to the tangent vector of the transfer vertex and normalized to obtain the tangent vector of the transfer vertex.

10. A digital model processing device, the device comprising: Vertex data determination data, used to determine relevant data of the current vertex for each vertex in the digital model, wherein the relevant data includes vertex data and relevant surface data, wherein a vertex of the relevant surface is the current vertex; A collapse data determination module, configured to determine collapse data of a current vertex based on the vertex data and the related surface data, wherein the collapse data includes a collapse cost and a collapse edge, wherein the collapse edge represents an edge with the smallest collapse cost among all connected edges of the current vertex, and the collapse cost is determined based on the collapse costs of all connected edges of the current vertex; The vertex processing module is used to delete the first vertex with the smallest collapse cost among all vertices in the digital model, and connect other vertices originally connected to the first vertex to a transfer vertex, where the transfer vertex is the vertex at the other end of the collapsed edge of the first vertex.