A method for reducing the surface of three-dimensional models
By dynamically adjusting the collapse threshold and new vertex calculation method, the problems of broken surfaces, defects, deformation and feature loss in the 3D model are solved, and the effect of quickly displaying the 3D model in a conventional client hardware environment is achieved, and the effect of improving the Reduce surface speed and effect.
Patent Information
- Application Number
- CN202411312031.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-09-20
AI Technical Summary
The existing three-dimensional model surface reduction method is difficult to quickly display in conventional client hardware environments, and it is easy to cause problems such as surface breakage, defect, deformation and feature loss after simplification.
By traversing all edges of the three-dimensional model, sorting and establishing a set according to the reference coefficient, calculating the area after collapse of the vertex and the cost of surface reduction error, dynamically adjusting the collapse threshold, and using the new vertex calculation method to gradually perform surface reduction operations to ensure that feature loss is minimized And increase the surface reduction speed.
It effectively solves the problems of broken surfaces, defects, deformation and feature loss, and improves the speed and effect of surface reduction in three-dimensional models, especially in large models, which significantly improves the surface reduction speed, while taking into account both speed and effect.
Smart Images

Figure CN118840518B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of three-dimensional visualization, and in particular to a three-dimensional model surface reduction method. Background Art
[0002] With the widespread application of 3D visualization, virtual 3D models are increasingly used in various fields. However, how to quickly display 3D models and achieve timely interaction under conventional client hardware environment conditions has become one of the biggest constraints for further promotion and application of 3D visualization technology.
[0003] In the prior art, a Chinese invention patent document with publication number CN106504340A and publication date March 15, 2017 is proposed. The technical solution disclosed in the patent document is as follows: a polyhedron model face reduction method, using the volume change value caused by the collapse of the vertex to its adjacent vertices as the collapse degree value of the vertex (this value refers to the contour change value caused by this type of collapse, that is, the volume change value), and the smallest one among a series of collapse degree values calculated by the vertex collapsing to each adjacent vertex in turn is the contour contribution of the vertex. Those vertices with low influence are eliminated from the polyhedron until the purpose of face reduction is achieved.
[0004] The above technical solution may have the following problems during actual use: insufficient simplification, and surface breakage, surface loss, deformation, and feature loss may occur after simplification. Summary of the invention
[0005] In order to solve the above technical problems, the present invention proposes a three-dimensional model surface reduction method, which can minimize feature loss and solve the problems of broken surfaces, missing surfaces, deformation and feature loss that are prone to occur after simplification in the prior art.
[0006] The present invention is achieved by adopting the following technical solutions:
[0007] A three-dimensional model surface reduction method comprises the following steps:
[0008] Step S 1 . Traverse all the edges of the 3D model and sort them according to the reference coefficients to create a set :
[0009] ;
[0010] Step S 2 . Calculate all and sets middle The sum of the areas of the adjacent faces of two vertices ;
[0011] Step S 3 . Will The two vertices of , After collapse, a new vertex is obtained , and The connection relationship of the original vertex is transferred to the new vertex ;
[0012] Step S 4 . Calculation and new vertices The area of the adjacent faces gives ;
[0013] Step S 5 . Calculate the error cost of reducing the surface :
[0014] ;
[0015] Step S 6 . Subtract the error cost With collapse threshold For comparison, if , then cancel The model remains unchanged if , then collapse Two vertices of and generate a new vertex , the collapsed model replaces the original model;
[0016] Step S 7 . By Collection The order of the middle edge, continue to take the set Zhongyu The edges of adjacent faces without overlapping faces are 6 Based on the updated model, continue with step S 2 ~Step S 6 Method to reduce the number of faces until the set All edges in the image are reduced.
[0017] Also includes step S 8 , follow step S 1 ~Step S 7 The model is cyclically reduced until the number of cyclic reductions reaches times, or the model face reduction meets the required face reduction ratio .
[0018] The reference system The number is calculated as:
[0019]
[0020] In the formula, For the i The base coefficient of the edge, For the i The opening coefficient of the edge, For the i The length coefficient of the edge, For the i The angle coefficient of the edge.
[0021] The step S 6 In the collapse threshold The calculation method is:
[0022]
[0023] In the formula, n For the N The subtraction operation is repeated once. is the required reduction ratio, is the total number of surface reduction cycles, is the correction factor, No. N Sub-cycle collapse threshold adjustment factor.
[0024] New Vertex The method for determining is:
[0025]
[0026] In the formula, and For the new vertex The coordinates of , Vertex The coordinates of , Vertex The coordinates of Segment scale factor for new vertices.
[0027] Opening coefficient The calculation method is: If i If an edge belongs to and only belongs to one face, then the edge is an open edge. ; If the edge is not an open edge, then .
[0028] Length factor The calculation method is:
[0029]
[0030] In the formula, is the base length, i.e. the set The length of the longest side of For thei The length of the edge.
[0031] Angle coefficient The calculation method is:
[0032]
[0033] In the formula, For the i The angle between an edge and the normals of all adjacent faces.
[0034] The collection The establishment method includes the following steps:
[0035] Step S 11 . Traverse all edges of the 3D model and store them randomly in a newly created collection middle;
[0036] Step S 12 . For collections All edges in , calculate the base coefficients of all edges ;
[0037] Step S 13 . Set All edges in Rearrange the set from small to large .
[0038] The step S 8 middle The method for determining is:
[0039] ;
[0040] For the calculated Round up; when hour, The value of is 50; when , The value is 200.
[0041] In step S 1 In the first traversal of all edges of the model, if the model has symmetry, the symmetric edges will be marked, and the face reduction operation will be performed on the symmetric edges at the same time; if the model has rotation characteristics, the rotated edges will be marked, and the marked rotated edges will be directly skipped during the face reduction operation.
[0042] In the process of reducing the surface, according to the collection The order in which the edges are arranged is used to reduce the faces.
[0043] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0044] 1. Since the face reduction of the model does not have the commutative law, that is, for the same edge, the effects of pre-processing and post-processing are different. Therefore, based on the reference coefficient, the present invention dynamically calculates the face reduction ratio before and after the model processing, realizes the face reduction strategy of sorting and classifying all edges of the model, highlighting the key points, and reducing the easy first and then the difficult, that is, first reducing the faces with small feature impact, then reducing the faces with large feature impact, and not reducing the important faces, so as to ensure the effect and speed of face reduction to the greatest extent, and solve the problems of broken faces, missing faces, deformation and feature loss after simplification in the prior art.
[0045] 2. The present invention comprehensively considers the number of faces of the model, the face reduction requirements and the number of face reduction cycles, and adopts a dynamic collapse threshold method to reduce the number of invalid face reduction cycles and improve the face reduction speed. Especially for large three-dimensional models, the face reduction speed improvement effect is particularly obvious. In addition, through the improved collapse threshold calculation method, both speed and face reduction effect can be taken into account.
[0046] 3. In addition to considering the characteristics of the model itself, the present invention also focuses on the physical properties of the model. For example, for symmetrical edges, multiple edges can be processed at the same time; for rotated or important edges, early locking can skip the processing of these edges, which can not only increase the speed of surface reduction but also maximize the effect of surface reduction.
[0047] 4. In this application, through the new vertex The calculation method can maximize the inheritance of vertices and The characteristics of the proposed method lay the foundation for reducing feature loss. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments, wherein:
[0049] Figure 1 is a schematic diagram of the model in the present invention;
[0050] Figure 2 It is a schematic diagram of the model after surface reduction in the present invention. DETAILED DESCRIPTION
[0051] Example 1
[0052] As a basic implementation mode of the present invention, the present invention includes a three-dimensional model surface reduction method, comprising the following steps:
[0053] Step S 1 . Traverse all the edges of the 3D model and sort them according to the reference coefficient to create a set :
[0054] .
[0055] Step S 2 . Calculate all and sets middle The sum of the areas of the adjacent faces of two vertices .
[0056] Step S 3 . Will The two vertices of , After collapse, a new vertex is obtained , and The connection relationship of the original vertex is transferred to the new vertex .
[0057] Step S 4 . Calculation and new vertices The area of the adjacent faces gives .
[0058] Step S 5 . Calculate the error cost of reducing the surface :
[0059] .
[0060] Step S 6 . Subtract the error cost With collapse threshold For comparison, if , then cancel The model remains unchanged if , then collapse Two vertices of and generate new vertices , the collapsed model replaces the original model.
[0061] Step S 7 . By Collection The order of the middle edge, continue to take the set Zhongyu The edges of adjacent faces without overlapping faces are 6 Based on the updated model, continue with step S 2 ~Step S 6 Method to reduce the number of faces until the set All the edges in the image are reduced, completing a cycle of reducing the surface.
[0062] Example 2
[0063] As a preferred embodiment of the present invention, this embodiment further refines, supplements and explains the technical solution of the present invention on the basis of Embodiment 1. In this embodiment, step S 8 , that is, according to step S in Example 1 1 ~Step S 7 The model is tested a second, third, and so on. N Repeat the face reduction operation until the number of face reduction cycles reaches times, or the model face reduction meets the required face reduction ratio .
[0064] Example 3
[0065] As a preferred embodiment of the present invention, this embodiment further refines, supplements and explains the technical solution of the present invention on the basis of Embodiment 1 or Embodiment 2. The establishment method includes the following steps:
[0066] Step S 11 . Traverse all edges of the 3D model and store them randomly in a newly created collection middle.
[0067] Step S 12 . For collections Calculate the base coefficients of all edges in :
[0068]
[0069] In the formula, For the i The base coefficient of the edge, For the i The opening coefficient of the edge, For the i The length coefficient of the edge, For the i The angle coefficient of the edge; is the base length, i.e. the set The length of the longest side of For the i The length of the strip edge; For the i The angle between an edge and the normals of all adjacent faces.
[0070] Jordi i If an edge belongs to and only belongs to one face, then the edge is an open edge. ; If the edge is not an open edge, then .
[0071] Step S13 . Set All edges in Rearrange the set from small to large , .
[0072] Based on the above method, the collection When performing the face reduction operation, first follow the set Select the edges in the order of arrangement in the , that is, when the face reduction operation is performed for the first time, first select the set In .
[0073] Example 4
[0074] As a preferred implementation mode of the present invention, this embodiment further refines, supplements and explains the technical solution of the present invention on the basis of any one of Embodiments 1 to 3.
[0075] In the present invention, the new vertex Can be located at the vertex and In order to maximize the number of inherited vertices, and vertices The characteristics of the new vertex lay the foundation for reducing feature loss. The determination method can be:
[0076]
[0077] In the formula, and For the new vertex The coordinates of , Vertex The coordinates of , Vertex The coordinates of . It is the new vertex segment scale factor, which is taken from the database formed by project experience.
[0078] Example 5
[0079] As a preferred embodiment of the present invention, this embodiment further refines, supplements and explains the technical solution of the present invention on the basis of any one of Embodiments 1 to 4. There are many methods to calculate the collapse threshold, the most commonly used is to calculate by area ratio and volume ratio. In the present invention, in order to take into account both speed and surface reduction effect, the collapse threshold is The calculation method of the collapse threshold is improved. The calculation method can be:
[0080]
[0081] In the formula, n For the N The subtraction operation is repeated once. is the required reduction ratio, is the total number of surface reduction cycles, is the correction factor, No. N Sub-cycle collapse threshold adjustment factor.
[0082] Example 6
[0083] As a preferred implementation mode of the present invention, this embodiment further refines, supplements and explains the technical solution of the present invention on the basis of any one of Embodiments 1 to 5.
[0084] In the present invention, Methods for determining include:
[0085] calculate :
[0086] ;
[0087] For the calculated To round: hour, The value of is 50; when , The value of is 200; when Between 50 and 200, is the value obtained and rounded according to the above calculation method.
[0088] Example 7
[0089] As another preferred embodiment of the present invention, this embodiment further refines, supplements and elaborates the technical solution of the present invention on the basis of any one of Embodiments 1 to 6. In order to increase the speed of face reduction and to maintain the effect of face reduction to the greatest extent. When traversing all edges of the model for the first time, if the model has symmetry characteristics, the symmetric edges are marked, and the face reduction operation is performed on the symmetric edges at the same time when the face reduction operation is performed; if the model has rotation characteristics, the rotated edges are marked, and the marked rotated edges are directly skipped when the face reduction operation is performed.
[0090] Example 8
[0091] As the best embodiment of the present invention, the present invention includes a three-dimensional model surface reduction method, comprising the following steps:
[0092] Step S 1 . Traverse all the edges of the 3D model and sort them according to the reference coefficients to create a set : Among them, when all edges of the model are traversed for the first time, the edges that meet specific conditions are marked in combination with the application field and physical characteristics of the 3D model. If the model has symmetry characteristics, the symmetric edges are marked, and the face reduction operation can be performed on the symmetric edges at the same time. If the model has rotation characteristics, the rotated edges are marked, and these edges are directly skipped during the face reduction operation, that is, the face reduction operation is not performed on the rotated edges.
[0093] The collection The establishment method includes the following steps:
[0094] Step S 11 . Traverse all edges of the 3D model and store them randomly in a newly created collection middle;
[0095] Step S 12 . For all edges in the set, calculate the base coefficients of all edges ;
[0096]
[0097] In the formula, For the i The base coefficient of the edge, For the i The opening coefficient of the edge, For the i The length coefficient of the edge, For the i The angle coefficient of the edge.
[0098] Among them, the opening coefficient , i If an edge belongs to and only belongs to one face, then the edge is an open edge. ; If the edge is not an open edge, then .
[0099] About the length factor , take the set The longest side in is the base length ,but
[0100]
[0101] In the formula, is the base length, i.e. the set or Collection The length of the longest side of For the i The length of the edge.
[0102] About the angle coefficient , which is calculated as:
[0103]
[0104] In the formula, For the i The angle between an edge and the normals of all adjacent faces, Pick The minimum value in .
[0105] Step S 13 . Set All edges in Rearrange the set from small to large .
[0106] Step S 2 . Perform the first round of face reduction operation on the model. Calculate all the sets middle The sum of the areas of the adjacent faces of two vertices In this embodiment, first take the set The first edge in , calculate all The sum of the areas of the adjacent faces of a vertex .
[0107] Step S 3 . Refer to the instruction manual Figure 1 And the instruction manual Figure 2 ,Will The two vertices of , After collapse, a new vertex is obtained , and The connection relationship of the original vertex is transferred to the new vertex .
[0108] Among them, the new vertex The method for determining is:
[0109]
[0110] In the formula, and For the new vertex The coordinates of , Vertex The coordinates of , Vertex The coordinates of is the new vertex segment ratio coefficient, which is taken from the database formed by project experience. The new vertex calculated using this method , which can maximize inheritance and The characteristics of the proposed method lay the foundation for reducing feature loss.
[0111] Step S 4 . Calculation and new vertices The area of the adjacent faces gives .
[0112] Step S 5 . Calculate the error cost of reducing the surface :
[0113]
[0114] Step S 6 . Subtract the error cost The collapse threshold of the first cycle For comparison, if , then cancel The model remains unchanged if , then collapse Two vertices of and generate new vertices , the collapsed model replaces the original model.
[0115] The collapse threshold The calculation method is:
[0116]
[0117] in, The value of can be determined according to the number of model faces, and the specific value can be shown in the following Table 1:
[0118] Table 1
[0119]
[0120] The value of can also be determined according to the number of model faces, and the specific value can be shown in the following Table 2:
[0121] Table 2
[0122]
[0123] Step S 7 . By Collection The order of the middle edges, that is, continue to take the set Zhongyu The edges of adjacent faces without overlapping faces and in the first order are in step S 6 Based on the updated model, continue with step S 2 ~Step S 6 Method to reduce the number of faces until the set All the edges in the model are reduced once, completing the first cycle of reducing the surface of the model.
[0124] Step S 8 , on the model after the first cycle of surface reduction, follow step S 1 ~Step S 7 The method is to perform a cyclic reduction operation on the model, that is, to sort all the edges in the model after the first cyclic reduction operation according to the reference coefficient, and establish a set Using the same method as the first loop reduction operation, the set The face reduction operation is performed only once on all edges in the model, thus completing the second face reduction operation on the model.
[0125] Among them, the collapse threshold of the second cycle reduction operation is The calculation method is:
[0126]
[0127] In the formula, is the required reduction ratio, is the total number of surface reduction cycles, is the correction factor, No. N Sub-cycle collapse threshold adjustment factor.
[0128] Until the number of times of surface reduction reaches times, or the model face reduction meets the required face reduction ratio , the face reduction operation is completed. n When greater than 1, the collapse threshold of the nth loop reduction operation The calculation method is:
[0129]
[0130] In the formula, n For the N The subtraction operation is repeated once. is the required reduction ratio, is the total number of surface reduction cycles, is the correction factor, No. N Sub-cycle collapse threshold adjustment factor.
[0131] in,
[0132] According to the rounding method, Perform rounding operation.
[0133] when hour, The value of is 50; when , The value is 200.
[0134] In summary, after reading the present invention document, ordinary technicians in this field can make various other corresponding transformation schemes based on the technical scheme and technical concept of the present invention without creative mental labor, which all fall within the scope of protection of the present invention.
Claims
1. A three-dimensional model surface reduction method, characterized in that: The following steps are involved: Step S1. Traverse all edges of the 3D model and sort them according to the reference coefficients to create a set : ; Step S2. Calculate all and sets middle The sum of the areas of the adjacent faces of two vertices ; Step S3. The two vertices of , After collapse, a new vertex is obtained , and The connection relationship of the original vertex is transferred to the new vertex ; Step S4. Calculate and new vertex The area of the adjacent faces gives ; Step S5. Calculate the face reduction error cost : ; Step S6. Subtract the face error cost With collapse threshold For comparison, if , then cancel The model remains unchanged if , then collapse Two vertices of and generate a new vertex , the collapsed model replaces the original model; Step S7. Press Set The order of the middle edge, continue to take the set Zhongyu For the edges of adjacent faces without overlapping faces, based on the model updated in step S6, continue to reduce the faces according to the method of steps S2 to S6 until the set All edges in the are subjected to face reduction operation; The calculation method of the reference coefficient is: In the formula, For the i The base coefficient of the edge, For the i The opening coefficient of the edge, For the i The length coefficient of the edge, For the i The angle coefficient of the edge; In step S6, the collapse threshold The calculation method is: In the formula, n For the N The subtraction operation is repeated once. is the required reduction ratio, is the total number of surface reduction cycles, is the correction factor, No. N Sub-cycle collapse threshold adjustment factor.
2. A three-dimensional model surface reduction method according to claim 1, characterized in that: The method further includes step S8, wherein the model is subjected to a cyclic surface reduction operation according to the method of steps S1 to S7 until the number of cyclic surface reductions reaches times, or the model face reduction meets the required face reduction ratio .
3. A three-dimensional model surface reduction method according to claim 1 or 2, characterized in that: New Vertex The method to determine is: In the formula, and are the coordinates of the new vertex, , Vertex The coordinates of , Vertex The coordinates of Segment scale factor for new vertices.
4. A three-dimensional model surface reduction method according to claim 1, characterized in that: Opening coefficient The calculation method is: If i If an edge belongs to and only belongs to one face, then the edge is an open edge. ; If the edge is not an open edge, then .
5. A three-dimensional model surface reduction method according to claim 1, characterized in that: Length factor The calculation method is: In the formula, is the base length, i.e. the set The length of the longest side of For the i The length of the edge.
6. A three-dimensional model surface reduction method according to claim 1, characterized in that: Angle coefficient The calculation method is: In the formula, For the i The angle between an edge and the normals of all adjacent faces.
7. A three-dimensional model surface reduction method according to claim 1, characterized in that: The collection The establishment method includes the following steps: Step S 11 . Traverse all edges of the 3D model and store them randomly in a newly created collection middle; Step S 12 . For collections All edges in , calculate the base coefficients of all edges ; Step S 13 . Set All edges in Rearrange the set from small to large .
8. A three-dimensional model surface reduction method according to claim 2, characterized in that: In step S8 The method to determine is: ; For the calculated To round: hour, The value of is 50; when , The value is 200.
9. A three-dimensional model surface reduction method according to claim 1, characterized in that: In step S1, when all edges of the model are traversed for the first time, if the model has symmetry characteristics, the symmetric edges are marked, and the face reduction operation is performed on the symmetric edges at the same time; if the model has rotation characteristics, the rotated edges are marked, and the marked rotated edges are directly skipped during the face reduction operation.
10. A three-dimensional model surface reduction method according to claim 1, characterized in that: In the process of reducing the surface, according to the collection The order in which the edges are arranged is used to reduce the faces.
Citation Information
Patent Citations
Polyhedron model reduction method
CN106504340A
Surface number reduction method and device, and display device
CN106846487A
