Model data processing method and device, storage medium and electronic equipment

By determining point pairs in the 3D model file and calculating the target texture coordinates of the shrinkage points, the problem of high manual cost of drawing texture coordinates after surface reduction is solved, realizing automatic calculation of texture coordinates in 3D model processing and improving processing efficiency.

CN115880434BActive Publication Date: 2026-03-31NEUSOFT CORP +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-20
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing technologies require significant manual labor to draw texture coordinates after reducing the number of faces in a 3D model, resulting in low processing efficiency.

Method used

By identifying point pairs from the 3D model file, calculating the shrinkage point of the point pair, and calculating the target texture coordinates of the shrinkage point based on the texture coordinates of the points, a new 3D model file is generated. The texture coordinates are calculated simultaneously to reduce subsequent manual processing.

Benefits of technology

It enables automatic calculation of texture coordinates during the face reduction process, reducing subsequent manual processing costs and improving processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115880434B_ABST
    Figure CN115880434B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a model data processing method and device, a storage medium and an electronic device. The method comprises: determining at least one set of point pairs from a three-dimensional model file, each point pair comprising a first point and a second point; calculating a contraction point of the first point and the second point; calculating a target texture coordinate of the contraction point according to a first texture coordinate of the first point and a second texture coordinate of the second point; and generating a new three-dimensional model file according to the contraction point and the target texture coordinate. The above technical solution synchronously calculates the target texture coordinate of the contraction point when reducing the surface, so that the three-dimensional model file after surface reduction has texture coordinates. In this way, the subsequent manual processing cost can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and more specifically, to a model data processing method, apparatus, storage medium, and electronic device. Background Technology

[0002] With the development of computer hardware and software technology, the demand for 3D modeling is rapidly increasing, and the structure of 3D models is becoming increasingly complex. In practical applications, there are often requirements for model processing speed, which necessitates the simplification of 3D models. In some scenarios, reducing the polygon count of the model can lower the space storage cost and reduce the computational load of subsequent texture mapping. Although the above methods can make the model lighter, significant manual labor is still required for subsequent model processing after polygon reduction. Summary of the Invention

[0003] The purpose of this disclosure is to provide a model data processing method, apparatus, storage medium, and electronic device to solve the aforementioned related technical problems.

[0004] To achieve the above objectives, according to a first aspect of the present disclosure, a model data processing method is provided, comprising:

[0005] Determine at least one pair of points from the 3D model file, each pair of points including a first point and a second point;

[0006] Calculate the point of contraction between the first and second points;

[0007] Calculate the target texture coordinates of the contraction point based on the first texture coordinates of the first point and the second texture coordinates of the second point;

[0008] A new 3D model file is generated based on the contraction point and the target texture coordinates.

[0009] Optionally, calculating the contraction point of the first point and the second point includes:

[0010] Multiple candidate points are determined from the line segment between the first point and the second point;

[0011] Calculate the quadratic error measure for each candidate point;

[0012] The candidate point with the smallest quadratic error measure value is taken as the contraction point.

[0013] Optionally, determining multiple candidate points from the line segment between the first point and the second point includes:

[0014] Divide the line segment between the first point and the second point into multiple equal division points;

[0015] The first point, the second point, and the plurality of equally divided points are selected as candidate points.

[0016] Optionally, calculating the target texture coordinates of the contraction point based on the first texture coordinates of the first point and the second texture coordinates of the second point includes:

[0017] Based on the distance between the contraction point and the first point, and the distance between the contraction point and the second point, calculate the first weight coefficient of the first texture coordinate and the second weight coefficient of the second texture coordinate;

[0018] When the first point corresponds one-to-one with the first texture coordinate and the second point corresponds one-to-one with the second texture coordinate, the target texture coordinate is calculated based on the first texture coordinate, the first weight coefficient, the second texture coordinate, and the second weight coefficient.

[0019] Optionally, calculating the target texture coordinates of the contraction point based on the first texture coordinates of the first point and the second texture coordinates of the second point includes:

[0020] When the first point corresponds to multiple first texture coordinates and the second point corresponds to multiple second texture coordinates, the multiple first texture coordinates and the multiple second texture coordinates are used as the target texture coordinates of the contraction point.

[0021] Optionally, calculating the target texture coordinates of the contraction point based on the first texture coordinates of the first point and the second texture coordinates of the second point includes:

[0022] Based on the distance between the contraction point and the first point, and the distance between the contraction point and the second point, calculate the first weight coefficient of the first texture coordinate and the second weight coefficient of the second texture coordinate;

[0023] When the first texture coordinates correspond to multiple points and the second texture coordinates correspond to multiple points, the target texture coordinates are calculated based on the first texture coordinates, the first weight coefficient, the second texture coordinates, and the second weight coefficient.

[0024] Optionally, the point pairs are multiple sets, and the step of generating a new 3D model file based on the contraction points and the target texture coordinates includes:

[0025] Obtain the quadratic error measure of the contraction point for each pair of points;

[0026] The point of contraction with the minimum quadratic error measure is determined to obtain the target point of contraction, which is the point of contraction of the target point pair;

[0027] The target shrinkage point is used as the new representation of the target point pair in the 3D model file, and the 3D model file is updated to obtain a new 3D model file;

[0028] In the new 3D model file, the texture coordinates of the target shrinkage point are the target texture coordinates.

[0029] According to a second aspect of the present disclosure, a model data processing apparatus is provided, comprising:

[0030] A first determining module is configured to determine at least one pair of points from a 3D model file, each pair of points including a first point and a second point;

[0031] The first calculation module is used to calculate the contraction point of the first point and the second point;

[0032] The second calculation module is used to calculate the target texture coordinates of the contraction point based on the first texture coordinates of the first point and the second texture coordinates of the second point;

[0033] The generation module is used to generate a new 3D model file based on the contraction point and the target texture coordinates.

[0034] Optionally, the first computing module includes:

[0035] The first determining submodule is used to determine multiple candidate points from the line segment between the first point and the second point;

[0036] The first calculation submodule is used to calculate the quadratic error measure value of each candidate point;

[0037] The first execution submodule is used to select the candidate point with the smallest quadratic error measure value as the contraction point.

[0038] Optionally, the first determining submodule includes:

[0039] Equal molecular units are used to divide the line segment between the first point and the second point into multiple equal division points;

[0040] An execution subunit is used to select the first point, the second point, and the plurality of equally divided points as candidate points.

[0041] Optionally, the second computing module includes:

[0042] The second calculation submodule is used to calculate the first weight coefficient of the first texture coordinate and the second weight coefficient of the second texture coordinate based on the distance between the contraction point and the first point and the distance between the contraction point and the second point.

[0043] The third calculation submodule is used to calculate the target texture coordinates based on the first texture coordinates, the first weight coefficient, the second texture coordinates, and the second weight coefficient, when the first point corresponds one-to-one with the first texture coordinates and the second point corresponds one-to-one with the second texture coordinates.

[0044] Optionally, the second computing module includes:

[0045] The second execution submodule is used to use the multiple first texture coordinates and the multiple second texture coordinates as the target texture coordinates of the contraction point when the first point corresponds to multiple first texture coordinates and the second point corresponds to multiple second texture coordinates.

[0046] Optionally, the second computing module includes:

[0047] The second calculation submodule is used to calculate the first weight coefficient of the first texture coordinate and the second weight coefficient of the second texture coordinate based on the distance between the contraction point and the first point and the distance between the contraction point and the second point.

[0048] The third calculation submodule is used to calculate the target texture coordinates based on the first texture coordinates, the first weight coefficient, the second texture coordinates, and the second weight coefficient when the first texture coordinates correspond to multiple points and the second texture coordinates correspond to multiple points.

[0049] Optionally, the point pairs are in multiple groups, and the generation module includes:

[0050] The acquisition submodule is used to obtain the quadratic error measure value of the contraction point for each pair of points;

[0051] The second determining submodule is used to determine the contraction point with the minimum quadratic error measure value, and obtain the target contraction point, wherein the target contraction point is the contraction point of the target point pair;

[0052] The update submodule is used to update the three-dimensional model file by taking the target shrinkage point as the new representation of the target point pair in the three-dimensional model file, and obtaining a new three-dimensional model file.

[0053] In the new 3D model file, the texture coordinates of the target shrinkage point are the target texture coordinates.

[0054] According to a third aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the method described in any of the first aspects above.

[0055] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising:

[0056] A memory on which computer programs are stored;

[0057] A processor for executing the computer program in the memory to implement the steps of the method described in any of the first aspects above.

[0058] In the above technical solution, at least one pair of points can be determined from the 3D model file. For each pair of points, the shrinkage point of the first and second points can be calculated, and the target texture coordinates of the shrinkage point can be calculated based on the first texture coordinates of the first point and the second texture coordinates of the second point. Thus, a new 3D model file can be generated based on the shrinkage point and the target texture coordinates. By shrinking the first and second points into shrinkage points, the above technical solution achieves the effect of reducing the number of polygons in the model. Furthermore, the above technical solution simultaneously calculates the target texture coordinates of the shrinkage point during polygon reduction, resulting in a 3D model file with its own texture coordinates after polygon reduction. This reduces subsequent manual processing costs.

[0059] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description

[0060] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings:

[0061] Figure 1 This is a schematic diagram illustrating a model reduction method according to an exemplary embodiment of this disclosure.

[0062] Figure 2 This is a flowchart illustrating a model data processing method according to an exemplary embodiment of this disclosure.

[0063] Figure 3 This is a flowchart illustrating the calculation of a contraction point according to an exemplary embodiment of this disclosure.

[0064] Figure 4 This is a schematic diagram of a candidate point as shown in an exemplary embodiment of this disclosure.

[0065] Figure 5 This is a flowchart illustrating the calculation of target texture coordinates according to an exemplary embodiment of this disclosure.

[0066] Figure 6 This is a flowchart illustrating the generation process of a three-dimensional model as shown in an exemplary embodiment of this disclosure.

[0067] Figure 7This is a block diagram of a model data processing apparatus shown in an exemplary embodiment of the present disclosure.

[0068] Figure 8 This is a block diagram of an electronic device 800 as shown in an exemplary embodiment of this disclosure. Detailed Implementation

[0069] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.

[0070] Before introducing the model data processing method, apparatus, storage medium and electronic equipment of this disclosure, the application scenarios of this disclosure will be introduced first.

[0071] Generally, 3D models are represented using triangular meshes. The more triangular meshes used in a given 3D model, the more detailed the model. As the structure of 3D models becomes increasingly complex, and given the often demanding requirements for processing speed in practical applications, related technologies can simplify 3D models to reduce the computational load of subsequent rendering and improve rendering speed. For example, reducing the number of triangular meshes in a 3D model by performing polygon reduction can improve rendering speed.

[0072] Figure 1 This is a schematic diagram illustrating a model face reduction method, in which the number of triangles in the model is reduced by shrinking vertices V1 and V2 to V3. This reduces the computational load in subsequent texturing processes and improves the rendering speed of the model.

[0073] It's important to note that when applying textures to a model, the correspondence between the model's vertices and the texture images needs to be determined. Taking an OBJ format 3D model file as an example, each vertex in the OBJ file can be associated with at least one texture coordinate, which can be a UV coordinate.

[0074] Among them, UV coordinates are short for (U,V) texture map coordinates. They define the position of each point on the texture image. These points are interconnected with the 3D model to determine the position of the texture map. UV coordinates can accurately associate each point on the texture image with the surface of the model.

[0075] However, in related technologies, after reducing the polygon count of an OBJ file, the resulting OBJ file does not include texture coordinate information. Furthermore, due to the polygon reduction, the original texture coordinate information becomes invalid. Therefore, it is necessary to redraw the texture coordinates of the OBJ file after polygon reduction, and this drawing process is usually done manually, requiring significant manpower.

[0076] Therefore, this disclosure provides a model data processing method. Figure 2 This is a flowchart of a model data processing method shown in this disclosure, with reference to... Figure 2 The method includes:

[0077] In step S21, at least one pair of points is determined from the 3D model file, each pair of points including a first point and a second point.

[0078] The point pairs can include one or more groups. Taking an OBJ format 3D model file as an example, in some implementation scenarios, two connected points in the OBJ file can be considered as a point pair. In some implementation scenarios, the distance value of each point in the OBJ file can also be calculated, and two points with a distance value less than a set distance threshold can be considered as a point pair.

[0079] In step S22, the contraction points of the first and second points are calculated.

[0080] Reference Figure 3 The flowchart shown illustrates a calculation process for a contraction point. The calculation of the contraction point between the first and second points (step S22) may include:

[0081] In step S221, multiple candidate points are determined from the line segment between the first point and the second point.

[0082] For example, in one possible implementation scenario, determining multiple candidate points from the line segment between the first point and the second point includes:

[0083] Divide the line segment between the first point and the second point into multiple equal division points;

[0084] The first point, the second point, and the plurality of equally divided points are selected as candidate points.

[0085] For example, the line segment between the first point and the second point can be divided into three segments, five segments, etc., to obtain multiple equal division points. This disclosure does not restrict the method of equal division.

[0086] Figure 4 This is a schematic diagram of one type of candidate point as shown in this disclosure, where point 0 is the first point and point 10 is the second point. Thus, the line segment from point 1 to point 10 can be divided into 10 equal segments using points 1-9. When determining candidate points, points 0 to 10 can be considered as candidate points.

[0087] In some implementation scenarios, multiple points can be randomly determined in the line segment between the first point and the second point, and these multiple points can be used as candidate points.

[0088] In step S222, the quadratic error measure value of each candidate point is calculated.

[0089] The quadratic error measure can be the sum of the squares of the distances between the candidate point and the target point in the target surface. The target surface refers to the triangular face containing the first point and the triangular face containing the second point, and the target point is each point in the target surface. For the calculation method of the quadratic error measure, please refer to the descriptions in relevant technologies, such as the QEM algorithm; this disclosure will not elaborate on it further.

[0090] In step S223, the candidate point with the smallest quadratic error measure value is selected as the contraction point.

[0091] It should be noted that the QEM algorithm calculates the shrinkage point between two points using matrix operations. However, in some implementation scenarios, due to accuracy issues, the location of the shrinkage point may be far from the shrinkage edge (i.e., the edge formed by connecting the two points), resulting in a significant deviation between the model after surface reduction and the original model.

[0092] By employing the aforementioned technical solution, multiple candidate points can be determined from the line segment between the first and second points, and the shrinking point can be selected from these candidate points. This method ensures that the shrinking point lies within the line segment between the first and second points, i.e., on the shrinking edge, thus guaranteeing the reduction in surface area. Furthermore, compared to matrix calculations, determining the shrinking point from candidate points also offers advantages such as lower computational complexity and faster processing speed.

[0093] Reference Figure 2 In step S23, the target texture coordinates of the shrinkage point are calculated based on the first texture coordinates of the first point and the second texture coordinates of the second point.

[0094] Figure 5 This is a flowchart illustrating the calculation of target texture coordinates, as shown in this disclosure. Figure 5 The step of calculating the target texture coordinates of the shrinkage point based on the first texture coordinates of the first point and the second texture coordinates of the second point (step S23) includes:

[0095] In step S231, the first weight coefficient of the first texture coordinate and the second weight coefficient of the second texture coordinate are calculated based on the distance between the contraction point and the first point and the distance between the contraction point and the second point.

[0096] For example, in some implementation scenarios, the distance between the contraction point and the first point can be calculated to obtain the first distance, and the distance between the contraction point and the second point can be calculated to obtain the second distance. Furthermore, the distance between the first point and the second point can be calculated to obtain the third distance. Thus, the ratio of the first distance to the third distance can be calculated to obtain the first weighting coefficient, and the ratio of the second distance to the third distance can be calculated to obtain the second weighting coefficient.

[0097] In some implementation scenarios, when the line segment between the first point and the second point is divided into equal parts, each candidate point can be numbered, and a first weighting coefficient and a second weighting coefficient can be calculated based on the candidate point number and the number of equal segments. For example, in... Figure 4 In the middle, following the direction from the first point to the second point, the 11 candidate points can be numbered sequentially from 0 to 10.

[0098] Thus, the first weighting coefficient A can be calculated using the following formula: i is the number of the candidate point. Of course, in some implementation scenarios, the number of equal segments can also be N, then the formula for calculating the first weight coefficient can be:

[0099] Similarly, the second weighting coefficient B can be calculated using the following formula: i is the number of the candidate point. Of course, in some implementation scenarios, the number of equal segments can also be N, then the formula for calculating the second weighting coefficient can be:

[0100] It should be noted that in some implementation scenarios, the 11 candidate points can also be numbered sequentially from 0 to 10 along the direction from the second point to the first point. In this case, the formula for calculating the first weight coefficient can be: The formula for calculating the second weighting coefficient can be:

[0101] In step S232, when the first point corresponds one-to-one with the first texture coordinates and the second point corresponds one-to-one with the second texture coordinates, the target texture coordinates are calculated based on the first texture coordinates, the first weight coefficient, the second texture coordinates, and the second weight coefficient.

[0102] When the first point corresponds one-to-one with the first texture coordinates, and the second point corresponds one-to-one with the second texture coordinates, the 3D model plane containing the contracted edge corresponds one-to-one with the region in the texture image. In this case, the target texture coordinates can be calculated using the first texture coordinates, the first weighting coefficient, the second texture coordinates, and the second weighting coefficient. Following the example above, the target texture coordinates v can be calculated using the following formula. t0 :

[0103] v t0 =A×v t1 +B×v t2

[0104] Among them, v t1 v is the first texture coordinate. t2 Let A be the second texture coordinate, A be the first weighting coefficient, and B be the second weighting coefficient. For example, in... Figure 4 In the example, but:

[0105]

[0106] In one possible implementation, the target texture coordinates of the contraction point are calculated based on the first texture coordinates of the first point and the second texture coordinates of the second point (step S23), including:

[0107] When the first point corresponds to multiple first texture coordinates and the second point corresponds to multiple second texture coordinates, the multiple first texture coordinates and the multiple second texture coordinates are used as the target texture coordinates of the shrinkage point.

[0108] When the first point corresponds to multiple first texture coordinates and the second point corresponds to multiple second texture coordinates, it means that the same model plane where the contraction edge is located corresponds to multiple different target regions in the texture image.

[0109] Here, multiple target regions may be far apart in the texture image. In this case, if the first texture coordinate and the second texture coordinate are weighted, the resulting target texture coordinates may correspond to unrelated regions between the multiple target regions, thus leading to incorrect texture content.

[0110] Therefore, when the first point corresponds to multiple first texture coordinates and the second point corresponds to multiple second texture coordinates, the multiple first texture coordinates and multiple second texture coordinates can be used as the target texture coordinates for the shrinkage point. In this case, texturing operations can be performed based on the target texture coordinates using methods such as stretching and extending.

[0111] In one possible implementation, the target texture coordinates of the contraction point are calculated based on the first texture coordinates of the first point and the second texture coordinates of the second point (step S23), including:

[0112] Based on the distance between the contraction point and the first point, and the distance between the contraction point and the second point, calculate the first weight coefficient of the first texture coordinate and the second weight coefficient of the second texture coordinate;

[0113] When the first texture coordinate corresponds to multiple points and the second texture coordinate corresponds to multiple points, the target texture coordinate is calculated based on the first texture coordinate, the first weight coefficient, the second texture coordinate, and the second weight coefficient.

[0114] For example, in some implementation scenarios, the distance between the contraction point and the first point can be calculated to obtain the first distance, and the distance between the contraction point and the second point can be calculated to obtain the second distance. In addition, the distance between the first point and the second point can be calculated to obtain the third distance.

[0115] In this way, the ratio of the first distance to the third distance can be calculated to obtain the first weight coefficient, and the ratio of the second distance to the third distance can be calculated to obtain the second weight coefficient.

[0116] In some implementation scenarios, when the line segment between the first point and the second point is divided into equal parts, each candidate point can be numbered, and a first weighting coefficient and a second weighting coefficient can be calculated based on the candidate point number and the number of equal segments. For example, in... Figure 4 In the middle, following the direction from the first point to the second point, the 11 candidate points can be numbered sequentially from 0 to 10.

[0117] Thus, the first weighting coefficient A can be calculated using the following formula: i is the number of the candidate point. Of course, in some implementation scenarios, the number of equal segments can also be N, then the formula for calculating the first weight coefficient can be:

[0118] Similarly, the second weighting coefficient B can be calculated using the following formula: i is the number of the candidate point. Of course, in some implementation scenarios, the number of equal segments can also be N, then the formula for calculating the second weighting coefficient can be:

[0119] It should be noted that in some implementation scenarios, the 11 candidate points can also be numbered sequentially from 0 to 10 along the direction from the second point to the first point. In this case, the formula for calculating the first weight coefficient can be: The formula for calculating the second weighting coefficient can be:

[0120] When the first texture coordinate corresponds to multiple points, and the second texture coordinate corresponds to multiple points, it indicates that the 3D model plane where the contraction edge is located is related to the texture. Figure 1 With a one-to-one correspondence, the target texture coordinates can be calculated using the first texture coordinates, the first weighting coefficient, the second texture coordinates, and the second weighting coefficient. Continuing with the example above, the target texture coordinates v can be calculated using the following formula. t0 :

[0121] v t0 =A×v t1 +B×v t2

[0122] Among them, v t1 v is the first texture coordinate. t2 Let A be the second texture coordinate, A be the first weighting coefficient, and B be the second weighting coefficient. For example, in... Figure 4 In the example, but:

[0123]

[0124] In step S24, a new 3D model file is generated based on the contraction point and the target texture coordinates.

[0125] Figure 6 This is a flowchart illustrating the generation process of a three-dimensional model as shown in this disclosure, with reference to... Figure 6 The process of generating a new 3D model file based on the contraction point and the target texture coordinates (step S24) includes:

[0126] In step S241, the quadratic error measure value of the contraction point of each pair of points is obtained.

[0127] In step S242, the contraction point with the smallest quadratic error measure value is determined to obtain the target contraction point, which is the contraction point of the target point pair.

[0128] It should be noted that those skilled in the art can determine the target contraction point based on application requirements. For example, in some possible implementations, the contraction point where the quadratic error measure value is less than a set threshold can be used as the target contraction point.

[0129] In some possible implementations, the quadratic error measure values ​​of the contraction points can be sorted from largest to smallest, and a preset number of contraction points with smaller quadratic error measure values ​​can be used as target contraction points. This disclosure does not limit this.

[0130] In step S243, the target shrinkage point is used as the new representation of the target point pair in the 3D model file, and the 3D model file is updated to obtain a new 3D model file.

[0131] In the new 3D model file, the texture coordinates of the target shrinkage point are the target texture coordinates.

[0132] For example, you can replace the target point pairs in a 3D model file with the target shrinkage points and replace the texture coordinates associated with the target point pairs with the target texture coordinates to obtain a new 3D model file.

[0133] It should be noted that when the first texture coordinate corresponds to multiple points and the second texture coordinate corresponds to multiple points, changes to the first and second texture coordinates may affect the mapping process of other points.

[0134] Therefore, step S243 may include:

[0135] Delete the target point pair from the 3D model file;

[0136] Create the target shrinkage point in the 3D model file, and the texture coordinates of the target shrinkage point are the target texture coordinates.

[0137] This way, the first and second texture coordinates can remain unchanged, ensuring that other points can correctly perform the texture mapping process.

[0138] In the above technical solution, at least one pair of points can be determined from the 3D model file. For a pair of points, the contraction point of the first and second points in the pair can be calculated, and the target texture coordinates of the contraction point can be calculated based on the first texture coordinates of the first point and the second texture coordinates of the second point.

[0139] In this way, a new 3D model file can be generated based on the shrinkage point and the target texture coordinates. By shrinking the first and second points into a shrinkage point, the above technical solution can achieve the effect of reducing the number of polygons in the model. Furthermore, the above technical solution simultaneously calculates the target texture coordinates of the shrinkage point during polygon reduction, so that the 3D model file after polygon reduction inherently contains texture coordinates. This reduces the subsequent manual processing costs.

[0140] Based on the same inventive concept, this disclosure also provides a model data processing device. Figure 7 This is a block diagram of a model data processing apparatus shown in this disclosure, with reference to... Figure 7 The model data processing device includes:

[0141] The first determining module 701 is used to determine at least one pair of points from a 3D model file, each pair of points including a first point and a second point;

[0142] The first calculation module 702 is used to calculate the contraction point of the first point and the second point;

[0143] The second calculation module 703 is used to calculate the target texture coordinates of the contraction point based on the first texture coordinates of the first point and the second texture coordinates of the second point;

[0144] The generation module 704 is used to generate a new three-dimensional model file based on the contraction point and the target texture coordinates.

[0145] In the above technical solution, at least one pair of points can be determined from the 3D model file. For each pair of points, the shrinkage point of the first and second points can be calculated, and the target texture coordinates of the shrinkage point can be calculated based on the first texture coordinates of the first point and the second texture coordinates of the second point. Thus, a new 3D model file can be generated based on the shrinkage point and the target texture coordinates. By shrinking the first and second points into shrinkage points, the above technical solution achieves the effect of reducing the number of polygons in the model. Furthermore, the above technical solution simultaneously calculates the target texture coordinates of the shrinkage point during polygon reduction, resulting in a 3D model file with its own texture coordinates after polygon reduction. This reduces subsequent manual processing costs.

[0146] Optionally, the first computing module includes:

[0147] The first determining submodule is used to determine multiple candidate points from the line segment between the first point and the second point;

[0148] The first calculation submodule is used to calculate the quadratic error measure value of each candidate point;

[0149] The first execution submodule is used to select the candidate point with the smallest quadratic error measure value as the contraction point.

[0150] Optionally, the first determining submodule includes:

[0151] Equal molecular units are used to divide the line segment between the first point and the second point into multiple equal division points;

[0152] An execution subunit is used to select the first point, the second point, and the plurality of equally divided points as candidate points.

[0153] Optionally, the second computing module includes:

[0154] The second calculation submodule is used to calculate the first weight coefficient of the first texture coordinate and the second weight coefficient of the second texture coordinate based on the distance between the contraction point and the first point and the distance between the contraction point and the second point.

[0155] The third calculation submodule is used to calculate the target texture coordinates based on the first texture coordinates, the first weight coefficient, the second texture coordinates, and the second weight coefficient, when the first point corresponds one-to-one with the first texture coordinates and the second point corresponds one-to-one with the second texture coordinates.

[0156] Optionally, the second computing module includes:

[0157] The second execution submodule is used to use the multiple first texture coordinates and the multiple second texture coordinates as the target texture coordinates of the contraction point when the first point corresponds to multiple first texture coordinates and the second point corresponds to multiple second texture coordinates.

[0158] Optionally, the second computing module includes:

[0159] The second calculation submodule is used to calculate the first weight coefficient of the first texture coordinate and the second weight coefficient of the second texture coordinate based on the distance between the contraction point and the first point and the distance between the contraction point and the second point.

[0160] The third calculation submodule is used to calculate the target texture coordinates based on the first texture coordinates, the first weight coefficient, the second texture coordinates, and the second weight coefficient when the first texture coordinates correspond to multiple points and the second texture coordinates correspond to multiple points.

[0161] Optionally, the point pairs are in multiple groups, and the generation module includes:

[0162] The acquisition submodule is used to obtain the quadratic error measure value of the contraction point for each pair of points;

[0163] The second determining submodule is used to determine the contraction point with the minimum quadratic error measure value, and obtain the target contraction point, wherein the target contraction point is the contraction point of the target point pair;

[0164] The update submodule is used to update the three-dimensional model file by taking the target shrinkage point as the new representation of the target point pair in the three-dimensional model file, and obtaining a new three-dimensional model file.

[0165] In the new 3D model file, the texture coordinates of the target shrinkage point are the target texture coordinates.

[0166] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0167] This disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the model data processing method provided in this disclosure.

[0168] This disclosure also provides an electronic device, including:

[0169] A memory on which computer programs are stored;

[0170] A processor is configured to execute the computer program in the memory to implement the steps of the model data processing method provided in this disclosure.

[0171] Figure 8 This is a block diagram illustrating an electronic device 800 according to an exemplary embodiment. For example... Figure 8 As shown, the electronic device 800 may include a processor 801 and a memory 802. The electronic device 800 may also include one or more of a multimedia component 803, an input / output (I / O) interface 804, and a communication component 805.

[0172] The processor 801 controls the overall operation of the electronic device 800 to complete all or part of the steps in the aforementioned model data processing method. The memory 802 stores various types of data to support the operation of the electronic device 800. This data may include, for example, instructions for any application or method operating on the electronic device 800, and application-related data such as contact data, sent and received messages, pictures, audio, video, etc. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. Multimedia component 803 may include a screen and an audio component. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 802 or transmitted via communication component 805. The audio component also includes at least one speaker for outputting audio signals. I / O interface 804 provides an interface between processor 801 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 805 is used for wired or wireless communication between the electronic device 800 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IoT, eMTC, or other 5G technologies, or combinations thereof, is not limited here. Therefore, the corresponding communication component 805 may include: a Wi-Fi module, a Bluetooth module, an NFC module, etc.

[0173] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the model data processing method described above.

[0174] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the model data processing method described above. For example, the computer-readable storage medium may be the memory 802 including the program instructions described above, which may be executed by the processor 801 of the electronic device 800 to complete the model data processing method described above.

[0175] In another exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program executable by a programmable device, the computer program having a code portion for performing the model data processing method described above when executed by the programmable device.

[0176] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and these simple modifications all fall within the protection scope of this disclosure.

[0177] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.

[0178] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.

Claims

1. A model data processing method characterized by, The method comprises: determining at least one set of point pairs from a three-dimensional model file, each of the point pairs comprising a first point and a second point; calculating a contraction point of the first point and the second point, the contraction point being located on a line segment between the first point and the second point; calculating a target texture coordinate of the contraction point according to a first texture coordinate of the first point and a second texture coordinate of the second point; generating a new three-dimensional model file according to the contraction point and the target texture coordinate.

2. The method of claim 1, wherein, The calculating of the contraction point of the first point and the second point comprises: determining a plurality of candidate points from the line segment between the first point and the second point; calculating a quadratic error measure value of each of the candidate points; taking the candidate point with the minimum quadratic error measure value as the contraction point.

3. The method of claim 2, wherein, The determining of the plurality of candidate points from the line segment between the first point and the second point comprises: equally dividing the line segment between the first point and the second point to obtain a plurality of equally divided points; taking the first point, the second point and the plurality of equally divided points as the candidate points.

4. The method of claim 1, wherein, The calculating of the target texture coordinate of the contraction point according to the first texture coordinate of the first point and the second texture coordinate of the second point comprises: calculating a first weight coefficient of the first texture coordinate and a second weight coefficient of the second texture coordinate according to a distance between the contraction point and the first point and a distance between the contraction point and the second point; in a case where the first point corresponds to the first texture coordinate one-to-one and the second point corresponds to the second texture coordinate one-to-one, calculating the target texture coordinate according to the first texture coordinate, the first weight coefficient, the second texture coordinate and the second weight coefficient.

5. The method of claim 1, wherein, The calculating of the target texture coordinate of the contraction point according to the first texture coordinate of the first point and the second texture coordinate of the second point comprises: in a case where the first point corresponds to a plurality of first texture coordinates and the second point corresponds to a plurality of second texture coordinates, taking the plurality of first texture coordinates and the plurality of second texture coordinates as the target texture coordinate of the contraction point.

6. The method of claim 1, wherein, The calculating of the target texture coordinate of the contraction point according to the first texture coordinate of the first point and the second texture coordinate of the second point comprises: calculating a first weight coefficient of the first texture coordinate and a second weight coefficient of the second texture coordinate according to a distance between the contraction point and the first point and a distance between the contraction point and the second point; in a case where the first texture coordinate corresponds to a plurality of points and the second texture coordinate corresponds to a plurality of points, calculating the target texture coordinate according to the first texture coordinate, the first weight coefficient, the second texture coordinate and the second weight coefficient.

7. The method according to any one of claims 1 to 6, characterized in that, The point pairs are a plurality of sets, and the generating of the new three-dimensional model file according to the contraction point and the target texture coordinate comprises: obtaining a quadratic error measure value of the contraction point of each set of point pairs; determining a contraction point with the minimum quadratic error measure value to obtain a target contraction point, the target contraction point being a contraction point of a target point pair; The target contraction point is taken as a target point pair of a new representation in the three-dimensional model file, the three-dimensional model file is updated to obtain a new three-dimensional model file; In the new three-dimensional model file, the texture coordinate of the target contraction point is a target texture coordinate.

8. A model data processing apparatus, characterized by, The method comprises the steps of: A first determination module is configured to determine at least one point pair from a three-dimensional model file, each point pair comprising a first point and a second point; A first calculation module is configured to calculate a contraction point of the first point and the second point, the contraction point being located on a line segment between the first point and the second point; A second calculation module is configured to calculate a target texture coordinate of the contraction point according to a first texture coordinate of the first point and a second texture coordinate of the second point; A generation module is configured to generate a new three-dimensional model file according to the contraction point and the target texture coordinate.

9. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the steps of the method in any one of claims 1 to 7.

10. An electronic device, comprising: The method comprises the steps of: A memory having a computer program stored thereon; A processor configured to execute the computer program in the memory to implement the steps of the method in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Three-dimensional model simplification method suitable for model with textures

    CN103714577A

  • Three-dimensional model data processing method and device

    CN104637089A