Error-bounded low-distortion unstructured T-spline surface fitting method and device
By constructing a multi-cube parameter domain and an adaptive subdivision method, low-distortion unstructured T-spline surface is generated, which solves the spline surface fitting problem in the existing technology, realizes the generation of spline surfaces with low distortion and low fitting error, simplifies model editing and reduces memory usage.
Patent Information
- Application Number
- CN202211544173.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-28
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2042-11-28
AI Technical Summary
Existing technologies make it difficult to generate spline surfaces that meet low distortion and low fitting error requirements in computer-aided design and manufacturing, and the large number of control points makes model editing difficult and occupies a large amount of memory.
By constructing a multi-cube parameter domain, using optimization problems and adaptive subdivision methods, low-distortion unstructured T-spline surfaces are generated to reduce the number of control points. The objective function is constructed by minimizing interpolation fitting and thin plate energy, and the control points are optimized to achieve low distortion and low fitting error.
It achieves low-distortion fitting of arbitrarily complex topological models, reduces the number of control points, reduces the difficulty of secondary design, and improves model editing accuracy and smoothness.
Smart Images

Figure CN116186912B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of surface fitting, and in particular relates to a method and a device for fitting a low-distortion unstructured T-spline surface with bounded error. Background Art
[0002] In recent years, reverse design has been widely used in the fields of product upgrade, product comparison and quality inspection, and analysis of physical models. The reverse process reconstructs the model based on the physical object, converting the model representation that is not suitable for editing, manufacturing, and analysis into a model representation that is suitable for these activities. The reverse process is generally divided into three steps: data acquisition, mesh reconstruction, and CAD model reconstruction. Figure 1 The figure shows a flowchart for producing industrial parts in a computer-aided manufacturing process. Furthermore, due to their parametric equations, high-order continuity, and compact representation, spline surfaces are particularly advantageous for describing and analyzing smooth shapes in modeling design. Therefore, in computer-aided design and manufacturing, industrial engineering, and computational engineering, spline surface fitting techniques are often used to convert mesh models into easily editable spline surface models.
[0003] The goal of spline surface fitting is to construct a spline surface whose fitting error with the input discrete data is less than a given threshold, while also minimizing distortion and the number of control points. First, the smaller the fitting error between the spline surface and the input model, the more details of the original model are retained. Second, the lower the distortion of the fitting result, the easier and simpler it is to perform secondary design on the fitted surface, while also increasing the accuracy of the numerical simulation. Finally, since more control vertices not only take up more memory space but also increase the difficulty for designers to perform secondary design on the fitted surface, we prefer to use fewer control vertices to represent the fitted surface.
[0004] Given this situation, finding a spline surface that satisfies all three objectives is extremely challenging for the following reasons: First, given a model with arbitrarily complex topology, generating a suitable spline parameter domain that satisfies these requirements is nontrivial. Second, the correspondence between the parameter domain and the input model is nonlinearly related to the approximation error and distortion, making it difficult to find a suitable correspondence that achieves low approximation error and low distortion. Third, the number of control vertices is incompatible with low fitting error and low distortion; low fitting error and low distortion require a large number of control vertices.
[0005] Currently, there is no relevant software or solution to obtain a spline surface design method that meets the above requirements. Summary of the Invention
[0006] In response to the shortcomings of the existing technology, the purpose of the embodiments of the present application is to provide a low-distortion unstructured T-spline surface fitting method and device with bounded error, which can obtain a low-distortion spline surface that meets the fitting error threshold for any defect input model and significantly reduce the number of parameter domain control points.
[0007] According to a first aspect of an embodiment of the present application, a low-distortion unstructured T-spline surface fitting method with bounded error is provided, comprising:
[0008] Obtaining a grid to be fitted and calculating a multi-cube parameter domain having the same topology as the grid to be fitted;
[0009] Constructing and solving a first optimization problem according to the multi-cube parameter domain to obtain a low-distortion body parameterization of the to-be-fitted grid to the to-be-fitted parameter domain;
[0010] Calculating a low-distortion boundary parameterization from the grid to be fitted to a parameter domain to be fitted according to the low-distortion body parameterization;
[0011] By using the minimization interpolation fitting and the thin plate energy as the smooth function term, an objective function is constructed, and the control points of the spline surface are obtained by minimizing the objective function, thereby obtaining a fitting surface;
[0012] If the maximum fitting error of the fitted surface exceeds a predetermined threshold, adaptive subdivision is employed to introduce new degrees of freedom in the parameter domain and the surface, thereby reducing the fitting error;
[0013] On the basis of satisfying that the maximum fitting error of the fitting surface does not exceed the predetermined threshold and the low distortion is satisfied, the fitting surface is simplified to obtain a low-distortion unstructured T-spline surface.
[0014] Furthermore, a first optimization problem is constructed and solved according to the multi-cube parameter domain to obtain a low-distortion body parameterization of the grid to be fitted to the parameter domain to be fitted, including:
[0015] Construct the first optimization problem:
[0016]
[0017] st It is a bijection
[0018]
[0019] Among them E disV represents the three-dimensional distortion energy, C→M is a low-distortion mapping, C is the three-dimensional mesh obtained by tetrahedralizing the mesh to be fitted, S is the surface of C, P is the polycube parameter domain, and M is the entity of P;
[0020] Map The boundary result is restricted to the boundary of the multi-cube parameter domain. This hard constraint is transformed into a soft constraint, resulting in the second optimization problem:
[0021]
[0022] sth is a bijection
[0023]
[0024] Where β is a non-negative weight, the energy formula of the tangent motion constraint
[0025] Solve the second optimization problem and obtain the low distortion mapping C→M is the parameterization of the low-distortion body.
[0026] Furthermore, according to the low-distortion body parameterization, calculating the low-distortion boundary parameterization of the grid to be fitted to the parameter domain to be fitted includes:
[0027] For the sampling point u on the multi-cube parameter domain P, the nearest point projection method is used to project it onto the image h(S) of the mapping h, and the specific point g(u) on the surface S of the three-dimensional mesh is obtained by barycentric interpolation coordinates;
[0028] If the resulting mapping is a bijection, use the result as the low-distortion boundary parameterization;
[0029] If the result is not a bijection, the boundary alignment method is used to align and extract the low distortion map The surface mapping h of the mesh to be fitted is used to calculate the inverse mapping g of h, thereby obtaining a low-distortion boundary parameterization of the mesh to be fitted to the parameter domain to be fitted.
[0030] Furthermore, the boundary alignment processing method is:
[0031] Use the nearest point projection to reconstruct the boundary correspondence and solve the second optimization problem. During the optimization process, h(S) is fixed. After projection, the vertices on the edge of the polycube are only allowed to move along the edge of the polycube, and after mapping, the vertices on the face of the polycube are only allowed to move within the face.
[0032] Furthermore, the objective function is
[0033] E=E dist +σE fair
[0034] Among them E dist is the fitting error term, E fair is the smooth energy term, σ is a trade-off constant;
[0035]
[0036] The first term is the interpolation error, h(v i ) is the sampling point v in the grid to be fitted i The image after mapping; the second term is the sampling fitting error, u i is a sampling point in the parameter domain, f() and g() represent mapping h and mapping g respectively;
[0037]
[0038] where f ss represents the second-order derivative along the s direction in the local parameter coordinate system.
[0039] Furthermore, if the maximum fitting error of the fitted surface exceeds a predetermined threshold, adaptive subdivision is used to introduce new degrees of freedom into the surface of the parameter domain, including:
[0040] Calculate the maximum fitting error L of the fitting surface ∞ :
[0041]
[0042] Where m is the number of grid sampling points to be fitted, and n is the number of parameter domain sampling points;
[0043] If the maximum fitting error exceeds a predetermined threshold, the rectangular region R containing the sampling points exceeding the threshold is considered, and if there is an original grid point v mapped in R j Violate the constraint or there is a sampling point u in R j If the constraint is violated, R is subdivided.
[0044] Furthermore, on the basis of satisfying that the maximum fitting error of the fitting surface does not exceed the predetermined threshold and low distortion, simplifying the fitting surface to obtain a low-distortion unstructured T-spline surface, including:
[0045] Step (6.1): Each node on the T grid obtained by adaptive subdivision is used as a sampling point u i , calculate the fitting error ||f(u i )-g(u i )|| 2 And sort them to get the priority queue Q from small to large;
[0046] Step (6.2): determine in turn whether the node corresponding to the element Q(i) in the priority queue can be deleted. If the node can be deleted, delete the node and recalculate the fitting equation and update the control point. Return to step (6.1) until all elements in the priority queue are traversed;
[0047] The criteria for determining whether a node can be deleted are:
[0048] If the node is a singular point, it will not be deleted;
[0049] If the T-grid obtained after deleting the node violates the rules of the T-grid, the node will not be deleted;
[0050] Calculate the new basis function of the T mesh obtained after deleting the node, recalculate the fitting equation and update the control vertex, and then recalculate the maximum value L of the interpolation error and sampling fitting error ∞ As well as the average distortion ave_new of the spline surface, it is determined whether the error constraint and low distortion constraint are violated after deleting the node. If so, the node is not deleted.
[0051] According to a second aspect of an embodiment of the present application, there is provided a low-distortion unstructured T-spline surface fitting device with bounded error, comprising:
[0052] An acquisition module, configured to acquire a grid to be fitted and calculate a multi-cube parameter domain having the same topology as the grid to be fitted;
[0053] A solving module, configured to construct and solve a first optimization problem according to the multi-cube parameter domain, and obtain a low-distortion body parameterization of the to-be-fitted grid to the to-be-fitted parameter domain;
[0054] A calculation module, configured to calculate a low-distortion boundary parameterization from the grid to be fitted to a parameter domain to be fitted according to the low-distortion body parameterization;
[0055] A minimization module is used to construct an objective function by minimizing interpolation fitting and thin plate energy as smooth function terms, and obtain control points of the spline surface by minimizing the objective function, thereby obtaining a fitting surface;
[0056] an adaptive subdivision module, configured to introduce new degrees of freedom in the parameter domain and the surface by using adaptive subdivision if the maximum fitting error of the fitted surface exceeds a predetermined threshold, thereby reducing the fitting error;
[0057] The simplification module is used to simplify the fitting surface on the basis of satisfying that the maximum fitting error of the fitting surface does not exceed the predetermined threshold and the low distortion is satisfied, so as to obtain a low-distortion unstructured T-spline surface.
[0058] According to a third aspect of the embodiments of the present application, there is provided an electronic device, including:
[0059] one or more processors;
[0060] a memory for storing one or more programs;
[0061] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in the first aspect.
[0062] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
[0063] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:
[0064] As can be seen from the above embodiments, the present application utilizes a step-by-step solution strategy to design a low-distortion unstructured T-spline surface fitting method that satisfies a fitting error threshold. This method can produce a low-distortion fitting surface for any input model with complex topology. Without considering the complexity of the input model, the present invention enables the use of fewer control vertices to achieve lower parametric distortion, thereby achieving smooth shape descriptions in computer-aided design and manufacturing industries and engineering calculations while improving the accuracy of the description and reducing the difficulty of secondary design.
[0065] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0067] Figure 1 It is a flowchart of the reverse process of reconstructing a CAD model in the background technology.
[0068] Figure 2 The present invention is a flowchart of a low-distortion unstructured T-spline surface fitting method with bounded error according to an exemplary embodiment.
[0069] Figure 3 1 is a schematic diagram of a process of producing a complete fitting surface by using the error-bounded low-distortion unstructured T-spline surface fitting method according to an exemplary embodiment, wherein (a) is an input mesh to be fitted, (b) is a schematic diagram of a multi-cube parameter domain, (c) is a result of parameterizing the input mesh to be fitted to the multi-cube parameter domain, (d) is a schematic diagram of the fitting surface obtained in step (4), (e) is a schematic diagram of a low-distortion spline surface that meets the fitting error threshold, and (f) is a schematic diagram of the low-distortion unstructured T-spline surface obtained in step (6);
[0070] Figure 4 is a schematic diagram of a T-grid according to an exemplary embodiment.
[0071] Figure 5 The present invention is a block diagram of a low-distortion unstructured T-spline surface fitting device with bounded error according to an exemplary embodiment.
[0072] Figure 6 The figure is a schematic diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0073] Exemplary embodiments are described in detail herein, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numerals in different drawings represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with this application.
[0074] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0075] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0076] Figure 2 FIG. 1 is a flow chart of a low-distortion unstructured T-spline surface fitting method with bounded error according to an exemplary embodiment. Figure 2 As shown, the method may include the following steps:
[0077] Step (1): obtaining a mesh to be fitted and calculating a multi-cube parameter domain having the same topology as the mesh to be fitted;
[0078] Step (2): constructing a first optimization problem according to the multi-cube parameter domain and solving it to obtain a low-distortion body parameterization of the grid to be fitted to the parameter domain to be fitted;
[0079] Step (3): Calculating the low-distortion boundary parameterization of the grid to be fitted to the parameter domain to be fitted according to the low-distortion body parameterization;
[0080] Step (4): using the minimization interpolation fitting and the thin plate energy as smooth function terms, constructing the objective function, and obtaining the control points of the spline surface by minimizing the objective function, thereby obtaining the fitting surface;
[0081] Step (5): if the maximum fitting error of the fitting surface exceeds a predetermined threshold, introducing new degrees of freedom into the surface of the parameter domain by using adaptive subdivision, thereby reducing the fitting error;
[0082] Step (6): On the basis of satisfying that the maximum fitting error of the fitting surface does not exceed the predetermined threshold and the low distortion is satisfied, simplifying the fitting surface to obtain a low-distortion unstructured T-spline surface.
[0083] As can be seen from the above examples, the present invention utilizes a step-by-step solution strategy to design a low-distortion unstructured T-spline surface fitting method that satisfies a fitting error threshold. This method can generate a low-distortion fitting surface for any input model with complex topology. This method allows for achieving lower parametric distortion using fewer control vertices, regardless of the complexity of the input model.
[0084] In this application, to avoid the increased number of control points caused by segmenting and splicing complex topological shapes and achieve a globally unified spline representation, we use a polycube as the parameter domain for implementing spline-fitted surfaces. The polycube provides a rectangular structure that accurately represents the topology of arbitrary geometric shapes, with singular points appearing only at corners, greatly facilitating subsequent calculations and analysis. This method is explained below with reference to an example.
[0085] In the specific implementation of step (1), a grid to be fitted is obtained and a multi-cube parameter domain having the same topology as the grid to be fitted is calculated;
[0086] Specifically, obtain Figure 3 (a) in the figure shows a mesh to be fitted containing 18925 vertices, which is a mesh model of an industrial part in an embodiment. For a given mesh to be fitted, an approximate axis-aligned shape is first obtained by a rotation-driven deformation method. Then, the approximate error between the approximate axis-aligned shape and the polycube structure is used to calculate the polycube parameter domain with the same topology as the mesh to be fitted, as shown in FIG. Figure 3 As shown in (b), the number of vertices in the polycube parameter domain is 1580.
[0087] In the specific implementation of step (2), a first optimization problem is constructed and solved according to the multi-cube parameter domain to obtain a low-distortion body parameterization of the grid to be fitted to the parameter domain to be fitted;
[0088] Specifically, this step may include the following sub-steps:
[0089] Construct the first optimization problem:
[0090]
[0091] st It is a bijection
[0092]
[0093] Among them E disV represents the three-dimensional distortion energy, which is the boundary distortion energy when it is restricted to the boundary. C→M is a low-distortion mapping, C is a three-dimensional mesh obtained by tetrahedralizing the mesh to be fitted, S is the surface of C, P is the polycube parameter domain, and M is the entity of P;
[0094] Map The boundary result is restricted to the boundary of the multi-cube parameter domain. This hard constraint is transformed into a soft constraint, resulting in the second optimization problem:
[0095]
[0096] sth is a bijection
[0097]
[0098] Where β is a non-negative weight, the energy formula of the tangent motion constraint
[0099] Solve the second optimization problem and obtain the low distortion mapping C→M is the parameterization of the low-distortion body.
[0100] In a specific implementation of step (3), according to the low-distortion body parameterization, a low-distortion boundary parameterization of the grid to be fitted to the parameter domain to be fitted is calculated;
[0101] Specifically, extract The boundary mapping h: S→P is used, where h is a bijection between discrete grids. After solving, h(S) and P are not exactly the same. In order to make them exactly the same, the boundary correspondence needs to be reprocessed and the energy needs to be reoptimized. Since h(S) and P are very close, the boundary correspondence can be reconstructed using the nearest point projection. Then the same distortion energy as before is optimized again. This time, h(S) is required to be fixed during the optimization process. After mapping, the vertices on the edge of the polycube are only allowed to move along the edge of the polycube, and the vertices on the face of the polycube are only allowed to move within the face. However, this method may cause the distortion near the straightening to become larger.
[0102] Considering the characteristics of unstructured T-splines, edges on polycube features are essentially the same as edges at other locations. Instead of calculating the specific expression for the inverse of h, g, we can directly extract the surface map h. Instead, we calculate a sampling representation of g: for a sampling point u on the polycube parameter domain P, we use the nearest point projection method to project it onto the image h(S) of the map h. The specific point g(u) on the tetrahedralized surface S of the mesh to be fitted is obtained by barycentric interpolation of the coordinates.
[0103] Specifically, when every sampling point g(u) is a bijection, the mapping g is a bijection.
[0104] If the resulting mapping is a bijection, use the result as the low-distortion boundary parameterization;
[0105] If the result is not a bijection, the boundary alignment method is used to align the low-distortion map h, extract the surface map h of the low-distortion map h, and calculate the inverse map g of h, thereby obtaining the low-distortion boundary parameterization of the mesh to be fitted to the parameter domain to be fitted. The calculated result is as follows Figure 3 As shown in (c), the black spots indicate the areas that do not meet the fitting error threshold.
[0106] The boundary alignment processing method is as follows:
[0107] Use the nearest point projection to reconstruct the boundary correspondence and solve the second optimization problem. During the optimization process, h(S) is fixed. After projection, the vertices on the edge of the polycube are only allowed to move along the edge of the polycube, and after mapping, the vertices on the face of the polycube are only allowed to move within the face.
[0108] The initial volume parameterization had an average distortion of 3.39. After our optimization steps, we obtained a parameterized model with an average distortion of 1.28. Low-distortion parameterization results are beneficial for solving low-distortion fitted surface models. Furthermore, the easier and simpler the secondary design of the fitted surface model, the higher the accuracy of the numerical simulation.
[0109] In the specific implementation of step (4), the objective function is constructed by minimizing the interpolation fitting and the thin plate energy as the smooth function term, and the control points of the spline surface are obtained by minimizing the objective function, thereby obtaining the fitting surface;
[0110] Specifically, we use the minimization of interpolation fitting and the thin plate energy as smooth function terms to construct an optimization problem, solve the control points of the spline surface, and thus obtain our fitting surface. At this point, the optimization problem becomes minimizing the following objective function:
[0111] E=E dist +σE fair
[0112] Among them E dist is the fitting error term, E fair is the smoothing energy term, and σ is a trade-off constant that balances the accuracy and smoothness of the approximation. The larger σ is, the smoother the surface is;
[0113] The present invention obtains the bidirectional mapping h and g between S and P, so a bidirectional energy is used for fitting, that is, the sampling errors on the two surfaces are considered simultaneously:
[0114]
[0115] The first term is the interpolation error, h(v i ) is the sampling point v in the grid to be fitted i The image after mapping; the second term is the sampling fitting error, u i is a sampling point in the parameter domain, f() and g() represent mapping h and mapping g respectively. In the present invention, the sampling point is a Gaussian node in each parameter domain surface;
[0116] The specific expression of the second smooth energy term is:
[0117]
[0118] The parametric coordinate system has two directions s and t, where f ss represents the second-order derivative along the s direction in the local parameter coordinate system, f st and f tt Same thing.
[0119] The derivatives of the T-grid spline are linear combinations of the derivatives of the node functions. Since the basis functions are fixed during the fitting process, both energies can be expressed as quadratic functions of the unknown control points, which can be solved by solving a system of linear equations.
[0120] The low-distortion unstructured T-spline fitting obtained finally is the fitting surface such as Figure 3 As shown in (d) in the figure, we now obtain a fitting surface model with an average distortion of 1.31.
[0121] In the specific implementation of step (5), if the maximum fitting error of the fitted surface exceeds a predetermined threshold, adaptive subdivision is used to introduce new degrees of freedom in the parameter domain and the surface, thereby reducing the fitting error;
[0122] Specifically, since T-splines have the ability to adaptively subdivide local areas, fine fitting can be performed in areas where the fitting results are unsatisfactory, which can significantly reduce the amount of calculation and reduce the computational cost. In the present invention, we control the accuracy of the fitting by the maximum fitting error, so this step can include the following sub-steps:
[0123] Calculate the maximum fitting error L of the fitting surface ∞ :
[0124]
[0125] Where m is the number of grid sampling points to be fitted, and n is the number of parameter domain sampling points;
[0126] If the maximum fitting error exceeds a predetermined threshold, the rectangular region R containing the sampling points exceeding the threshold is considered, and if there is an original grid point v mapped in R j Violate the constraint or there is a sampling point u in R j If the constraint is violated, R is subdivided. Specifically, if the maximum fitting error satisfies Then split a rectangle into four, which is called 1→4 subdivision. Otherwise, split the matrix into two rectangles along the longest side.
[0127] After the adaptive refinement, the fitting equation needs to be recalculated and the control points updated. The present invention repeats the adaptive refinement process until the fitting error is satisfied. The low-distortion spline surface that satisfies the fitting error threshold can be obtained as follows: Figure 3 As shown in (e) in .
[0128] We default the fitting error threshold to 0.0025 of the diagonal length of the AABB bounding box. The maximum fitting error of the fitted surface model obtained in step (4) is 0.00519, and the average fitting error is 0.000411. The maximum fitting error of the fitted surface model obtained after our adaptive refinement step is 0.00226, and the average fitting error is 0.000168. With such a small fitting error, the detailed features of the original model can be well preserved. The number of vertices in the polycube parameter domain is now 4201.
[0129] In the specific implementation of step (6), on the basis of satisfying that the maximum fitting error of the fitting surface does not exceed the predetermined threshold and low distortion, the fitting surface is simplified to obtain a low-distortion unstructured T-spline surface.
[0130] Specifically, this step may include the following sub-steps:
[0131] Step (6.1): Each node on the T grid obtained by adaptive subdivision is used as a sampling point u i , calculate the fitting error ||f(u i )-g(u i )|| 2 And sort them to get the priority queue Q from small to large;
[0132] Specifically, the number of nodes in the multicube parameter domain (i.e., the number of T-grid nodes) is N, and i = 0. Each node on the T-grid is used as a sampling point to calculate the fitting error || f(u i )-g(u i )|| 2 , and sort them, recorded as a priority queue Q, so that Q(0) is the minimum value.
[0133] Step (6.2): determine in turn whether the node corresponding to the element Q(i) in the priority queue can be deleted. If the node can be deleted, delete the node and recalculate the fitting equation and update the control point. Return to step (6.1) until all elements in the priority queue are traversed;
[0134] The criteria for determining whether a node can be deleted are:
[0135] If the node is a singular point, it will not be deleted;
[0136] If the T-grid obtained after deleting the node violates the rules of the T-grid, the node will not be deleted;
[0137] Calculate the new basis function of the T mesh obtained after deleting the node, recalculate the fitting equation and update the control vertex, and then recalculate the maximum value L of the interpolation error and sampling fitting error ∞ As well as the average distortion ave_new of the spline surface, it is determined whether the error constraint and low distortion constraint are violated after deleting the node. If so, the node is not deleted.
[0138] Specifically, the average distortion of the spline surface is denoted as ave_old, the upper bound of the average distortion is ave = 1.1 × ave_old, i = 0, and the node corresponding to Q(i) is determined to be deletable. In the first case, if the node is a singular point, the node is not deleted, i←i+1, and i is determined to be N. If so, simplification is stopped. In the second case, if the T-grid obtained after deleting the node violates the rules of the T-grid, the node is not deleted, i←i+1, and i is determined to be N. If so, simplification is stopped. In the third case, the new basis function of the T-grid obtained after deleting the node is calculated, the fitting equation is recalculated, the control vertices are updated, and then the maximum value L of the interpolation error and the sampling fitting error is recalculated. ∞ And the average distortion ave_new of the spline surface, determine whether the error constraint and low distortion constraint are violated after deleting the node: if ave_new≤ave and L ∞ ≤ξ, delete the node, recalculate the fitting equation and update the control point; otherwise, do not delete the node, i←i+1, and determine whether i=N. If they are equal, stop simplification;
[0139] When deleting a node, we also need to delete some of the edges connected to it. The resulting unstructured T-grid may not meet the rules of the unstructured T-grid (i.e., the second case mentioned above). In this case, we need to determine which edges can be deleted and classify them according to the degree of the deleted node:
[0140] First, for a node with degree 4, you cannot directly delete the four edges when deleting the node, as this would violate the rules of the unstructured T-grid. In this case, you can only delete the two corresponding edges.
[0141] Second, for a T-node, if you delete three edges at the same time, it will violate the rules of the unstructured T-grid. If you delete two opposite edges, it will also violate the rules. If you delete an edge that has an opposite edge, the T-node will become an L-shaped inflection point, such as Figure 4 For the AD edge of node D, this edge cannot be deleted. In this case, there is only one case in which the deletion does not violate the rules of the unstructured T grid, that is, deleting an edge that has no opposite edge, such as Figure 4 AT edge for node T in .
[0142] The simplified spline surface obtained by this embodiment is as follows Figure 3 As shown in (f) in .
[0143] The average distortion of the fitted surface model we obtained was 1.38, the maximum fitting error was 0.00249, and the number of vertices in the polycube parameter domain was 2867. Based on low fitting error and distortion, redundant control vertices in the polycube parameter domain were deleted, resulting in a simplification rate of 31.75%. This reduced computer memory usage and made it easier for designers to perform secondary design on the fitted surface model.
[0144] Corresponding to the aforementioned embodiment of the error-bounded low-distortion unstructured T-spline surface fitting method, the present application also provides an embodiment of the error-bounded low-distortion unstructured T-spline surface fitting device.
[0145] Figure 5 This is a block diagram of a low-distortion unstructured T-spline surface fitting device with bounded error according to an exemplary embodiment. Figure 5 , the apparatus may include:
[0146] An acquisition module 21 is configured to acquire a grid to be fitted and calculate a multi-cube parameter domain having the same topology as the grid to be fitted;
[0147] A solving module 22 is configured to construct and solve a first optimization problem according to the multi-cube parameter domain to obtain a low-distortion body parameterization of the to-be-fitted grid to the to-be-fitted parameter domain;
[0148] A calculation module 23 is configured to calculate a low-distortion boundary parameterization from the grid to be fitted to a parameter domain to be fitted according to the low-distortion body parameterization;
[0149] A minimization module 24 is used to construct an objective function by minimizing interpolation fitting and thin plate energy as a smooth function term, and obtain control points of the spline surface by minimizing the objective function, thereby obtaining a fitting surface;
[0150] an adaptive subdivision module 25 for introducing new degrees of freedom in the parameter domain and the surface by using adaptive subdivision if the maximum fitting error of the fitted surface exceeds a predetermined threshold, thereby reducing the fitting error;
[0151] The simplification module 26 is configured to simplify the fitting surface to obtain a low-distortion unstructured T-spline surface on the basis that the maximum fitting error of the fitting surface does not exceed the predetermined threshold and the distortion is low.
[0152] Regarding the apparatus in the above 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.
[0153] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0154] Accordingly, the present application also provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the error-bounded low-distortion unstructured T-spline surface fitting method as described above. Figure 6 As shown in FIG, a hardware structure diagram of a low-distortion unstructured T-spline surface fitting method with bounded error provided by an embodiment of the present invention is provided for any device with data processing capability, except Figure 6 In addition to the processor, memory, and network interface shown, any device with data processing capabilities in which the apparatus in the embodiment is located may also include other hardware, generally based on the actual functions of the device with data processing capabilities, which will not be described in detail.
[0155] Accordingly, the present application also provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the error-bounded low-distortion unstructured T-spline surface fitting method as described above. The computer-readable storage medium may be an internal storage unit of any device with data processing capabilities as described in any of the aforementioned embodiments, such as a hard disk or memory. The computer-readable storage medium may also be an external storage device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), an SD card, a flash card (Flash Card), etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit and an external storage device of any device with data processing capabilities. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and may also be used to temporarily store data that has been output or is to be output.
[0156] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the contents disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art that are not disclosed in this application.
[0157] It will be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.
Claims
1. A low-distortion unstructured T-spline surface fitting method with bounded error, characterized in that: include: Obtaining a grid to be fitted and calculating a multi-cube parameter domain having the same topology as the grid to be fitted; Constructing and solving a first optimization problem according to the multi-cube parameter domain to obtain a low-distortion body parameterization of the to-be-fitted grid to the to-be-fitted parameter domain; Calculating a low-distortion boundary parameterization from the grid to be fitted to a parameter domain to be fitted according to the low-distortion body parameterization; By using the minimization interpolation fitting and the thin plate energy as the smooth function term, an objective function is constructed, and the control points of the spline surface are obtained by minimizing the objective function, thereby obtaining a fitting surface; If the maximum fitting error of the fitted surface exceeds a predetermined threshold, adaptive subdivision is employed to introduce new degrees of freedom in the parameter domain and the surface, thereby reducing the fitting error; On the basis of satisfying that the maximum fitting error of the fitting surface does not exceed the predetermined threshold and the low distortion is satisfied, the fitting surface is simplified to obtain a low-distortion unstructured T-spline surface.
2. The method according to claim 1, characterized in that Constructing and solving a first optimization problem according to the multi-cube parameter domain to obtain a low-distortion body parameterization of the to-be-fitted mesh to the to-be-fitted parameter domain, including: Construct the first optimization problem: st It is a bijection Among them E disV represents the three-dimensional distortion energy, C→M is a low-distortion mapping, C is the three-dimensional mesh obtained by tetrahedralizing the mesh to be fitted, S is the surface of C, P is the polycube parameter domain, and M is the entity of P; Map The boundary result is restricted to the boundary of the multi-cube parameter domain. This hard constraint is transformed into a soft constraint, resulting in the second optimization problem: sth is a bijection Where β is a non-negative weight, the energy formula of the tangent motion constraint Solve the second optimization problem and obtain the low distortion mapping C→M is the parameterization of the low-distortion body.
3. The method according to claim 2, characterized in that Calculating a low-distortion boundary parameterization from the to-be-fitted mesh to the to-be-fitted parameter domain according to the low-distortion body parameterization includes: For the sampling point u on the multi-cube parameter domain P, the nearest point projection method is used to project it onto the image h(S) of the mapping h, and the specific point g(u) on the surface S of the three-dimensional mesh is obtained by barycentric interpolation coordinates; If the resulting mapping is a bijection, use the result as the low-distortion boundary parameterization; If the result is not a bijection, the boundary alignment method is used to align and extract the low distortion map The surface mapping h of the mesh to be fitted is used to calculate the inverse mapping g of h, thereby obtaining a low-distortion boundary parameterization of the mesh to be fitted to the parameter domain to be fitted.
4. The method according to claim 3, characterized in that The processing method of the boundary alignment is: Use the nearest point projection to reconstruct the boundary correspondence and solve the second optimization problem. During the optimization process, h(S) is fixed. After projection, the vertices on the edge of the polycube are only allowed to move along the edge of the polycube, and after mapping, the vertices on the face of the polycube are only allowed to move within the face.
5. The method according to claim 1, wherein The objective function is AND dist +σE fair Among them E dist is the fitting error term, E fair is the smooth energy term, σ is a trade-off constant; The first term is the interpolation error, h(v i ) is the sampling point v in the grid to be fitted i The image after mapping; The second term is the sampling fitting error, u i is a sampling point in the parameter domain, f() and g() represent mapping h and mapping g respectively; where f ss represents the second-order derivative along the s direction in the local parameter coordinate system.
6. The method according to claim 1, characterized in that If the maximum fitting error of the fitted surface exceeds a predetermined threshold, adaptive subdivision is employed to introduce new degrees of freedom into the surface of the parameter domain, including: Calculate the maximum fitting error L of the fitting surface ∞ : Where m is the number of grid sampling points to be fitted, and n is the number of parameter domain sampling points; If the maximum fitting error exceeds a predetermined threshold, the rectangular region R containing the sampling points exceeding the threshold is considered, and if there is an original grid point v mapped in R j Violate the constraint or there is a sampling point u in R j If the constraint is violated, R is subdivided.
7. The method according to claim 1, characterized in that On the basis of satisfying that the maximum fitting error of the fitting surface does not exceed the predetermined threshold and the low distortion is satisfied, simplifying the fitting surface to obtain a low-distortion unstructured T-spline surface, including: Step (6.1): Each node on the T grid obtained by adaptive subdivision is used as a sampling point u i , calculate the fitting error ||f(u i )-g(u i )|| 2 And sort them to get the priority queue Q from small to large; Step (6.2): determine in turn whether the node corresponding to the element Q(i) in the priority queue can be deleted. If the node can be deleted, delete the node and recalculate the fitting equation and update the control point. Return to step (6.1) until all elements in the priority queue are traversed; The criteria for determining whether a node can be deleted are: If the node is a singular point, it will not be deleted; If the T-grid obtained after deleting the node violates the rules of the T-grid, the node will not be deleted; Calculate the new basis function of the T mesh obtained after deleting the node, recalculate the fitting equation and update the control vertex, and then recalculate the maximum value L of the interpolation error and sampling fitting error ∞ As well as the average distortion ave_new of the spline surface, it is determined whether the error constraint and low distortion constraint are violated after deleting the node. If so, the node is not deleted.
8. A low-distortion unstructured T-spline surface fitting device with bounded error, characterized in that: include: An acquisition module, configured to acquire a grid to be fitted and calculate a multi-cube parameter domain having the same topology as the grid to be fitted; A solving module, configured to construct and solve a first optimization problem according to the multi-cube parameter domain, and obtain a low-distortion body parameterization of the to-be-fitted grid to the to-be-fitted parameter domain; A calculation module, configured to calculate a low-distortion boundary parameterization from the grid to be fitted to a parameter domain to be fitted according to the low-distortion body parameterization; A minimization module is used to construct an objective function by minimizing interpolation fitting and thin plate energy as smooth function terms, and obtain control points of the spline surface by minimizing the objective function, thereby obtaining a fitting surface; an adaptive subdivision module, configured to introduce new degrees of freedom in the parameter domain and the surface by using adaptive subdivision if the maximum fitting error of the fitted surface exceeds a predetermined threshold, thereby reducing the fitting error; The simplification module is used to simplify the fitting surface on the basis of satisfying that the maximum fitting error of the fitting surface does not exceed the predetermined threshold and the low distortion is satisfied, so as to obtain a low-distortion unstructured T-spline surface.
9. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Partition local fairing weight factor-based T-spline curved-surface fitting method
CN106981097A
Quadrilateral mesh generation method based on normal filtering
CN114549790A