Triangular mesh model smoothing method and device, computer equipment and medium

By calculating the average area and coordinate adjustment weight of the surface sheet in the triangular mesh model, and iteratively adjusting the vertex coordinates, the problem of poor smoothing effect of the sharp mesh model in the grid brush selection smoothing scene is solved, and more accurate smoothing control is achieved and visual effects are improved.

CN119228682AInactive Publication Date: 2024-12-31BOYI HUIXIN (HANGZHOU) NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411775436.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2024-12-31
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing mesh smoothing algorithm is difficult to accurately control the smoothing area and degree in mesh brush selection smoothing scenarios, resulting in poor smoothing effect on the sharp mesh model.

Method used

By obtaining the area of ​​the face plate to the surface of each vertex in the triangular mesh model, calculate the average area of ​​the face plate, determine the coordinates based on the average area, and adjust the vertex coordinates iteratively to achieve grid smoothing, using the area smoothing of the two neighborhoods to Smooth the area and make full use of the patch information in larger areas.

Benefits of technology

It achieves good smoothing effect on the sharpness of the mesh model, and can more accurately control the smoothing area and degree, improving the appearance quality and visual effect of the mesh model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119228682A_ABST
    Figure CN119228682A_ABST
Patent Text Reader

Abstract

The invention relates to a triangular mesh model smoothing method and device, computer equipment and a medium, and the method comprises the steps: obtaining the area of a patch pair corresponding to each vertex in a triangular mesh model, the patch pair comprising a first-order neighborhood patch and a corresponding second-order neighborhood patch, and calculating the average area of the patch corresponding to each vertex according to the area of the patch pair; determining a coordinate adjustment weight corresponding to each vertex based on the average surface patch area; and carrying out grid smooth iteration adjustment on the coordinate of each vertex according to the coordinate adjustment weight. In the whole process, area smoothing of two neighborhoods is adopted to expand area smoothing, patch information of a larger area can be fully utilized, grid smoothing with more uniform density is achieved, and therefore a good smoothing effect can be achieved for the sharp position of the grid model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of computer graphics, and in particular to a triangular mesh model smoothing method, device, computer equipment and medium. Background Art

[0002] In the current field of computer graphics and 3D modeling, mesh smoothing is a crucial technology, whose main purpose is to improve the appearance quality of mesh models, optimize their geometric structure, and reduce surface noise and irregularities. Mesh smoothing technology is widely used in many aspects such as surface reconstruction, shape smoothing, animation deformation, etc., and is an important means to improve model rendering and visual effects.

[0003] However, although there are many mesh smoothing algorithms, such as Laplace smoothing and algorithms in the vtkSmoothPolyDataFilter class, these algorithms can achieve good smoothing effects in most scenarios, but they face certain challenges in specific scenarios, especially in the context of mesh brushing smoothing. In the specific scenario of mesh brushing smoothing, users often want to smooth specific areas on the mesh model while retaining the sharp features and details in other areas. However, conventional mesh smoothing algorithms often find it difficult to accurately control the smoothing area and degree, resulting in a poor smoothing effect on sharp areas on the mesh model in the specific scenario of mesh brushing smoothing.

[0004] Therefore, there is an urgent need for a solution that has a good smoothing effect on the sharp parts of the mesh model. Summary of the invention

[0005] Based on this, it is necessary to provide a triangular mesh model smoothing method, device, computer equipment, computer readable storage medium and computer program product with good smoothing effect on sharp parts of the mesh model in order to solve the above technical problems.

[0006] In a first aspect, the present application provides a triangular mesh model smoothing method. The method comprises: Obtain the area of ​​the facet pair corresponding to each vertex in the triangular mesh model, where the facet pair includes a first-order neighbor facet and a corresponding second-order neighbor facet; According to the area of ​​the facet pairs, calculate the average area of ​​the facets corresponding to each vertex; Based on the average area of ​​the patch, determining a coordinate adjustment weight corresponding to each vertex; The coordinates of each vertex are iteratively adjusted for mesh smoothing according to the coordinate adjustment weight.

[0007] In one embodiment, obtaining the area of ​​the facet pair corresponding to each vertex in the triangular mesh model includes: Get the first-order neighboring face and the second-order neighboring face corresponding to each vertex in the triangular mesh model; Combine the first-order neighboring patches and the second-order neighboring patches corresponding to the same vertex to obtain the patch pair corresponding to the vertex; Calculate the area of ​​the face pair corresponding to each vertex.

[0008] In one embodiment, the iterative mesh smoothing adjustment of the coordinates of each vertex according to the coordinate adjustment weight comprises: Get the coordinates of the adjacent points of the current vertex, where the current vertex is any vertex; Adjust the weight according to the coordinates of the adjacent points and the coordinates corresponding to the current vertex, and adjust the coordinates of the current vertex; Return to the step of obtaining the area of ​​the facet pair corresponding to each vertex in the triangular mesh model until a preset iteration stop condition is reached.

[0009] In one embodiment, the adjusting the weight according to the coordinates of the adjacent points and the coordinates corresponding to the current vertex, and adjusting the coordinates of the current vertex includes: Performing weighted summation on the coordinates of different adjacent points based on the coordinate adjustment weights to obtain a weighted summation result; Calculate the sum of the areas of all facet pairs corresponding to the current vertex to obtain the total area of ​​the facet pairs; The ratio of the weighted sum result to the total area of ​​the facets is calculated to obtain the adjusted coordinates of the current vertex.

[0010] In one embodiment, determining the coordinate adjustment weight corresponding to each vertex based on the average area of ​​the patch includes: The Mth power of the average area of ​​the patch is calculated to obtain the coordinate adjustment weight corresponding to each vertex, where M is a positive integer.

[0011] In one embodiment, M is a positive integer not less than 3.

[0012] In a second aspect, the present application also provides a triangular mesh model smoothing device. The device comprises: An area acquisition module is used to acquire the area of ​​a facet pair corresponding to each vertex in a triangular mesh model, where the facet pair includes a first-order neighbor facet and a corresponding second-order neighbor facet; An area average calculation module, used to calculate the average area of ​​the facets corresponding to each vertex according to the area of ​​the facet pairs; A weight determination module, used to determine the coordinate adjustment weight corresponding to each vertex based on the average area of ​​the facet; The iterative adjustment module is used to perform mesh smoothing iterative adjustment on the coordinates of each vertex according to the coordinate adjustment weight.

[0013] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program: Obtain the area of ​​the facet pair corresponding to each vertex in the triangular mesh model, where the facet pair includes a first-order neighbor facet and a corresponding second-order neighbor facet; According to the area of ​​the facet pairs, calculate the average area of ​​the facets corresponding to each vertex; Based on the average area of ​​the patch, determining a coordinate adjustment weight corresponding to each vertex; The coordinates of each vertex are iteratively adjusted for mesh smoothing according to the coordinate adjustment weight.

[0014] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented: Obtain the area of ​​the facet pair corresponding to each vertex in the triangular mesh model, where the facet pair includes a first-order neighbor facet and a corresponding second-order neighbor facet; According to the area of ​​the facet pairs, calculate the average area of ​​the facets corresponding to each vertex; Based on the average area of ​​the patch, determining a coordinate adjustment weight corresponding to each vertex; The coordinates of each vertex are iteratively adjusted for mesh smoothing according to the coordinate adjustment weight.

[0015] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented: Obtain the area of ​​the facet pair corresponding to each vertex in the triangular mesh model, where the facet pair includes a first-order neighbor facet and a corresponding second-order neighbor facet; According to the area of ​​the facet pairs, calculate the average area of ​​the facets corresponding to each vertex; Based on the average area of ​​the patch, determining a coordinate adjustment weight corresponding to each vertex; The coordinates of each vertex are iteratively adjusted for mesh smoothing according to the coordinate adjustment weight.

[0016] The above-mentioned triangular mesh model smoothing method, device, computer equipment, storage medium and computer program product obtain the area of ​​the patch pair corresponding to each vertex in the triangular mesh model, the patch pair includes a first-order neighbor patch and a corresponding second-order neighbor patch, and calculates the average area of ​​the patch corresponding to each vertex based on the patch pair area; determines the coordinate adjustment weight corresponding to each vertex based on the patch average area; and performs mesh smoothing iterative adjustment on the coordinates of each vertex based on the coordinate adjustment weight. In the whole process, the area smoothing of the second neighborhood is adopted to expand the area smoothing, which can make full use of the patch information of a larger area and realize mesh smoothing with more uniform density, so that a good smoothing effect can be achieved for the sharp parts of the mesh model. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a schematic diagram of the original triangular mesh model; Figure 2 This is a schematic diagram of a triangular mesh model after smoothing based on traditional technology; Figure 3 A diagram showing an application environment of a triangular mesh model smoothing method in an embodiment; Figure 4 A schematic diagram of a flow chart of a triangular mesh model smoothing method in one embodiment; Figure 5 A schematic diagram of a flow chart of a triangular mesh model smoothing method in another embodiment; Figure 6 It is a flowchart of a triangular mesh model smoothing method in a specific application example; Figure 7 A schematic diagram of a triangular mesh model after being processed by the triangular mesh model smoothing method of the present application; Figure 8 is a structural block diagram of a triangular mesh model smoothing device in one embodiment; Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0018] 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.

[0019] In order to explain in detail the technical solution of the triangular mesh model smoothing method of the present application and its significant differences from traditional technologies, the triangular mesh model and smoothing method in traditional technologies will be first introduced below.

[0020] like Figure 1As shown in the figure, there are some sharp points in the original triangular mesh model. The mesh density at these sharp points is high and the triangle area is relatively small. The mesh density at the flat area is less than that at the sharp area. Traditional smoothing cannot make the density of the sharp area tend to be uniform, and the smoothing effect cannot achieve the expected effect. The specific effect of smoothing is as follows: Figure 2 As shown. Figure 2 It can be found that there is still no good smoothing effect at the sharp points in the entire mesh model. In view of the above problems in the traditional technology, the embodiment of the present application provides a triangular mesh model smoothing method, which can be applied to Figure 3 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal 102 sends a triangular mesh model smoothing processing request to the server 104, and the server 104 responds to the request, obtains the area of ​​the facet pair corresponding to each vertex in the triangular mesh model, and the facet pair includes a first-order neighbor facet and a corresponding second-order neighbor facet. According to the facet pair area, the average area of ​​the facet corresponding to each vertex is calculated; based on the average area of ​​the facet, the coordinate adjustment weight corresponding to each vertex is determined; according to the coordinate adjustment weight, the coordinate of each vertex is adjusted iteratively for mesh smoothing. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0021] In one embodiment, Figure 4 As shown, a triangular mesh model smoothing method is provided, which is applied to Figure 3 Taking the server 104 in the example as an example, the following steps are included: S200: Obtaining the area of ​​a facet pair corresponding to each vertex in a triangular mesh model, where the facet pair includes a first-order neighbor facet and a corresponding second-order neighbor facet.

[0022] Here, a patch pair refers to a vertex's first-order neighbor patch and its corresponding second-order neighbor patch. The first-order neighbor patch is the triangle patch directly connected to the vertex, while the second-order neighbor patch is the triangle patch that shares an edge with the first-order neighbor patch (but is not directly connected to the vertex). Calculate the area of ​​these patch pairs corresponding to each vertex. This usually involves calculating the area of ​​the triangle, and standard triangle area formulas (such as Heron's formula or the vector cross product formula based on the vertex coordinates) can be used.

[0023] S400: Calculate the average area of ​​the patch corresponding to each vertex according to the area of ​​the patch pair.

[0024] After obtaining the area of ​​the facet pairs corresponding to each vertex, calculate the average of these facet areas. This average reflects the "average size" of the geometric shape around the vertex, which is useful for subsequent smoothing. Specifically, the average area can be calculated by first calculating the sum of the facet areas corresponding to each vertex, and then dividing the sum of the facet areas by the number of facets corresponding to the vertex. For example, if a vertex corresponds to 4 facet pairs, you can first calculate the sum of the areas of the 4 facet pairs, and then divide the sum of the areas by 4 to get the average area of ​​the facets corresponding to each vertex.

[0025] S600: Determine a coordinate adjustment weight corresponding to each vertex based on the average area of ​​the patch.

[0026] Based on the calculated average area of ​​the patch, a coordinate adjustment weight is determined for each vertex. This weight can be determined based on the size of the average area of ​​the patch. The purpose of the weight is to give different degrees of adjustment to different vertices during the smoothing process to preserve the detailed features of the model or achieve a specific smoothing effect. Further, the coordinate adjustment weight is positively correlated with the average area of ​​the patch corresponding to the vertex, that is, the larger the average area of ​​the patch, the greater the coordinate adjustment weight corresponding to the vertex.

[0027] S800: Perform mesh smoothing iterative adjustment on the coordinates of each vertex according to the coordinate adjustment weight.

[0028] Using the calculated coordinate adjustment weights, the coordinates of each vertex are iteratively adjusted. This typically involves moving the vertex position towards some "target position", which can be a weighted average position based on its neighboring vertices. The iterative process may need to be repeated many times until a satisfactory smoothing effect is achieved or some stopping condition is met (such as the vertex position change is less than a certain threshold).

[0029] The above triangular mesh model smoothing method obtains the area of ​​the patch pair corresponding to each vertex in the triangular mesh model. The patch pair includes the first-order neighbor patch and the corresponding second-order neighbor patch. According to the patch pair area, the average patch area corresponding to each vertex is calculated; based on the patch average area, the coordinate adjustment weight corresponding to each vertex is determined; according to the coordinate adjustment weight, the coordinates of each vertex are iteratively adjusted for mesh smoothing. In the whole process, the area smoothing of the second neighborhood is used to expand the area smoothing, which can make full use of the patch information of a larger area and realize mesh smoothing with more uniform density, so that a good smoothing effect can be achieved for the sharp parts of the mesh model.

[0030] like Figure 5 As shown, in one embodiment, S200 includes: S220: Obtain the first-order neighboring facets and the second-order neighboring facets corresponding to each vertex in the triangular mesh model.

[0031] For each vertex in the triangular mesh model, find all the triangular patches directly connected to the vertex. These patches constitute the first-order neighborhood of the vertex. Next, find the triangular patches that share edges with the first-order neighbor patches (but are not directly connected to the vertex). These patches constitute the second-order neighborhood of the vertex.

[0032] S240: Combine the first-order neighboring face patches and the second-order neighboring face patches corresponding to the same vertex to obtain a face patch pair corresponding to the vertex.

[0033] For each vertex, its first-order neighbor patches and second-order neighbor patches are combined to form a patch pair. Each patch pair consists of a first-order neighbor patch and a corresponding second-order neighbor patch. It should be noted that a vertex may correspond to multiple first-order neighbor patches and multiple second-order neighbor patches, thus forming multiple patch pairs. Each first-order neighbor patch f i0 Corresponding to a second-order neighborhood patch f i1 , forming a face pair ( f i0 , f i1 ).

[0034] S260: Calculate the area of ​​the face pair corresponding to each vertex.

[0035] For each pair of patches corresponding to each vertex, calculate its area. This usually involves calculating the area of ​​two triangles, namely the area of ​​the first-order neighbor patch and the area of ​​the second-order neighbor patch; the area can be calculated using a standard triangle area formula, such as Heron's formula or a vector cross product formula based on vertex coordinates. For each vertex P i The areas of the n face pairs obtained by (i=0, 1, …, m), where n is the number of face pairs corresponding to the current vertex i.

[0036] In one embodiment, performing mesh smoothing iterative adjustment on the coordinates of each vertex according to the coordinate adjustment weight includes: Get the coordinates of the adjacent points of the current vertex, where the current vertex is any vertex; adjust the weight according to the coordinates of the adjacent points and the coordinates corresponding to the current vertex, and adjust the coordinates of the current vertex; return to the step of obtaining the area of ​​the facet pair corresponding to each vertex in the triangular mesh model until the preset iteration stop condition is reached.

[0037] The same method is used to perform smooth iterative adjustment for any vertex in the triangular mesh model. Specifically, for any vertex in the triangular mesh model (called the current vertex), all vertices directly connected to it (called adjacent points) are found. The coordinates of these adjacent points will be used for subsequent calculations. A new coordinate position is calculated using the coordinates of the adjacent points of the current vertex and the coordinate adjustment weight corresponding to the current vertex. This new coordinate position may be a weighted average position based on the coordinates of the adjacent points, where the weight is determined by the average area of ​​the patch corresponding to the current vertex. The specific calculation method can be to multiply the coordinates of the adjacent points by the corresponding weights, and then weighted average to obtain the new coordinate position. After adjusting the coordinates of the current vertex, the algorithm returns to the step of obtaining the patch area corresponding to each vertex in the triangular mesh model. This means that the algorithm will recalculate the patch area, average patch area and coordinate adjustment weight of each vertex, and adjust the coordinates of each vertex again. This process will be iterated until the preset iteration stop condition is reached. The stop condition may include reaching the maximum number of iterations, the change in the vertex position is less than a certain threshold, or other indicators to measure whether the smoothing effect is satisfactory.

[0038] In one embodiment, the weight is adjusted according to the coordinates of the adjacent points and the coordinates corresponding to the current vertex, and adjusting the coordinates of the current vertex includes: Based on the coordinate adjustment weight, the coordinates of different adjacent points are weightedly summed to obtain the weighted sum result; the sum of the areas of all facet pairs corresponding to the current vertex is calculated to obtain the total area of ​​the facet pairs; the ratio of the weighted sum result to the total area of ​​the facet pairs is calculated to obtain the adjusted coordinates of the current vertex.

[0039] For the current vertex, find all its neighboring points and get the coordinates of these neighboring points. Adjust the weights according to the coordinates corresponding to the current vertex, and weight the coordinates of each neighboring point. This usually means multiplying the coordinates of each neighboring point by the corresponding weight (the weight reflects the importance of the neighboring point in the smoothing process of the current vertex). Sum up all the weighted neighboring point coordinates to get the weighted sum result. This result is a vector that represents the direction and distance that the current vertex may move during the smoothing process. Recalling the patch pair area corresponding to each vertex calculated previously, add up all the patch pair areas corresponding to the current vertex to get the sum of the patch pair areas. This sum reflects the "total size" or "complexity" of the geometry around the current vertex. Divide the weighted sum result by the sum of the patch pair areas to get a ratio. This ratio is actually a scaling factor used to adjust the weighted sum result (i.e., the moving direction and distance) to the appropriate scale. Add this ratio to the original coordinates of the current vertex (or in some implementations, it may be multiplied by a small learning rate or step size and then added to the original coordinates) to get the adjusted coordinates of the current vertex.

[0040] Furthermore, the specific formula for calculating the adjusted coordinates of the current vertex is:

[0041] in, represents the adjusted coordinates of the i-th vertex, Indicates the coordinate adjustment weight corresponding to vertex i, represents the second-order area of ​​the jth adjacent face of the ith vertex, Represents the coordinates of the jth adjacent point of the i-th vertex.

[0042] In one of the embodiments, determining the coordinate adjustment weight corresponding to each vertex based on the average area of ​​the patch includes: calculating the Mth power of the average area of ​​the patch to obtain the coordinate adjustment weight corresponding to each vertex, where M is a positive integer.

[0043] In this embodiment, the Mth power of the average area of ​​the patch is used as the coordinate adjustment weight corresponding to each vertex, so that the weight of the patch with a large area is increased to make the vertices more evenly distributed. Further, M can be a positive integer not less than 3, preferably, M can be 3, that is, the cube of the average area of ​​the patch is calculated here as the coordinate adjustment weight corresponding to the vertex.

[0044] In one specific application example, the triangular mesh model smoothing method of the present application specifically processes as follows: Figure 6 As shown, it specifically includes: 1. Obtain the first-order neighboring patches of each point in the three-dimensional grid, and then obtain the adjacent patches of each edge corresponding to the point to form a second-order patch; each first-order neighboring patch f i0 Corresponding to a second-order neighborhood patch f i1 , forming a face pair ( f i0 , f i1 ).

[0045] 2. Calculate vertex P i The areas of the n face pairs obtained by (i=0,...,m) are calculated, and the cube of the average area is taken as the weight, which is recorded as area ij (j=0,...,n).

[0046] 3. Calculate the coordinates of the adjusted vertices.

[0047]

[0048] in, represents the adjusted coordinates of the i-th vertex, Indicates the coordinate adjustment weight corresponding to vertex i, represents the second-order area of ​​the jth adjacent face of the ith vertex, Represents the coordinates of the jth adjacent point of the i-th vertex.

[0049] 4. Repeat multiple times. After the final iteration, the smoothing effect of the triangular mesh model is as follows: Figure 7 shown.

[0050] It should be understood that, although the steps in the flowcharts involved in the above 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 is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may 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 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.

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

[0052] In one embodiment, Figure 8 As shown, a triangular mesh model smoothing device is provided, comprising: An area acquisition module 200 is used to acquire the area of ​​a facet pair corresponding to each vertex in a triangular mesh model, where the facet pair includes a first-order neighbor facet and a corresponding second-order neighbor facet; The average area calculation module 400 is used to calculate the average area of ​​the facets corresponding to each vertex according to the area of ​​the facet pairs; A weight determination module 600, for determining a coordinate adjustment weight corresponding to each vertex based on the average area of ​​the patch; The iterative adjustment module 800 is used to perform mesh smoothing iterative adjustment on the coordinates of each vertex according to the coordinate adjustment weight.

[0053] In one embodiment, the area acquisition module 200 is also used to obtain the first-order neighborhood patches and second-order neighborhood patches corresponding to each vertex in the triangular mesh model; combine the first-order neighborhood patches and second-order neighborhood patches corresponding to the same vertex to obtain the patch pairs corresponding to the vertex; and calculate the area of ​​the patch pairs corresponding to each vertex.

[0054] In one embodiment, the iterative adjustment module 800 is also used to obtain the coordinates of the adjacent points of the current vertex, where the current vertex is any vertex; adjust the weight according to the coordinates of the adjacent points and the coordinates corresponding to the current vertex, and adjust the coordinates of the current vertex; return to the step of obtaining the area of ​​the facet pair corresponding to each vertex in the triangular mesh model until the preset iteration stop condition is reached.

[0055] In one embodiment, the iterative adjustment module 800 is also used to perform weighted summation on the coordinates of different adjacent points based on the coordinate adjustment weight to obtain a weighted summation result; calculate the sum of the areas of all facet pairs corresponding to the current vertex to obtain the total area of ​​the facet pairs; calculate the ratio of the weighted summation result to the total area of ​​the facet pairs to obtain the adjusted coordinates of the current vertex.

[0056] In one embodiment, the weight determination module 600 is further used to calculate the Mth power of the average area of ​​the patch to obtain the coordinate adjustment weight corresponding to each vertex, where M is a positive integer.

[0057] In one embodiment, M is a positive integer not less than 3.

[0058] Each module in the above triangular mesh model smoothing device can be implemented in whole or in part by software, hardware and 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 the operations corresponding to each module.

[0059] 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. 9 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, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store preset data. 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 triangular mesh model smoothing method is implemented.

[0060] Those skilled in the art will understand that Fig. 9 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.

[0061] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented: Obtain the area of ​​the facet pair corresponding to each vertex in the triangular mesh model, where the facet pair includes a first-order neighbor facet and a corresponding second-order neighbor facet; According to the area of ​​the facet pairs, calculate the average area of ​​the facets corresponding to each vertex; Based on the average area of ​​the patch, determine the coordinate adjustment weight corresponding to each vertex; Mesh smoothing iteratively adjusts the coordinates of each vertex according to the coordinate adjustment weights.

[0062] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: Obtain the first-order neighboring facets and second-order neighboring facets corresponding to each vertex in the triangular mesh model; combine the first-order neighboring facets and second-order neighboring facets corresponding to the same vertex to obtain the facet pairs corresponding to the vertex; calculate the area of ​​the facet pairs corresponding to each vertex.

[0063] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: Get the coordinates of the adjacent points of the current vertex, where the current vertex is any vertex; adjust the weight according to the coordinates of the adjacent points and the coordinates corresponding to the current vertex, and adjust the coordinates of the current vertex; return to the step of obtaining the area of ​​the facet pair corresponding to each vertex in the triangular mesh model until the preset iteration stop condition is reached.

[0064] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: Based on the coordinate adjustment weight, the coordinates of different adjacent points are weightedly summed to obtain the weighted sum result; the sum of the areas of all facet pairs corresponding to the current vertex is calculated to obtain the total area of ​​the facet pairs; the ratio of the weighted sum result to the total area of ​​the facet pairs is calculated to obtain the adjusted coordinates of the current vertex.

[0065] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: Calculate the Mth power of the average area of ​​the patch to obtain the coordinate adjustment weight corresponding to each vertex, where M is a positive integer.

[0066] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: Obtain the area of ​​the facet pair corresponding to each vertex in the triangular mesh model, where the facet pair includes a first-order neighbor facet and a corresponding second-order neighbor facet; According to the area of ​​the facet pairs, calculate the average area of ​​the facets corresponding to each vertex; Based on the average area of ​​the patch, determine the coordinate adjustment weight corresponding to each vertex; Mesh smoothing iteratively adjusts the coordinates of each vertex according to the coordinate adjustment weights.

[0067] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: Obtain the first-order neighboring facets and second-order neighboring facets corresponding to each vertex in the triangular mesh model; combine the first-order neighboring facets and second-order neighboring facets corresponding to the same vertex to obtain the facet pairs corresponding to the vertex; calculate the area of ​​the facet pairs corresponding to each vertex.

[0068] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: Get the coordinates of the adjacent points of the current vertex, where the current vertex is any vertex; adjust the weight according to the coordinates of the adjacent points and the coordinates corresponding to the current vertex, and adjust the coordinates of the current vertex; return to the step of obtaining the area of ​​the facet pair corresponding to each vertex in the triangular mesh model until the preset iteration stop condition is reached.

[0069] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: Based on the coordinate adjustment weight, the coordinates of different adjacent points are weightedly summed to obtain the weighted sum result; the sum of the areas of all facet pairs corresponding to the current vertex is calculated to obtain the total area of ​​the facet pairs; the ratio of the weighted sum result to the total area of ​​the facet pairs is calculated to obtain the adjusted coordinates of the current vertex.

[0070] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: Calculate the Mth power of the average area of ​​the patch to obtain the coordinate adjustment weight corresponding to each vertex, where M is a positive integer.

[0071] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps: In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: Obtain the area of ​​the facet pair corresponding to each vertex in the triangular mesh model, where the facet pair includes a first-order neighbor facet and a corresponding second-order neighbor facet; According to the area of ​​the facet pairs, calculate the average area of ​​the facets corresponding to each vertex; Based on the average area of ​​the patch, determine the coordinate adjustment weight corresponding to each vertex; Mesh smoothing iteratively adjusts the coordinates of each vertex according to the coordinate adjustment weights.

[0072] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: Obtain the first-order neighboring facets and second-order neighboring facets corresponding to each vertex in the triangular mesh model; combine the first-order neighboring facets and second-order neighboring facets corresponding to the same vertex to obtain the facet pairs corresponding to the vertex; calculate the area of ​​the facet pairs corresponding to each vertex.

[0073] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: Get the coordinates of the adjacent points of the current vertex, where the current vertex is any vertex; adjust the weight according to the coordinates of the adjacent points and the coordinates corresponding to the current vertex, and adjust the coordinates of the current vertex; return to the step of obtaining the area of ​​the facet pair corresponding to each vertex in the triangular mesh model until the preset iteration stop condition is reached.

[0074] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: Based on the coordinate adjustment weight, the coordinates of different adjacent points are weightedly summed to obtain the weighted sum result; the sum of the areas of all facet pairs corresponding to the current vertex is calculated to obtain the total area of ​​the facet pairs; the ratio of the weighted sum result to the total area of ​​the facet pairs is calculated to obtain the adjusted coordinates of the current vertex.

[0075] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: Calculate the Mth power of the average area of ​​the patch to obtain the coordinate adjustment weight corresponding to each vertex, where M is a positive integer.

[0076] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments 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 this 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.

[0077] 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.

[0078] The above 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 triangular mesh model smoothing method, characterized in that: The method comprises: Obtain the area of ​​the facet pair corresponding to each vertex in the triangular mesh model, where the facet pair includes a first-order neighbor facet and a corresponding second-order neighbor facet; According to the area of ​​the facet pairs, calculate the average area of ​​the facets corresponding to each vertex; Based on the average area of ​​the patch, determining a coordinate adjustment weight corresponding to each vertex; The coordinates of each vertex are iteratively adjusted for mesh smoothing according to the coordinate adjustment weight.

2. The method according to claim 1, characterized in that The step of obtaining the area of ​​the facet pair corresponding to each vertex in the triangular mesh model comprises: Get the first-order neighboring face and the second-order neighboring face corresponding to each vertex in the triangular mesh model; Combine the first-order neighboring patches and the second-order neighboring patches corresponding to the same vertex to obtain the patch pair corresponding to the vertex; Calculate the area of ​​the face pair corresponding to each vertex.

3. The method according to claim 1, characterized in that: The step of performing mesh smoothing iterative adjustment on the coordinates of each vertex according to the coordinate adjustment weight comprises: Get the coordinates of the adjacent points of the current vertex, where the current vertex is any vertex; Adjust the weight according to the coordinates of the adjacent points and the coordinates corresponding to the current vertex, and adjust the coordinates of the current vertex; Return to the step of obtaining the area of ​​the facet pair corresponding to each vertex in the triangular mesh model until a preset iteration stop condition is reached.

4. The method according to claim 3, characterized in that The step of adjusting the weight according to the coordinates of the adjacent points and the coordinates corresponding to the current vertex, and adjusting the coordinates of the current vertex includes: Performing weighted summation on the coordinates of different adjacent points based on the coordinate adjustment weights to obtain a weighted summation result; Calculate the sum of the areas of all facet pairs corresponding to the current vertex to obtain the total area of ​​the facet pairs; The ratio of the weighted sum result to the total area of ​​the facets is calculated to obtain the adjusted coordinates of the current vertex.

5. The method according to claim 1, characterized in that The determining the coordinate adjustment weight corresponding to each vertex based on the average area of ​​the facet includes: The Mth power of the average area of ​​the patch is calculated to obtain the coordinate adjustment weight corresponding to each vertex, where M is a positive integer.

6. The method according to claim 5, characterized in that The M is a positive integer not less than 3.

7. A triangular mesh model smoothing device, characterized in that: The device comprises: An area acquisition module is used to acquire the area of ​​a facet pair corresponding to each vertex in a triangular mesh model, where the facet pair includes a first-order neighbor facet and a corresponding second-order neighbor facet; An area average calculation module, used to calculate the average area of ​​the facets corresponding to each vertex according to the area of ​​the facet pairs; A weight determination module, used to determine the coordinate adjustment weight corresponding to each vertex based on the average area of ​​the facet; The iterative adjustment module is used to perform mesh smoothing iterative adjustment on the coordinates of each vertex according to the coordinate adjustment weight.

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

9. 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 6 are implemented.

10. 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 6 are implemented.