Grid simplification method and device, computer equipment and storage medium

By randomly disrupting the relationship between the vertex and threads of the three-dimensional grid model, and selecting simplified points based on the occupation mark and merging it, the problems of slow simplification speed and feature loss in the existing technology are solved, and efficient and uniform grid simplification is achieved.

CN119559354APending Publication Date: 2025-03-04HEFEI MEIYA OPTOELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311123514.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-01
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

When the prior art simplifies the three-dimensional grid model, the speed is slow and prone to loss of grid density features and detail features, and the speed of improvement is limited.

Method used

By randomly disrupting the correspondence between each vertex of the three-dimensional mesh model and each thread of the graphics processor, the occupation identifiers of the vertices corresponding to each thread are obtained, and the target simplification points are selected from the vertices based on these identifiers for merging and simplifying.

Benefits of technology

It achieves the improvement of simplification speed while ensuring simplified uniformity, avoids the loss of grid features, and improves the efficiency of simplified processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119559354A_ABST
    Figure CN119559354A_ABST
Patent Text Reader

Abstract

The invention relates to a grid simplification method and device, computer equipment and a storage medium. The method comprises the following steps of: randomly disrupting a corresponding relationship between each vertex of a three-dimensional grid model and each thread of a graphics processor to obtain a corresponding relationship between each vertex and each thread in the grid simplification process of the round; obtaining a first occupation identifier of a vertex corresponding to each thread and a second occupation identifier of a first-order neighborhood vertex of the vertex; according to the first occupation identifier and the second occupation identifier corresponding to each vertex, selecting a first target simplification point from each vertex, selecting a second target simplification point from a first-order neighborhood vertex of the first target simplification point, and combining the second target simplification point corresponding to the first target simplification point with the first target simplification point; and updating the three-dimensional grid model according to the combined vertexes. By adopting the method, the three-dimensional grid model can be uniformly simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer graphics technology, and in particular to a grid simplification method, device, computer equipment and storage medium. Background Art

[0002] A 3D mesh model is a model that approximates a 3D object using multiple triangular faces. After building a 3D mesh model, it may be necessary to simplify the model to different degrees to reduce the amount of calculation for different application scenarios, such as merging some faces or points on the model.

[0003] Since the simplification speed is slow when the model data volume is large, the existing technology usually adopts methods such as dividing the data into multiple parts for splicing, or adopting vertex aggregation to improve the simplification processing speed. However, the above methods will cause the loss of density features and detail features of the mesh during simplification, and the improvement speed is limited. Summary of the invention

[0004] Based on this, it is necessary to provide a grid simplification method, device, computer equipment and storage medium to address the above technical problems.

[0005] In a first aspect, the present application provides a grid simplification method. The method comprises:

[0006] Randomly disrupting the correspondence between each vertex of the three-dimensional mesh model and each thread of the graphics processor to obtain the correspondence between each vertex and each thread in the current mesh simplification process;

[0007] Obtaining a first occupation flag of the vertex corresponding to each of the threads and a second occupation flag of a first-order neighboring vertex of the vertex;

[0008] According to the first occupancy identifier and the second occupancy identifier corresponding to each of the vertices, a first target simplified point is selected from each of the vertices, and a second target simplified point is selected from the first-order neighboring vertices of the first target simplified point, and the second target simplified point corresponding to the first target simplified point is merged with the first target simplified point;

[0009] The three-dimensional mesh model is updated according to the merged vertices.

[0010] In one embodiment, after updating the three-dimensional mesh model, the method further includes:

[0011] If the updated three-dimensional mesh model does not meet the simplification requirement, jump to the step of randomly disrupting the correspondence between each vertex of the three-dimensional mesh model and each thread of the graphics processor to obtain the correspondence between each vertex and each thread in the current round of mesh simplification; or

[0012] When the updated three-dimensional mesh model meets the simplification requirement, the updated three-dimensional mesh model is used as the final simplified three-dimensional mesh model.

[0013] In one embodiment, selecting a first target simplified point from each of the vertices according to the first occupancy flag and the second occupancy flag corresponding to each of the vertices includes:

[0014] For any of the vertices, when the first occupied flag of the vertex and all the second occupied flags corresponding to the vertex are unoccupied flags, modify the first occupied flag of the vertex and all the second occupied flags corresponding to the vertex to occupied flags, and mark the vertex as a vertex to be simplified;

[0015] A first target simplified point is selected from the vertices to be simplified.

[0016] In one embodiment, the step of selecting a first target simplified point from each of the vertices to be simplified includes:

[0017] For any of the vertices to be simplified, respectively determine the merging errors between each of the first-order neighboring vertices of the vertex to be simplified and the vertex to be simplified, and determine a target merging error according to each of the merging errors;

[0018] The vertices to be simplified are sorted according to the target merging errors to obtain a queue of vertices to be simplified, and a first target simplification point is selected from the queue of vertices to be simplified according to a first preset strategy.

[0019] In one of the embodiments, before sorting the vertices to be simplified according to the target merging errors, the method further includes:

[0020] For any of the vertices to be simplified, obtaining a skip flag of the vertex to be simplified, and if the skip flag is a first flag, changing the skip flag to a second flag, and deleting the vertex to be simplified from all the vertices to be simplified;

[0021] After sorting the vertices to be simplified according to the target merging errors, the method further includes:

[0022] According to the second preset strategy, a target vertex is selected from the queue of vertices to be simplified, and the skip flag of the target vertex is modified to the first flag.

[0023] In one of the embodiments, before selecting the first target simplified point from the queue of vertices to be simplified according to the first preset strategy, the method further includes:

[0024] For any vertex to be simplified in the queue of vertices to be simplified, determine the expected merging points corresponding to the vertex to be simplified according to the first-order neighboring vertices of the vertex to be simplified, and when all the expected merging points do not meet the merging point requirements, adjust the position of the vertex to be simplified in the queue of vertices to be simplified based on the first preset strategy.

[0025] In one embodiment, the selecting a second target simplified point from the first-order neighboring vertices of the first target simplified point includes:

[0026] The first-order neighborhood vertex corresponding to the smallest merging error among the merging errors is used as the second target simplified point.

[0027] In one embodiment, after respectively determining the merging errors between each of the first-order neighboring vertices of the vertex to be simplified and the vertex to be simplified, the method further includes:

[0028] For any of the first-order neighbor vertices, when the connecting edge between the vertex to be simplified and the first-order neighbor vertex is a boundary edge, the merging errors corresponding to the vertex to be simplified and the first-order neighbor vertex are updated based on a preset constant.

[0029] In a second aspect, the present application also provides a grid simplification device. The device comprises:

[0030] A scrambling module, used for randomly scrambling the correspondence between each vertex of the three-dimensional mesh model and each thread of the graphics processor, to obtain the correspondence between each vertex and each thread in the current round of mesh simplification process;

[0031] A first acquisition module, used for acquiring a first occupation flag of the vertex corresponding to each of the threads, and a second occupation flag of a first-order neighboring vertex of the vertex;

[0032] A first selection module is used to select a first target simplified point from each of the vertices according to the first occupancy identifier and the second occupancy identifier corresponding to each of the vertices, and select a second target simplified point from the first-order neighboring vertices of the first target simplified point, and merge the second target simplified point corresponding to the first target simplified point with the first target simplified point;

[0033] The updating module is used to update the three-dimensional mesh model according to the merged vertices.

[0034] In one embodiment, the device further comprises:

[0035] A jump module, configured to jump to the step of randomly disrupting the correspondence between each vertex of the three-dimensional mesh model and each thread of the graphics processor to obtain the correspondence between each vertex and each thread in the current round of mesh simplification process when the updated three-dimensional mesh model does not meet the simplification requirement; or

[0036] When the updated three-dimensional mesh model meets the simplification requirement, the updated three-dimensional mesh model is used as the final simplified three-dimensional mesh model.

[0037] In one embodiment, the selection module is further used to:

[0038] For any of the vertices, when the first occupied flag of the vertex and all the second occupied flags corresponding to the vertex are unoccupied flags, modify the first occupied flag of the vertex and all the second occupied flags corresponding to the vertex to occupied flags, and mark the vertex as a vertex to be simplified;

[0039] A first target simplified point is selected from the vertices to be simplified.

[0040] In one embodiment, the selection module is further used to:

[0041] For any of the vertices to be simplified, respectively determine the merging errors between each of the first-order neighboring vertices of the vertex to be simplified and the vertex to be simplified, and determine a target merging error according to each of the merging errors;

[0042] The vertices to be simplified are sorted according to the target merging errors to obtain a queue of vertices to be simplified, and a first target simplification point is selected from the queue of vertices to be simplified according to a first preset strategy.

[0043] In one embodiment, the device further comprises:

[0044] A second acquisition module is used to acquire a skip flag of any of the vertices to be simplified, and when the skip flag is a first flag, modify the skip flag to a second flag, and delete the vertex to be simplified from each of the vertices to be simplified;

[0045] The second selection module is used to select a target vertex from the queue of vertices to be simplified according to a second preset strategy, and to modify the skip flag of the target vertex to the first flag.

[0046] In one embodiment, the device further comprises:

[0047] A determination module is used to determine, for any of the vertices to be simplified in the queue of vertices to be simplified, the expected merging points corresponding to the vertex to be simplified according to the first-order neighboring vertices of the vertex to be simplified, and when all the expected merging points do not meet the merging point requirements, adjust the position of the vertex to be simplified in the queue of vertices to be simplified based on the first preset strategy.

[0048] In one embodiment, the first selection module is further used to:

[0049] The first-order neighborhood vertex corresponding to the smallest merging error among the merging errors is used as the second target simplified point.

[0050] In one embodiment, the device further comprises:

[0051] The updating module is used to update the merging error corresponding to the vertex to be simplified and the first-order neighboring vertex based on a preset constant for any of the first-order neighboring vertices when the connecting edge between the vertex to be simplified and the first-order neighboring vertex is a boundary edge.

[0052] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, any one of the above methods is implemented.

[0053] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, any of the above methods is implemented.

[0054] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, any of the above methods is implemented.

[0055] The above-mentioned mesh simplification method, device, computer equipment and storage medium disrupt the correspondence between threads and vertices, and obtain the occupancy identification of vertices and their first-order neighboring vertices through threads in parallel, and select target simplified points from the vertices according to the occupancy identification for merging and simplification. Since the GPU randomly determines the order of scheduling threads when performing parallel calculations, and the vertices corresponding to the threads are random, the embodiment of the present application is equivalent to realizing the simplification of randomly selecting vertices from a three-dimensional mesh model in a simple way, which can ensure a good simplification uniformity and is not prone to the problem of mesh feature loss; at the same time, since the embodiment of the present application uses the GPU to simplify each vertex in parallel, it can also improve the simplification speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 A schematic diagram of a flow chart of a grid simplification method in one embodiment;

[0057] Figure 2 A schematic diagram of thread marking vertices in one embodiment;

[0058] Figure 3 is a schematic diagram of different vertices marked in different rounds in one embodiment;

[0059] Figure 4 A schematic diagram of the effect of merging vertices in one embodiment;

[0060] Figure 5 is a schematic diagram of merging vertex effects in multiple rounds in one embodiment;

[0061] Figure 6 is a flow chart of step 106 in one embodiment;

[0062] Figure 7 A schematic diagram of an area occupied by threads in one embodiment;

[0063] Figure 8 is a flow chart of step 604 in one embodiment;

[0064] Fig. 9 A schematic diagram of a flow chart of a grid simplification method in one embodiment;

[0065] Fig.10 is a structural block diagram of a grid simplification device in an embodiment;

[0066] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0067] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0068] In one embodiment, Figure 1 As shown, a grid simplification method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0069] Step 102, randomly disrupting the correspondence between each vertex of the three-dimensional mesh model and each thread of the graphics processor to obtain the correspondence between each vertex and each thread in this round of mesh simplification process.

[0070] In an embodiment of the present application, the terminal can simplify the three-dimensional mesh model through a graphics processing unit (GPU). The GPU can be made to assign a thread to each vertex of the three-dimensional mesh model and record the correspondence between the vertex and the thread. For example, since each thread has a unique thread identifier and each vertex also has a unique vertex identifier, the vertex identifiers can be arranged into an array according to the thread identifiers corresponding to the vertex identifiers, and the position of the vertex identifier in the array represents the thread identifier corresponding to the vertex identifier, so as to record the correspondence between the thread and the vertex. For example, taking the thread identifiers as 0-9 and the vertex identifiers as 0-9 as an example, if the array is {7 2 8 5 6 0 4 3 1 9}, the correspondence between the threads and the vertices represented by the array is that thread 0 corresponds to vertex 7, thread 1 corresponds to vertex 2...thread 9 corresponds to vertex 9. Alternatively, each pair of corresponding vertex identifiers and thread identifiers can be directly recorded as a number pair, for example, (0,7) represents the thread with thread identifier 0 corresponding to the vertex with vertex identifier 7. In addition, the correspondence between vertices and threads may be recorded in other ways, which are not specifically limited in the embodiments of the present application.

[0071] Since threads have different scheduling speeds, in order to ensure that when the GPU subsequently schedules threads to determine the vertices that need to be simplified, adjacent threads will not be scheduled at the same time, resulting in the simplified vertices being concentrated in one place. At the same time, in order to avoid the vertices corresponding to faster-scheduled threads always becoming simplified vertices, resulting in uneven simplification of the 3D mesh model, before starting this round of mesh simplification, the correspondence between threads and vertices can be randomly shuffled to ensure that each vertex in the 3D mesh model has a probability of becoming a simplified vertex. The embodiment of the present application does not specifically limit the manner of disrupting the correspondence between threads and vertices. For example, if the correspondence between threads and vertices is recorded in an array, the array can be traversed, and vertex identifiers can be randomly selected from positions other than the currently traversed position, and exchanged with the vertex identifier in the currently traversed position: taking the array {7 2 8 5 6 0 4 3 1 9} as an example, when traversing to the first position (that is, vertex identifier 7), a position can be randomly selected from positions other than the first position (for example, the fifth position, corresponding to vertex identifier 6), and the vertex identifier in the selected position can be exchanged with the vertex identifier in the traversed position to obtain the array {6 2 8 5 7 0 4 3 1 9}... and so on, until the vertex identifiers at each position have been exchanged and are no longer the original vertex identifiers, thereby completing the disruption of the correspondence between threads and vertices.

[0072] Alternatively, the correspondence between threads and vertices may be disrupted by generating random numbers. For example, a random number coprime to the total number of threads may be used as the base (to avoid different threads corresponding to the same vertex in the subsequent modulus operation), the product of the thread identifier and the base is calculated, the modulus is taken for the total number of threads, and the remainder is used as the vertex identifier corresponding to the thread identifier. In addition, the correspondence between vertices and threads may be disrupted by other methods, which are not specifically limited in the embodiments of the present application.

[0073] It should be noted that, in view of the fact that some vertices will be merged in each round of simplifying the three-dimensional mesh model, each time a new round of mesh simplification and the corresponding relationship between threads and vertices is disrupted, some threads will correspond to vertices that no longer exist. When a thread performs an operation on a vertex according to its corresponding vertex, if the vertex corresponding to the thread does not exist, the thread can be terminated. Alternatively, if the corresponding relationship between threads and vertices is recorded through an array, an array can be set to record whether each vertex identifier in the array has been deleted. For example, all elements in the array can be 1 and 0, 1 represents that the vertex corresponding to the vertex identifier has been merged with other vertices, 0 represents that the vertex corresponding to the vertex identifier has not been merged, and the arrangement position of each element in the array represents its corresponding vertex identifier (for example, if the array used to record whether the vertex identifier has been deleted is {0 01 1 0 0 1 0 0 0}, it means that the vertices with vertex identifiers 2, 3, and 6 have all been merged). The thread can determine whether the vertex corresponding to the vertex identifier has been merged according to the identifier corresponding to the vertex identifier in the array; if the vertex has been merged, the thread can be terminated.

[0074] Step 104: Obtain a first occupation flag of a vertex corresponding to each thread and a second occupation flag of a first-order neighboring vertex of the vertex.

[0075] In the embodiment of the present application, the occupation flag of the vertex is used to indicate whether the vertex has been marked as a vertex that needs to be simplified. The occupation flag may include an occupied flag and an unoccupied flag, wherein the occupied flag indicates that the vertex has been marked and may be represented by 1; the unoccupied flag indicates that the vertex is not marked and may be represented by 0. Alternatively, other numbers or symbols may be used to represent the occupied flag and the unoccupied flag, which is not specifically limited in the embodiment of the present application.

[0076] The first-order neighbor vertices of a vertex refer to the vertices that belong to the same triangle mesh as the vertex, that is, the vertices that are directly connected to the vertex through edges. Since the vertex needs to be merged with a first-order neighbor vertex when simplifying the vertex, the vertex can only be selected as the vertex to be simplified when the occupancy flag of the vertex (first occupancy flag) and the occupancy flag of at least one of its first-order neighbor vertices (second occupancy flag) are unoccupied flags.

[0077] Each thread can concurrently obtain the first occupancy flag of the vertex corresponding to it and the second occupancy flag of the first-order neighboring vertex of the vertex. Figure 2As shown in the figure, due to the different thread scheduling speeds, the fast-scheduling thread will give priority to occupying its corresponding vertex (point A) and its first-order neighboring vertices (point B, point C) (a thread can occupy only one first-order neighboring vertex, or multiple first-order neighboring vertices, and then select points and vertices from all occupied first-order neighboring vertices for merging). Taking the fastest-scheduling thread that has already occupied points A, B, and C as an example, the thread can modify the occupation flags of points A, B, and C to occupied flags (the occupied flags can be modified by atomic exchange, so that the occupation flag of each vertex can only be operated by one thread at a time to avoid thread conflicts); in this way, the subsequent threads corresponding to points B and C can no longer occupy points B or C, and the threads corresponding to the first-order neighboring vertices of points B and C (points D and E) can no longer occupy points B and C, which means that the effect of randomly selecting points A, B, and C for merging and simplification among multiple simplification possibilities is achieved. Since the correspondence between threads and vertices will be randomly disrupted in each round of mesh simplification, the vertices that are preempted and marked first will be different in each round, thus ensuring uniform simplification of the model. Figure 3 As shown in FIG. 1 , it is a schematic diagram of the area occupied by threads in different mesh simplification rounds when the threads occupy all the first-order neighboring vertices of the vertices. It can be seen that the vertices occupied by threads in different rounds are different, and because the threads will occupy all the first-order neighboring vertices of the vertices, there is also a certain distance between the areas occupied by each thread, so the three-dimensional mesh model can be uniformly simplified.

[0078] Step 106, according to the first occupancy flag and the second occupancy flag corresponding to each vertex, select the first target simplified point from each vertex, and select the second target simplified point from the first-order neighboring vertices of the first target simplified point, and merge the second target simplified point corresponding to the first target simplified point with the first target simplified point.

[0079] In an embodiment of the present application, when a thread obtains a first occupancy flag of a vertex corresponding to it and a second occupancy flag of a first-order neighboring vertex corresponding to it, if the first occupancy flag and at least one second occupancy flag are unoccupied flags, the GPU can determine whether the vertex corresponding to the thread can be used as a first target simplification point according to the simplification standard; if the vertex can be used as the first target simplification point, the second target simplification point can be selected from the first-order neighboring vertices of the vertex, and the first target simplification point and the second target simplification point can be merged.

[0080] The simplification standard is used to determine whether a vertex can become the first target simplified point to be finally simplified. It can be that the error after the vertex is simplified is less than a threshold value (the error is used to characterize the accuracy loss of the three-dimensional mesh model caused by simplifying the point, which can be calculated based on the position of the point before and after simplification. For example, the quadratic surface error metric algorithm (QEM, Quadric Error Metrics) can be used to calculate the error caused by the simplification of the vertex, and the embodiments of the present application do not make specific limitations on this), the relative position of the vertex in the three-dimensional mesh model meets the standard (for example, vertices located at the boundary of the three-dimensional mesh model should not be simplified to avoid deformation of the model boundary), whether the number of vertices that have been selected as the first target simplified point has reached a threshold, etc. The specific simplification standard can be determined by a person skilled in the art according to actual needs. When the vertex meets the simplification standard, the vertex can be used as the first target simplified point.

[0081] In order to minimize the accuracy loss caused by mesh simplification, the second target simplified point can be selected from the first-order neighboring vertices of the first target simplified point to be merged with the first target simplified point. If the thread only occupies some of the first-order neighboring vertices at the same time when occupying a vertex each time (for example, the first-order neighboring vertices of point A are point B, point C and point D, but when the thread changes the occupied flag of point A to the occupied flag, it only changes the occupied flag of point B to the occupied flag at the same time), then the second target simplified point can be selected only from the above-mentioned partially occupied first-order neighboring vertices. For each first-order neighborhood vertex, the loss corresponding to merging the first-order neighborhood vertex with the first target simplification point can be calculated, and the first-order neighborhood vertex with the smallest loss can be selected as the second target simplification point; or other factors can be considered at the same time, such as excluding the first-order neighborhood vertices located on the boundary in advance and selecting the second target simplification point only from the first-order neighborhood vertices not located on the boundary; or to avoid the situation where multiple adjacent vertices in the same area are simplified at the same time, resulting in uneven simplification of the three-dimensional mesh model, for each first-order neighborhood vertex, it can be determined whether there is a first target simplification point among the first-order neighborhood vertices of the first-order neighborhood vertex, and the first-order neighborhood vertex where the first target simplification point does not exist among the first-order neighborhood vertices is selected as the second target simplification point. The embodiments of the present application do not make specific limitations on this.

[0082] Merging the first target simplified point and the second target simplified point means calculating the position of a merged new point based on the positions of the first target simplified point and the second target simplified point, and deleting the first target simplified point and the second target simplified point. The middle point of the line connecting the first target simplified point and the second target simplified point can be directly taken as the position of the merged new point, or the first target simplified point or the second target simplified point can be taken as the merged new point, or the quadratic surface error metric algorithm and other algorithms can be used to calculate the position of the new point that minimizes the merged error, and the embodiments of the present application do not specifically limit this.

[0083] Step 108: updating the three-dimensional mesh model according to the merged vertices.

[0084] In the embodiment of the present application, after the vertices are merged, the connection relationship between the vertices in the three-dimensional mesh model needs to be updated. A connection relationship can be established between the points that originally have a connection relationship with the first target simplified point or the second target simplified point and the merged new point to complete the update of the three-dimensional mesh model. Figure 4 The figure shows the effect of merging vertex p1 and vertex p2.

[0085] The mesh simplification method provided in the embodiment of the present application disrupts the correspondence between threads and vertices, obtains the occupancy marks of vertices and their first-order neighboring vertices in parallel through threads, and selects target simplified points from the vertices according to the occupancy marks for merging and simplifying. Since the GPU randomly determines the order of scheduling threads when performing parallel calculations, and the vertices corresponding to the threads are random, the embodiment of the present application is equivalent to implementing the simplification of randomly selecting vertices from a three-dimensional mesh model in a simple way, which can ensure a good simplification uniformity and is not prone to the problem of mesh feature loss; at the same time, since the embodiment of the present application uses the GPU to simplify each vertex in parallel, the simplification speed can also be improved.

[0086] In one embodiment, in step 108, after updating the three-dimensional mesh model, the method further includes:

[0087] If the updated three-dimensional mesh model does not meet the simplification requirements, jump to the step of randomly disrupting the correspondence between each vertex of the three-dimensional mesh model and each thread of the graphics processor to obtain the correspondence between each vertex and each thread in the current round of mesh simplification; or,

[0088] When the updated three-dimensional mesh model meets the simplification requirement, the updated three-dimensional mesh model is used as the final simplified three-dimensional mesh model.

[0089] In the embodiments of the present application, the simplification requirements are set by technical personnel in this field according to needs, and are used to characterize the simplification effect that needs to be achieved. For example, the ratio of the number of remaining vertices / faces of the three-dimensional mesh model to the number of vertices / faces of the three-dimensional mesh model before the simplification begins reaches a threshold, the accumulated accuracy loss of the model has reached a threshold, etc. The embodiments of the present application do not make specific limitations on this.

[0090] The above process is described by taking the simplification requirement that the ratio of the number of remaining vertices of the three-dimensional mesh model to the number of vertices before the simplification starts reaches a threshold value, and the threshold value is 60%. Figure 5As shown in the figure, it is the effect diagram of each round of simplification. If the 3D mesh model has 11 vertices before simplification, and vertices 2 and 9, 4 and 5 are merged in the first round of simplification (the new vertex after merging inherits the smaller vertex identifier before merging), there are still 9 vertices left in the 3D mesh model after simplification, and the ratio is 81% greater than the threshold, so it enters the next round of simplification; in the second round of simplification, vertices 6 and 7, 3 and 10 are merged, and the ratio is still greater than the threshold; in the third round of simplification, vertices 1 and 11 are merged, and there are still 6 vertices left in the 3D mesh model after simplification, and the ratio is less than the threshold, so the simplification is stopped at this time, and the 3D mesh model at this time is used as the final simplified 3D mesh model.

[0091] The mesh simplification method provided in the embodiment of the present application sets simplification requirements, and if the simplified three-dimensional mesh model does not meet the simplification requirements, the three-dimensional mesh model is repeatedly simplified until the simplification requirements are met, and a simplified three-dimensional mesh model that meets the requirements can be finally obtained.

[0092] In one embodiment, Figure 6 As shown, in step 106, according to the first occupation mark and the second occupation mark corresponding to each vertex, a first target simplified point is selected from each vertex, including:

[0093] Step 602, for any vertex, when the first occupied flag of the vertex and all the second occupied flags corresponding to the vertex are unoccupied flags, modify the first occupied flag of the vertex and all the second occupied flags corresponding to the vertex to occupied flags, and mark the vertex as a vertex to be simplified.

[0094] Step 604: Select a first target simplified point from the vertices to be simplified.

[0095] In the embodiment of the present application, when a thread obtains the first occupied flag of a vertex and the second occupied flag of a first-order neighboring vertex of the vertex, if the first occupied flag and all the second occupied flags are unoccupied flags, the thread can modify both the first occupied flag and the second occupied flag to occupied flags, and mark the vertex as a vertex to be simplified. Figure 7 As shown in the figure, the above method is equivalent to each thread checking whether there is an occupied vertex in the area centered on the vertex corresponding to the thread. After the faster-scheduled thread changes the occupied flags of the vertex and its first-order neighboring vertices to occupied flags (the dark gray area in the figure), the subsequent slower-scheduled threads whose corresponding vertices are located in the light gray area cannot use their corresponding vertices as vertices to be simplified, so that each vertex to be simplified is spaced farther apart, increasing the uniformity of mesh simplification.

[0096] After obtaining each vertex to be simplified, the first target simplification point can be selected from the vertices to be simplified by referring to the method of obtaining the first target simplification point from the vertex in the aforementioned embodiment, and the embodiments of the present application will not be described in detail here.

[0097] It should be noted that after obtaining each vertex to be simplified, each vertex to be simplified can also be checked to ensure that the occupied flags of the vertex to be simplified and its first-order neighboring vertices are correctly modified to occupied flags, and the areas covered by each vertex to be simplified and its first-order neighboring vertices (hereinafter referred to as sub-areas) do not overlap. Exemplarily, for each vertex to be simplified, it can be checked whether the occupied flags of the vertex to be simplified and its first-order neighboring vertices are all occupied flags. If the occupied flag of any vertex is not an occupied flag, the vertex to be simplified is deleted from the vertices to be simplified; it can also be checked whether there are other vertices to be simplified in the first-order neighboring vertices of the first-order neighboring vertices of the vertex to be simplified; if so, it indicates that the sub-areas corresponding to the two vertices to be simplified overlap, and the vertex to be simplified can also be deleted from the vertices to be simplified.

[0098] The mesh simplification method provided in the embodiment of the present application enables each thread to modify the occupied flag of a vertex and all its first-order neighboring vertices to an occupied flag when the occupied flags of the vertex and all its first-order neighboring vertices are unoccupied flags, and use the vertex as a vertex to be simplified. This can ensure that the distances between the vertices to be simplified are far enough, thereby improving the uniformity of model simplification.

[0099] In one embodiment, Figure 8 As shown, in step 604, selecting a first target simplified point from each of the vertices to be simplified includes:

[0100] Step 802 : for any vertex to be simplified, respectively determine the merging errors between each first-order neighboring vertex of the vertex to be simplified and the vertex to be simplified, and determine a target merging error according to each merging error.

[0101] Step 804 , sorting the vertices to be simplified according to the target merging error to obtain a queue of vertices to be simplified, and selecting a first target simplification point from the queue of vertices to be simplified according to a first preset strategy.

[0102] In the embodiment of the present application, the first target simplified point can be determined from each vertex to be simplified by calculating the merging error between each first-order neighboring vertex of the vertex to be simplified and the vertex to be simplified. The merging error is used to characterize the accuracy loss caused to the three-dimensional mesh model after the vertex to be simplified and its first-order neighboring vertex are merged. It can be calculated according to existing algorithms (such as the loss in the quadratic surface error measurement algorithm), or it can be calculated by other methods, such as defining the loss as the difference between the sum of the distances between the new point after the merger and all the points connected to it, and the sum of the distances between the two old points before the merger and all the points connected to them.

[0103] For each first-order neighboring vertex of the vertex to be simplified, the merging error between it and the vertex to be simplified can be calculated, and then the target merging error can be calculated based on each merging error. The target merging error is used to characterize the overall accuracy loss caused to the three-dimensional mesh model by simplifying the vertex to be simplified. It can be characterized by the maximum value, minimum value, average value, etc. in the merging error, which is not specifically limited in the embodiment of the present application. After obtaining the target merging error of each vertex to be simplified, the vertices to be simplified are sorted according to the target merging error (which can be sorted from small to large, or from large to small, etc.), and a queue of vertices to be simplified is obtained, so as to obtain the vertex to be simplified with a smaller target merging error from the queue of vertices to be simplified as the first target simplification point. The first preset strategy refers to a strategy for selecting vertices to be simplified, such as selecting vertices to be simplified whose target merging error is less than a threshold as the first target simplification point, or selecting vertices to be simplified arranged in a previous preset position as the first target simplification point, or selecting vertices to be simplified whose target merging error is less than a threshold and at the same time meet other requirements (such as points that are not located on the boundary, or points whose distance from other already selected first target simplification points is greater than a threshold, etc.) as the first target simplification point, etc. The embodiments of the present application do not make specific limitations on this.

[0104] The mesh simplification method provided in the embodiment of the present application calculates the merging error between the vertex to be simplified and its first-order neighboring vertices, calculates the target merging error based on the merging error, and then sorts the vertices to be simplified according to the target merging error, selects the first target simplification point from the queue obtained after sorting, and can select a point with a smaller error as the first target simplification point for merging, thereby reducing the accuracy loss caused by model simplification.

[0105] In one embodiment, Fig. 9 As shown, in step 804, before sorting the vertices to be simplified according to the target merging errors, the method further includes:

[0106] Step 902: for any vertex to be simplified, obtain a skip flag of the vertex to be simplified, and when the skip flag is a first flag, change the skip flag to a second flag, and delete the vertex to be simplified from all vertices to be simplified.

[0107] In step 804, after sorting the vertices to be simplified according to the target merging errors, the method further includes:

[0108] Step 904: According to the second preset strategy, a target vertex is selected from the queue of vertices to be simplified, and the skip flag of the target vertex is modified to the first flag.

[0109] In the embodiment of the present application, a skip flag can be assigned to each vertex. The skip flag includes a first flag and a second flag, the first flag indicates that the simplification of the vertex should be skipped in this round, and the second flag indicates that the simplification of the vertex should not be skipped in this round. In each round of mesh simplification, the target vertex can be selected from the queue of vertices to be simplified according to the second preset strategy, and the skip flag of the target vertex is modified to the first flag, so that in the next round of mesh simplification, the target vertex will be skipped. The second preset strategy can be determined by a person skilled in the art according to actual needs. For example, the second preset strategy can be set to select the vertices arranged in the 15% position after the queue of vertices to be simplified (that is, the merging error is large) as the target vertex, so that the vertices with large merging errors in the previous round cannot become the first target simplification points in this round, avoiding the vertices with large merging errors from being simplified; or the second preset strategy can be set to randomly select vertices whose distances are greater than the distance threshold as the target vertex, so that vertices scattered in different positions can be randomly selected in each round and not simplified in the next round, further avoiding the situation where the simplified vertices are all from the same area during simplification, resulting in uneven simplification of the three-dimensional mesh model.

[0110] In each round of mesh simplification, if the skip flag of the vertex to be simplified is the first flag, it indicates that the vertex to be simplified should be skipped in this round of mesh simplification. The vertex to be simplified can be deleted from the vertices to be simplified to achieve the effect of skipping the vertex to be simplified in this round. Since the target vertex needs to be reselected in each round of mesh simplification, the skip flag of the vertex to be simplified can be modified to the second flag. If the skip flag of the vertex to be simplified is the second flag, the vertex to be simplified will not be processed, and the skip flag of the next vertex to be simplified will be obtained.

[0111] Alternatively, the thread may also check whether the skip flag of the vertex is the first flag or the second flag when checking the first occupied flag of the corresponding vertex. If the skip flag of the vertex is the first flag, the thread modifies the skip flag to the second flag and terminates the thread to achieve the effect of skipping the vertex in this round.

[0112] The mesh simplification method provided in the embodiment of the present application assigns a skip flag to each vertex, deletes the vertices to be simplified whose skip flag is the first flag in each round of mesh simplification, and then selects the target vertex to be skipped in the next round according to the second preset strategy, and changes the skip flag of the target vertex to the first flag. The embodiment of the present application can select some vertices to be simplified that are not processed in the next round in each round of mesh simplification, thereby further improving the accuracy of mesh simplification.

[0113] In one embodiment, in step 804, before selecting the first target simplified point from the queue of vertices to be simplified according to the first preset strategy, the method further includes:

[0114] For any vertex to be simplified in the queue of vertices to be simplified, the expected merging points corresponding to the vertex to be simplified are determined according to the first-order neighboring vertices of the vertex to be simplified, and when all the expected merging points do not meet the merging point requirements, the position of the vertex to be simplified in the queue of vertices to be simplified is adjusted based on the first preset strategy.

[0115] In the embodiment of the present application, for each first-order neighboring vertex of the vertex to be simplified, the position of the new merged point after merging the first-order neighboring vertex and the vertex to be simplified, that is, the expected merged point, can be calculated. The merge point requirement refers to the requirement that the newly generated vertex should meet after merging two vertices, such as the sum of the distances between the original two vertices is less than a distance threshold, the distance from the surface of the three-dimensional mesh model is less than another distance threshold, the difference between the curvature of the three-dimensional mesh model at the newly generated vertex and the curvature at the original two vertices is less than the curvature threshold, or after updating the three-dimensional mesh model according to the newly generated vertex, the angle between the triangles updated due to the vertex merging is greater than the angle threshold, etc., which can be specifically set by those skilled in the art according to actual needs, and the embodiment of the present application does not make specific limitations on this. If all the expected merge points corresponding to the vertex to be simplified cannot meet the merge point requirements, the position of the vertex to be simplified in the queue of vertices to be simplified can be adjusted according to the first preset strategy, so as to ensure that according to the first preset strategy, the vertex to be simplified will not be selected as the first target simplification point (for example, if the first preset strategy is to select the vertices arranged in the front 15% of the queue of vertices to be simplified as the first target simplification point, then when adjusting the position, the vertex to be simplified can be adjusted to the position after 15% of the queue of vertices to be simplified), so as to prevent the situation where the newly generated merge point cannot meet the requirements after the selected first target simplification point is merged with the second target simplification point.

[0116] The mesh simplification method provided in the embodiment of the present application determines the expected merging points corresponding to the vertex to be simplified, and if all the expected merging points do not meet the requirements, adjusts the position of the vertex to be simplified in the queue of vertices to be simplified, that is, the vertex to be simplified is not simplified in this round, which can avoid the situation where the newly generated point does not meet the requirements after the first target simplification point and the second target simplification point are merged.

[0117] In one embodiment, in step 106, selecting a second target simplified point from the first-order neighboring vertices of the first target simplified point includes:

[0118] The first-order neighbor vertex corresponding to the smallest merging error among the merging errors is taken as the second target simplified point.

[0119] In an embodiment of the present application, in order to minimize the accuracy loss after the simplification of the three-dimensional mesh model, the first-order neighborhood vertex corresponding to the smallest merged error among the merged errors can be used as the second target simplified point, and then the second target simplified point and the first target simplified point can be merged.

[0120] In addition, if a merge point requirement is set for the newly generated merge point after the two vertices are merged (the merge point requirement can be found in the relevant description of the aforementioned embodiment), the first-order neighboring vertex with the smallest merging error among the first-order neighboring vertices of the newly generated merge point that meet the merge point requirement can be selected as the second target simplified point. In this way, the accuracy loss caused by the merged vertex to the three-dimensional mesh model can be reduced while ensuring that the merge point meets the requirements.

[0121] The mesh simplification method provided in the embodiment of the present application uses the first-order neighborhood vertex with the smallest merging error as the second target simplification point, which can reduce the accuracy loss of the three-dimensional mesh model caused by the merging of vertices.

[0122] In one embodiment, in step 702, after respectively determining the merging errors between each first-order neighboring vertex of the vertex to be simplified and the vertex to be simplified, the method further includes:

[0123] For any first-order neighboring vertex, when the connecting edge between the vertex to be simplified and the first-order neighboring vertex is a boundary edge, the merging error corresponding to the vertex to be simplified and the first-order neighboring vertex is updated based on a preset constant.

[0124] In the embodiment of the present application, the boundary edge refers to an edge belonging to only one triangle face. Since merging two vertices at both ends of the boundary edge will cause the hole at the boundary to expand, a larger preset constant can be added to the merging error corresponding to the vertices at both ends of the boundary edge, so that the vertices at both ends of the boundary edge will not become vertices that need to be merged.

[0125] When a specific algorithm is used to calculate the merging error, other methods can also be used to increase the merging error corresponding to the vertices at both ends of the boundary edge. For example, when a quadratic surface error measurement algorithm is used to calculate the merging error, since each triangular face in the quadratic surface error measurement algorithm corresponds to a quadratic error matrix, the quadratic error matrix of the vertex is the sum of the quadratic error matrices of all the triangular faces where the vertex is located, after two vertices are merged, the quadratic error matrix of the newly generated vertex is the sum of the quadratic error matrices of the two vertices before the merger, and the merging error can be calculated based on the quadratic error matrix of the newly generated vertex, so a larger constant can be added to the quadratic error matrix corresponding to the vertices at both ends of the boundary edge to increase the merging error corresponding to the vertices at both ends of the boundary edge; or a triangular face perpendicular to the triangular face originally located at the boundary edge can be constructed on all boundary edges, so that when calculating the quadratic error matrix corresponding to the vertices at both ends of the boundary edge, the quadratic error matrix corresponding to the perpendicular triangular face needs to be added to the quadratic error matrix corresponding to the vertices at both ends of the boundary edge, which can also achieve the effect of increasing the value of the quadratic error matrix of the vertices at both ends of the boundary edge and improving the merging error corresponding to the vertices at both ends of the boundary edge.

[0126] The mesh simplification method provided in the embodiment of the present application adds a larger preset constant to the merging error corresponding to the vertices at both ends of the boundary edge, which can avoid the merging of the vertices at both ends of the boundary edge and prevent the expansion of holes at the boundary of the three-dimensional mesh model.

[0127] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0128] Based on the same inventive concept, the embodiment of the present application also provides a mesh simplification device for implementing the mesh simplification method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more mesh simplification device embodiments provided below can refer to the limitations of the mesh simplification method above, and will not be repeated here.

[0129] In one embodiment, Fig.10As shown, a grid simplification device 1000 is provided, comprising: a scrambling module 1002, a first acquisition module 1004, a first selection module 1006, and an updating module 1008, wherein:

[0130] A scrambling module 1002 is used to randomly scramble the correspondence between each vertex of the three-dimensional mesh model and each thread of the graphics processor to obtain the correspondence between each vertex and each thread in the current mesh simplification process;

[0131] A first acquisition module 1004 is used to acquire a first occupation flag of the vertex corresponding to each of the threads and a second occupation flag of a first-order neighboring vertex of the vertex;

[0132] A first selection module 1006 is used to select a first target simplified point from each of the vertices according to the first occupancy identifier and the second occupancy identifier corresponding to each of the vertices, and select a second target simplified point from the first-order neighboring vertices of the first target simplified point, and merge the second target simplified point corresponding to the first target simplified point with the first target simplified point;

[0133] The updating module 1008 is used to update the three-dimensional mesh model according to the merged vertices.

[0134] The mesh simplification device provided in the embodiment of the present application disrupts the correspondence between threads and vertices, obtains the occupancy marks of vertices and their first-order neighboring vertices in parallel through threads, and selects target simplified points from the vertices according to the occupancy marks for merging and simplification. Since the GPU randomly determines the order of scheduling threads when performing parallel calculations, and the vertices corresponding to the threads are random, the embodiment of the present application is equivalent to realizing the simplification of randomly selecting vertices from a three-dimensional mesh model in a simple way, which can ensure a good simplification uniformity and is not prone to the problem of mesh feature loss; at the same time, since the embodiment of the present application uses the GPU to simplify each vertex in parallel, the simplification speed can also be improved.

[0135] In one embodiment, the device further comprises:

[0136] A jump module, configured to jump to the step of randomly disrupting the correspondence between each vertex of the three-dimensional mesh model and each thread of the graphics processor to obtain the correspondence between each vertex and each thread in the current round of mesh simplification process when the updated three-dimensional mesh model does not meet the simplification requirement; or

[0137] When the updated three-dimensional mesh model meets the simplification requirement, the updated three-dimensional mesh model is used as the final simplified three-dimensional mesh model.

[0138] In one embodiment, the selection module is further used to:

[0139] For any of the vertices, when the first occupied flag of the vertex and all the second occupied flags corresponding to the vertex are unoccupied flags, modify the first occupied flag of the vertex and all the second occupied flags corresponding to the vertex to occupied flags, and mark the vertex as a vertex to be simplified;

[0140] A first target simplified point is selected from the vertices to be simplified.

[0141] In one embodiment, the selection module is further used to:

[0142] For any of the vertices to be simplified, respectively determine the merging errors between each of the first-order neighboring vertices of the vertex to be simplified and the vertex to be simplified, and determine a target merging error according to each of the merging errors;

[0143] The vertices to be simplified are sorted according to the target merging errors to obtain a queue of vertices to be simplified, and a first target simplification point is selected from the queue of vertices to be simplified according to a first preset strategy.

[0144] In one embodiment, the device further comprises:

[0145] A second acquisition module is used to acquire a skip flag of any of the vertices to be simplified, and when the skip flag is a first flag, modify the skip flag to a second flag, and delete the vertex to be simplified from each of the vertices to be simplified;

[0146] The second selection module is used to select a target vertex from the queue of vertices to be simplified according to a second preset strategy, and to modify the skip flag of the target vertex to the first flag.

[0147] In one embodiment, the device further comprises:

[0148] A determination module is used to determine, for any of the vertices to be simplified in the queue of vertices to be simplified, the expected merging points corresponding to the vertex to be simplified according to the first-order neighboring vertices of the vertex to be simplified, and when all the expected merging points do not meet the merging point requirements, adjust the position of the vertex to be simplified in the queue of vertices to be simplified based on the first preset strategy.

[0149] In one embodiment, the first selection module is further used to:

[0150] The first-order neighborhood vertex corresponding to the smallest merging error among the merging errors is used as the second target simplified point.

[0151] In one embodiment, the device further comprises:

[0152] The updating module is used to update the merging error corresponding to the vertex to be simplified and the first-order neighboring vertex based on a preset constant for any of the first-order neighboring vertices when the connecting edge between the vertex to be simplified and the first-order neighboring vertex is a boundary edge.

[0153] Each module in the above-mentioned grid simplification device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.

[0154] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a grid simplification method is implemented.

[0155] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0156] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0157] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0158] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0159] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0160] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0161] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0162] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A mesh simplification method, characterized in that: The method comprises: Randomly disrupting the correspondence between each vertex of the three-dimensional mesh model and each thread of the graphics processor to obtain the correspondence between each vertex and each thread in the current mesh simplification process; Obtaining a first occupation flag of the vertex corresponding to each of the threads and a second occupation flag of a first-order neighboring vertex of the vertex; According to the first occupancy identifier and the second occupancy identifier corresponding to each of the vertices, a first target simplified point is selected from each of the vertices, and a second target simplified point is selected from the first-order neighboring vertices of the first target simplified point, and the second target simplified point corresponding to the first target simplified point is merged with the first target simplified point; The three-dimensional mesh model is updated according to the merged vertices.

2. The method according to claim 1, characterized in that After updating the three-dimensional mesh model, the method further includes: If the updated three-dimensional mesh model does not meet the simplification requirement, jump to the step of randomly disrupting the correspondence between each vertex of the three-dimensional mesh model and each thread of the graphics processor to obtain the correspondence between each vertex and each thread in the current round of mesh simplification; or When the updated three-dimensional mesh model meets the simplification requirement, the updated three-dimensional mesh model is used as the final simplified three-dimensional mesh model.

3. The method according to claim 2, characterized in that The selecting a first target simplified point from each of the vertices according to the first occupancy flag and the second occupancy flag corresponding to each of the vertices includes: For any of the vertices, when the first occupied flag of the vertex and all the second occupied flags corresponding to the vertex are unoccupied flags, modify the first occupied flag of the vertex and all the second occupied flags corresponding to the vertex to occupied flags, and mark the vertex as a vertex to be simplified; A first target simplified point is selected from the vertices to be simplified.

4. The method according to claim 3, characterized in that The step of selecting a first target simplified point from each of the vertices to be simplified includes: For any of the vertices to be simplified, respectively determine the merging errors between each of the first-order neighboring vertices of the vertex to be simplified and the vertex to be simplified, and determine a target merging error according to each of the merging errors; The vertices to be simplified are sorted according to the target merging errors to obtain a queue of vertices to be simplified, and a first target simplification point is selected from the queue of vertices to be simplified according to a first preset strategy.

5. The method according to claim 1, characterized in that Before sorting the vertices to be simplified according to the target merging errors, the method further includes: For any of the vertices to be simplified, obtaining a skip flag of the vertex to be simplified, and if the skip flag is a first flag, changing the skip flag to a second flag, and deleting the vertex to be simplified from all the vertices to be simplified; After sorting the vertices to be simplified according to the target merging errors, the method further includes: According to the second preset strategy, a target vertex is selected from the queue of vertices to be simplified, and the skip flag of the target vertex is modified to the first flag.

6. The method according to claim 4, characterized in that Before selecting the first target simplified point from the to-be-simplified vertex queue according to the first preset strategy, the method further includes: For any vertex to be simplified in the queue of vertices to be simplified, determine the expected merging points corresponding to the vertex to be simplified according to the first-order neighboring vertices of the vertex to be simplified, and when all the expected merging points do not meet the merging point requirements, adjust the position of the vertex to be simplified in the queue of vertices to be simplified based on the first preset strategy.

7. The method according to claim 4, characterized in that The selecting a second target simplified point from the first-order neighborhood vertices of the first target simplified point comprises: The first-order neighborhood vertex corresponding to the smallest merging error among the merging errors is used as the second target simplified point.

8. The method according to claim 4, characterized in that After respectively determining the merging errors between each of the first-order neighboring vertices of the vertex to be simplified and the vertex to be simplified, the method further includes: For any of the first-order neighbor vertices, when the connecting edge between the vertex to be simplified and the first-order neighbor vertex is a boundary edge, the merging errors corresponding to the vertex to be simplified and the first-order neighbor vertex are updated based on a preset constant.

9. A grid simplification device, characterized in that: The device comprises: A scrambling module, used for randomly scrambling the correspondence between each vertex of the three-dimensional mesh model and each thread of the graphics processor, to obtain the correspondence between each vertex and each thread in the current round of mesh simplification process; A first acquisition module, used for acquiring a first occupation flag of the vertex corresponding to each of the threads, and a second occupation flag of a first-order neighboring vertex of the vertex; A first selection module is used to select a first target simplified point from each of the vertices according to the first occupancy identifier and the second occupancy identifier corresponding to each of the vertices, and select a second target simplified point from the first-order neighboring vertices of the first target simplified point, and merge the second target simplified point corresponding to the first target simplified point with the first target simplified point; The updating module is used to update the three-dimensional mesh model according to the merged vertices.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.