Business service processing method, device, equipment and storage medium
By receiving the service request from the terminal device, the collapse value is calculated based on the curvature value and length of the edge, and the three-dimensional model data is simplified, which solves the problem of low efficiency of surface reduction processing of the three-dimensional model in the existing technology, and realizes efficient three-dimensional model simplification and business services. deal with.
Patent Information
- Application Number
- CN201910935626.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-29
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2039-09-29
AI Technical Summary
The existing technology has complex calculations and low processing efficiency in surface reduction processing of 3D models, cannot meet the rendering needs of mobile terminals, and requires huge labor costs.
By receiving the service request from the terminal device, the three-dimensional model data is obtained, and the collapse value is calculated based on the curvature value and length of the edge, simplified processing is performed, and the number of faces is iteratively reduced until it is within the preset threshold range, thereby improving the simplification efficiency of the three-dimensional model.
It effectively improves the efficiency of surface reduction processing of 3D models, reduces labor costs, is suitable for AR, VR and other technical fields, and improves the efficiency of business service processing.
Smart Images

Figure CN111754632B
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a method, device, equipment and storage medium for processing business services. Background Art
[0002] With the continuous development of augmented reality (AR) and virtual reality (VR) technologies, 3D experiential shopping has become a trend. Massive 3D models are constantly being created, and e-commerce 3D model standards are gradually taking shape. Many products are already high-precision models when they are produced by manufacturers, reaching millions or even tens of millions of faces. The volume is very large and the number of faces is very high, which cannot meet the requirements of mobile rendering. Recreating the model or modifying it through software on the high-precision model requires huge manpower costs.
[0003] In the prior art, the three-dimensional model can be reduced in surface area by using edge collapse technology. However, the existing surface reduction method calculates the collapse value based on the symmetric error matrix of the vertices, and the calculation process is complicated and the processing efficiency is low. Summary of the invention
[0004] The present application provides a business service processing method, device, equipment and storage medium to solve the defects of the prior art such as low efficiency of simplified processing.
[0005] The first aspect of the present application provides a method for processing a business service, including:
[0006] Receiving a service request sent by a terminal device, wherein the service request includes identification information of a product;
[0007] Acquire original three-dimensional model data corresponding to the identification information according to the service request;
[0008] Based on the collapse value of each edge in the original three-dimensional model data, simplifying the original three-dimensional model data to obtain simplified three-dimensional model data, wherein the collapse value of each edge is obtained according to the curvature value of the edge and the length of the edge;
[0009] The simplified three-dimensional model data of the product is sent to the terminal device.
[0010] Optionally, based on the collapse value of each edge in the original three-dimensional model data, simplifying the original three-dimensional model data to obtain simplified three-dimensional model data includes:
[0011] Traversing each edge of the i-th level three-dimensional model data, and calculating the collapse value of each edge, wherein i is a positive integer, and the first level three-dimensional model data is the original three-dimensional model data;
[0012] According to the collapse value of each edge, determine the target edge to be collapsed and the collapsed vertices corresponding to each target edge;
[0013] Perform collapse processing according to the target edges to be collapsed and the collapsed vertices corresponding to each target edge, and obtain the i+1th level three-dimensional model data;
[0014] The above steps are iterated until three-dimensional model data with a face number within a preset threshold range is obtained as the simplified three-dimensional model data.
[0015] Optionally, traversing each edge of the i-th level three-dimensional model data and calculating the collapse value of each edge includes:
[0016] For each edge of the i-th level three-dimensional model data, the curvature value and the length of the edge are calculated, and the collapse value of the edge is calculated based on the curvature value and the length of the edge.
[0017] Optionally, the curvature value of the edge is calculated, including:
[0018] The curvature value of the edge is obtained by calculating the normal vectors of the two faces to which the edge belongs.
[0019] Optionally, traversing each edge of the i-th level three-dimensional model data and calculating the collapse value of each edge includes:
[0020] For each edge of the i-th level 3D model data, the collapse value cost of the edge is calculated using the following formula:
[0021]
[0022] Among them, u and v represent the two vertices of the edge, cost(u,v) represents the collapse value of vertex u to v of the edge, ||uv|| represents the distance between the two vertices, that is, the length of the edge; f.normal and n.normal represent the normal vectors of the two faces f and n to which the edge belongs, f.normal·n.normal represents the dot product of the two normal vectors, that is, the curvature value of the edge, Tu represents the set of triangular faces containing vertex u, and Tuv represents the set of triangular faces containing both vertex u and vertex v.
[0023] Optionally, performing collapse processing according to the target edges to be collapsed and the collapsed vertices corresponding to each target edge to obtain the i+1th level three-dimensional model data includes:
[0024] For each target edge uv, the triangular face with the target edge as an edge is removed from the i+1th level three-dimensional model data, and for other triangular faces, the collapsed vertex u is updated to the vertex v, and the vertex u is removed.
[0025] Optionally, the collapse value of each edge includes a first collapse value and a second collapse value, wherein the first collapse value is a collapse value of the first vertex of the edge collapsing toward the second vertex, and the second collapse value is a collapse value of the second vertex of the edge collapsing toward the first vertex;
[0026] According to the collapse value of each edge, the target edge to be collapsed and the collapsed vertices corresponding to each target edge are determined according to the preset rules, including:
[0027] The collapse values of the edges are arranged in descending order, and the edges corresponding to the collapse values of a preset proportion are taken as the target edges;
[0028] For each target edge, if the collapse value is a collapse value of the first vertex collapsing toward the second vertex, the first vertex is the collapsed vertex corresponding to the target edge.
[0029] Optionally, the method further comprises:
[0030] Traverse each vertex of the i-th level three-dimensional model data to obtain the number of edges associated with each vertex;
[0031] The vertices with a preset ratio of the number of associated edges are taken as key vertices;
[0032] Before performing collapse processing according to the target edges to be collapsed and the collapsed vertices corresponding to each target edge, the method further includes:
[0033] The edge whose collapsed vertex is the key vertex is not used as the target edge.
[0034] A second aspect of the present application provides a business service processing device, including:
[0035] A receiving module, used to receive a service request sent by a terminal device, wherein the service request includes identification information of a product;
[0036] An acquisition module, used for acquiring original three-dimensional model data corresponding to the identification information according to the service request;
[0037] A simplification module, configured to simplify the original three-dimensional model data based on the collapse value of each edge in the original three-dimensional model data to obtain simplified three-dimensional model data, wherein the collapse value of each edge is obtained according to the curvature value of the edge and the length of the edge;
[0038] The sending module is used to send the simplified three-dimensional model data of the product to the terminal device.
[0039] Optionally, the simplification module is specifically used to:
[0040] Traversing each edge of the i-th level three-dimensional model data, and calculating the collapse value of each edge, wherein i is a positive integer, and the first level three-dimensional model data is the original three-dimensional model data;
[0041] According to the collapse value of each edge, determine the target edge to be collapsed and the collapsed vertices corresponding to each target edge;
[0042] Perform collapse processing according to the target edges to be collapsed and the collapsed vertices corresponding to each target edge to obtain the i+1th level three-dimensional model data;
[0043] The above steps are iterated until three-dimensional model data with a face number within a preset threshold range is obtained as the simplified three-dimensional model data.
[0044] Optionally, the simplification module is specifically used to:
[0045] For each edge of the i-th level three-dimensional model data, the curvature value and the length of the edge are calculated, and the collapse value of the edge is calculated based on the curvature value and the length of the edge.
[0046] Optionally, the simplification module is specifically used to:
[0047] The curvature value of the edge is obtained by calculating the normal vectors of the two faces to which the edge belongs.
[0048] Optionally, the simplification module is specifically used to:
[0049] For each edge of the i-th level 3D model data, the collapse value cost of the edge is calculated using the following formula:
[0050]
[0051] Among them, u and v represent the two vertices of the edge, cost(u,v) represents the collapse value of vertex u to v of the edge, ||uv|| represents the distance between the two vertices, that is, the length of the edge; f.normal and n.normal represent the normal vectors of the two faces f and n to which the edge belongs, f.normal·n.normal represents the dot product of the two normal vectors, that is, the curvature value of the edge, Tu represents the set of triangular faces containing vertex u, and Tuv represents the set of triangular faces containing both vertex u and vertex v.
[0052] Optionally, the simplification module is specifically used to:
[0053] For each target edge uv, the triangular face with the target edge as an edge is removed from the i+1th level three-dimensional model data, and for other triangular faces, the collapsed vertex u is updated to the vertex v, and the vertex u is removed.
[0054] Optionally, the collapse value of each edge includes a first collapse value and a second collapse value, wherein the first collapse value is a collapse value of the first vertex of the edge collapsing toward the second vertex, and the second collapse value is a collapse value of the second vertex of the edge collapsing toward the first vertex;
[0055] The simplified module is specifically used for:
[0056] The collapse values of the edges are arranged in descending order, and the edges corresponding to the collapse values of a preset proportion are taken as the target edges;
[0057] For each target edge, if the collapse value is a collapse value of the first vertex collapsing toward the second vertex, the first vertex is the collapsed vertex corresponding to the target edge.
[0058] Optionally, the simplification module is further used to: traverse each vertex of the i-th level three-dimensional model data to obtain the number of edges associated with each vertex; and use the vertices with a preset proportion of the number of associated edges as key vertices;
[0059] Before performing collapse processing according to the target edges to be collapsed and the collapsed vertices corresponding to each target edge, the simplification module is further used to: not use the edge whose collapsed vertex is the key vertex as the target edge.
[0060] A third aspect of the present application provides a computer device, comprising: at least one processor and a memory;
[0061] The memory stores computer-executable instructions;
[0062] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method described in the first aspect and various possible designs of the first aspect.
[0063] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method described in the first aspect and various possible designs of the first aspect are implemented.
[0064] The processing method, device, equipment and storage medium of the business service provided by the application, the user can select the product to be viewed through the terminal device, the terminal device obtains the identification information of the product selected by the user, carries the identification information of the product in the service request and sends it to the service device, the service device receives the service request of the terminal device, responds to the service request, obtains the original 3D model data corresponding to the identification information, simplifies the original 3D model data based on the edge collapse technology to obtain simplified 3D model data, and sends the simplified 3D model data to the terminal device so that the terminal device can render and display it. The efficiency of 3D model face reduction processing is effectively improved, thereby improving the efficiency of business service processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0066] Figure 1 A flowchart of a method for processing a business service provided in an embodiment of the present application;
[0067] Figure 2 A schematic diagram of edge collapse provided in an embodiment of the present application;
[0068] Figure 3 A flowchart of a method for processing a business service provided by another embodiment of the present application;
[0069] Figure 4 A schematic diagram of edge collapse provided by another embodiment of the present application;
[0070] Figure 5 A schematic diagram of the structure of a processing device for a business service provided in an embodiment of the present application;
[0071] Figure 6 A schematic diagram of the structure of a computer device provided in one embodiment of the present application.
[0072] The above drawings have shown clear embodiments of the present application, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0073] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0074] First, the terms involved in this application are explained:
[0075] High-precision molds: Industrial models with millions or even tens of millions of faces are called high-precision molds.
[0076] Edge collapse: In a three-dimensional model diagram, with a triangular plane as a component of the model's surface, if one vertex (the first vertex) of one of the edges is merged with another vertex (the second vertex), the edge will disappear after the merger, the first vertex will also disappear, and will be replaced by the second vertex, and the number of triangles will also decrease. This process is called edge collapse.
[0077] The processing method of the business service provided in the embodiment of the present application is applicable to application scenarios where industrial models need to be provided, and the specific application fields are not limited, such as AR and VR fields, as long as the three-dimensional model needs to be simplified, it can be applied. The processing method of the business service provided in the embodiment of the present application is based on the following processing device. The processing device includes a service device and at least one terminal device. The user can send a service request to the service device through the terminal device, and the service request may include the identification information of the product. The service request may be a request for the user to view products related to the three-dimensional model. The identification information of the product may be the name, number ID and other identifying information of the product. The terminal device may be an AR device, a VR device, etc. The user can select the product to be viewed through the terminal device, and the terminal device obtains the identification information of the product selected by the user, carries the identification information of the product in the service request and sends it to the service device, the service device receives the service request of the terminal device, responds to the service request, obtains the original three-dimensional model data corresponding to the identification information, simplifies the original three-dimensional model data based on the edge collapse technology to obtain simplified three-dimensional model data, and sends the simplified three-dimensional model data to the terminal device so that the terminal device can render and display it. The efficiency of three-dimensional model face reduction processing is effectively improved, thereby improving the efficiency of business service processing. Optionally, the service device may also perform rendering processing based on the simplified 3D model data to obtain a target 3D model of the product, and send it to the terminal device. After the terminal device receives the target 3D model of the product, it displays the product to the user based on the target 3D model.
[0078] In addition, the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. In the description of the following embodiments, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0079] The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0080] Embodiment 1
[0081] This embodiment provides a business service processing method for simplifying three-dimensional model data. The execution subject of this embodiment is a business service processing device, which can be set on a computer device, such as a desktop computer, a laptop computer, a tablet computer, a mobile phone, and other terminal devices.
[0082] like Figure 1 FIG. 1 is a flow chart of a method provided in this embodiment, and the method includes:
[0083] Step 101: receiving a service request sent by a terminal device, where the service request includes identification information of a product.
[0084] Specifically, a processing device for business services (hereinafter referred to as device) may receive a service request sent by a terminal device, and the service request may include identification information of a product.
[0085] For example, when a user performs a 3D experience through a terminal device, such as 3D experiential shopping, the user can select product information to be learned on the terminal device, such as the product name. The terminal device can then obtain identification information of the product selected by the user and carry the product identification information in a service request to the device. The device can then receive the service request sent by the terminal device and obtain the product identification information from the service request.
[0086] Step 102: acquiring original three-dimensional model data corresponding to the identification information according to the service request.
[0087] Specifically, after receiving the service request, the identification information of the product is obtained from the service request, and the corresponding original three-dimensional model data is obtained according to the identification information.
[0088] Step 103, based on the collapse value of each edge in the original 3D model data, simplify the original 3D model data to obtain simplified 3D model data, wherein the collapse value of each edge is obtained according to the curvature value of the edge and the length of the edge.
[0089] Specifically, the original three-dimensional model data can be the model data of the high-precision mold of the established product, which can mainly include vertex data, edge data and face data. The vertex data can include vertex identification and vertex coordinates and other related data, the edge data can include edge identification and the vertex of the edge and other related data, the face data can include face identification and the edge of the face and the vertex of the face and other related data. In the three-dimensional model data, triangles are used as the basic face units constituting the three-dimensional model. Of course, other shapes can also be selected according to actual needs, which is not limited in this embodiment. The specific content of the specific three-dimensional model data can be set according to actual needs, which is a prior art and will not be repeated here.
[0090] When the original 3D model data needs to be simplified, the original 3D model data can be obtained, and based on the collapse value of each edge in the original 3D model data, the original 3D model data is simplified to obtain simplified 3D model data. The collapse value of each edge is obtained based on the curvature value of the edge and the length of the edge. For example, if the original 3D model has tens of millions of faces and needs to be simplified to 100,000 faces, the above method is used for simplification until the number of faces is reduced to 100,000 or less.
[0091] Exemplarily, the collapse value of each edge is calculated based on the curvature value and length of each edge, and the edges are sorted from large to small according to the collapse value. The top 10% of the edges are selected for collapse, thereby reducing a batch of vertices, a batch of edges, and a batch of triangles. The above process can also be iteratively performed, reducing round by round until the required number is reduced.
[0092] For example, take the collapse of an edge as an example, Figure 2 As shown, it is a schematic diagram of edge collapse provided by this embodiment. The figure shows that the edge collapses from vertex u to vertex v, that is, edge uv is the edge to be collapsed, and vertex u is the collapsed vertex. After the edge collapses, the triangle with the edge as the edge disappears in the model, and the edge disappears. The vertex u of other triangles with vertex u as the vertex is replaced by vertex v. Of course, the vertex u of the edge with vertex u as a vertex is also replaced by vertex v. In this way, after each edge collapses, other edges and other faces will be affected accordingly.
[0093] Exemplarily, the calculation of the collapse value of the edge can be the product of the curvature value of the edge and the length of the edge, or the result of other calculations, such as: length*(1-curvature value), or length*(1-curvature value) / 2, etc., which can be specifically considered and set according to actual needs.
[0094] Step 104: Send the simplified three-dimensional model data of the product to the terminal device.
[0095] Specifically, after obtaining the simplified three-dimensional model data of the product, the simplified three-dimensional model data of the product can be sent to the terminal device, and the terminal device can perform rendering processing based on the simplified three-dimensional model data to obtain the target three-dimensional model of the product, and display the target three-dimensional model, that is, display the product.
[0096] Optionally, after obtaining the simplified 3D model data, the device can also perform rendering processing according to the simplified 3D model data to obtain the target 3D model of the product, and then send it to the terminal device. After the terminal device obtains the target 3D model, it can display the target 3D model to the user.
[0097] The processing method of the business service provided in this embodiment is that the user can select the product to be viewed through the terminal device, and the terminal device obtains the identification information of the product selected by the user, carries the identification information of the product in the service request and sends it to the service device, the service device receives the service request of the terminal device, responds to the service request, obtains the original 3D model data corresponding to the identification information, simplifies the original 3D model data based on the edge collapse technology to obtain simplified 3D model data, and sends the simplified 3D model data to the terminal device so that the terminal device can render and display it. The efficiency of 3D model face reduction processing is effectively improved, thereby improving the efficiency of business service processing.
[0098] Embodiment 2
[0099] This embodiment further supplements the method provided in the first embodiment.
[0100] like Figure 3 The figure is a flow chart of the method for processing the business service provided in this embodiment.
[0101] As an implementable manner, based on the above embodiment 1, optionally, step 103 may specifically include:
[0102] Step 1031, traverse each edge of the i-th level three-dimensional model data, and calculate the collapse value of each edge, wherein i is a positive integer, and the first level three-dimensional model data is the original three-dimensional model data.
[0103] Step 1032, according to the collapse value of each edge, determine the target edge to be collapsed and the collapsed vertices corresponding to each target edge.
[0104] Step 1033, performing collapse processing according to the target edges to be collapsed and the collapsed vertices corresponding to each target edge, to obtain the (i+1)th level three-dimensional model data.
[0105] Step 1034, iterate according to the above steps 1031-1033 until the three-dimensional model data with the number of faces within the preset threshold range is obtained as the simplified three-dimensional model data.
[0106] Specifically, since the original 3D model data may be a high-precision model with millions or even tens of millions of faces, it is generally not possible to reduce the required number of faces at one time during face reduction processing. Each collapse can only reduce some edges, and the number of faces reduced each time is less than one-quarter. Therefore, it is necessary to set a threshold for iterative processing, reducing it round by round until the number of faces remaining is within the preset threshold range, such as 50,000-100,000 faces. The specific preset threshold range can be set according to actual needs. The original 3D model data is used as the first-level 3D model data, and the second-level 3D model data is obtained after one reduction. Then, based on the second-level 3D model data, the second round of reduction is performed in accordance with the same process as the reduction process of the first-level 3D model data, and so on. It is iteratively executed. After each round, it can be determined whether the number of remaining faces meets the requirements, and the iterative process is stopped until the result is determined to meet the requirements.
[0107] Take one round of reduction as an example to explain as follows:
[0108] Traverse each edge of the i-th level three-dimensional model data, calculate the collapse value of each edge, determine the target edge to be collapsed and the collapsed vertex corresponding to each target edge according to the collapse value of each edge, and perform collapse processing according to the target edge to be collapsed and the collapsed vertex corresponding to each target edge, and obtain the i+1-th level three-dimensional model data. Among them, the preset rule can be to set a collapse value threshold, and the edge greater than the collapse value threshold is determined as the target edge; the preset rule can also be to specify a certain number or proportion of edges with a high collapse value ranking to collapse, such as the edges with the top 10% of the collapse value. The specific preset rule can be set according to actual needs. The collapse value of the edge includes two, because an edge has two vertices, and it is necessary to determine which vertex is the collapsed vertex, that is, which vertex needs to be removed and replaced by another vertex. Then for a vertex u, it may be the vertex of many triangles, so it can collapse from this vertex to many other vertices v. If the vertex u is the collapsed vertex, it is necessary to select the most suitable edge uv for collapse. For example, if you need to select edges with large collapse values for collapse, cost(u,v1), cost(u,v2), cost(u,v3), and cost(u,v4) represent the collapse values of the four edges with u as the vertex from u to vi, that is, if the edge is the target collapse edge, then u is the collapsed vertex. If cost(u,v2) and cost(u,v3) are both in the top 10%, then the target edge is determined to be the one with the largest collapse value. For example, if cost(u,v2)>cost(u,v3), then edge uv2 is the target edge, and u is the collapsed vertex of the target edge.
[0109] Optionally, step 1031 may specifically include: for each edge of the i-th level three-dimensional model data, calculating the curvature value and the length of the edge, and calculating the collapse value of the edge according to the curvature value and the length of the edge.
[0110] Specifically, the calculation of the collapse value of the edge can be the product of the curvature value of the edge and the length of the edge, or the result of other calculations, such as: length*(1-curvature value), or length*(1-curvature value) / 2, etc., which can be considered and set according to actual needs.
[0111] Optionally, calculating and obtaining the curvature value of the edge includes: calculating and obtaining the curvature value of the edge according to normal vectors of two faces to which the edge belongs.
[0112] Optionally, the collapse value of an edge can be calculated using the following formula:
[0113]
[0114] Among them, u and v represent the two vertices of the edge, cost(u,v) represents the collapse value of vertex u to v of the edge, ||uv|| represents the distance between the two vertices, that is, the length of the edge; f.normal and n.normal represent the normal vectors of the two faces f and n to which the edge belongs, f.normal·n.normal represents the dot product of the two normal vectors, that is, the curvature value of the edge, Tu represents the set of triangular faces containing vertex u, and Tuv represents the set of triangular faces containing both vertex u and vertex v.
[0115] The min and max in the above formula take into account that the triangle containing both vertex u and vertex v in the model may include a large triangle composed of multiple basic unit triangles in addition to the basic unit triangle, and the triangle containing vertex u may include a large triangle composed of multiple basic unit triangles in addition to the basic unit triangle.
[0116] If the 3D model data is represented only by the basic unit triangle, without considering the large triangle composed of multiple triangles, the collapse calculation formula can be:
[0117] cost(u,v)=||uv||×{(1-f.normal·n.normal) / 2}
[0118] The meaning of each symbol is the same as in the above formula.
[0119] When selecting the target edge to collapse, the curvature and size of the surface are balanced, which is also effective for the collapse of ridged edges. The two surfaces connected by the ridged edge can be at an acute angle or a right angle. For example, Figure 4FIG. 1 is a schematic diagram of edge collapse provided in the present embodiment. ORIGINAL may represent the original model to be simplified, B to A and B to C represent vertex B in the middle of the plane region, which is collapsed to vertex A and vertex C, respectively, and vertex C at the corner is retained. If vertex A is collapsed to vertex B in the middle of the plane region, or vertex C is collapsed to vertex A or vertex B, the structural shape of the model is seriously affected, but vertex A can be collapsed to vertex C along the ridge (AC edge) without affecting the appearance of the model.
[0120] Optionally, step 1033 may specifically include: for each target edge uv, removing the triangular face with the target edge as an edge in the i+1th level three-dimensional model data, and for other triangular faces, updating the collapsed vertex u to vertex v, and removing vertex u.
[0121] Optionally, the collapse value of each edge includes a first collapse value and a second collapse value, wherein the first collapse value is a collapse value of the first vertex of the edge collapsing toward the second vertex, and the second collapse value is a collapse value of the second vertex of the edge collapsing toward the first vertex;
[0122] According to the collapse value of each edge, the target edge to be collapsed and the collapsed vertices corresponding to each target edge are determined, including:
[0123] The collapse values of each edge are arranged in descending order, and the edges corresponding to the collapse values of a preset proportion are taken as target edges; for each target edge, if the collapse value is the collapse value of the first vertex collapsing to the second vertex, the first vertex is the collapsed vertex corresponding to the target edge.
[0124] For example, if it is necessary to select edges with large collapse values for collapse, cost(u,v1), cost(u,v2), cost(u,v3), and cost(u,v4) represent the collapse values of the four edges with u as the vertex from u to vi, that is, if the edge is the target collapse edge, then u is the collapsed vertex. If cost(u,v2) and cost(u,v3) are both in the top 10%, then the target edge is determined to be the one with the largest collapse value. For example, if cost(u,v2)>cost(u,v3), then edge uv2 is the target edge, and u is the collapsed vertex of the target edge.
[0125] Optionally, the method further comprises:
[0126] Step 211, traverse each vertex of the i-th level three-dimensional model data to obtain the number of edges associated with each vertex;
[0127] Step 2012, taking vertices with a preset ratio of associated edges as key vertices;
[0128] Before step 1033, the method further includes:
[0129] The edges whose collapsed vertices are key vertices are not used as target edges.
[0130] Specifically, since the final decision of collapse depends on the product of the curvature value of the edge and the edge length, the two factors are combined. However, the curvature of some key edges is very large, but the edge length is very small, and the vertices associated with it are at risk of collapse. In order to keep the overall structure of the model from being seriously changed and the distortion rate of the model is minimized, it is necessary to protect the key points of the model. If the collapsed vertices of the collapsed edge are these key points, then no collapse is performed. The specific protection method can be to sort the number of edges associated with each vertex, such as arranging from high to low, and selecting the top 5% as key points for protection. According to the geometric characteristics of the model, these points are basically in the edge area of the model. The proportion of selected key points can be dynamically configured according to actual needs, which is not limited to 5%. For example, it can also be 1%, 2%, 7%, etc.
[0131] As another practicable manner, based on the above embodiment 1, optionally, after obtaining the simplified 3D model data, the 3D model rendering process can be performed according to the simplified 3D model data. The specific rendering process can adopt any practicable manner in the prior art, and this embodiment does not limit it.
[0132] Optionally, the device may also send the simplified three-dimensional model data to other terminals for rendering processing.
[0133] Optionally, the above-mentioned iterative control conditions (such as a preset face number threshold) and preset rules can be continuously adjusted to obtain the best simplification effect. For example, after obtaining the simplified three-dimensional model data, a simplified three-dimensional model display can be generated and compared with the original three-dimensional model. If the simplification effect is not ideal, the iterative control conditions and various parameters in the iterative process can be adjusted, and the simplification process can be performed again, and so on until satisfactory simplified three-dimensional model data is obtained. Certain rules can be set for the adjustment of iterative control conditions and parameters to make them automatically adjusted, or they can be adjusted manually. The specific settings can be based on actual needs, and the embodiments of the present application are not limited thereto.
[0134] The method provided in the embodiment of the present application can solve the problem of surface reduction of 3D high-precision models, allowing many industrial models to be directly applied to 3D displays in e-commerce, reducing labor costs, allowing the 3D industry to develop better, laying the foundation for the implementation of technologies such as AR and VR, and allowing more people to enjoy the fun of technology.
[0135] It should be noted that each implementable method in this embodiment may be implemented separately, or may be implemented in combination in any combination without conflict, and this application is not limited thereto.
[0136] In the processing method of the business service provided in this embodiment, the user can select the product to be viewed through the terminal device, and the terminal device obtains the identification information of the product selected by the user, carries the identification information of the product in the service request and sends it to the service device. The service device receives the service request of the terminal device, responds to the service request, obtains the original three-dimensional model data corresponding to the identification information, simplifies the original three-dimensional model data based on the edge collapse technology to obtain simplified three-dimensional model data, and sends the simplified three-dimensional model data to the terminal device so that the terminal device can render and display it. The efficiency of three-dimensional model face reduction processing is effectively improved, thereby improving the efficiency of business service processing. And the key vertex protection is performed through the number of edges associated with each vertex, further improving the simplification effect.
[0137] Embodiment 3
[0138] This embodiment provides a business service processing device, which is used to execute the method of the above-mentioned embodiment 1.
[0139] like Figure 5 FIG. 3 is a schematic diagram of the structure of the processing device for the business service provided in this embodiment. The processing device 30 for the business service includes a receiving module 31 , an acquiring module 32 , a simplifying module 33 and a sending module 34 .
[0140] Among them, a receiving module is used to receive a service request sent by a terminal device, and the service request includes identification information of a product; an obtaining module is used to obtain original three-dimensional model data corresponding to the identification information according to the service request; a simplification module is used to simplify the original three-dimensional model data based on the collapse value of each edge in the original three-dimensional model data to obtain simplified three-dimensional model data, wherein the collapse value of each edge is obtained based on the curvature value of the edge and the length of the edge; and a sending module is used to send the simplified three-dimensional model data of the product to the terminal device.
[0141] Optionally, the apparatus may further include a processing module, configured to perform rendering processing according to the simplified three-dimensional model data to obtain a target three-dimensional model; and the sending module is further configured to send the target three-dimensional model to a terminal device for display.
[0142] Regarding the device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0143] According to the processing device of the business service provided by this embodiment, the user can select the product to be viewed through the terminal device, and the terminal device obtains the identification information of the product selected by the user, carries the identification information of the product in the service request and sends it to the service device. The service device receives the service request of the terminal device, responds to the service request, obtains the original 3D model data corresponding to the identification information, simplifies the original 3D model data based on the edge collapse technology to obtain simplified 3D model data, and sends the simplified 3D model data to the terminal device so that the terminal device can render and display it. The efficiency of 3D model face reduction processing is effectively improved, thereby improving the efficiency of business service processing.
[0144] Embodiment 4
[0145] This embodiment further supplements the description of the device for processing the business service provided in the third embodiment.
[0146] As an implementable manner, based on the above-mentioned embodiment 3, optionally, a simplified module is specifically used for:
[0147] Traverse each edge of the i-th level 3D model data, and calculate the collapse value of each edge, wherein i is a positive integer, and the first level 3D model data is the original 3D model data;
[0148] According to the collapse value of each edge, determine the target edge to be collapsed and the collapsed vertices corresponding to each target edge;
[0149] Perform collapse processing according to the target edges to be collapsed and the collapsed vertices corresponding to each target edge, and obtain the i+1th level three-dimensional model data;
[0150] The above steps are iterated until three-dimensional model data with a face number within a preset threshold range is obtained as the simplified three-dimensional model data.
[0151] Optionally, a simplified module is specifically used to:
[0152] For each edge of the i-th level three-dimensional model data, the curvature value and the length of the edge are calculated, and the collapse value of the edge is calculated based on the curvature value and the length of the edge.
[0153] Optionally, a simplified module is specifically used to:
[0154] The curvature value of the edge is obtained by calculating the normal vectors of the two faces to which the edge belongs.
[0155] Optionally, a simplified module is specifically used to:
[0156] For each edge of the i-th level 3D model data, the collapse value cost of the edge is calculated using the following formula:
[0157]
[0158] Among them, u and v represent the two vertices of the edge, cost(u,v) represents the collapse value of vertex u to v of the edge, ||uv|| represents the distance between the two vertices, that is, the length of the edge; f.normal and n.normal represent the normal vectors of the two faces f and n to which the edge belongs, f.normal·n.normal represents the dot product of the two normal vectors, that is, the curvature value of the edge, Tu represents the set of triangular faces containing vertex u, and Tuv represents the set of triangular faces containing both vertex u and vertex v.
[0159] Optionally, a simplified module is specifically used to:
[0160] For each target edge uv, the triangular face with the target edge as an edge is removed from the i+1th level 3D model data. For other triangular faces, the collapsed vertex u is updated to vertex v, and vertex u is removed.
[0161] Optionally, the collapse value of each edge includes a first collapse value and a second collapse value, wherein the first collapse value is a collapse value of the first vertex of the edge collapsing toward the second vertex, and the second collapse value is a collapse value of the second vertex of the edge collapsing toward the first vertex;
[0162] Simplified modules, specifically for:
[0163] The collapse values of each edge are arranged in descending order, and the edges corresponding to the collapse values of the preset proportion are taken as the target edges;
[0164] For each target edge, if the collapse value is a collapse value of the first vertex collapsing toward the second vertex, the first vertex is the collapsed vertex corresponding to the target edge.
[0165] Optionally, the simplification module is further used to: traverse each vertex of the i-th level three-dimensional model data to obtain the number of edges associated with each vertex; and use the vertices with a preset proportion of the number of associated edges as key vertices;
[0166] Before performing collapse processing according to the target edges to be collapsed and the collapsed vertices corresponding to each target edge, the simplification module is further used for: not treating the edges with the collapsed vertices as key vertices as target edges.
[0167] Regarding the device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0168] It should be noted that each implementable method in this embodiment may be implemented separately, or may be implemented in combination in any combination without conflict, and this application is not limited thereto.
[0169] According to the processing device of the business service of this embodiment, the user can select the product to be viewed through the terminal device, and the terminal device obtains the identification information of the product selected by the user, carries the identification information of the product in the service request and sends it to the service device. The service device receives the service request of the terminal device, responds to the service request, obtains the original three-dimensional model data corresponding to the identification information, simplifies the original three-dimensional model data based on the edge collapse technology to obtain simplified three-dimensional model data, and sends the simplified three-dimensional model data to the terminal device so that the terminal device can render and display it. The efficiency of three-dimensional model face reduction processing is effectively improved, thereby improving the efficiency of business service processing. And the key vertex protection is performed through the number of edges associated with each vertex, further improving the simplification effect.
[0170] Embodiment 5
[0171] This embodiment provides a computer device, which is used to execute the method provided in the above embodiment.
[0172] like Figure 6 The figure is a schematic diagram of the structure of the computer device provided in this embodiment. The computer device 50 includes: at least one processor 51 and a memory 52;
[0173] The memory stores a computer program; and at least one processor executes the computer program stored in the memory to implement the method provided in the above embodiment.
[0174] According to the computer device of this embodiment, the user can select the product to be viewed through the terminal device, and the terminal device obtains the identification information of the product selected by the user, carries the identification information of the product in the service request and sends it to the service device. The service device receives the service request of the terminal device, responds to the service request, obtains the original three-dimensional model data corresponding to the identification information, simplifies the original three-dimensional model data based on the edge collapse technology to obtain simplified three-dimensional model data, and sends the simplified three-dimensional model data to the terminal device so that the terminal device can render and display it. The efficiency of the three-dimensional model face reduction processing is effectively improved, thereby improving the efficiency of business service processing. And the key vertex protection is performed through the number of edges associated with each vertex, further improving the simplification effect.
[0175] Embodiment 6
[0176] This embodiment provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed, the method provided in any of the above embodiments is implemented.
[0177] According to the computer-readable storage medium of this embodiment, the user can select the product to be viewed through the terminal device, and the terminal device obtains the identification information of the product selected by the user, carries the identification information of the product in the service request and sends it to the service device. The service device receives the service request of the terminal device, responds to the service request, obtains the original three-dimensional model data corresponding to the identification information, simplifies the original three-dimensional model data based on the edge collapse technology to obtain simplified three-dimensional model data, and sends the simplified three-dimensional model data to the terminal device so that the terminal device can render and display it. The efficiency of the three-dimensional model face reduction processing is effectively improved, thereby improving the efficiency of business service processing. And the key vertex protection is performed through the number of edges associated with each vertex, further improving the simplification effect.
[0178] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0179] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0180] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0181] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0182] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0183] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for processing a business service, characterized in that: include: Receiving a service request sent by a terminal device, wherein the service request includes identification information of a product; Acquire original three-dimensional model data corresponding to the identification information according to the service request; Based on the collapse value of each edge in the original three-dimensional model data, simplifying the original three-dimensional model data to obtain simplified three-dimensional model data, wherein the collapse value of each edge is obtained according to the curvature value of the edge and the length of the edge; Sending the simplified three-dimensional model data of the product to the terminal device; Based on the collapse value of each edge in the original three-dimensional model data, the original three-dimensional model data is simplified to obtain simplified three-dimensional model data, including: Traversing each edge of the i-th level three-dimensional model data, and calculating the collapse value of each edge, wherein i is a positive integer, and the first level three-dimensional model data is the original three-dimensional model data; According to the collapse value of each edge, determine the target edge to be collapsed and the collapsed vertices corresponding to each target edge; Perform collapse processing according to the target edges to be collapsed and the collapsed vertices corresponding to each target edge, and obtain the i+1th level three-dimensional model data; Iterate according to the above steps until the three-dimensional model data with the number of faces within the preset threshold range is obtained as the simplified three-dimensional model data; The method further comprises: Traverse each vertex of the i-th level three-dimensional model data to obtain the number of edges associated with each vertex; The vertices with a preset ratio of the number of associated edges are taken as key vertices; Before performing collapse processing according to the target edges to be collapsed and the collapsed vertices corresponding to each target edge to obtain the i+1th level three-dimensional model data, the method further includes: The edge whose collapsed vertex is the key vertex is not used as a target edge.
2. The method according to claim 1, characterized in that Traverse each edge of the i-th level 3D model data and calculate the collapse value of each edge, including: For each edge of the i-th level three-dimensional model data, the curvature value and the length of the edge are calculated, and the collapse value of the edge is calculated based on the curvature value and the length of the edge.
3. The method according to claim 2, characterized in that Calculate the curvature value of the edge, including: The curvature value of the edge is obtained by calculating the normal vectors of the two faces to which the edge belongs.
4. The method according to claim 1, characterized in that: Traverse each edge of the i-th level 3D model data and calculate the collapse value of each edge, including: For each edge of the i-th level 3D model data, the collapse value cost of the edge is calculated using the following formula: Among them, u and v represent the two vertices of the edge, cost(u,v) represents the collapse value of vertex u to v of the edge, ||uv|| represents the distance between the two vertices, that is, the length of the edge; f.normal and n.normal represent the normal vectors of the two faces f and n to which the edge belongs, f.normal·n.normal represents the dot product of the two normal vectors, that is, the curvature value of the edge, Tu represents the set of triangular faces containing vertex u, and Tuv represents the set of triangular faces containing both vertex u and vertex v.
5. A processing device for business services, characterized in that: include: A receiving module, used to receive a service request sent by a terminal device, wherein the service request includes identification information of a product; An acquisition module, used for acquiring original three-dimensional model data corresponding to the identification information according to the service request; A simplification module, configured to simplify the original three-dimensional model data based on the collapse value of each edge in the original three-dimensional model data to obtain simplified three-dimensional model data, wherein the collapse value of each edge is obtained according to the curvature value of the edge and the length of the edge; A sending module, used to send the simplified three-dimensional model data of the product to the terminal device; The simplified module is specifically used for: Traversing each edge of the i-th level three-dimensional model data, and calculating the collapse value of each edge, wherein i is a positive integer, and the first level three-dimensional model data is the original three-dimensional model data; According to the collapse value of each edge, determine the target edge to be collapsed and the collapsed vertices corresponding to each target edge; Perform collapse processing according to the target edges to be collapsed and the collapsed vertices corresponding to each target edge, and obtain the i+1th level three-dimensional model data; Iterate according to the above steps until the three-dimensional model data with the number of faces within the preset threshold range is obtained as the simplified three-dimensional model data; The simplified module is also used for: Traverse each vertex of the i-th level three-dimensional model data to obtain the number of edges associated with each vertex; The vertices with a preset ratio of the number of associated edges are taken as key vertices; Simplified module, also used for: Before performing collapse processing according to the target edges to be collapsed and the collapsed vertices corresponding to each target edge to obtain the i+1th level three-dimensional model data, the edge whose collapsed vertex is the key vertex is not used as the target edge.
6. The device according to claim 5, characterized in that The simplified module is specifically used for: For each edge of the i-th level three-dimensional model data, the curvature value and the length of the edge are calculated, and the collapse value of the edge is calculated based on the curvature value and the length of the edge.
7. The device according to claim 6, characterized in that The simplified module is specifically used for: The curvature value of the edge is obtained by calculating the normal vectors of the two faces to which the edge belongs.
8. The device according to claim 5, characterized in that The simplified module is specifically used for: For each edge of the i-th level 3D model data, the collapse value cost of the edge is calculated using the following formula: Among them, u and v represent the two vertices of the edge, cost(u,v) represents the collapse value of vertex u to v of the edge, ||uv|| represents the distance between the two vertices, that is, the length of the edge; f.normal and n.normal represent the normal vectors of the two faces f and n to which the edge belongs, f.normal·n.normal represents the dot product of the two normal vectors, that is, the curvature value of the edge, Tu represents the set of triangular faces containing vertex u, and Tuv represents the set of triangular faces containing both vertex u and vertex v.
9. A computer device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 4 is implemented.
