Model simplification method, apparatus, device, and storage medium
By identifying and updating the cost value of the initial edges and the associated plane set of the 3D model, the problem of reverse faces during the 3D model simplification process is solved, and the visual effect is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-16
- Publication Date
- 2026-03-27
AI Technical Summary
Existing 3D model simplification methods are prone to producing reversed surfaces during the reduction of surfaces, resulting in a black and white intermingling effect on the surface and affecting the visual effect.
By obtaining the original cost value of the initial edge and the associated plane set, calculating the update parameters, determining the update value and cost value, identifying and avoiding reverse faces, redefining the target shrinking edge for shrinking, and obtaining the target simplified model.
This effectively avoids the reverse face problem during the model simplification process and improves the visual experience.
Smart Images

Figure CN115690328B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of Internet, and particularly relates to a model simplification method and device, equipment and a storage medium. BACKGROUND
[0002] With the continuous development of computer hardware and software technology, the continuous popularization of augmented reality, virtual reality and mixed reality, the demand for three-dimensional modeling in the industrial Internet industry is increasing exponentially, and the structure of industrial three-dimensional models is becoming increasingly complex. In actual application process, there is a certain requirement for the processing speed of three-dimensional models, and when the structure of three-dimensional models is relatively complex, the processing speed of three-dimensional models will be limited. Therefore, it is necessary to simplify the three-dimensional model.
[0003] However, the method for simplifying the three-dimensional model currently has the problem of reverse face (the normal vector of the face is less than 0) in the process of facet reduction of the three-dimensional model, which further leads to the phenomenon of black and white surfaces in the final result display. SUMMARY
[0004] The present application aims to at least solve one of the technical problems in the related art. To this end, one object of the present application is to provide a model simplification method, device, equipment and storage medium.
[0005] In order to solve the above technical problems, the embodiments of the present application provide the following technical solutions:
[0006] A model simplification method, comprising:
[0007] obtaining an original model and calculating the original generation value of each initial edge in the original model;
[0008] obtaining a plane set associated with each initial edge and calculating the update parameter of each initial edge based on the plane set;
[0009] determining the update value of each initial edge based on the update parameter of each initial edge, and updating the original generation value of each initial edge based on the update value of each initial edge to obtain the update generation value of each initial edge;
[0010] determining a target edge to be shrunk based on the update generation value of each initial edge in the original model, and shrinking the target edge to be shrunk to obtain a target simplified model.
[0011] Optionally, the obtaining a plane set associated with each initial edge and calculating the update parameter of each initial edge based on the plane set comprises:
[0012] obtaining a first vertex and a second vertex of each of the initial edges;
[0013] obtaining a first sub-plane set connected with the first vertex based on the first vertex of each of the initial edges; wherein the plane set comprises a first sub-plane set and a second sub-plane set; the first sub-plane set comprises a plurality of first sub-planes; obtaining the second sub-plane set connected with the second vertex based on the second vertex; wherein the second sub-plane set comprises a plurality of second sub-planes;
[0014] calculating a plurality of the first sub-planes associated with each of the initial edges to obtain a first sub-update parameter of each of the initial edges; calculating a plurality of the second sub-planes associated with each of the initial edges to obtain a second sub-update parameter of each of the initial edges;
[0015] obtaining the update parameter of each of the initial edges based on the first sub-update parameter and the second sub-update parameter of each of the initial edges.
[0016] Optionally, the calculating a plurality of the first sub-planes associated with each of the initial edges to obtain a first sub-update parameter of each of the initial edges; calculating a plurality of the second sub-planes associated with each of the initial edges to obtain a second sub-update parameter of each of the initial edges, comprises:
[0017] calculating any two of the first sub-planes in the first sub-plane set associated with each of the initial edges to obtain a plurality of first calculation results of each of the initial edges; calculating the first sub-update parameter of each of the initial edges according to a plurality of the first calculation results of each of the initial edges;
[0018] calculating any two of the second sub-planes in the second sub-plane set associated with each of the initial edges to obtain a plurality of second calculation results of each of the initial edges; calculating the second sub-update parameter of each of the initial edges according to a plurality of the second calculation results of each of the initial edges.
[0019] Optionally, the determining an update value of each of the initial edges based on the update parameter of each of the initial edges comprises:
[0020] comparing the update parameter of each of the initial edges with a preset threshold; wherein the preset threshold comprises a first sub-pre-set threshold, a second sub-pre-set threshold and a third sub-pre-set threshold; the update value comprises any one of a first sub-update value, a second sub-update value and a third sub-update value;
[0021] when the update parameter of the initial edge is equal to the first sub-pre-set threshold, the first sub-update value is obtained; or
[0022] when the update parameter of the initial edge is equal to the second sub preset threshold, a second sub update value is obtained; or
[0023] when the update parameter of the initial edge is greater than or equal to the third sub preset threshold, a third sub update value is obtained.
[0024] Optionally, the second sub update value of the initial edge is obtained by:
[0025] determining a reference edge of the initial edge based on the original model;
[0026] obtaining an intersection point of the initial edge and the reference edge, and determining the intersection point as a target contraction point of the initial edge;
[0027] calculating the second sub update value of the initial edge according to the target contraction point.
[0028] Optionally, the original objective value of each initial edge is updated based on the update value of each initial edge to obtain an update objective value of each initial edge, including:
[0029] a first sub update objective value is obtained based on the first sub update value and the original objective value; wherein the update objective value includes any one of a first sub update objective value, a second sub update objective value and a third sub update objective value; or
[0030] a second sub update objective value is obtained based on the second sub update value and the original objective value; or
[0031] a third sub update objective value is obtained based on the third sub update value and the original objective value.
[0032] Optionally, the target contraction edge is determined according to the update objective value of each initial edge in the original model, including:
[0033] comparing the update objective value of each initial edge with an objective value threshold;
[0034] if the update objective value is less than the objective value threshold, the initial edge corresponding to the update objective value is determined as a candidate edge;
[0035] a target contraction edge is determined based on the update objective value of a plurality of candidate edges, and the target contraction edge is contracted to obtain the target simplified model.
[0036] Embodiments of the present application also provide a model simplification device, including:
[0037] The first calculation module is configured to obtain an original model and calculate an original generation value of each initial edge in the original model.
[0038] The second calculation module is configured to obtain a plane set associated with each initial edge and calculate an update parameter of each initial edge based on the plane set.
[0039] The update module is configured to determine an update value of each initial edge based on the update parameter of each initial edge and update the original generation value of each initial edge based on the update value of each initial edge to obtain an updated generation value of each initial edge.
[0040] The simplification module is configured to determine a target edge to be shrunk based on the updated generation value of each initial edge in the original model and shrink the target edge to be shrunk to obtain a target simplified model.
[0041] Embodiments of the present application also provide an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and the processor implements the method as described above when executing the computer program.
[0042] Embodiments of the present application also provide a computer readable storage medium, including a stored computer program, wherein the computer readable storage medium controls a device where the computer readable storage medium is located to execute the method as described above when the computer program runs.
[0043] Embodiments of the present application have the following technical effects:
[0044] The above technical solutions of the present application pre-identify the reverse face appearing in the edge shrinking process, update the original generation value of each initial edge of the original model before edge shrinking, re-determine the target edge to be shrunk based on the updated generation value of each initial edge, and shrink the target edge to be shrunk to obtain the target simplified model, thereby solving the problem of the reverse face appearing in the model simplification process.
[0045] Additional aspects and advantages of the present application will be in part apparent and in part pointed out hereinafter. BRIEF DESCRIPTION OF DRAWINGS
[0046] Figure 1 is a flowchart of a model simplification method provided by an embodiment of the present application;
[0047] Figure 2 is an example of determining an original shrink point provided by an embodiment of the present application;
[0048] Figure 3is an example of the reverse surface provided by the embodiment of the present application;
[0049] Figure 4 is an example of determining the target shrinkage point provided by the embodiment of the present application;
[0050] Figure 5 is an example of the target simplified model provided by the embodiment of the present application. DETAILED DESCRIPTION
[0051] The embodiments of the present application are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar notations represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are intended to explain the present application, and cannot be understood as a limitation of the present application.
[0052] In order to facilitate the understanding of the embodiments by those skilled in the art, some terms are explained:
[0053] QEM: Quadic Error Metrics, mesh simplification, is an optimization algorithm based on quadratic metric error.
[0054] As shown in Figure 1 The embodiment of the present application provides a model simplification method, comprising:
[0055] Step S11: obtaining an original model and calculating the original generation value of each initial edge in the original model;
[0056] The embodiment of the present application, after obtaining the original model, calculates the original generation value of each initial edge in the original model based on the QEM algorithm.
[0057] Specifically, the coordinate vector V1 of the first vertex and the coordinate vector V2 of the second vertex of each initial edge are obtained;
[0058] Since the first vertex of each initial edge is adjacent to n (n is a positive integer) planes, that is, connected as a vertex of a certain plane, the distance from the first vertex to each plane is calculated, and then the first sum of squares of the first vertex to multiple planes is calculated;
[0059] The coordinate vector V1 of the first vertex and the first sum of squares are calculated based on the QEM algorithm to obtain the first cost matrix Q1 corresponding to the first vertex;
[0060] Similarly, the coordinate vector V2 of the second vertex and the second sum of squares are calculated based on the QEM algorithm to obtain the second cost matrix Q2 corresponding to the second vertex;
[0061] Then the original generation value P of each initial edge is RT (Q1+Q2)*R;
[0062] In the formula, R is a coordinate vector of an original shrinkage point obtained after an initial edge is shrunk based on the prior art, and when the value of P is minimum, the coordinate vector of R can be obtained, and thus the original generation value of each initial edge can be obtained.
[0063] However, based on the above method, the coordinate vector of R determined may have a reverse face problem in subsequent edge shrinking. In order to solve the existing reverse face problem, the following technical scheme is proposed.
[0064] Step S12: obtaining a plane set associated with each initial edge, and calculating the plane set to obtain an update parameter of each initial edge;
[0065] In an optional embodiment of the present application, the obtaining of the plane set associated with each initial edge and the calculation of the plane set to obtain the update parameter of each initial edge comprises:
[0066] obtaining a first vertex and a second vertex of each initial edge;
[0067] obtaining a first sub-plane set connected with the first vertex based on the first vertex of each initial edge; wherein the plane set comprises the first sub-plane set and a second sub-plane set; the first sub-plane set comprises a plurality of first sub-planes; and obtaining the second sub-plane set connected with the second vertex based on the second vertex; wherein the second sub-plane set comprises a plurality of second sub-planes;
[0068] calculating a plurality of first sub-planes associated with each initial edge to obtain a first sub-update parameter of each initial edge; and calculating a plurality of second sub-planes associated with each initial edge to obtain a second sub-update parameter of each initial edge;
[0069] obtaining the update parameter of each initial edge based on the first sub-update parameter and the second sub-update parameter of each initial edge.
[0070] In an embodiment of the present application, each initial edge in the original model corresponds to two vertices, which are a first vertex and a second vertex, wherein the first vertex is included in a plurality of first sub-planes, and the first sub-planes constitute a first sub-plane set; and the second vertex is included in a plurality of second sub-planes, and the second sub-planes constitute a second sub-plane set.
[0071] Further, inner product calculation is performed on the plurality of first sub-planes associated with each initial edge to obtain a first sub-update parameter of each initial edge; inner product calculation is performed on the plurality of second sub-planes associated with each initial edge to obtain a second sub-update parameter of each initial edge.
[0072] Then, based on the first sub-update parameter and the second sub-update parameter of each initial edge, an update parameter of each initial edge is determined.
[0073] In an optional embodiment of the present application, the calculation on the plurality of first sub-planes associated with each initial edge to obtain a first sub-update parameter of each initial edge; the calculation on the plurality of second sub-planes associated with each initial edge to obtain a second sub-update parameter of each initial edge comprises:
[0074] The calculation on any two first sub-planes in the first sub-plane set associated with each initial edge to obtain a plurality of first calculation results of each initial edge; and the calculation on the plurality of first calculation results of each initial edge to obtain the first sub-update parameter of each initial edge.
[0075] The calculation on any two second sub-planes in the second sub-plane set associated with each initial edge to obtain a plurality of second calculation results of each initial edge; and the calculation on the plurality of second calculation results of each initial edge to obtain the second sub-update parameter of each initial edge.
[0076] In an optional embodiment of the present application, taking any initial edge l in the original model as an example, the following is explained and described.
[0077] The coordinate vector a of the first vertex and the coordinate vector b of the second vertex of the initial edge l are obtained; it is assumed that the first sub-planes including the first vertex are f a1 , f a2 , f a3 , f a4 ……f ax in turn; the second sub-planes including the second vertex are f b1 , f b2 , f b3 , f b4 ……f ay in turn; wherein x is the number of the first sub-planes; x is a positive integer; y is the number of the second sub-planes; y is a positive integer.
[0078] The normal vectors of each first sub-plane are calculated, which are n a1 , n a2 , n a3 , n a4 ……n ax; calculate the normal vector of each second subplane, in turn, n b1 , n b2 , n b3 , n b4 … n by ;
[0079] For the normal vectors of the above plurality of first subplanes, the inner product of each two is calculated, and the first calculation result corresponding to each inner product is obtained; for example: n a1 ·n a2 =P i ; wherein, i is a positive integer; for the normal vectors of the above plurality of second subplanes, the inner product of each two is calculated, and the second calculation result corresponding to each inner product is obtained; for example: n b1 ·n b2 =M j ; wherein, j is a positive integer;
[0080] Compare each P i with 0, at the same time, compare each M j with 0, and obtain the number of first calculation results corresponding to P i <0 (first sub update parameter) and the number of second calculation results corresponding to M j <0 (second sub update parameter), based on the sum of the number of first calculation results corresponding to P i <0 and the number of second calculation results corresponding to M j <0 (that is, the sum of the first sub update parameter and the second sub update parameter), obtain the update parameter of the initial edge l.
[0081] Step S13: determining the update value of each of the initial edges based on the update parameter of each of the initial edges, and updating the original generation value of each of the initial edges based on the update value of each of the initial edges, to obtain the updated generation value of each of the initial edges;
[0082] In an optional embodiment of the present application, the determination of the update value of each of the initial edges based on the update parameter of each of the initial edges comprises:
[0083] Comparing the update parameter of each of the initial edges with a preset threshold value; wherein, the preset threshold value comprises a first sub preset threshold value, a second sub preset threshold value and a third sub preset threshold value; the update value comprises any one of a first sub update value, a second sub update value and a third sub update value;
[0084] When the update parameter of the initial edge is equal to the first sub preset threshold value, the first sub update value is obtained; or
[0085] When the update parameter of the initial edge is equal to the second sub preset threshold, the second sub update value is obtained; or
[0086] When the update parameter of the initial edge is greater than or equal to the third sub preset threshold, the third sub update value is obtained.
[0087] In an optional embodiment of the present application, the first sub preset threshold can be 0, the second sub preset threshold can be 1, and the third sub preset threshold can be 2; then:
[0088] When the update parameter of the initial edge l is equal to 0, that is, each first calculation result and second calculation result is greater than 0, the first sub update value of the initial edge l is obtained.
[0089] Specifically, when each first calculation result and second calculation result is greater than 0, it indicates that the normal vector of all faces including the first vertex or the second vertex of the initial edge l is greater than 0, that is, before edge contraction, it can be determined that there is no reverse face (the normal vector of the face is less than 0); or
[0090] When the update parameter of the initial edge l is equal to 1, that is, there is one first calculation result or second calculation result less than 0, the second sub update value of the initial edge l is obtained.
[0091] Specifically, there is one first calculation result less than 0 or one second calculation result less than 0, which indicates that the normal vector of one of all faces including the first vertex or the second vertex of the initial edge l is less than 0, that is, before edge contraction, it can be determined that there is one reverse face; or
[0092] When the update parameter of the initial edge l is greater than or equal to 2, that is, in multiple first calculation results and second calculation results, there are at least two values less than 0, the third sub update value of the initial edge l is obtained.
[0093] Specifically, there are multiple first calculation results less than 0, multiple second calculation results less than 0, or both multiple first calculation results less than 0 and multiple second calculation results less than 0, which indicates that there are multiple normal vectors less than 0 in all faces including the first vertex or the second vertex of the initial edge l, that is, before edge contraction, it can be determined that there are multiple reverse faces.
[0094] In the embodiment of the present application, before edge contraction, reverse face identification is first performed, and when it is identified that the reverse face exists, the original generation value of the initial edge corresponding to the reverse face is updated based on the update value to obtain an updated generation value, which is used to avoid the occurrence of the reverse face in the process of edge contraction, and thus the black and white interlaced effect of the model after model simplification is avoided, thereby improving the visual experience of the user.
[0095] In an optional embodiment of the present application, the original generation value of each initial edge is updated based on a Dirichlet function d(z), and the specific expression of the Dirichlet function is determined based on an update parameter; z is the independent variable of the Dirichlet function;
[0096] When the update parameter is 0, the Dirichlet function d(z) is 0;
[0097] When the update parameter is 1, the Dirichlet function d(z) is the updated generation value minus the original generation value;
[0098] When the update parameter is greater than or equal to 2, the Dirichlet function d(z) is u; where u is a specific numerical value, and the actual size thereof is determined according to actual needs, for example, u = 1, 1.5 or 3, etc.
[0099] In an optional embodiment of the present application, the second sub-update value of the initial edge is obtained, including:
[0100] Based on the original model, a reference edge of the initial edge is determined;
[0101] An intersection point of the initial edge and the reference edge is obtained, and the intersection point is determined as a target shrinkage point of the initial edge;
[0102] According to the target shrinkage point, a second sub-update value of the initial edge is calculated and obtained.
[0103] In an optional embodiment of the present application, as shown in Figure 2 , the initial edge is l 26 , and the original shrinkage point determined according to the prior art is the position w0 corresponding to the 0 point; the first vertex corresponding to the initial edge l 26 is w2, and the second vertex corresponding to the initial edge l 26 is w6.
[0104] The first face including the first vertex w2 includes m 125 , m 235 and m 236 .
[0105] The second face including the second vertex w6 includes m 236 and m 364 .
[0106] As shown in Figure 3 , assuming that the initial edge l 26 is shrunk based on the original shrinkage point w0, the face m 430 is a reverse face.
[0107] In order to solve the above problems, in an embodiment of the present application, the reference edge l 26 of the initial edge l 43and the intersection point w7 (i.e. the target shrinkage point) is obtained; as Figure 4 As shown in the figure, assuming that the initial edge I 26 is shrunk based on the target shrinkage point w7, no reverse face (a normal vector of a face is less than 0) occurs.
[0108] Further, after the target shrinkage point w7 is determined, a coordinate vector W7 of the target shrinkage point w7 is obtained;
[0109] Based on the above method of calculating the original generation value of the initial edge, a second sub-update value of the initial edge I 26 shrunk based on the target shrinkage point is calculated.
[0110] The second sub-update value = d(z) = updated generation value - original generation value.
[0111] For example: the updated generation value = W T *(Q1+Q2)*W.
[0112] The second sub-update value = W T *(Q1+Q2)*W - R T *(Q1+Q2)*R.
[0113] Specifically, when the original shrinkage point is w0 and the corresponding target shrinkage point is w7, then:
[0114] The second sub-update value = W7 T *(Q1+Q2)*W7 - W0 T *(Q1+Q2)*W0.
[0115] In an optional embodiment of the present application, the updating of the original generation value of each initial edge based on the updated value of each initial edge to obtain an updated generation value of each initial edge comprises:
[0116] Based on the first sub-update value and the original generation value, a first sub-update generation value is obtained; wherein the updated generation value comprises any one of a first sub-update generation value, a second sub-update generation value and a third sub-update generation value; or
[0117] Based on the second sub-update value and the original generation value, the second sub-update generation value is obtained; or
[0118] Based on the third sub-update value and the original generation value, the third sub-update generation value is obtained.
[0119] In an optional embodiment of the present application, the updated generation value is obtained based on the sum of the original generation value and the updated value of each initial edge.
[0120] For example, when the update parameter of the initial edge l is 0, the update generation value of the initial edge l is the first sub-update generation value, and the first sub-update generation value = the original generation value + 0, that is, when the update parameter of the initial edge l is 0, the update generation value corresponding to the initial edge l is equal to the original generation value; or
[0121] When the update parameter of the initial edge l is 1, the update generation value of the initial edge l is the second sub-update generation value, and the second sub-update generation value = the original generation value + (the second sub-update generation value - the original generation value), that is, when the update parameter of the initial edge l is 1, the update generation value corresponding to the initial edge l can be directly obtained based on the target contraction point; or
[0122] When the update parameter of the initial edge l is greater than or equal to 2, the update generation value of the initial edge l is the third sub-update generation value, and the third sub-update generation value = the original generation value + u.
[0123] Step S14: determining a target edge to be contracted according to the update generation value of each initial edge in the original model, and contracting the target edge to be contracted to obtain a target simplified model.
[0124] In an optional embodiment of the present application, the determination of the target edge to be contracted according to the update generation value of each initial edge in the original model comprises:
[0125] comparing the update generation value of each initial edge with a generation value threshold;
[0126] If the update generation value is less than the generation value threshold, the initial edge corresponding to the update generation value is determined as a candidate edge;
[0127] determining a target edge to be contracted based on the update generation value of the plurality of candidate edges, and contracting the target edge to be contracted to obtain the target simplified model.
[0128] In an optional embodiment of the present application, after obtaining the update generation value of each initial edge in the original model, the update generation value of each initial edge is compared with a generation value threshold; wherein the generation value threshold can be determined according to actual needs, for example, the generation value threshold is u.
[0129] comparing the update generation value (any one of the first sub-update generation value, the second sub-update generation value and the third sub-update generation value) corresponding to each initial edge with a cost threshold;
[0130] Specifically, if the update generation value of an initial edge is less than the generation value threshold, the initial edge is determined as a candidate edge; otherwise, if the update generation value of an initial edge is greater than or equal to the generation value threshold, the initial edge is determined as a non-contracted edge, that is, the initial edge is not subjected to contraction processing.
[0131] Based on the method, a plurality of candidate edges are determined, and an updated generation value of each candidate edge is obtained. The plurality of updated generation values are sorted in ascending order, the smallest updated generation value is obtained, and a candidate edge matched with the smallest updated generation value is determined as a target contraction edge. Then, the target contraction edge is contracted to obtain a target simplified model.
[0132] In an optional embodiment of the present application, the above steps are repeated, and edge contraction is performed on the original model for N (N is a positive integer) rounds until the updated generation value of each edge of the current model is greater than or equal to u, and then the edge contraction process on the current model is stopped, that is, the current model is determined as the final target simplified model.
[0133] In an optional embodiment of the present application, the number of edge contraction rounds M (1≤M≤N, and N is a positive integer) can be determined according to the user's requirement for the simplification degree of the model. After M rounds of edge contraction are performed on the original model, the final target simplified model is obtained.
[0134] In an optional embodiment of the present application, the generation value threshold can be adjusted, for example, the generation value threshold is adjusted from u to h. Until the updated generation value of each edge of the current model is greater than or equal to h, the edge contraction process on the current model is stopped, and the final target simplified model is obtained.
[0135] In the embodiments of the present application, the reverse face appearing in the edge contraction process is pre-identified, and the original generation value of each initial edge of the original model is updated before edge contraction. Based on the updated generation value of each initial edge, the target contraction edge is re-determined, and the target contraction edge is contracted to obtain the target simplified model, thereby solving the problem of the appearance of the reverse face in the model simplification process.
[0136] As shown in Figure 5 The embodiments of the present application also provide a model simplification device 50, which comprises:
[0137] A first calculation module 51 is configured to obtain an original model and calculate an original generation value of each initial edge in the original model.
[0138] A second calculation module 52 is configured to obtain a plane set associated with each initial edge and calculate the plane set to obtain an updated parameter of each initial edge.
[0139] An updating module 53 is configured to determine an updated value of each initial edge based on the updated parameter of each initial edge and update the original generation value of each initial edge based on the updated value of each initial edge to obtain an updated generation value of each initial edge.
[0140] The simplification module 54 is configured to determine a target edge to be shrunk according to the update value of each initial edge in the original model, and to shrink the target edge to be shrunk to obtain a target simplified model.
[0141] Optionally, the update parameter of each initial edge is obtained by acquiring a plane set associated with each initial edge and performing calculation on the plane set.
[0142] The first vertex and the second vertex of each initial edge are acquired.
[0143] The first sub-plane set connected with the first vertex is obtained based on the first vertex of each initial edge; the plane set includes the first sub-plane set and the second sub-plane set; the first sub-plane set includes a plurality of first sub-planes; the second sub-plane set connected with the second vertex is obtained based on the second vertex; the second sub-plane set includes a plurality of second sub-planes.
[0144] The first sub-update parameter of each initial edge is obtained by performing calculation on a plurality of first sub-planes associated with each initial edge; the second sub-update parameter of each initial edge is obtained by performing calculation on a plurality of second sub-planes associated with each initial edge.
[0145] The update parameter of each initial edge is obtained based on the first sub-update parameter and the second sub-update parameter of each initial edge.
[0146] Optionally, the first sub-update parameter of each initial edge is obtained by performing calculation on any two first sub-planes in the first sub-plane set associated with each initial edge; the second sub-update parameter of each initial edge is obtained based on a plurality of first calculation results of each initial edge.
[0147] The first sub-update parameter of each initial edge is obtained based on a plurality of first calculation results of each initial edge.
[0148] The second sub-update parameter of each initial edge is obtained based on a plurality of second calculation results of each initial edge.
[0149] Optionally, the update value of each initial edge is determined based on the update parameter of each initial edge.
[0150] comparing the update parameter of each of the initial edges with a preset threshold; wherein the preset threshold comprises a first sub preset threshold, a second sub preset threshold and a third sub preset threshold; and the update value comprises any one of a first sub update value, a second sub update value and a third sub update value;
[0151] when the update parameter of the initial edge is equal to the first sub preset threshold, the first sub update value is obtained; or
[0152] when the update parameter of the initial edge is equal to the second sub preset threshold, the second sub update value is obtained; or
[0153] when the update parameter of the initial edge is greater than or equal to the third sub preset threshold, the third sub update value is obtained.
[0154] Optionally, the second sub update value of the initial edge is obtained, comprising:
[0155] determining a reference edge of the initial edge based on the original model;
[0156] obtaining the intersection point of the initial edge and the reference edge, and determining the intersection point as the target contraction point of the initial edge;
[0157] calculating the second sub update value of the initial edge according to the target contraction point.
[0158] Optionally, the original generation value of each of the initial edges is updated based on the update value of each of the initial edges, and an update generation value of each of the initial edges is obtained, comprising:
[0159] a first sub update generation value is obtained based on the first sub update value and the original generation value; wherein the update generation value comprises any one of a first sub update generation value, a second sub update generation value and a third sub update generation value; or
[0160] the second sub update generation value is obtained based on the second sub update value and the original generation value; or
[0161] the third sub update generation value is obtained based on the third sub update value and the original generation value.
[0162] Optionally, the target edge to be contracted is determined according to the update generation value of each of the initial edges in the original model, comprising:
[0163] comparing the update generation value of each of the initial edges with a generation value threshold;
[0164] If the updated generation value is less than the generation value threshold, the initial edge corresponding to the updated generation value is determined as a candidate edge;
[0165] Based on the updated generation values of the plurality of candidate edges, a target contracted edge is determined, and the target contracted edge is contracted to obtain the target simplified model.
[0166] Embodiments of the present application also provide an electronic device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the method described above.
[0167] Embodiments of the present application also provide a computer readable storage medium comprising a stored computer program, wherein the computer readable storage medium controls a device where the computer readable storage medium is located to execute the method described above when the computer program runs.
[0168] In addition, other configurations and functions of the device of the embodiments of the present application are known to those skilled in the art, and to reduce redundancy, they are not described here.
[0169] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a list of executable instructions for implementing logic functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device, such as a computer-based system, a system including a processor, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions, or in conjunction with these instructions. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable medium include the following: an electrical connection having one or more wires (electronic devices), a portable computer diskette (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, a computer-readable medium can even be paper or other suitable medium on which the program can be printed, as the program can be electronically obtained, for example, by optical scanning of the paper or other medium, followed by electronic conversion of the scanned program into a computer-readable medium, and then storing the program in a computer memory if necessary. Other suitable media can also be used.
[0170] It should be understood that various aspects of the application can be implemented in hardware, software, firmware or a combination of them. In the above embodiments, various steps or methods can be implemented in software or firmware that is stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any of the following technologies, known in the art, or their combinations can be used: discrete logic circuitry having logic gates for implementing logic functions upon an application data signal, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and the like.
[0171] In the description of the present application, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are contained in at least one embodiment or example of the present application. In the present description, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0172] In the description of the present application, it should be understood that the orientation or positional relationship indicated by the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application.
[0173] In addition, the terms "first", "second" are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "a plurality of" is at least two, for example, two, three, etc., unless otherwise specifically limited.
[0174] In this application, unless otherwise explicitly specified and limited, the terms "mounting", "connection", "connecting", "fixing" and the like should be understood broadly, for example, can be fixed connection, can also be detachable connection, or integral; can be mechanical connection, can also be electrical connection; can be directly connected, can also be indirectly connected through an intermediate medium, can be the internal communication of two elements or the interaction relationship of two elements, unless otherwise explicitly limited. For those skilled in the art, the specific meaning of the above terms in this application can be understood according to the specific circumstances.
[0175] In this application, unless otherwise explicitly specified and limited, the first feature is "on" or "under" the second feature. The first and second features can be in direct contact or indirectly contact through an intermediate medium. Moreover, the first feature "above", "over" and "on" the second feature can be directly above or obliquely above the second feature, or only indicates that the horizontal height of the first feature is higher than that of the second feature. The first feature "below", "under" and "under" the second feature can be directly below or obliquely below the second feature, or only indicates that the horizontal height of the first feature is less than that of the second feature.
[0176] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.
Claims
1. A model reduction method, characterized by, The method comprises: obtaining an original model and calculating an original generation value of each initial edge in the original model; obtaining a plane set associated with each initial edge and calculating an update parameter of each initial edge based on the plane set; determining an update value of each initial edge based on the update parameter of each initial edge and updating the original generation value of each initial edge based on the update value of each initial edge to obtain an updated generation value of each initial edge; determining a target edge to be shrunk based on the updated generation value of each initial edge in the original model and shrinking the target edge to be shrunk to obtain a target simplified model; the determination of the update value of each initial edge based on the update parameter of each initial edge comprises: comparing the update parameter of each initial edge with a preset threshold value; wherein the preset threshold value comprises a first sub-preset threshold value, a second sub-preset threshold value and a third sub-preset threshold value; and the update value comprises any one of a first sub-update value, a second sub-update value and a third sub-update value; when the update parameter of the initial edge is equal to the first sub-preset threshold value, the first sub-update value is obtained; or when the update parameter of the initial edge is equal to the second sub-preset threshold value, the second sub-update value is obtained; or when the update parameter of the initial edge is greater than or equal to the third sub-preset threshold value, the third sub-update value is obtained; the obtaining of the second sub-update value of the initial edge comprises: determining a reference edge of the initial edge based on the original model; obtaining an intersection point of the initial edge and the reference edge and determining the intersection point as a target shrinkage point of the initial edge; calculating the second sub-update value of the initial edge based on the target shrinkage point.
2. The method of claim 1, wherein, the obtaining of the update parameter of each initial edge based on the plane set associated with each initial edge and the calculation of the plane set comprises: obtaining a first vertex and a second vertex of each initial edge; obtaining a first sub-plane set connected with the first vertex based on the first vertex of each initial edge; wherein the plane set comprises a first sub-plane set and a second sub-plane set; the first sub-plane set comprises a plurality of first sub-planes; and obtaining the second sub-plane set connected with the second vertex based on the second vertex; wherein the second sub-plane set comprises a plurality of second sub-planes; calculating a first sub-update parameter of each initial edge based on a plurality of first sub-planes associated with each initial edge; and calculating a second sub-update parameter of each initial edge based on a plurality of second sub-planes associated with each initial edge; obtaining the update parameter of each initial edge based on the first sub-update parameter and the second sub-update parameter of each initial edge.
3. The method of claim 2, wherein, The first sub-update parameter of each initial edge is obtained by calculating a plurality of first sub-planes associated with each initial edge; and the second sub-update parameter of each initial edge is obtained by calculating a plurality of second sub-planes associated with each initial edge, including: The first sub-update parameter of each initial edge is obtained by calculating any two first sub-planes in the first sub-plane set associated with each initial edge; and the first sub-update parameter of each initial edge is obtained by calculating a plurality of first calculation results of each initial edge according to the plurality of first calculation results of each initial edge. The second sub-update parameter of each initial edge is obtained by calculating any two second sub-planes in the second sub-plane set associated with each initial edge; and the second sub-update parameter of each initial edge is obtained by calculating a plurality of second calculation results of each initial edge according to the plurality of second calculation results of each initial edge.
4. The method of claim 1, wherein, The updated generation value of each initial edge is obtained by updating the original generation value of each initial edge based on the update value of each initial edge, including: The first sub-update generation value is obtained based on the first sub-update value and the original generation value; wherein the update generation value includes any one of the first sub-update generation value, the second sub-update generation value, and the third sub-update generation value; or The second sub-update generation value is obtained based on the second sub-update value and the original generation value; or The third sub-update generation value is obtained based on the third sub-update value and the original generation value.
5. The method of claim 1, wherein, The target edge to be contracted is determined according to the update generation value of each initial edge in the original model, including: The update generation value of each initial edge is compared with a generation value threshold; If the update generation value is less than the generation value threshold, the initial edge corresponding to the update generation value is determined as a candidate edge; The target contracted edge is determined based on the update generation value of a plurality of candidate edges, and the target contracted edge is contracted to obtain a target simplified model.
6. A model reduction apparatus characterized by comprising: Including: The first calculation module is configured to obtain an original model and calculate an original generation value of each initial edge in the original model; The second calculation module is configured to obtain a first sub-plane set and a second sub-plane set associated with each initial edge, and calculate the first sub-plane set and the second sub-plane set to obtain an update parameter of each initial edge; The update module is configured to determine an update value of each initial edge based on the update parameter of each initial edge, and update the original generation value of each initial edge based on the update value of each initial edge to obtain an update generation value of each initial edge; The simplification module is configured to determine a target edge to be contracted according to the update generation value of each initial edge in the original model, and contract the target edge to be contracted to obtain a target simplified model; and The first calculation module is configured to obtain an original model and calculate an original generation value of each initial edge in the original model; The second calculation module is configured to obtain a first sub-plane set and a second sub-plane set associated with each initial edge, and calculate the first sub-plane set and the second sub-plane set to obtain an update parameter of each initial edge; The update module is configured to determine an update value of each initial edge based on the update parameter of each initial edge, and update the original generation value of each initial edge based on the update value of each initial edge to obtain an update generation value of each initial edge; The simplification module is configured to determine a target edge to be contracted according to the update generation value of each initial edge in the original model, and contract the target edge to be contracted to obtain a target simplified model; and The updating module is specifically configured to: compare the updating parameter of each initial edge with a preset threshold; wherein the preset threshold comprises a first sub-pre-set threshold, a second sub-pre-set threshold and a third sub-pre-set threshold; and the updating value comprises any one of a first sub-updating value, a second sub-updating value and a third sub-updating value; when the updating parameter of the initial edge is equal to the first sub-pre-set threshold, the first sub-updating value is obtained; or when the updating parameter of the initial edge is equal to the second sub-pre-set threshold, the second sub-updating value is obtained; or when the updating parameter of the initial edge is greater than or equal to the third sub-pre-set threshold, the third sub-updating value is obtained; The updating module is further configured to: determine a reference edge of the initial edge based on the original model; obtain the intersection of the initial edge and the reference edge, and determine the intersection as a target contraction point of the initial edge; According to the target contraction point, the second sub-updating value of the initial edge is obtained.
7. An electronic device, comprising: The computer readable storage medium comprises a stored computer program, wherein the computer program, when running, controls the device where the computer readable storage medium is located to execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises a stored computer program, wherein the computer program, when running, controls the device where the computer readable storage medium is located to execute the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
BIM model simplification method and device
CN112562085A
Three-dimensional model processing method and device, electronic equipment and storage medium
CN114429534A