Clothing cloth dynamic simulation method and device, electronic equipment and storage medium
By constructing the target Heisen matrix of clothing fabrics and using the implicit time integral algorithm, the stability and accuracy of dynamic simulation of clothing fabrics in the existing technology are solved, and a more real-time and realistic dynamic simulation effect is achieved.
Patent Information
- Application Number
- CN202311577238.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-23
- Publication Date
- 2025-05-23
AI Technical Summary
The prior art is difficult to dynamically simulate various clothing fabrics stably and accurately, especially to effectively adapt to the physical characteristics of different fabrics, resulting in the dynamic simulation effect not being real-time and realistic enough.
By using the fabric grid model based on the fabric to be simulated, all dihedral elements in each grid are obtained, and the target Heisen matrix is constructed according to the multi-directional geometric stiffness matrix of the dihedral elements. The implicit time integral algorithm is used to combine the target Heisen matrix of all dihedral angle units to determine the vertex displacement of all grids, and then adjust the fabric grid model.
It realizes dynamic simulation of various clothing fabrics stably and accurately, and optimizes the dynamic simulation effect of clothing fabrics to make it more real-time and realistic.
Smart Images

Figure CN120032074A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of clothing simulation, and in particular to a clothing fabric dynamic simulation method, device, electronic equipment and storage medium. Background Art
[0002] At present, in order to meet the personalized needs of users, solutions such as virtual fitting and virtual clothing making are provided. In application scenarios such as virtual fitting and virtual clothing making, physics-based methods are mainly used, such as dihedral bending models to simulate the changes in the appearance of clothing fabrics, such as ups and downs, wrinkles, and folds.
[0003] However, different clothing fabrics have different physical properties and will present different appearances. The dihedral bending model is difficult to apply to various clothing fabrics, and cannot guarantee stable and accurate prediction of the movement of various clothing fabrics, making the dynamic simulation effect of various clothing fabrics more real-time and realistic. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a method, device, electronic device and storage medium for dynamic simulation of clothing fabrics, so as to achieve the technical effect of stably and accurately performing dynamic simulation on various clothing fabrics and optimizing the dynamic simulation effects of various clothing fabrics.
[0005] In a first aspect, an embodiment of the present invention provides a clothing fabric dynamic simulation method, comprising:
[0006] Based on the cloth mesh model of the cloth to be simulated, all dihedral angle units in each mesh are obtained;
[0007] For each of the dihedral angle elements, constructing a target Hessian matrix of the dihedral angle element according to a multi-directional geometric stiffness matrix of the dihedral angle element;
[0008] Determining the vertex displacements of all the meshes using an implicit time integration algorithm in combination with target Hessian matrices of all the dihedral elements;
[0009] The cloth mesh model is adjusted according to the vertex displacements of all the meshes to obtain an updated cloth mesh model.
[0010] In the above implementation process, based on the cloth mesh model of the cloth to be simulated, the multi-directional geometric stiffness matrix of each dihedral angle unit is determined to construct the target Hessian matrix of each dihedral angle unit, and the implicit time integration algorithm is used to combine the target Hessian matrices of all dihedral angle units for dynamic simulation. It is possible to stably and accurately perform dynamic simulation on various clothing fabrics and optimize the dynamic simulation effects of various clothing fabrics.
[0011] Furthermore, for each of the dihedral angle units, constructing a target Hessian matrix of the dihedral angle unit according to the multi-directional geometric stiffness matrix of the dihedral angle unit specifically includes:
[0012] For each of the dihedral angle elements, constructing eight geometric stiffness direction vectors of the dihedral angle element according to the structural parameters of the dihedral angle element;
[0013] Combining eight geometric stiffness direction vectors of the dihedral element, generating a multi-directional geometric stiffness matrix of the dihedral element;
[0014] Combining the stiffness parameters of the eight geometric stiffness direction vectors of the dihedral element, generating a multi-directional geometric stiffness parameter matrix of the dihedral element;
[0015] The target Hessian matrix of the dihedral element is constructed by combining the multi-directional geometric stiffness matrix and the multi-directional geometric stiffness parameter matrix of the dihedral element.
[0016] In the above implementation process, by constructing 8 geometric stiffness direction vectors of the dihedral angle unit according to the structural parameters of the dihedral angle unit, and combining the stiffness parameters of the 8 geometric stiffness direction vectors of the dihedral angle unit to construct the target Hessian matrix of the dihedral angle unit, the 8 geometric stiffness directions of all dihedral angle units can be finely analyzed in the subsequent dynamic simulation process, and the effective bending motion modes of all dihedral angle units are fully retained, further ensuring the semi-positive definiteness of the target Hessian matrix of all dihedral angle units, thereby more stably and accurately performing dynamic simulation of various clothing fabrics, and optimizing the dynamic simulation effects of various clothing fabrics.
[0017] Furthermore, the eight geometric stiffness direction vectors of the dihedral element are:
[0018]
[0019]
[0020]
[0021]
[0022] Among them, q i is the i+1th geometric stiffness direction vector of the dihedral element, t 1 =h 1 -1 [ω 1 -1,-ω 1 ,1,0] T ,h 1is the height of a vertex on a unit face of the dihedral unit relative to the unit edge, ω 1 is the centroid of the vertex on a unit face of the dihedral unit relative to the unit edge, t 2 =h 2 -1 [ω 2 -1,-ω 2 ,1,0] T ,h 2 is the height of the vertex on the other unit face of the dihedral unit relative to the unit edge, ω 2 is the centroid of the vertex on the other unit face of the dihedral unit relative to the unit edge, n 1 is the normal vector of a unit face of the dihedral element, n 2 is the normal vector of the other unit face of the dihedral element, m 1 is the height vector of a unit face of the dihedral element, m 2 is the normal vector of the other unit face of the dihedral unit, e is the edge vector of the unit edge of the dihedral unit, s=l -1 [1,-1,0,0] T , l is the length of the unit side of the dihedral unit, [·] T Represents the transpose of a matrix.
[0023] In the above implementation process, by constructing 8 geometric stiffness direction vectors of the dihedral angle unit according to the structural parameters of the dihedral angle unit according to the above formula, the 8 geometric stiffness directions of all dihedral angle units can be finely analyzed in the subsequent dynamic simulation process, and the effective bending motion modes of all dihedral angle units are fully retained, further ensuring the semi-positive definiteness of the target Hessian matrix of all dihedral angle units, thereby more stably and accurately performing dynamic simulation of various clothing fabrics and optimizing the dynamic simulation effects of various clothing fabrics.
[0024] Furthermore, the multi-directional geometric stiffness matrix of the dihedral element is:
[0025] Q=[q 0 ,q 1 ,q 2 ,q 3 ,q 4 ,q 5 ,q 6 ,q 7 ];
[0026] Where Q is the multi-directional geometric stiffness matrix of the dihedral element, q i is the i+1th geometric stiffness direction vector of the dihedral element, Represents a real number.
[0027] In the above implementation process, by combining the 8 geometric stiffness direction vectors of the dihedral angle unit according to the above formula, a multi-directional geometric stiffness matrix of the dihedral angle unit is generated, which can finely analyze the 8 geometric stiffness directions of all dihedral angle units in the subsequent dynamic simulation process, and fully retain the effective bending motion mode of all dihedral angle units, further ensuring the semi-positive definiteness of the target Hessian matrix of all dihedral angle units, thereby more stably and accurately performing dynamic simulation of various clothing fabrics and optimizing the dynamic simulation effects of various clothing fabrics.
[0028] Furthermore, the multi-directional geometric stiffness parameter matrix of the dihedral element is:
[0029]
[0030] Wherein, Λ is the multi-directional geometric stiffness parameter matrix of the dihedral element, α i is the stiffness parameter of the i+1th geometric stiffness direction vector of the dihedral element, α i Equal to the matrix (KΣK T ), K is the original eigenvector transformation matrix of the dihedral unit, K=[k 0 ,k 1 ,k 2 ,k 3 ,k 4 ,k 5 ,k 6 ,k 7 ],k i =Q -1 e i , Q is the multi-directional geometric stiffness matrix of the dihedral element, e i is the i-th element in the original eigenvector matrix E of the dihedral unit, E = [e 0 ,e 1 ,e 2 ,e 3 ,e 4 ,e 5 ,e 6 ,e 7 ], K T is the transposed matrix of the original eigenvector conversion matrix of the dihedral angle unit, Σ is the original eigenvalue matrix of the dihedral angle unit, Represents a real number.
[0031] In the above implementation process, by reasonably selecting the stiffness parameters of the 8 geometric stiffness direction vectors of the dihedral angle unit, according to the above formula, combined with the stiffness parameters of the 8 geometric stiffness direction vectors of the dihedral angle unit, a multi-directional geometric stiffness parameter matrix of the dihedral angle unit is generated, which can finely analyze the 8 geometric stiffness directions of all dihedral angle units in the subsequent dynamic simulation process, fully retain the effective bending motion mode of all dihedral angle units, and further ensure the semi-positive definiteness of the target Hessian matrix of all dihedral angle units, so as to more stably and accurately perform dynamic simulation on various clothing fabrics and optimize the dynamic simulation effects of various clothing fabrics.
[0032] Furthermore, the target Hessian matrix of the dihedral unit is:
[0033] H d =QΛQ T ;
[0034] Among them, H d is the target Hessian matrix of the dihedral unit; Q is the multi-directional geometric stiffness matrix of the dihedral unit, Q T is the transposed matrix of the multi-directional geometric stiffness matrix of the dihedral angle unit, and Λ is the multi-directional geometric stiffness parameter matrix of the dihedral angle unit.
[0035] In the above implementation process, by combining the multi-directional geometric stiffness matrix and the multi-directional geometric stiffness parameter matrix of the dihedral angle unit according to the above formula, the target Hessian matrix of the dihedral angle unit is constructed, which can finely analyze the 8 geometric stiffness directions of all dihedral angle units in the subsequent dynamic simulation process, and fully retain the effective bending motion mode of all dihedral angle units, further ensuring the semi-positive definiteness of the target Hessian matrix of all dihedral angle units, so as to more stably and accurately perform dynamic simulation of various clothing fabrics and optimize the dynamic simulation effects of various clothing fabrics.
[0036] Furthermore, the implicit time integration algorithm is used to determine the vertex displacements of all the meshes in combination with the target Hessian matrix of all the dihedral units, specifically including:
[0037] Traversing each of the meshes, obtaining vertex parameters and simulation parameters of the current mesh, and obtaining physical parameters of the cloth to be simulated;
[0038] Combining the target Hessian matrices of all the dihedral elements in the current grid, establishing the dynamic equation of the current grid;
[0039] An implicit time integration algorithm is adopted to solve the dynamic equation of the current mesh according to the vertex parameters and simulation parameters of the current mesh and the physical parameters of the cloth to be simulated, so as to obtain the vertex displacement of the current mesh.
[0040] In the above implementation process, the dynamic equation of each grid is established by combining the target Hessian matrix of all dihedral units in each grid respectively. The implicit time integration algorithm is used to solve the dynamic equation of each grid according to the vertex parameters and simulation parameters of each grid and the physical parameters of the fabric to be simulated, and the vertex displacement of each grid is obtained. This can ensure stable and accurate dynamic simulation of various clothing fabrics and optimize the dynamic simulation effects of various clothing fabrics.
[0041] Furthermore, the dynamic equation of the current grid is:
[0042] H x Δx=-g x ;
[0043] Among them, H x is the target Hessian matrix of all the dihedral elements in the current grid, Δx is the vertex displacement of the current grid, g x is the optimization gradient of the current grid.
[0044] In the above implementation process, by selecting the above linear equation as the dynamic equation of the current grid, the implicit time integration algorithm is used to solve the dynamic equation of each grid according to the vertex parameters and simulation parameters of each grid, as well as the physical parameters of the cloth to be simulated, and the vertex displacement of each grid is obtained, which can ensure stable and accurate dynamic simulation of various clothing fabrics and optimize the dynamic simulation effects of various clothing fabrics.
[0045] In a second aspect, an embodiment of the present invention provides a clothing fabric dynamic simulation device, comprising:
[0046] An acquisition module, used for acquiring all dihedral angle units in each mesh based on a cloth mesh model of the cloth to be simulated;
[0047] A construction module, for constructing, for each of the dihedral angle elements, a target Hessian matrix of the dihedral angle element according to a multi-directional geometric stiffness matrix of the dihedral angle element;
[0048] A calculation module, for determining the vertex displacements of all the meshes by using an implicit time integration algorithm in combination with target Hessian matrices of all the dihedral elements;
[0049] The adjustment module is used to adjust the cloth mesh model according to the vertex displacements of all the meshes to obtain an updated cloth mesh model.
[0050] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor; the memory is coupled to the processor, and when the processor executes the computer program, the dynamic simulation method of clothing fabric as described above is implemented.
[0051] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program; wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the clothing fabric dynamic simulation method as described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments of the present invention are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0053] Figure 1 A schematic flow chart of a method for dynamic simulation of clothing fabrics provided by the first embodiment of the present invention;
[0054] Figure 2 A three-dimensional diagram of a dihedral angle unit according to an alternative embodiment of the first embodiment of the present invention;
[0055] Figure 3 A side view of a dihedral angle unit according to an alternative embodiment of the first embodiment of the present invention;
[0056] Figure 4 A plan view of a unit face of a dihedral angle element according to an alternative embodiment of the first embodiment of the present invention;
[0057] Figure 5 A plan view of another unit face of a dihedral angle element according to an alternative embodiment of the first embodiment of the present invention;
[0058] Figure 6 A schematic diagram of a process of dynamically simulating a cloth to be simulated by using an implicit time integration algorithm according to an optional embodiment of the first embodiment of the present invention;
[0059] Figure 7 A schematic structural diagram of a clothing fabric dynamic simulation device provided by a second embodiment of the present invention;
[0060] Figure 8 A schematic structural diagram of an electronic device provided in the third embodiment of the present invention. DETAILED DESCRIPTION
[0061] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0062] It should be noted that in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance. At the same time, the step numbers in the text are only for the convenience of explaining the embodiments of the present invention and do not serve to limit the order of execution of the steps. The method provided in the embodiment of the present invention can be executed by a related terminal device, and the following description will be taken as an example of a processor as the execution subject.
[0063] Please see Figure 1 , Figure 1 The first embodiment of the present invention provides a method for dynamic simulation of clothing fabrics, comprising steps S101 to S104:
[0064] S101, based on the cloth mesh model of the cloth to be simulated, obtaining all dihedral angle units in each mesh;
[0065] S102, for each dihedral angle unit, constructing a target Hessian matrix of the dihedral angle unit according to the multi-directional geometric stiffness matrix of the dihedral angle unit;
[0066] S103, using an implicit time integration algorithm, combined with the target Hessian matrix of all dihedral units, to determine the vertex displacements of all grids;
[0067] S104. Adjust the cloth mesh model according to the vertex displacements of all meshes to obtain an updated cloth mesh model.
[0068] As an exemplary embodiment, a cloth mesh model of the cloth to be simulated is obtained, where the cloth mesh model of the cloth to be simulated is obtained by splicing a plurality of meshes, and each mesh has at least one dihedral unit.
[0069] Based on the cloth mesh model of the cloth to be simulated, all dihedral angle units in each mesh are obtained to obtain all dihedral angle units.
[0070] For each dihedral angle unit, the multi-directional geometric stiffness matrix of the dihedral angle unit is determined, and the target Hessian matrix of the dihedral angle unit is constructed according to the multi-directional geometric stiffness matrix of the dihedral angle unit, so as to obtain the target Hessian matrix of all dihedral angle units.
[0071] An implicit time integration algorithm is used to determine the vertex displacements of all meshes in combination with the target Hessian matrices of all dihedral elements.
[0072] The vertex positions of each mesh on the cloth mesh model are adjusted according to the vertex displacement of each mesh, that is, the vertex positions of all dihedral units in each mesh, to obtain an updated cloth mesh model, thereby completing the dynamic simulation of the cloth to be simulated.
[0073] Since the target Hessian matrix of the dihedral angle unit is constructed based on the multi-directional geometric stiffness matrix of the dihedral angle unit, in the process of dynamic simulation using the implicit time integration algorithm combined with the target Hessian matrix of all dihedral angle units, only the effective bending motion modes of all dihedral angle units are retained, ensuring the semi-positive definiteness of the target Hessian matrix of all dihedral angle units. This can support the physical properties of various clothing fabrics, stably and accurately perform dynamic simulation of various clothing fabrics, and optimize the dynamic simulation effects of various clothing fabrics.
[0074] The embodiment of the present invention determines the multi-directional geometric stiffness matrix of each dihedral angle unit based on the cloth mesh model of the cloth to be simulated to construct the target Hessian matrix of each dihedral angle unit, and uses an implicit time integration algorithm to combine the target Hessian matrices of all dihedral angle units for dynamic simulation. It can stably and accurately perform dynamic simulation on various clothing fabrics and optimize the dynamic simulation effects of various clothing fabrics.
[0075] In an optional embodiment, for each dihedral angle unit, a target Hessian matrix of the dihedral angle unit is constructed according to the multi-directional geometric stiffness matrix of the dihedral angle unit, specifically including: for each dihedral angle unit, 8 geometric stiffness direction vectors of the dihedral angle unit are constructed according to the structural parameters of the dihedral angle unit; the multi-directional geometric stiffness matrix of the dihedral angle unit is generated by combining the 8 geometric stiffness direction vectors of the dihedral angle unit; the multi-directional geometric stiffness parameter matrix of the dihedral angle unit is generated by combining the stiffness parameters of the 8 geometric stiffness direction vectors of the dihedral angle unit; the target Hessian matrix of the dihedral angle unit is constructed by combining the multi-directional geometric stiffness matrix and the multi-directional geometric stiffness parameter matrix of the dihedral angle unit.
[0076] As an example, for each dihedral angle unit, the structural parameters of the dihedral angle unit are obtained, wherein the structural parameters of the dihedral angle unit include vertex parameters, unit face parameters and unit edge parameters of the dihedral angle unit, the vertex parameters of the dihedral angle unit include the three-dimensional positions of all vertices constituting the dihedral angle unit, the unit face parameters of the dihedral angle unit include the heights and center of gravity of the vertices on two unit faces constituting the dihedral angle unit relative to the unit edge, as well as the normal vectors and height vectors of the two unit faces, and the unit edge parameters include the length and edge vector of the unit edge constituting the dihedral angle unit.
[0077] According to the structural parameters of the dihedral element, eight geometric stiffness direction vectors of the dihedral element are constructed, and stiffness parameters of the eight geometric stiffness direction vectors of the dihedral element are determined.
[0078] The eight geometric stiffness direction vectors of the dihedral element are combined to generate the multi-directional geometric stiffness matrix of the dihedral element.
[0079] The stiffness parameters of the eight geometric stiffness direction vectors of the dihedral element are combined to generate the multi-directional geometric stiffness parameter matrix of the dihedral element.
[0080] The target Hessian matrix of the dihedral element is constructed by combining the multi-directional geometric stiffness matrix and the multi-directional geometric stiffness parameter matrix of the dihedral element.
[0081] The embodiment of the present invention constructs 8 geometric stiffness direction vectors of the dihedral angle unit according to the structural parameters of the dihedral angle unit, and constructs the target Hessian matrix of the dihedral angle unit in combination with the stiffness parameters of the 8 geometric stiffness direction vectors of the dihedral angle unit. In the subsequent dynamic simulation process, the 8 geometric stiffness directions of all dihedral angle units can be finely analyzed, and the effective bending motion modes of all dihedral angle units are fully retained, further ensuring the semi-positive definiteness of the target Hessian matrix of all dihedral angle units, thereby more stably and accurately performing dynamic simulation on various clothing fabrics, and optimizing the dynamic simulation effects of various clothing fabrics.
[0082] In an optional embodiment, the eight geometric stiffness direction vectors of the dihedral unit are:
[0083]
[0084]
[0085]
[0086]
[0087] Among them, q i is the i+1th geometric stiffness direction vector of the dihedral element, t 1 =h 1 -1 [ω 1 -1,-ω 1 ,1,0] T ,h 1 is the height of a vertex on a unit face of a dihedral unit relative to the unit edge, ω 1 is the centroid of the vertex on a unit face of the dihedral unit relative to the unit edge, t 2 =h 2 -1 [ω 2 -1,-ω 2 ,1,0] T ,h 2is the height of the vertex on the other unit face of the dihedral unit relative to the unit edge, ω 2 is the centroid of the vertex on the other unit face of the dihedral element relative to the unit edge, n 1 is the normal vector of a unit face of the dihedral unit, n 2 is the normal vector of the other unit face of the dihedral element, m 1 is the height vector of a unit face of the dihedral unit, m 2 is the normal vector of the other unit face of the dihedral unit, e is the edge vector of the unit edge of the dihedral unit, s = l -1 [1,-1,0,0] T , l is the length of the unit side of the dihedral unit.
[0088] As an example, assume that the stereogram of the dihedral unit is Figure 2 The side view of the dihedral unit is shown in Figure 3 As shown, the plan view of a unit face of a dihedral unit is Figure 4 As shown, the plan view of the other unit face of the dihedral unit is Figure 5 As shown, according to Figure 2 It can be seen that the dihedral unit consists of 4 vertices X = [X 0 ,X 1 ,X 2 ,X 3 ], where X 0 , X 1 , X 2 , X 3 are the three-dimensional position coordinates of the first, second, third, and fourth vertices that constitute the dihedral unit. A unit face of a dihedral unit consists of three vertices [X 0 ,X 1 ,X 2 ], the other unit face of the dihedral unit consists of three vertices [X 0 ,X 1 ,X 3 ], the unit edge of the dihedral unit consists of two vertices [X 0 ,X 1 ], the length of the unit side of the dihedral unit is l = ||X 1 -X 0 ||, where ||·|| represents the vector modulus, and the edge vector of the unit edge of the dihedral unit is e=(X 1 -X 0 ) / l, the angle between the two unit faces of the dihedral angle unit, that is, the dihedral angle is θ; according to Figure 3 It can be seen that the normal vector of a unit face of a dihedral unit is n 1 , the normal vector of the other unit face of the dihedral element is n 2 ;according to Figure 4It can be seen that the vertex X on a unit face of the dihedral unit 2 The height relative to the unit side is h 1 , the vertex X on a unit face of the dihedral unit 2 The center of gravity relative to the unit side is ω 1 , the height vector of a unit face of the dihedral unit is m 1 ;according to Figure 5 It can be seen that the vertex X on the other unit face of the dihedral unit 3 The height relative to the unit side is h 2 , the vertex X on the other unit face of the dihedral unit 3 The center of gravity relative to the unit side is ω 2 , the height vector of the other unit face of the dihedral unit is m 2 .
[0089] The energy function of the dihedral bending model is Among them, E(X) is the bending potential energy function of the dihedral angle unit, and its independent variable is the three-dimensional position coordinates of the vertex of the dihedral angle unit, is the bending potential energy function of the dihedral unit, and its independent variable is the dihedral angle of the dihedral unit. The Hessian matrix corresponding to the dihedral bending model is H = pP + gG, where P is the projection matrix in the gradient direction, X is all the vertices of the dihedral unit, (·) T represents the transposed matrix of the matrix, G is the geometric stiffness matrix, is the bending potential energy of the dihedral unit, Specifically, the gradient of the dihedral angle θ with respect to vertex X is The geometric stiffness matrix can be expressed as G = G m +G e ,in, With G e =B 1 +B 1 T +B 2 +B 2 T There are two important components, t 1 =h 1 -1 [ω 1 -1,-ω 1 ,1,0] T , t 2 =h 2 -1 [ω 2 -1,-ω 2 ,1,0] T , s = l-1 [1,-1,0,0] T .
[0090] In order to verify the instability of the geometric stiffness matrix G, the dynamic equation HΔX=f can be analyzed, where f is the bending force, The ideal displacement direction should be consistent with the direction of the bending force, but under the combined effect of the projection matrix P and the geometric stiffness matrix G, the actual displacement direction has a large deviation from the direction of the bending force.
[0091] Analyzing the projection matrix P, we can get It can be seen that the displacement in any direction satisfies the dynamic equation under the action of the projection matrix P. By analyzing the geometric stiffness matrix G, we can get and Among them, y 1 ,y 2 ,y 3 are three relative displacement vectors, y 1 =∑t 1 [i]ΔX i ,y 2 =∑t 2 [i]ΔX i ,y 3 =∑s[i]ΔX i , t 1 [i] is the vector t 1 The i-th component of 2 [i] is the vector t 2 The i-th component of , s[i] is the i-th component of vector s, ΔX i is the displacement vector of the i-th vertex of the dihedral unit. Since e is not included in f, we have and Represents y 3 must be parallel to e, and thus A 1 y 3 +A 2 y 3 = 0, resulting in s in G m ΔX disappears, and s should also be in G e ΔX disappears, resulting in e T y 1 =0 and e T y 2 = 0. In addition, A 1 y 1 Should not contain m 1 , A 2 y 2 Should not contain m 2 . From this we can conclude that: 1 With m 1 Parallel, y2 With m 2 In summary, under the action of the geometric stiffness matrix G, the effective displacement is This displacement will cause the area of the two unit faces of the dihedral element to continue to expand, which is not conducive to the stability of the simulation.
[0092] Considering the instability of the geometric stiffness matrix of the dihedral element, a geometric stiffness direction can be given Define q i The corresponding directional geometric stiffness matrix is Among them, α i for q i The stiffness parameter, α i >0.
[0093] For a dihedral element, eight geometric stiffness direction vectors of the dihedral element are constructed, which are:
[0094]
[0095]
[0096]
[0097]
[0098] In formulas (1)-(8), q i is the i+1th geometric stiffness direction vector of the dihedral element, t 1 =h 1 -1 [ω 1 -1,-ω 1 ,1,0] T ,h 1 is the height of a vertex on a unit face of a dihedral unit relative to the unit edge, ω 1 is the centroid of the vertex on a unit face of the dihedral unit relative to the unit edge, t 2 =h 2 -1 [ω 2 -1,-ω 2 ,1,0] T ,h 2 is the height of the vertex on the other unit face of the dihedral unit relative to the unit edge, ω 2 is the centroid of the vertex on the other unit face of the dihedral element relative to the unit edge, n 1 is the normal vector of a unit face of the dihedral unit, n 2 is the normal vector of the other unit face of the dihedral element, m 1is the height vector of a unit face of the dihedral unit, m 2 is the normal vector of the other unit face of the dihedral unit, e is the edge vector of the unit edge of the dihedral unit, s = l -1 [1,-1,0,0] T , l is the length of the unit side of the dihedral unit.
[0099] At this point, the original Hessian matrix of the dihedral bending model can be optimized to the target Hessian matrix, and the target Hessian matrix of the dihedral bending model is approximately expressed as a semi-positive definite matrix Corresponding to the first direction geometric stiffness matrix The sum of the geometric stiffness matrices in 7 directions is: Among them, Λ is composed of α i is a diagonal matrix with main diagonal elements, Q=[q 0 ,q 1 ,q 2 ,q 3 ,q 4 ,q 5 ,q 6 ,q 7 ], the matrix is a column-full rank matrix,
[0100] The embodiment of the present invention constructs 8 geometric stiffness direction vectors of the dihedral angle unit according to the structural parameters of the dihedral angle unit according to the above formula, and can finely analyze the 8 geometric stiffness directions of all dihedral angle units in the subsequent dynamic simulation process, fully retain the effective bending motion mode of all dihedral angle units, and further ensure the semi-positive definiteness of the target Hessian matrix of all dihedral angle units, so as to more stably and accurately perform dynamic simulation on various clothing fabrics, and optimize the dynamic simulation effects of various clothing fabrics.
[0101] In an optional embodiment, the multi-directional geometric stiffness matrix of the dihedral element is:
[0102] Q=[q 0 ,q 1 ,q 2 ,q 3 ,q 4 ,q 5 ,q 6 ,q 7 ] (9);
[0103] Where Q is the multi-directional geometric stiffness matrix of the dihedral element, q i is the i+1th geometric stiffness direction vector of the dihedral element, Represents a real number.
[0104] As an example, the eight geometric stiffness direction vectors {q 0 ,q 1 ,q 2 ,q 3 ,q 4 ,q 5 ,q 6 ,q 7}, combined with the 8 geometric stiffness direction vectors {q 0 ,q 1 ,q 2 ,q 3 ,q 4 ,q 5 ,q 6 ,q 7}, generate the multi-directional geometric stiffness matrix Q of the dihedral element = [q 0 ,q 1 ,q 2 ,q 3 ,q 4 ,q 5 ,q 6 ,q 7 ].
[0105] The embodiment of the present invention generates a multi-directional geometric stiffness matrix of the dihedral angle unit by combining the 8 geometric stiffness direction vectors of the dihedral angle unit according to the above formula, and can finely analyze the 8 geometric stiffness directions of all dihedral angle units in the subsequent dynamic simulation process, fully retain the effective bending motion mode of all dihedral angle units, and further ensure the semi-positive definiteness of the target Hessian matrix of all dihedral angle units, so as to more stably and accurately perform dynamic simulation on various clothing fabrics, and optimize the dynamic simulation effect of various clothing fabrics.
[0106] In an optional embodiment, the multi-directional geometric stiffness parameter matrix of the dihedral element is:
[0107]
[0108] Where Λ is the multi-directional geometric stiffness parameter matrix of the dihedral element, α i is the stiffness parameter of the i+1th geometric stiffness direction vector of the dihedral element, α i Equal to the matrix (KΣK T ), K is the original eigenvector transformation matrix of the dihedral unit, K=[k 0 ,k 1 ,k 2 ,k 3 ,k 4 ,k5 ,k 6 ,k 7 ],k i =Q -1 e i , Q is the multi-directional geometric stiffness matrix of the dihedral element, e i is the i-th element in the original eigenvector matrix E of the dihedral unit, E = [e 0 ,e 1 ,e 2 ,e 3 ,e 4 ,e 5 ,e 6 ,e 7 ], K T is the transposed matrix of the original eigenvector transformation matrix of the dihedral unit, Σ is the original eigenvalue matrix of the dihedral unit, Represents a real number.
[0109] As an example, in order to verify the validity of the multi-directional geometric stiffness matrix, the dynamic equation H can be analyzed. d ΔX=f. Since only q 0 is parallel to f, so we can get because So we can get With e T y 1 +e T y 2 = 0. So we can get With e T y 1 -e T y 2 = 0. Combining these five equality constraints, we can conclude that: y 1 Parallel to n 1 ,y 2 Parallel to n 2 , and ||y 1 ||=||y 2 ||. Therefore, the displacement of the dihedral unit can be obtained as Furthermore, due to So we can get and y 3 must be parallel to the edge vector e. In summary, the effective displacement is This displacement corresponds to the clockwise rotation direction of the dihedral element around the edge direction and represents the bending displacement.
[0110] In order to reasonably determine the stiffness parameters of the eight geometric stiffness direction vectors, the non-zero eigenvalue diagonal matrix of the original Hessian matrix H of the dihedral angle unit can be obtained, that is, the original eigenvalue matrix Σ of the dihedral angle unit. And obtain the original eigenvector matrix E of the dihedral unit, E = [e 0 ,e 1 ,e 2 ,e 3 ,e 4 ,e 5 ,e 6 ,e 7 ], The original eigenvalue matrix Σ and the original eigenvector matrix E of the dihedral element are calculated. Since the multi-directional geometric stiffness matrix Q of the dihedral element is also a full-rank matrix, the multi-directional geometric stiffness matrix Q of the dihedral element can be used to represent each eigenvector e i =Qk i , converted to k i =Q -1 e i , E = QK, where K is the original eigenvector transformation matrix of the dihedral unit, K = [k 0 ,k 1 ,k 2 ,k 3 ,k 4 ,k 5 ,k 6 ,k 7 ], In summary, we can get H d =EΣE T =Q(KΣK T )Q T , then we can use the matrix matrix (KΣK T ), The main diagonal elements in the 8 geometric stiffness directions are used as the stiffness parameters, that is, Λ=diagonal(KΣK T ), diagonal(·) is a function used to obtain the main diagonal elements.
[0111] In determining the stiffness parameters {α 0 ,α 1 ,α 2 ,α 3 ,α 4 ,α 5 ,α 6 ,α 7}, the stiffness parameters {α 0 ,α 1 ,α2 ,α 3 ,α 4 ,α 5 ,α 6 ,α 7}, generate the multi-directional geometric stiffness parameter matrix of the dihedral element
[0112]
[0113] The embodiment of the present invention generates a multi-directional geometric stiffness parameter matrix of the dihedral angle unit by reasonably selecting the stiffness parameters of the 8 geometric stiffness direction vectors of the dihedral angle unit according to the above formula and combining the stiffness parameters of the 8 geometric stiffness direction vectors of the dihedral angle unit. The 8 geometric stiffness directions of all dihedral angle units can be finely analyzed in the subsequent dynamic simulation process, and the effective bending motion modes of all dihedral angle units are fully retained, further ensuring the semi-positive definiteness of the target Hessian matrix of all dihedral angle units, thereby more stably and accurately performing dynamic simulation on various clothing fabrics, and optimizing the dynamic simulation effects of various clothing fabrics.
[0114] In an optional embodiment, the target Hessian matrix of the dihedral unit is:
[0115] H d =QΛQ T (11);
[0116] Among them, H d is the target Hessian matrix of the dihedral element; Q is the multi-directional geometric stiffness matrix of the dihedral element, Q T is the transposed matrix of the multi-directional geometric stiffness matrix of the dihedral element, and Λ is the multi-directional geometric stiffness parameter matrix of the dihedral element.
[0117] As an example, when the multi-directional geometric stiffness matrix Q and the multi-directional geometric stiffness parameter matrix Λ of the dihedral angle unit are obtained, the target Hessian matrix H of the dihedral angle unit is constructed by combining the multi-directional geometric stiffness matrix Q and the multi-directional geometric stiffness parameter matrix Λ of the dihedral angle unit. d =QΛQ T .
[0118] The embodiment of the present invention constructs a target Hessian matrix of the dihedral angle unit by combining the multi-directional geometric stiffness matrix and the multi-directional geometric stiffness parameter matrix of the dihedral angle unit according to the above formula, and can finely analyze the 8 geometric stiffness directions of all dihedral angle units in the subsequent dynamic simulation process, and fully retain the effective bending motion mode of all dihedral angle units, and further ensure the semi-positive definiteness of the target Hessian matrix of all dihedral angle units, so as to more stably and accurately perform dynamic simulation on various clothing fabrics, and optimize the dynamic simulation effect of various clothing fabrics.
[0119] In an optional embodiment, the implicit time integration algorithm is used in combination with the target Hessian matrix of all dihedral units to determine the vertex displacement of all meshes, specifically including: traversing each mesh to obtain the vertex parameters and simulation parameters of the current mesh, and obtaining the physical parameters of the cloth to be simulated; combining the target Hessian matrix of all dihedral units in the current mesh to establish the dynamic equation of the current mesh; using the implicit time integration algorithm, according to the vertex parameters and simulation parameters of the current mesh, and the physical parameters of the cloth to be simulated, solve the dynamic equation of the current mesh to obtain the vertex displacement of the current mesh.
[0120] As an example, in the process of performing dynamic simulation on the cloth to be simulated, an implicit time integration algorithm can be used to solve the dynamic equations of the cloth to be simulated.
[0121] Based on the cloth simulation model of the cloth to be simulated, traverse each mesh, obtain the vertex parameters and simulation parameters of the current mesh, and obtain the physical parameters of the cloth to be simulated. Among them, the vertex parameters of the current mesh include the vertex parameters of all dihedral units in the current mesh, and the vertex parameters of the current mesh include the three-dimensional position, force, velocity, acceleration, and mass of all vertices constituting each dihedral unit in the current mesh. The simulation parameters of the current mesh include the time step, strain potential energy, and bending potential energy of the current mesh. The physical parameters of the cloth to be simulated include the strain strength and bending strength of the cloth to be simulated.
[0122] Assume that there are n vertices in the current grid x=[x 0 ,x 1 ,...,x n ], x 0 、x 1 , ..., x n are the three-dimensional position coordinates of the 1st, 2nd, ..., nth vertices in the current grid, The force on all vertices is f = [f 0 ,f 1 ,...,f n ], f 0 、f 1 , ..., f n are the forces on the 1st, 2nd, ..., nth vertices in the current grid respectively; the velocity of all vertices is v = [v 0 ,v 1 ,...,v n ],v 0 、v 1 ,...,v n are the velocities of the 1st, 2nd, ..., nth vertices in the current grid, The acceleration of all vertices is a = [a 0 ,a 1,...,a n ], a 0 、a 1 , ..., a n are the accelerations of the 1st, 2nd, ..., nth vertices in the current grid, The mass matrix of all vertices is m 0 、m 1 ,...,m n are the velocity masses of the 1st, 2nd, ..., nth vertices in the current grid. Assume that the time step of the current grid is Δt and the strain potential energy is E s , bending potential energy is E b Assume that the strain strength of the cloth to be simulated is k s , bending strength is k b .
[0123] According to Newton's second law of motion, the motion equation Ma = f can be obtained. Since there is strain potential energy E inside the current grid s and bending potential energy E b , so the force is a function of the three-dimensional positions of all vertices in the current mesh, that is, f=f(x).
[0124] It is known that at time t, the three-dimensional positions x of all vertices in the current mesh are t With speed v t The goal of implicit time integration is to calculate the position x of all vertices in the current mesh at the next time t+1. t+1 With speed v t+1 At time t+1, the acceleration of all vertices in the current mesh can be equivalently expressed as a t+1 =(x t+1 -x t -v t Δt) / (Δt) 2 , so the equation of motion Ma=f can be equivalently expressed as an optimization problem, that is, the objective function Where E(x) is the potential energy stored in the current grid, including the strain potential energy E s (x) and bending potential energy E b (x), that is, E(x)=E s (x)+E b (x). Since the potential energy stored in the current grid is a nonlinear function of the three-dimensional positions of all vertices in the current grid, it is necessary to use Newton's method to solve the above optimization problem and calculate the optimization gradient and target Hessian matrix of the objective function, which are as follows:
[0125]
[0126] In formula (12), gx is the optimization gradient of the objective function, f s With f b are strain force and bending force respectively.
[0127]
[0128] In formula (13), H x is the target Hessian matrix of the objective function, and are the strain Hessian matrix and the bending Hessian matrix, k s With k b They are the strain resistance and bending strength of the fabric to be simulated.
[0129] In summary, the vertex displacement of the current mesh can be obtained by solving a dynamic equation H x Δx=-g x The specific process of using implicit time integration algorithm to perform dynamic simulation of simulated cloth is as follows: Figure 6 shown.
[0130] It is understandable that in order to obtain stable dynamic simulation results, the Hessian matrix of the potential energy model needs to be used in the implicit time integration simulation framework. The Hessian matrix of the potential energy model consists of a projection matrix in the gradient direction and a geometric stiffness matrix. Usually, the geometric stiffness matrix of the strain potential is a semi-positive definite matrix, or can be transformed into a semi-positive definite matrix by some method, but the geometric stiffness matrix of the dihedral bending model is indefinite. Due to the negative eigenvalues of the geometric stiffness matrix of the dihedral bending model, under the action of the geometric stiffness matrix of the dihedral bending model, the displacement vector solved by the implicit time integration algorithm retains the height changes of the two unit faces of the dihedral unit. Therefore, when performing dynamic simulation on clothing fabrics with physical properties of weak strain resistance and strong bending strength, such as space cotton, the implicit time integration shows obvious instability.
[0131] The target Hessian matrix of the dihedral angle unit is constructed by optimizing the geometric stiffness matrix of the dihedral angle bending model into a multi-directional geometric stiffness matrix. In this way, in the process of dynamic simulation using the implicit time integration algorithm combined with the target Hessian matrix of all dihedral angle units, only the effective bending motion modes of all dihedral angle units are retained, ensuring the semi-positive definiteness of the target Hessian matrix of all dihedral angle units. This method can support the physical properties of various clothing fabrics, including clothing fabrics such as space cotton with weak strain resistance and strong bending strength, and can stably and accurately perform dynamic simulations on various clothing fabrics, thereby optimizing the dynamic simulation effects of various clothing fabrics.
[0132] The embodiment of the present invention establishes the dynamic equation of each grid by combining the target Hessian matrix of all dihedral units in each grid respectively, adopts the implicit time integration algorithm, solves the dynamic equation of each grid according to the vertex parameters and simulation parameters of each grid, and the physical parameters of the cloth to be simulated, and obtains the vertex displacement of each grid, which can ensure stable and accurate dynamic simulation of various clothing fabrics and optimize the dynamic simulation effects of various clothing fabrics.
[0133] In an optional embodiment, the dynamic equation of the current grid is:
[0134] H x Δx=-g x (14);
[0135] Among them, H x is the target Hessian matrix of all dihedral elements in the current grid, Δx is the vertex displacement of the current grid, and g x The optimized gradient of the current grid.
[0136] As an example, the dynamic equation of the current grid is the following linear equation:
[0137] H x Δx=-g x (14);
[0138] In formula (14), H x is the target Hessian matrix of all dihedral elements in the current grid, Δx is the vertex displacement of the current grid, and g x The optimized gradient of the current grid.
[0139] The embodiment of the present invention selects the above linear equation as the dynamic equation of the current grid, adopts an implicit time integration algorithm, and solves the dynamic equation of each grid according to the vertex parameters and simulation parameters of each grid, as well as the physical parameters of the fabric to be simulated, to obtain the vertex displacement of each grid, thereby ensuring stable and accurate dynamic simulation of various clothing fabrics and optimizing the dynamic simulation effects of various clothing fabrics.
[0140] Please see Figure 7 , Figure 7A schematic diagram of the structure of a clothing fabric dynamic simulation device provided by the second embodiment of the present invention. The second embodiment of the present invention provides a clothing fabric dynamic simulation device, comprising: an acquisition module 201, used to acquire all dihedral angle units in each grid based on the cloth grid model of the cloth to be simulated; a construction module 202, used to construct a target Hessian matrix of the dihedral angle unit for each dihedral angle unit according to the multi-directional geometric stiffness matrix of the dihedral angle unit; a calculation module 203, used to determine the vertex displacement of all grids by combining the target Hessian matrices of all dihedral angle units using an implicit time integration algorithm; an adjustment module 204, used to adjust the cloth grid model according to the vertex displacement of all grids to obtain an updated cloth grid model.
[0141] In an optional embodiment, for each dihedral angle unit, a target Hessian matrix of the dihedral angle unit is constructed according to the multi-directional geometric stiffness matrix of the dihedral angle unit, specifically including: for each dihedral angle unit, 8 geometric stiffness direction vectors of the dihedral angle unit are constructed according to the structural parameters of the dihedral angle unit; the multi-directional geometric stiffness matrix of the dihedral angle unit is generated by combining the 8 geometric stiffness direction vectors of the dihedral angle unit; the multi-directional geometric stiffness parameter matrix of the dihedral angle unit is generated by combining the stiffness parameters of the 8 geometric stiffness direction vectors of the dihedral angle unit; the target Hessian matrix of the dihedral angle unit is constructed by combining the multi-directional geometric stiffness matrix and the multi-directional geometric stiffness parameter matrix of the dihedral angle unit.
[0142] In an optional embodiment, the eight geometric stiffness direction vectors of the dihedral unit are:
[0143]
[0144]
[0145]
[0146]
[0147] Among them, q i is the i+1th geometric stiffness direction vector of the dihedral element, i=(0,1,...,7), t 1 =h 1 -1 [ω 1 -1,-ω 1 ,1,0] T ,h 1 is the height of a vertex on a unit face of a dihedral unit relative to the unit edge, ω 1 is the centroid of the vertex on a unit face of the dihedral unit relative to the unit edge, t 2 =h 2-1 [ω 2 -1,-ω 2 ,1,0] T ,h 2 is the height of the vertex on the other unit face of the dihedral unit relative to the unit edge, ω 2 is the centroid of the vertex on the other unit face of the dihedral element relative to the unit edge, n 1 is the normal vector of a unit face of the dihedral unit, n 2 is the normal vector of the other unit face of the dihedral element, m 1 is the height vector of a unit face of the dihedral unit, m 2 is the normal vector of the other unit face of the dihedral unit, e is the edge vector of the unit edge of the dihedral unit, s = l -1 [1,-1,0,0] T , l is the length of the unit side of the dihedral unit.
[0148] In an optional embodiment, the multi-directional geometric stiffness matrix of the dihedral element is:
[0149] Q=[q 0 ,q 1 ,q 2 ,q 3 ,q 4 ,q 5 ,q 6 ,q 7 ] (twenty three);
[0150] Where Q is the multi-directional geometric stiffness matrix of the dihedral element, q i is the i+1th geometric stiffness direction vector of the dihedral element, Represents a real number.
[0151] In an optional embodiment, the multi-directional geometric stiffness parameter matrix of the dihedral element is:
[0152]
[0153] Where Λ is the multi-directional geometric stiffness parameter matrix of the dihedral element, α i is the stiffness parameter of the i+1th geometric stiffness direction vector of the dihedral element, α i Equal to the matrix (KΣK T ), K is the original eigenvector transformation matrix of the dihedral unit, K=[k 0 ,k 1 ,k 2 ,k3 ,k 4 ,k 5 ,k 6 ,k 7 ],k i =Q -1 e i , Q is the multi-directional geometric stiffness matrix of the dihedral element, e i is the i-th element in the original eigenvector matrix E of the dihedral unit, E = [e 0 ,e 1 ,e 2 ,e 3 ,e 4 ,e 5 ,e 6 ,e 7 ], K T is the transposed matrix of the original eigenvector transformation matrix of the dihedral unit, Σ is the original eigenvalue matrix of the dihedral unit, Represents a real number.
[0154] In an optional embodiment, the target Hessian matrix of the dihedral unit is:
[0155] H d =QΛQ T (25);
[0156] Among them, H d is the target Hessian matrix of the dihedral element; Q is the multi-directional geometric stiffness matrix of the dihedral element, Q T is the transposed matrix of the multi-directional geometric stiffness matrix of the dihedral element, and Λ is the multi-directional geometric stiffness parameter matrix of the dihedral element.
[0157] In an optional embodiment, the implicit time integration algorithm is used in combination with the target Hessian matrix of all dihedral units to determine the vertex displacement of all meshes, specifically including: traversing each mesh to obtain the vertex parameters and simulation parameters of the current mesh, and obtaining the physical parameters of the cloth to be simulated; combining the target Hessian matrix of all dihedral units in the current mesh to establish the dynamic equation of the current mesh; using the implicit time integration algorithm, according to the vertex parameters and simulation parameters of the current mesh, and the physical parameters of the cloth to be simulated, solve the dynamic equation of the current mesh to obtain the vertex displacement of the current mesh.
[0158] In an optional embodiment, the dynamic equation of the current grid is:
[0159] H x Δx=-g x (26);
[0160] Among them, Hx is the target Hessian matrix of all dihedral elements in the current grid, Δx is the vertex displacement of the current grid, and g x The optimized gradient of the current grid.
[0161] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0162] Please see Figure 8 , Figure 8 The third embodiment of the present invention provides an electronic device 30, comprising a processor 301, a memory 302, and a computer program stored in the memory 302 and configured to be executed by the processor 301; the memory 302 is coupled to the processor 301, and when the processor 301 executes the computer program, the clothing fabric dynamic simulation method as described in the first embodiment of the present invention is implemented, and the same beneficial effects can be achieved.
[0163] The processor 301 reads the computer program from the memory 302 through the bus 303 and executes the computer program to implement any of the embodiments of the method for dynamic simulation of clothing fabrics as described in the first embodiment of the present invention.
[0164] Processor 301 can process digital signals and can include various computing structures, such as complex instruction set computer structure, reduced instruction set computer structure, or a structure that implements a combination of multiple instruction sets. In some examples, processor 301 can be a microprocessor.
[0165] The memory 302 can be used to store instructions executed by the processor 301 or data related to the execution of instructions. These instructions and / or data may include codes for implementing some functions or all functions of one or more modules described in the embodiments of the present invention. The processor 301 of the disclosed embodiment can be used to execute the instructions in the memory 302 to implement the clothing fabric dynamic simulation method as described in the first embodiment of the present invention. The memory 302 includes a dynamic random access memory, a static random access memory, a flash memory, an optical memory, or other memories known to those skilled in the art.
[0166] The fourth embodiment of the present invention provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the clothing fabric dynamic simulation method as described in the first embodiment of the present invention, and can achieve the same beneficial effects as the first embodiment.
[0167] In summary, the embodiment of the present invention provides a method, device, electronic device and storage medium for dynamic simulation of clothing fabrics, the method comprising: based on the cloth mesh model of the cloth to be simulated, obtaining all dihedral angle units in each mesh; for each dihedral angle unit, constructing the target Hessian matrix of the dihedral angle unit according to the multi-directional geometric stiffness matrix of the dihedral angle unit; using an implicit time integration algorithm, combining the target Hessian matrices of all dihedral angle units, determining the vertex displacements of all meshes; adjusting the cloth mesh model according to the vertex displacements of all meshes, and obtaining an updated cloth mesh model. The embodiment of the present invention determines the multi-directional geometric stiffness matrix of each dihedral angle unit based on the cloth mesh model of the cloth to be simulated to construct the target Hessian matrix of each dihedral angle unit, and uses an implicit time integration algorithm to combine the target Hessian matrices of all dihedral angle units for dynamic simulation, so as to stably and accurately perform dynamic simulation on various clothing fabrics and optimize the dynamic simulation effects of various clothing fabrics.
[0168] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0169] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0170] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0171] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A dynamic simulation method for clothing fabrics, It is characterized in that include: Based on the cloth mesh model of the cloth to be simulated, all dihedral angle units in each mesh are obtained; For each of the dihedral angle elements, constructing a target Hessian matrix of the dihedral angle element according to a multi-directional geometric stiffness matrix of the dihedral angle element; Determining the vertex displacements of all the meshes using an implicit time integration algorithm in combination with target Hessian matrices of all the dihedral elements; The cloth mesh model is adjusted according to the vertex displacements of all the meshes to obtain an updated cloth mesh model.
2. The clothing fabric dynamic simulation method according to claim 1, It is characterized in that For each of the dihedral angle units, constructing a target Hessian matrix of the dihedral angle unit according to the multi-directional geometric stiffness matrix of the dihedral angle unit specifically includes: For each of the dihedral angle elements, constructing eight geometric stiffness direction vectors of the dihedral angle element according to the structural parameters of the dihedral angle element; Combining eight geometric stiffness direction vectors of the dihedral element, generating a multi-directional geometric stiffness matrix of the dihedral element; Combining the stiffness parameters of the eight geometric stiffness direction vectors of the dihedral element, generating a multi-directional geometric stiffness parameter matrix of the dihedral element; The target Hessian matrix of the dihedral element is constructed by combining the multi-directional geometric stiffness matrix and the multi-directional geometric stiffness parameter matrix of the dihedral element.
3. The clothing fabric dynamic simulation method according to claim 2, It is characterized in that The eight geometric stiffness direction vectors of the dihedral element are: Among them, q i is the i+1th geometric stiffness direction vector of the dihedral element, t 1 =h 1 -1 [ω 1 -1,-ω 1 ,1,0] T ,h 1 is the height of a vertex on a unit face of the dihedral unit relative to the unit edge, ω 1 is the centroid of the vertex on a unit face of the dihedral unit relative to the unit edge, t 2 =h 2 -1 [ω 2 -1,-ω 2 ,1,0] T ,h 2 is the height of the vertex on the other unit face of the dihedral unit relative to the unit edge, ω 2 is the centroid of the vertex on the other unit face of the dihedral unit relative to the unit edge, n 1 is the normal vector of a unit face of the dihedral element, n 2 is the normal vector of the other unit face of the dihedral element, m 1 is the height vector of a unit face of the dihedral element, m 2 is the normal vector of the other unit face of the dihedral unit, e is the edge vector of the unit edge of the dihedral unit, s=l -1 [1,-1,0,0] T , l is the length of the unit side of the dihedral unit, [·] T Represents the transpose of a matrix.
4. The clothing fabric dynamic simulation method according to claim 2, It is characterized in that The multi-directional geometric stiffness matrix of the dihedral element is: Q=[q 0 ,q 1 ,q 2 ,q 3 ,q 4 ,q 5 ,q 6 ,q 7 ]; Where Q is the multi-directional geometric stiffness matrix of the dihedral element, q i is the i+1th geometric stiffness direction vector of the dihedral element, Represents a real number.
5. The clothing fabric dynamic simulation method according to claim 2, It is characterized in that The multi-directional geometric stiffness parameter matrix of the dihedral element is: Wherein, Λ is the multi-directional geometric stiffness parameter matrix of the dihedral element, α i is the stiffness parameter of the i+1th geometric stiffness direction vector of the dihedral element, α i Equal to the matrix (KΣK T ), K is the original eigenvector transformation matrix of the dihedral unit, K=[k 0 ,k 1 ,k 2 ,k 3 ,k 4 ,k 5 ,k 6 ,k 7 ],k i =Q -1 e i , Q is the multi-directional geometric stiffness matrix of the dihedral element, e i is the i-th element in the original eigenvector matrix E of the dihedral unit, E = [e 0 ,e 1 ,e 2 ,e 3 ,e 4 ,e 5 ,e 6 ,e 7 ], K T is the transposed matrix of the original eigenvector conversion matrix of the dihedral angle unit, Σ is the original eigenvalue matrix of the dihedral angle unit, Represents a real number.
6. The clothing fabric dynamic simulation method according to claim 2, It is characterized in that The target Hessian matrix of the dihedral unit is: H d =QΛQ T ; Among them, H d is the target Hessian matrix of the dihedral unit; Q is the multi-directional geometric stiffness matrix of the dihedral unit, Q T is the transposed matrix of the multi-directional geometric stiffness matrix of the dihedral angle unit, and Λ is the multi-directional geometric stiffness parameter matrix of the dihedral angle unit.
7. The clothing fabric dynamic simulation method according to claim 1, It is characterized in that The implicit time integration algorithm is used to determine the vertex displacements of all the grids in combination with the target Hessian matrix of all the dihedral units, specifically including: Traversing each of the meshes, obtaining vertex parameters and simulation parameters of the current mesh, and obtaining physical parameters of the cloth to be simulated; Combining the target Hessian matrices of all the dihedral elements in the current grid, establishing the dynamic equation of the current grid; An implicit time integration algorithm is adopted to solve the dynamic equation of the current mesh according to the vertex parameters and simulation parameters of the current mesh and the physical parameters of the cloth to be simulated, so as to obtain the vertex displacement of the current mesh.
8. The clothing fabric dynamic simulation method according to claim 7, It is characterized in that The dynamic equation of the current grid is: H x Δx=-g x ; Among them, H x is the target Hessian matrix of all the dihedral elements in the current grid, Δx is the vertex displacement of the current grid, g x is the optimization gradient of the current grid.
9. A dynamic simulation device for clothing fabrics, It is characterized in that include: An acquisition module, used for acquiring all dihedral angle units in each mesh based on a cloth mesh model of the cloth to be simulated; A construction module, for constructing, for each of the dihedral angle elements, a target Hessian matrix of the dihedral angle element according to a multi-directional geometric stiffness matrix of the dihedral angle element; A calculation module, for determining the vertex displacements of all the meshes by using an implicit time integration algorithm in combination with target Hessian matrices of all the dihedral elements; The adjustment module is used to adjust the cloth mesh model according to the vertex displacements of all the meshes to obtain an updated cloth mesh model.
10. An electronic device, It is characterized in that The invention comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor; the memory is coupled to the processor, and the processor implements the clothing fabric dynamic simulation method according to any one of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored computer program; wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the clothing fabric dynamic simulation method according to any one of claims 1 to 8.