An implementation method for improving the digital model simplification effect of digital factories
By dividing the digital factory digital model into materials and removing redundant vertices, combined with the adaptive QEM mesh simplification algorithm and dictionary data structure, the problems of holes and excessive reduction in triangular mesh simplification are solved and better simplification is achieved. Effects and model shapes are preserved.
Patent Information
- Application Number
- CN202210162668.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-22
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-02-22
AI Technical Summary
Existing triangular mesh simplification algorithms are prone to holes when simplifying to a certain number of faces, and the same reduction ratio excessively reduces parts of the model with a small number of faces, resulting in poor simplification results.
By dividing the material of the model and removing redundant vertices, the adaptive QEM mesh simplification algorithm is used to automatically assign different reduction ratios according to the number of patches in each part of the model to avoid excessive reduction, and the dictionary data structure is used to merge the mesh data. Maintain model geometry.
It effectively avoids the appearance of holes, ensures the geometric integrity of the model and improves the simplification effect, and avoids excessive reduction of parts with a small number of patches.
Smart Images

Figure CN114549782B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of model processing, and in particular relates to an implementation method for improving the digital-analog simplification effect of a digital factory. Background Art
[0002] With the continuous development and application of computer technology, a large number of component models contain rich geometric information in computer-aided design. While making the models detailed and realistic, it also increases the computational pressure of model rendering simulation. Since a large number of geometric details are unnecessary in the simulation scene, these models need to be so-called lightweight.
[0003] Since most digital models are represented by triangular meshes, lightweighting is the simplification of triangular meshes. In theory, all existing triangular mesh simplification technologies can be used for lightweighting attempts. Generally speaking, mesh simplification technology allows simple meshes to approach the original complex mesh model, so that the number of triangular facets is reduced while the model still has a good display effect.
[0004] At present, when lightweighting a model, the mesh simplification method is based on a simplification algorithm that gradually reduces mesh vertices. Each time a vertex is deleted, the holes caused by the point are triangulated and deleted. There are usually two triangulation results for holes:
[0005] One method is that since the vertices of the simplified model are a subset of the vertices of the original model, the simplified model basically retains the original shape and corners, and does not deform too much. However, the algorithm is a bit cumbersome to execute, as it not only needs to classify the vertices and calculate the deformation error of each point, but also needs to triangulate the holes formed.
[0006] Another type of algorithm implements a strategy to simplify the mesh based on edge contraction, that is, by contracting an edge to achieve the effect of reducing points and faces. The contracted point can be a new vertex or an existing endpoint of the edge. This execution strategy eliminates the need for triangulation of holes, and the algorithm also changes from choosing which vertex to delete to choosing which edge to contract.
[0007] In the current triangular mesh simplification algorithm, whether deleting points or edges, the triangular face is reduced, and the polyhedron Euler theorem (number of vertices - number of edges + number of faces = 2) can still be satisfied after simplification. The selection of points or edges is based on error calculation, that is, the size of the deformation of the model after deleting the point or shrinking the edge. The calculation method varies according to the specific algorithm. The point or edge with the smallest error is selected for processing. After processing, the topological relationship of the mesh is adjusted, the error is recalculated, and the next round of operations is performed, and so on.
[0008] However, when the current mesh simplification algorithm is used for logarithmic model simplification, holes are likely to appear when the number of faces is simplified to a certain level. Summary of the invention
[0009] In view of the above technical problems, the present invention provides an implementation method for improving the digital model simplification effect of a digital factory, proposes an improvement strategy for mesh simplification during the implementation process, and improves the effect of digital model simplification.
[0010] The present invention is implemented by the following technical solutions:
[0011] An implementation method for improving the digital model simplification effect of a digital factory, comprising:
[0012] Obtain the overall model and reorganize the data of some models. In particular, the mesh data of some models are divided according to the same material, the mesh data of the same material are merged, and the redundant vertices in the mesh data are removed to obtain multiple reorganized meshes;
[0013] The mesh simplification technology is used to simplify each mesh of the partial model separately, and the adaptive method is used to simplify the whole model and the partial model.
[0014] As a further solution of the present invention, the mesh simplification technology is a QEM mesh simplification algorithm, which is used to simplify each mesh in a partial model. The method of simplification using the QEM mesh simplification algorithm is: adjusting the parameters of the QEM algorithm, based on the edge shrinkage algorithm of the QEM algorithm, shrinking an edge with the smallest error in each step, selecting one of the endpoints of the edge as the point after the edge is shrunk, and increasing the error weight of the mesh boundary edge.
[0015] As a further solution of the present invention, the adaptive simplification also includes counting the number of mesh facets of each partial model in the overall model, each time selecting the part with the largest number of facets and adaptively simplifying it according to the reduction ratio, and repeating the above reduction operation until the overall model reaches the number of facets required for simplification.
[0016] As a further solution of the present invention, before using the QEM mesh simplification algorithm to simplify each mesh in the partial model, it also includes reorganizing the mesh data to be merged with the help of a dictionary data structure; the mesh data structure uses a vertex list and a triangle list.
[0017] As a further solution of the present invention, vertices are input into the dictionary structure one by one, redundant vertices in the original vertex list are eliminated, the same vertices in the vertex lists of multiple mesh data structures are merged, the keys are sorted from small to large by value, and a new merged vertex list is output, in which the vertices are keys and the insertion order is the value.
[0018] As a further solution of the present invention, according to the output of the new merged vertex list, the triangle list to be merged is modified, and the modified triangle lists are combined into one list to obtain a new triangle list.
[0019] As a further solution of the present invention, a calculation method for automatically assigning different reduction ratios to various partial models of the overall model is: input the overall model, find the part with the largest number of faces, calculate the reduction ratio of the largest part, simplify the partial model according to the reduction ratio, and determine whether the reduction ratio of the overall model is reached. If the reduction ratio of the overall model is not reached, then re-find the part with the largest number of faces in the current overall model and simplify it. If the reduction ratio of the overall model is reached, the simplification of the model is terminated.
[0020] As a further solution of the present invention, when simplifying the partial model according to the reduction ratio, the mesh data is divided according to the material, the mesh data of the same material is merged, and the reorganized partial model is simplified.
[0021] As a further solution of the present invention, when simplifying the reorganized partial model, find the grid with the largest number of facets, calculate the reduction ratio of the grid, call the QEM grid simplification algorithm to simplify the grid according to the reduction ratio, and judge whether the reduction ratio of the partial model is reached. If the reduction ratio of the partial model is not reached, continue to find the grid with the largest number of current slices. If the reduction ratio of the partial model is reached, end.
[0022] As a further solution of the present invention, a method for adaptively simplifying a grid model comprises the following steps:
[0023] Step 1) Grid model Input grid model, given the total number of iterations N, parameter ε, initial reduction ratio R0 and unprocessed ratio p;
[0024] Step 2) If the mesh model has only one mesh, directly call the QEM simplification algorithm to simplify and end the output according to the given reduction ratio;
[0025] Step 3) If the number of iterations exceeds N, end; otherwise, find the grid with the largest number of faces;
[0026] Step 4) If the number of mesh model faces does not exceed p in the current total number of faces, p is adjusted down proportionally and the process goes to step 3); if it exceeds p, QEM is called to simplify according to the current reduction ratio and the number of reduced faces A is updated. k ;
[0027] Step 5) If A k =T*R0, end output;
[0028] Step 6) Update the current reduction ratio to R according to the update formula k+1 If R k+1 If it is less than ε, the output ends; otherwise, go to step 3).
[0029] The present invention also includes a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor loads and executes the computer program to implement the steps of an implementation method for improving the digital-analog simplification effect of a digital factory.
[0030] The present invention also includes a storage medium storing a computer program, which, when loaded and executed by a processor, implements the steps of the implementation method for improving the digital-analog simplification effect of a digital factory.
[0031] The technical solution provided by the present invention has the following beneficial effects:
[0032] The implementation method of the present invention for improving the simplification effect of digital models of digital factories divides partial models according to the same material and merges the grid data of the same material, and then uses an adaptive method to simplify each grid separately using the grid simplification technology. When simplifying the overall model, different reduction ratios are automatically allocated according to the different numbers of facets in each partial model, thereby avoiding excessive reduction and damage to the partial model with a small number of facets when using the same reduction ratio. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0034] Figure 1 The present invention is a flowchart of an implementation method for improving the digital-analog simplification effect of a digital factory according to an embodiment of the present invention.
[0035] Figure 2 This is a schematic diagram showing a list of points and surfaces in which the structure of grid data in an implementation method for improving the digital model simplification effect of a digital factory according to an embodiment of the present invention is represented.
[0036] Figure 3 It is a schematic diagram of de-duplication and merging of grid data sets in an implementation method for improving the digital model simplification effect of a digital factory according to an embodiment of the present invention.
[0037] Figure 4 The present invention is a flowchart of adaptive simplification in an implementation method for improving the digital-analog simplification effect of a digital factory according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention 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 invention and are not used to limit the present invention.
[0039] When the current mesh simplification algorithm is used to simplify the digital model of the embodiment, when the number of faces is simplified to a certain level, holes are prone to occur. The present invention provides an implementation method for improving the simplification effect of the digital model of a digital factory, which first reorganizes the data of the mesh model. The mesh model is divided according to the same material, the mesh data of the same material is merged, and the redundant vertices in the mesh data are removed to obtain multiple reorganized meshes, and then the mesh simplification technology is used to simplify each mesh separately. Compared with the current mesh simplification algorithm, this point is generally not paid attention to during the ordinary implementation process, resulting in redundant vertices in the mesh data, which is a major cause of holes.
[0040] In the present invention, a common QEM mesh simplification algorithm is adopted, and the parameters of the algorithm are set so that the points after the contraction edge are the endpoints of the original contraction edge. At the same time, the error weight of the mesh boundary edge is increased, so that the algorithm is not likely to choose to delete the mesh boundary, thereby better maintaining the model geometry.
[0041] In addition, when simplifying a mesh model containing multiple modules, each module is simplified using an automatically adjusted simplification ratio. That is, the number of mesh faces in each part of the model is counted, and each time the part with the largest number of faces is selected for simplification according to the reduction ratio. After the simplification is completed, the next round of the same operation is performed until the overall model reaches the required number of faces to be simplified.
[0042] This adaptive strategy can also be used when simplifying some models, such as dividing the mesh by material and then implementing this strategy.
[0043] Compared with the common implementation that does not divide the model and simplifies it at the same reduction ratio, our processing is equivalent to automatically assigning different reduction ratios to each module of the model while achieving the overall reduction goal, so that the parts with more facets are reduced more, and the parts with fewer facets are reduced less or not reduced, thereby avoiding excessive reduction of the parts with fewer facets and avoiding damage.
[0044] Specifically, the embodiments of the present application are further described below in conjunction with the accompanying drawings.
[0045] like Figure 1 As shown, an embodiment of the present invention provides an implementation method for improving the digital-analog simplification effect of a digital factory, the method comprising the following steps:
[0046] A mesh model is obtained, and data of a part of the model is reorganized, wherein the part of the model is divided according to the same material, mesh data of the same material is merged, and redundant vertices in the mesh data are removed to obtain a plurality of reorganized meshes.
[0047] The mesh simplification technology is used to simplify each mesh of the mesh model separately, and different reduction ratios are automatically assigned to each mesh of the mesh model for adaptive simplification.
[0048] In this embodiment, the QEM mesh simplification algorithm is used to simplify each part of the overall model respectively. The method of simplification using the QEM mesh simplification algorithm is: adjust the parameters of the QEM algorithm, based on the edge contraction algorithm of the QEM algorithm, contract an edge with the smallest error in each step, select one of the endpoints of the edge as the point after the edge is contracted, and increase the error weight of the mesh boundary edge.
[0049] When adjusting the parameters of the QEM algorithm, the QEM algorithm has multiple options for selecting the location of the point after contraction: it can be one of the endpoints of the contraction edge, it can be the calculated optimal point, and there are other options. Here we only choose the first method, because if we use the calculated optimal point, it may change the flat shape of the model in the factory.
[0050] In the embodiment of the present invention, when reducing each part of the overall model, the simplification ratio is automatically adjusted. For example, a model has 4 parts, and the number of faces in each part is (100, 200, 300, 400). Now an initial reduction ratio of 80% is given. If the number of faces reduced by simplifying each part on average is (80, 160, 240, 320). Now, 320 faces of the 400 part are reduced first, leaving 80. Now the number of faces to be reduced is 800-320=480. The reduction ratio is 480 / (100+200+300+80)=70.588%. Repeat the next round of simplification.
[0051] In this embodiment, adaptive simplification also includes counting the number of mesh facets in each partial model of the overall model, each time selecting the part with the largest number of facets and adaptively simplifying it according to the reduction ratio, and repeating the above reduction operation until the overall model reaches the number of facets required for simplification.
[0052] In this embodiment, before simplification, the number of facets in each part of the model is statistically sorted.
[0053] In one embodiment of the present invention, the parameters of the QEM algorithm are adjusted, because the QEM algorithm is a simplified algorithm based on edge contraction, and the algorithm contracts an edge with the smallest error in each step. The point after the edge contraction is made the end point of the edge, and the weight of the model boundary is increased to avoid deformation caused by the algorithm contraction of the boundary. Compared with directly letting the QEM algorithm select the optimal contraction point, the simplified model appearance effect generated in this way is more suitable for the model of the digital factory.
[0054] In this embodiment, before simplification using the QEM mesh simplification algorithm, the mesh data to be merged is reorganized with the help of a dictionary data structure; the mesh data structure uses a vertex list and a triangle list.
[0055] With the help of dictionary data structure, the grid data to be merged is reorganized. In this embodiment, see Figure 2 As shown, the mesh data structure uses a simple list of vertices and a list of triangles.
[0056] Using vertices as keys and insertion order as values, input a dictionary to remove redundant vertices from the original vertex list and merge the same vertices in the vertex lists of multiple mesh data structures. Finally, sort the keys from small to large by value and output a new merged vertex list. Modify the triangle list to be merged based on the new vertex list and combine them into a list to obtain a new triangle list.
[0057] If the same reduction ratio is uniformly applied to different parts of the model, the parts with a large number of faces will inevitably be under-simplified, while the parts with a small number of faces will be over-simplified, resulting in some small key parts being damaged and the overall simplification effect being poor.
[0058] In the present invention, an adaptive strategy is adopted to automatically adjust the reduction ratio of different parts of the model, and even different grids in each part of the model, to perform different degrees of simplification.
[0059] See also Figure 1 As shown, in one embodiment of the present invention, a calculation method for automatically assigning different reduction ratios to each partial model of the overall model is as follows: input the overall model, find the part with the largest number of facets, calculate the reduction ratio of the largest part, simplify the partial model according to the reduction ratio, and determine whether the reduction ratio of the overall model is reached. If the reduction ratio of the overall model is not reached, then re-find the part with the largest number of facets in the current overall model and simplify it. If the reduction ratio of the overall model is reached, then the simplification of the model is terminated.
[0060] When simplifying the part of the model according to the reduction ratio, the mesh data is divided according to the material, the mesh data of the same material is merged, and the reorganized part of the model is simplified.
[0061] When simplifying the reorganized part of the model, find the grid with the largest number of facets, calculate the reduction ratio of the grid, call the QEM grid simplification algorithm to simplify the grid according to the reduction ratio, and determine whether the reduction ratio of this part of the model is reached. If the reduction ratio of this part of the model is not reached, continue to find the grid with the largest number of current pieces. If the reduction ratio of this part of the model is reached, then end.
[0062] In one embodiment of the present invention, when merging mesh data of the same material, as described above, refer to Figure 2 As shown in the figure, the structure of a mesh data can be represented as a list of points and faces (V, T); V and T represent the data of vertices and triangular facets in the triangular mesh. Here, V stores the coordinate values of n vertices, and T stores the index values of the three vertices of m triangles in V, that is, the triangle f i is V(t i1 ),V(t i2 ),V(t i3 )These three vertices are connected by lines.
[0063] See also Figure 3 As shown in the figure, for the mesh data containing multiple different materials in the digital model, we use TS to represent a mesh data (V, T), and remove and merge the geometric data (V, T) of the TS objects belonging to the same material (Material) in the model to form a new geometric data (V * ,T * ). That is, assuming that for the mesh data set of the i-th material, there is |Ω i | elements, removing the overlap and merging them, can be represented as:
[0064] {TS ik |k∈Ω i}→TS i *
[0065] Specific steps:
[0066] 1. For a material's TS collection, initialize an empty dictionary.
[0067] 2. Enter the vertex list in the TS set into the dictionary one by one: the vertex is the key and the insertion order is the value.
[0068] 3. Based on the obtained dictionary, update the vertex index of each triangle in the triangle list of each TS to the corresponding value in the dictionary.
[0069] 4. Sort the vertices in the dictionary by value from small to large and output them to get a new vertex list.
[0070] 5. Merge the updated triangle lists in the TS set to get a new triangle list.
[0071] In one embodiment of the present invention, see Figure 4 As shown, the method for adaptively simplifying a grid model comprises the following steps:
[0072] Step 1) Grid model Input grid model, given the total number of iterations N, parameter ε, initial reduction ratio R0 and unprocessed ratio p;
[0073] Step 2) If the mesh model has only one mesh, directly call the QEM simplification algorithm to simplify and end the output according to the given reduction ratio;
[0074] Step 3) If the number of iterations exceeds N, end; otherwise, find the grid with the largest number of faces;
[0075] Step 4) If the number of mesh model faces does not exceed p in the current total number of faces, p is adjusted down proportionally and the process goes to step 3); if it exceeds p, QEM is called to simplify according to the current reduction ratio and the number of reduced faces A is updated. k ;
[0076] Step 5) If A k =T*R0, end output;
[0077] Step 6) Update the current reduction ratio to R according to the update formula k+1 If R k+1 If it is less than ε, the output ends; otherwise, go to step 3).
[0078] In this embodiment, if the total number of input model patches is T, the initial value of the target reduction ratio is R0, and the current cumulative number of reduced patches is A k , then:
[0079] Total number of patches to be reduced = T*R0, current number of patches = TA k ,
[0080] Current reduction ratio update formula:
[0081] R k+1 = Remaining reduction number / current number of faces = (T * R0 - A k ) / (TA k ).
[0082] In this embodiment, the ratio p is not processed in order to filter out the situation where the proportion of each part in the model is too small. Generally, models containing a large number of small parts will encounter this situation. Of course, there are also cases where the largest part has a small proportion, but there are still a large number of faces. In this case, a smaller p value can be set, or the number of iterations N can be increased to reduce p after several iterations. Therefore, the setting of p and the number of iterations allows the calculation process of this embodiment to process more models.
[0083] In one embodiment of the present invention, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0084] In one embodiment of the present invention, a storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0085] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented 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 memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory.
[0086] In summary, the implementation method of the present invention for improving the simplification effect of digital models of digital factories is to divide an overall mesh model according to the same material and merge the mesh data of the same material to obtain meshes of different materials, and then use mesh simplification technology to simplify each mesh separately. During simplification, different reduction ratios are automatically allocated according to the different numbers of facets in each part, thereby avoiding excessive reduction and damage to the parts with a small number of facets when using the same reduction ratio.
[0087] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An implementation method for improving the digital model simplification effect of a digital factory, comprising: The overall model is obtained, and data of a part of the model is reorganized, wherein the mesh data of the part of the model is divided according to the same material, the mesh data of the same material is merged, and redundant vertices in the mesh data are removed to obtain a plurality of reorganized meshes; The mesh simplification technology is used to simplify each mesh of the partial model separately, and the whole model and the partial model are simplified in an adaptive manner; The mesh simplification technology is the QEM mesh simplification algorithm. The QEM mesh simplification algorithm is used to simplify each mesh in the partial model. The simplification method using the QEM mesh simplification algorithm is as follows: adjusting the parameters of the QEM algorithm, based on the edge contraction algorithm of the QEM algorithm, contracting an edge with the smallest error in each step, selecting one of the endpoints of the edge as the point after the edge contraction, and increasing the error weight of the mesh boundary edge; Before using the QEM mesh simplification algorithm to simplify each mesh in the partial model, the method further includes reorganizing the mesh data to be merged by using a dictionary data structure; the mesh data structure uses a vertex list and a triangle list; Input the vertices into the dictionary structure one by one, remove the redundant vertices in the original vertex list, merge the same vertices in the vertex lists of multiple mesh data structures, sort the keys from small to large by value, and output a new merged vertex list, where the vertices are keys and the insertion order is the value; Output the new merged vertex list as described above, modify the triangle list to be merged, combine the modified triangle lists into one list, and obtain a new triangle list; The calculation method for automatically assigning different reduction ratios to each part of the overall model is as follows: input the overall model, find the part with the largest number of facets, calculate the reduction ratio of the largest part, simplify the part according to the reduction ratio, and determine whether the reduction ratio of the overall model is reached. If the reduction ratio of the overall model is not reached, then find the part with the largest number of facets in the current overall model again and simplify it. If the reduction ratio of the overall model is reached, then the simplification of the model is terminated. When simplifying the part of the model according to the reduction ratio, the mesh data is divided according to the material, the mesh data of the same material is merged, and the reorganized part of the model is simplified; When simplifying the reorganized part of the model, find the grid with the largest number of facets, calculate the reduction ratio of the grid, call the QEM grid simplification algorithm to simplify the grid according to the reduction ratio, and determine whether the reduction ratio of the part of the model is reached. If it is not reached, continue to find the grid with the largest number of facets. If it is reached, end; The method for adaptively simplifying a mesh model comprises the following steps: Step 1) Grid model Input grid model, given the total number of iterations N, parameter ε, initial reduction ratio R0 and unprocessed ratio p; Step 2) If the mesh model has only one mesh, directly call the QEM simplification algorithm to simplify and end the output according to the given reduction ratio; Step 3) If the number of iterations exceeds N, end; otherwise, find the grid with the largest number of faces; Step 4) If the number of mesh model faces does not exceed p in the current total number of faces, p is reduced proportionally and the process goes to step 3); if it exceeds p, QEM is called to simplify according to the current reduction ratio and the number of reduced faces A is updated. k ; Step 5) If A k =T*R0, end output; Step 6) Update the current reduction ratio to R according to the update formula k+1 If R k+1 Less than ε, end the output; otherwise, go to step 3); If the total number of input model faces is T, the initial value of the target reduction ratio is R0, and the current cumulative number of reduced faces is A k , then: Total number of patches to be reduced = T*R0, current number of patches = TA k , Current reduction ratio update formula: R k+1 =Remaining reduction number / current number of faces=(T*R0-A k ) / (TA k ).
2. The implementation method for improving the digital-analog simplification effect of a digital factory according to claim 1, characterized in that: When the adaptive simplification method is used, the number of mesh faces of each part of the overall model is counted, and each time the part with the largest number of faces is selected for adaptive simplification according to the reduction ratio, and the above reduction operation is repeated until the overall model reaches the required number of faces for simplification.
Citation Information
Patent Citations
Pervasive-terminal-oriented continuous and multi-resolution encoding method of three-dimensional grid model
CN102324107A
BIM-based mobile terminal building model rendering performance optimization method and system
CN104680572A
