Simulated cloth shape solidification method, device, electronic equipment and storage medium
By constructing texture edges in the triangular mesh unit of simulated cloth and calculating the target vertex position, the problem of poor solidification effect of simulated cloth shape in the existing technology is solved, better shape maintenance and physical attribute expression are achieved, and simulation is improved. Effect.
Patent Information
- Application Number
- CN202411034633.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-30
AI Technical Summary
The existing simulated fabric shape curing technology has poor effect and is difficult to effectively maintain the shape and physical properties of the simulated fabric.
By constructing the texture edges in the triangular mesh unit of the simulated cloth, and determining the target vertex position based on the plate centroid matrix and the deformation texture edge length matrix, the shape of the simulated cloth is solidified, and the mesh resolution and anisotropic physical attribute expression are improved. .
Significantly improves the morphological solidification effect of simulated fabric, maintaining the shape and physical properties of the deformed fabric, especially the accuracy of stretch and wrinkles.
Smart Images

Figure CN118570416B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of clothing design, and in particular, to a method, device, electronic device, computer-readable storage medium, and computer program product for solidifying simulated cloth form. Background Art
[0002] The shape solidification of simulated cloth means to keep the shape specified by the user locally or globally in the cloth simulation. Figure 1 As shown in the figure, a square cloth has its upper left and upper right corners fixed. After the user drags the cloth to a certain shape through an input device (such as a mouse), if the user wants the entire cloth to maintain this shape in subsequent simulations to achieve certain simulation effects, the user can release the drag and turn on the shape solidification, and continue to simulate the cloth drooping due to gravity after releasing the drag, as shown in the figure below. Figure 2 The simulation effect shown in the figure shows that under the effect of morphological solidification, Figure 2 The simulated cloth shown retains the shape dragged by the user, for example, the protrusions and several obvious wrinkles at the dragging point are maintained.
[0003] A commonly used technical solution in the related art is to maintain the angle of each mesh edge of the simulated cloth mesh to achieve a shape solidification effect. However, the shape solidification effect of the technical solution of maintaining the angle in the related art is poor. Summary of the invention
[0004] The purpose of the present disclosure is to provide a method, device, electronic device, computer-readable storage medium and computer program product for solidifying the shape of simulated cloth, which can improve the solidification effect of the shape of simulated cloth.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for solidifying the form of simulated cloth, comprising: obtaining a plate mesh and a deformation mesh of the simulated cloth, the plate mesh and the deformation mesh being different forms of a triangular mesh constituting the simulated cloth, the triangular mesh comprising a plurality of triangular mesh units; constructing a texture edge in each of the triangular mesh units; determining that each of the triangular mesh units corresponds to first vertex data and first texture edge data in the plate mesh, and determining that each of the triangular mesh units corresponds to second vertex data in the deformation mesh; for each of the triangular mesh units, determining a plate centroid matrix of two endpoints of the texture edge in the triangular mesh unit according to the first vertex data and the first texture edge data, determining a deformation texture edge length matrix of the texture edge in the deformation mesh according to the second vertex data, and determining a target vertex position of the triangular mesh unit according to the plate centroid matrix and the deformation texture edge length matrix; and determining a target mesh according to the target vertex positions of all the triangular mesh units.
[0006] Compared with the related art, in the method for solidifying the form of simulated cloth provided in the embodiment of the present disclosure, a corresponding texture edge is constructed in each triangular mesh unit constituting the simulated cloth. When the simulated cloth is deformed, the direction and length of the corresponding texture edge in the plate mesh and the deformation mesh also change. The texture edge data is split into texture direction data and texture length data according to the texture edge data of the texture edge. The plate centroid matrix in the embodiment of the present disclosure is the texture direction data corresponding to the plate mesh before deformation, and the deformation texture edge length matrix is the texture length data corresponding to the deformation mesh after deformation. The texture length data corresponding to the plate mesh before deformation is replaced with the deformation texture edge length matrix after deformation. The target vertex position of the triangular mesh unit is determined according to the plate centroid matrix and the deformation texture edge length matrix to realize the solidification of the form of the simulated cloth. Since the form solidification is performed by the tensile deformation characteristics of the triangular mesh unit in the mesh of the simulated cloth in the embodiment of the present disclosure, it has better mesh resolution independence and better anisotropic physical property expression, thereby improving the form solidification effect of the simulated cloth.
[0007] In an optional embodiment, determining the plate centroid matrix of the two endpoints of the texture edge in the triangular mesh unit based on the first vertex data and the first texture edge data includes: constructing a first vertex matrix of the triangular mesh unit based on the first vertex data; constructing a first texture matrix expression including the texture edge based on the first texture edge data; and determining the plate centroid matrix based on the first texture matrix expression and the inverse matrix of the first vertex matrix.
[0008] In an optional embodiment, the method of determining the plate centroid matrix according to the first texture matrix expression and the inverse matrix of the first vertex matrix includes: determining the first texture edge length of the texture edge and the first texture matrix expression including the texture edge according to the first texture edge data, and determining the first texture direction matrix of the texture edge according to the first texture matrix expression and the first texture edge length; calculating the product of the first texture direction matrix and the inverse matrix of the first vertex matrix as an intermediate matrix; decomposing the intermediate matrix by columns to obtain a number of intermediate vectors, and determining the intermediate number corresponding to each intermediate vector; calculating the quotient of each intermediate vector and the intermediate number corresponding to it to obtain a number of centroid vectors; and obtaining the plate centroid matrix according to a combination of all the centroid vectors.
[0009] In an optional embodiment, determining the deformation texture edge length matrix of the texture edge in the deformation mesh according to the second vertex data includes: constructing the second vertex data vector of the triangular mesh unit according to the second vertex data; respectively calculating the product of the second vertex data vector and each of the centroid vectors to obtain a plurality of intermediate vectors; and constructing a diagonal matrix as the deformation texture edge length matrix according to the module lengths of the plurality of intermediate vectors.
[0010] In an optional embodiment, determining the target vertex position of the triangular mesh unit according to the plate centroid matrix and the deformation texture edge length matrix includes: calculating the product of the plate centroid matrix and the inverse matrix of the deformation texture edge length matrix as a deformation intermediate matrix; and determining the target vertex position according to the deformation intermediate matrix.
[0011] In an optional embodiment, determining the intermediate number corresponding to each of the intermediate vectors includes: taking the absolute value of the component with the largest absolute value in each of the intermediate vectors as the intermediate number corresponding to the intermediate vector.
[0012] In an optional embodiment, constructing a texture edge in each of the triangular mesh units includes: taking the first vertex of the triangular mesh unit as a starting point, constructing a first texture edge in the triangular mesh unit along a first preset direction; taking the second vertex of the triangular mesh unit as a starting point, constructing a second texture edge in the triangular mesh unit along a second preset direction.
[0013] In a second aspect, an embodiment of the present disclosure provides a simulated cloth morphology solidification device, comprising: a mesh acquisition module, the mesh acquisition module is used to acquire a plate mesh and a deformation mesh of the simulated cloth, the plate mesh and the deformation mesh are different forms of a triangular mesh constituting the simulated cloth, the triangular mesh comprising a plurality of triangular mesh units; a texture edge construction module, the texture edge construction module is used to construct a texture edge in each of the triangular mesh units; a data processing module, the data processing module is used to determine the first vertex data and the first texture edge data corresponding to each of the triangular mesh units in the plate mesh, and determine the first vertex data and the first texture edge data corresponding to each of the triangular mesh units in the shape The corresponding second vertex data and second texture edge data in the deformable mesh; a calculation module, the calculation module is used to determine, for each of the triangular mesh units, the plate centroid matrix of the two endpoints of the texture edge in the triangular mesh unit according to the first vertex data and the first texture edge data, determine the deformation texture edge length matrix of the texture edge in the deformable mesh according to the second vertex data and the second texture edge data, and determine the target vertex position of the triangular mesh unit according to the plate centroid matrix and the deformation texture edge length matrix; a simulation module, the simulation module is used to determine the target mesh according to the target vertex positions of all the triangular mesh units.
[0014] Compared with the prior art, in the simulated cloth morphology solidification device provided by the embodiment of the present disclosure, the texture edge construction module constructs a corresponding texture edge in each triangular mesh unit constituting the simulated cloth. When the simulated cloth is deformed, the direction and length of the corresponding texture edge in the plate mesh and the deformation mesh also change. The calculation module can split the texture edge data into texture direction data and texture length data according to the texture edge data of the texture edge determined by the data processing module. The plate centroid matrix in the embodiment of the present disclosure is the texture direction data corresponding to the plate mesh before deformation, and the deformation texture edge length matrix is the texture length data corresponding to the deformation mesh after deformation. The texture length data corresponding to the plate mesh before deformation is replaced by the deformation texture edge length matrix after deformation. The target vertex position of the triangular mesh unit is determined according to the plate centroid matrix and the deformation texture edge length matrix, and the morphology solidification of the simulated cloth can be realized by the simulation module. Since the morphology solidification is performed by the tensile deformation characteristics of the triangular mesh unit in the mesh of the simulated cloth in the embodiment of the present disclosure, it has better mesh resolution independence and better anisotropic physical property expression, thereby improving the morphology solidification effect of the simulated cloth.
[0015] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the simulated cloth form solidification method as described above.
[0016] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the aforementioned simulated cloth shape solidification method.
[0017] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, which includes a computer program code. When the computer program code is executed by a computer device, the computer device executes the aforementioned simulated cloth form solidification method. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present disclosure and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can also be obtained based on these drawings.
[0019] Figure 1 This is a schematic diagram of the simulated cloth after being pulled and deformed;
[0020] Figure 2 This is a schematic diagram of the simulated cloth after the shape is solidified;
[0021] Figure 3 A schematic diagram of the process of the simulated cloth shape solidification method provided in the first embodiment of the present disclosure;
[0022] Figure 4 A schematic diagram of the structure of a triangular mesh unit in a plate mesh in the simulated cloth shape solidification method provided in the first embodiment of the present disclosure;
[0023] Figure 5 A schematic diagram of the structure of a triangular mesh unit in a deformable mesh in the simulated cloth shape solidification method provided in the first embodiment of the present disclosure;
[0024] Figure 6 A schematic diagram of a process of determining a plate centroid matrix according to first vertex data and first texture edge data in the method for solidifying the simulated cloth form provided in the first embodiment of the present disclosure;
[0025] Figure 7A schematic diagram of a process of determining a plate centroid matrix according to the inverse matrix of a first texture matrix expression and a first edge matrix expression in the simulated cloth morphology solidification method provided in the first embodiment of the present disclosure;
[0026] Figure 8 A schematic diagram of a process of determining a deformation texture edge length matrix according to second vertex data in the method for solidifying the simulated cloth form provided in the first embodiment of the present disclosure;
[0027] Fig. 9 This is a schematic diagram of the simulated cloth before deformation;
[0028] Fig.10 This is a schematic diagram of the simulated cloth after being pulled and deformed;
[0029] Fig.11 A schematic diagram of a simulated cloth after the shape is solidified by the simulated cloth shape solidification method provided by an embodiment of the present disclosure;
[0030] Fig.12 This is a schematic diagram of the structure of the simulated cloth shape solidification device provided in the second embodiment of the present disclosure;
[0031] Fig.13 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present disclosure. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. The components of the embodiments of the present disclosure described and shown in the drawings here can be arranged and designed in various different configurations.
[0033] Therefore, the following detailed description of the embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the present disclosure as claimed, but is merely representative of selected embodiments of the present disclosure.
[0034] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0035] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.
[0036] It should be noted that, in the absence of conflict, the features in the embodiments of the present disclosure may be combined with each other.
[0037] The first embodiment of the present disclosure provides a method for curing a simulated cloth shape, such as Figure 3 As shown, the following steps are included:
[0038] Step S101: Obtaining a plate mesh and a deformation mesh of simulated cloth.
[0039] In application scenarios such as electronic games and animation production, simulation of electronic characters and the clothes they wear is usually included, wherein the simulation of clothes can be disassembled into the simulation of different fabrics constituting the clothes. The simulated fabric involved in the embodiments of the present disclosure is a simulation model of the fabric constructed in a computer. The simulation model of the fabric can be composed of a large number of basic units, and the simulation effect of the deformation of the simulated fabric is achieved by changing the position and shape of these basic units. In some embodiments of the present disclosure, the shape of the basic unit in the simulation model of the fabric can be a triangle, that is, the simulated fabric is a triangular mesh composed of a plurality of triangular mesh units.
[0040] Among them, the plate mesh and the deformation mesh are different forms of triangular meshes that constitute the simulated cloth. The plate mesh is the triangular mesh before the simulated cloth is deformed, and the deformation mesh is the triangular mesh after the simulated cloth is deformed. The plate mesh and the deformation mesh are two forms of triangular meshes that constitute the simulated cloth in different situations. Therefore, each triangular mesh unit in the plate mesh corresponds to each triangular mesh unit in the deformation mesh one by one, which is actually different states corresponding to the same triangular mesh unit.
[0041] Step S102: constructing a texture edge in each triangular mesh unit.
[0042] It is understandable that the data analysis and processing of the simulated cloth can be divided into data analysis and processing of each triangular mesh unit in the triangular mesh constituting the simulated cloth. In the embodiments of the present disclosure, the data analysis and processing process of each triangular mesh unit is basically the same. This article takes any of the triangular mesh units as an example to explain the data analysis and processing process in detail. The other triangular mesh units can use the same method to perform data analysis and processing to achieve the overall morphological solidification effect of the simulated cloth.
[0043] In the embodiment of the present disclosure, constructing a texture edge in a triangular mesh unit may specifically include: starting from a first vertex of the triangular mesh unit, constructing a first texture edge in the triangular mesh unit along a first preset direction, and starting from a second vertex of the triangular mesh unit, constructing a second texture edge in the triangular mesh unit along a second preset direction. Figure 4 , Figure 5The figure shows the shape comparison of the same triangular mesh unit in the plate mesh and the deformation mesh. The texture edge E1 is the first texture edge constructed in the triangular mesh unit along the horizontal direction with the vertex 1 of the triangular mesh unit as the starting point, and the texture edge E2 is the second texture edge constructed in the triangular mesh unit along the vertical direction with the vertex 3 of the triangular mesh unit as the starting point. It can be understood that the horizontal direction as the first preset direction and the vertical direction as the second preset direction are only examples of the first preset direction and the second preset direction in some embodiments of the present disclosure, and do not constitute a limitation. In some other embodiments of the present disclosure, the first preset direction and the second preset direction may also be other directions.
[0044] Step S103: determining that each triangular mesh unit corresponds to first vertex data and first texture edge data in the plate mesh, and determining that each triangular mesh unit corresponds to second vertex data in the deformable mesh.
[0045] In this step, the first vertex data may include the position data of three vertices of the triangular mesh unit in the plate mesh, the first texture edge data may include the position data of the three two endpoints of each texture edge in the plate mesh, and the second vertex data may include the position data of three vertices of the triangular mesh unit in the deformation mesh.
[0046] Step S104: For each triangular mesh unit, determine the plate centroid matrix of the two endpoints of the texture edge in the plate mesh and the triangular mesh unit according to the first vertex data and the first texture edge data, and determine the deformation texture edge length matrix of the texture edge in the deformation mesh according to the second vertex data.
[0047] In some embodiments of the present disclosure, Figure 6 As shown, determining the plate centroid matrix of two endpoints of the texture edge in the plate mesh in the triangle mesh unit according to the first vertex data and the first texture edge data may specifically include:
[0048] Step S201: constructing a first vertex matrix of a triangle mesh unit according to first vertex data.
[0049] In this step, the first vertex data can be expressed in the form of a matrix including a single vertex of a triangular mesh unit, that is, the first vertex matrix ,in They are the position coordinates of the three vertices of the triangular mesh unit.
[0050] Step S202: construct a first texture matrix expression including texture edges according to first texture edge data.
[0051] In this step, the first texture edge data includes the positions of the two endpoints of each texture edge, which can also be obtained by the constant matrix Construct the first texture matrix expression including two texture edges = ,in, There are two texture edges respectively.
[0052] Step S203: Determine the plate centroid matrix according to the first texture matrix expression and the inverse matrix of the first vertex matrix.
[0053] In this step S203, if Figure 7 As shown, the centroid matrix of the plate can also be determined as:
[0054] Step S301: determining a first texture edge length of the texture edge according to first texture edge data, and determining a first texture direction matrix of the texture edge according to a first texture matrix expression and the first texture edge length.
[0055] In this step, the first texture side length includes two texture sides. The side length The first texture direction matrix of the texture edge can be determined based on the first texture matrix expression and the first texture edge length. Construct the diagonal matrix corresponding to the length of the texture edge , the texture edge consists of the texture direction and the texture edge length, that is ,in, It is the first texture direction matrix that represents the texture direction, that is .
[0056] In an embodiment of the present disclosure, a first edge matrix expression including any edge of the triangle mesh unit can also be constructed according to the first vertex matrix. The number of edges in the first edge matrix expression can be the same as the number of texture edges. Figure 4 , Figure 5 Taking the example of two texture edges shown in the figure, the first edge matrix expression can be a matrix expression of any two edges of the triangle mesh unit. Specifically, a constant matrix can be used. Constructs the first edge matrix expression involving any two edges of a triangular mesh element = .
[0057] Defining the Matrix is the first edge matrix expression of the triangular mesh element and the texture edge matrix The transformation matrix is ,make , then the first texture direction matrix .
[0058] Step S302: Calculate the product of the first texture direction matrix and the inverse matrix of the first vertex matrix as an intermediate matrix.
[0059] In this step, Represents the intermediate matrix, and the product of the first texture direction matrix and the inverse matrix of the first vertex matrix is calculated as the intermediate matrix. The mathematical expression is = .
[0060] Step S303: Decompose the intermediate matrix by columns to obtain a number of intermediate vectors, and determine the intermediate number corresponding to each intermediate vector.
[0061] In this step, for the intermediate matrix , decompose it by column to get several intermediate vectors , for each intermediate vector A unique corresponding intermediate number can be determined .
[0062] In some embodiments of the present disclosure, determining the intermediate number corresponding to each intermediate vector may specifically include converting each intermediate vector The absolute value of the component with the largest absolute value is taken as the intermediate number corresponding to the intermediate vector. That is, for each intermediate vector , take the absolute values of all the components for comparison, and take the absolute value of the component with the largest absolute value as the intermediate vector The only corresponding middle number .
[0063] It is understandable that the above are only intermediate numbers in some embodiments of the present disclosure. The specific description of the method for obtaining the value of does not constitute a limitation. In some other embodiments of the present disclosure, the intermediate vector may also be obtained. The absolute value, mean, minimum, etc. of all components are taken as the middle number , which can be set according to actual needs.
[0064] Step S304: Calculate the quotient of each intermediate vector and its corresponding intermediate number to obtain a number of centroid vectors.
[0065] In this step, the quotient of each intermediate vector and its corresponding intermediate number is calculated as ,in, That is the centroid vector corresponding to each texture edge.
[0066] Step S305: Obtain the plate centroid matrix based on the combination of all centroid vectors.
[0067] In this step, all centroid vectors are calculated according to The plate centroid matrix is obtained by combining the indicated order. In the embodiment disclosed herein, the number of texture edges is 2, then
[0068] In some embodiments of the present disclosure, Figure 8 As shown, determining the deformation texture edge length matrix of the texture edge in the deformable mesh according to the second vertex data may specifically include:
[0069] Step S401: constructing a second vertex data vector of a triangle mesh unit according to second vertex data.
[0070] In this step, Represents the second vertex data vector, that is .
[0071] Step S402: Calculate the product of the second vertex data vector and each centroid vector respectively to obtain several intermediate vectors.
[0072] In this step, the product of the second vertex data vector and each centroid vector is calculated respectively. .
[0073] Step S403: construct a diagonal matrix as a deformable texture edge length matrix according to the modulus lengths of a number of intermediate vectors.
[0074] In this step, Represents the deformation texture edge length matrix, that is .
[0075] Step S105: Determine the target vertex position of the triangular mesh unit according to the plate centroid matrix and the deformation texture edge length matrix.
[0076] In some embodiments of the present disclosure, the target vertex position of the triangular mesh unit is determined according to the plate centroid matrix and the deformation texture edge length matrix in this step, which can be specifically: the product of the plate centroid matrix and the inverse matrix of the deformation texture edge length matrix is calculated as the deformation intermediate matrix, The deformation intermediate matrix is ; According to the deformation intermediate matrix Determine the target vertex position.
[0077] Among them, according to the deformation intermediate matrix Determining the target vertex position may specifically include: Calculate the deformation gradient of the triangular mesh element ; According to the deformation gradient Determine the target vertex position.
[0078] In some embodiments of the present disclosure, according to the deformation gradient Determining the target vertex position may specifically include calculating the stretching force, including: defining the deformation gradient Then the force in the i-th texture direction is To obtain, is the physical rigidity of the i-th texture direction, a is the area of the triangle, for The i-th column of , we can see that this elastic force tends to make the triangle return to is 0 (that is, =1), that is, the texture edge formed by the current position The side length is restored to the original length calculated beforehand .in addition is a 9x1 column vector. The forces on the three vertices of the triangle are all contained in In, through The deformation gradient is distributed to the three vertices in a certain proportion. After the tensile force is obtained, the corresponding displacement can be calculated to determine the new vertex position. and the deformation intermediate matrix The target vertex position can be determined by inputting.
[0079] In some embodiments of the present disclosure, the cloth simulation model can be used to complete the deformation intermediate matrix Calculate the deformation gradient of the triangular mesh element ; According to the deformation gradient The calculation process of determining the target vertex position is to transform the intermediate matrix After inputting the cloth simulation model, the cloth simulation model can output the target vertex positions.
[0080] Step S106: Determine the target mesh according to the target vertex positions of all triangular mesh units.
[0081] Compared with the related art, in the simulated cloth morphology solidification method provided in the first embodiment of the present disclosure, a corresponding texture edge is constructed in each triangular mesh unit constituting the simulated cloth. When the simulated cloth is deformed, the direction and length of the corresponding texture edge in the plate mesh and the deformation mesh also change. The texture edge data is split into texture direction data and texture length data according to the texture edge data of the texture edge. The plate centroid matrix in the embodiment of the present disclosure is the texture direction data corresponding to the plate mesh before deformation, and the deformation texture edge length matrix is the texture length data corresponding to the deformation mesh after deformation. The texture length data corresponding to the plate mesh before deformation is replaced with the deformation texture edge length matrix after deformation. The target vertex position of the triangular mesh unit is determined according to the plate centroid matrix and the deformation texture edge length matrix to realize the morphology solidification of the simulated cloth. Since the morphology solidification is performed by the tensile deformation characteristics of the triangular mesh unit in the mesh of the simulated cloth in the embodiment of the present disclosure, it has better mesh resolution independence and better anisotropic physical property expression, thereby improving the morphology solidification effect of the simulated cloth.
[0082] Please refer to Figures 9 to 11 ,like Fig. 9 The figure shows the schematic diagram of the simulated cloth before deformation. Fig.10 The figure shows the schematic diagram of the simulated cloth after being pulled and deformed. Fig.11 The figure shows a schematic diagram of a simulated cloth after shape solidification using the simulated cloth shape solidification method provided by an embodiment of the present disclosure. It can be seen that the stretching effect is maintained, especially at the drag point in the lower left corner of the cloth.
[0083] The second embodiment of the present disclosure provides a simulated cloth shape solidification device, such as Fig.12 As shown, it includes: a grid acquisition module 501, the grid acquisition module 501 is used to acquire the plate grid and the deformation grid of the simulated cloth, and the simulated cloth is composed of multiple triangular grid units; a texture edge construction module 502, the texture edge construction module 502 is used to construct a texture edge in each triangular grid unit; a data processing module 503, the data processing module 503 is used to determine the first vertex data and the first texture edge data corresponding to each triangular grid unit in the plate grid, and determine the second vertex data and the second texture edge data corresponding to each triangular grid unit in the deformation grid; a calculation module 504, the calculation module 504 is used to determine, for each triangular grid unit, a plate centroid matrix of the two end points of the texture edge in the plate grid in the triangular grid unit according to the first vertex data and the first texture edge data, determine the deformation texture edge length matrix of the texture edge in the deformation grid according to the second vertex data and the second texture edge data, and determine the target vertex position of the triangular grid unit according to the plate centroid matrix and the deformation texture edge length matrix; a simulation module 505, the simulation module 505 is used to determine the target grid according to the target vertex positions of all triangular grid units.
[0084] Compared with the prior art, in the simulated cloth morphology solidification device provided in the second embodiment of the present disclosure, the texture edge construction module 502 constructs a corresponding texture edge in each triangular mesh unit constituting the simulated cloth. When the simulated cloth is deformed, the direction and length of the corresponding texture edge in the plate mesh and the deformation mesh also change. The calculation module 504 can split the texture edge data into texture direction data and texture length data according to the texture edge data of the texture edge determined by the data processing module 503. The plate centroid matrix in the embodiment of the present disclosure is the texture direction data corresponding to the plate mesh before deformation, and the deformed texture edge is the texture direction data corresponding to the plate mesh before deformation. The long matrix is the texture length data corresponding to the deformed mesh after deformation. The texture length data corresponding to the plate mesh before deformation is replaced by the deformed texture edge length matrix after deformation. The simulation module 505 can solidify the shape of the simulated cloth by determining the target vertex position of the triangular mesh unit according to the plate centroid matrix and the deformed texture edge length matrix. Since the shape is solidified by the tensile deformation characteristics of the triangular mesh units in the mesh of the simulated cloth in the embodiment of the present disclosure, it has better independence from mesh resolution and better expression of anisotropic physical properties, thereby improving the shape solidification effect of the simulated cloth.
[0085] Embodiment 3 of the present disclosure relates to an electronic device, such as Fig.13 As shown, it includes: at least one processor 601; and a memory 602 that is communicatively connected to the at least one processor 601; wherein the memory 602 stores instructions that can be executed by the at least one processor 601, and the instructions are executed by the at least one processor 601 so that the at least one processor 601 can execute the methods in the above-mentioned embodiments.
[0086] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor.
[0087] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.
[0088] Embodiment 4 of the present disclosure relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.
[0089] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of each embodiment method of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0090] Embodiment 5 of the present disclosure relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.
[0091] The above are only specific embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present disclosure should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A method for curing a simulated cloth shape, characterized in that: include: Acquire a plate mesh and a deformed mesh of a simulated cloth, wherein the plate mesh and the deformed mesh are different forms of a triangular mesh constituting the simulated cloth, and the triangular mesh includes a plurality of triangular mesh units; constructing a texture edge within each of the triangular mesh cells; Determine that each of the triangular mesh units corresponds to first vertex data and first texture edge data in the plate mesh, and determine that each of the triangular mesh units corresponds to second vertex data in the deformable mesh; For each of the triangular mesh units, determine a plate centroid matrix of two endpoints of the texture edge in the triangular mesh unit according to the first vertex data and the first texture edge data, determine a deformed texture edge length matrix of the texture edge in the deformed mesh according to the second vertex data, and determine a target vertex position of the triangular mesh unit according to the plate centroid matrix and the deformed texture edge length matrix; Determine a target mesh according to the target vertex positions of all the triangular mesh units; The determining, according to the first vertex data and the first texture edge data, a plate centroid matrix of two endpoints of the texture edge in the triangular mesh unit comprises: Constructing a first vertex matrix of the triangular mesh unit according to the first vertex data; Constructing a first texture matrix expression including the texture edge according to the first texture edge data; Determine a first texture edge length of the texture edge and a first texture matrix expression including the texture edge according to the first texture edge data, and determine a first texture direction matrix of the texture edge according to the first texture matrix expression and the first texture edge length; Calculate the product of the first texture direction matrix and the inverse matrix of the first vertex matrix as an intermediate matrix; Decomposing the intermediate matrix by columns to obtain a number of intermediate vectors, and determining an intermediate number corresponding to each of the intermediate vectors; Calculate the quotient of each intermediate vector and its corresponding intermediate number to obtain a number of centroid vectors; The plate centroid matrix is obtained according to the combination of all the centroid vectors.
2. The method for curing the simulated cloth shape according to claim 1, characterized in that: The step of determining a deformation texture edge length matrix of the texture edge in the deformable mesh according to the second vertex data comprises: Constructing a second vertex data vector of the triangle mesh unit according to the second vertex data; Calculate the product of the second vertex data vector and each of the centroid vectors respectively to obtain a plurality of intermediate vectors; A diagonal matrix is constructed according to the moduli of the plurality of intermediate vectors as the deformable texture edge length matrix.
3. The method for curing the simulated cloth shape according to claim 2, characterized in that: The step of determining the target vertex position of the triangular mesh unit according to the plate centroid matrix and the deformation texture edge length matrix includes: Calculate the product of the plate centroid matrix and the inverse matrix of the deformation texture edge length matrix as the deformation intermediate matrix; The target vertex position is determined according to the deformation intermediate matrix.
4. The method for curing the simulated cloth shape according to claim 1, characterized in that: The determining of the intermediate number corresponding to each of the intermediate vectors comprises: The absolute value of the component with the largest absolute value in each of the intermediate vectors is used as the intermediate number corresponding to the intermediate vector.
5. The method for curing the simulated cloth shape according to claim 1, characterized in that: The constructing of a texture edge in each of the triangular mesh units comprises: Taking the first vertex of the triangular mesh unit as a starting point, a first texture edge is constructed in the triangular mesh unit along a first preset direction, and taking the second vertex of the triangular mesh unit as a starting point, a second texture edge is constructed in the triangular mesh unit along a second preset direction.
6. A simulated cloth shape curing device, characterized in that: include: A mesh acquisition module, the mesh acquisition module is used to acquire a plate mesh and a deformation mesh of the simulated cloth, the plate mesh and the deformation mesh are different forms of a triangular mesh constituting the simulated cloth, and the triangular mesh includes a plurality of triangular mesh units; A texture edge construction module, the texture edge construction module is used to construct a texture edge in each of the triangular mesh units; A data processing module, the data processing module is used to determine the first vertex data and the first texture edge data corresponding to each of the triangular mesh units in the plate mesh, and determine the second vertex data and the second texture edge data corresponding to each of the triangular mesh units in the deformable mesh; A calculation module, the calculation module is used to determine, for each of the triangular mesh units, a plate centroid matrix of two end points of the texture edge in the triangular mesh unit according to the first vertex data and the first texture edge data, determine a deformation texture edge length matrix of the texture edge in the deformable mesh according to the second vertex data and the second texture edge data, and determine a target vertex position of the triangular mesh unit according to the plate centroid matrix and the deformation texture edge length matrix; The determining, according to the first vertex data and the first texture edge data, a plate centroid matrix of two endpoints of the texture edge in the triangular mesh unit comprises: Constructing a first vertex matrix of the triangular mesh unit according to the first vertex data; Constructing a first texture matrix expression including the texture edge according to the first texture edge data; Determine a first texture edge length of the texture edge and a first texture matrix expression including the texture edge according to the first texture edge data, and determine a first texture direction matrix of the texture edge according to the first texture matrix expression and the first texture edge length; Calculate the product of the first texture direction matrix and the inverse matrix of the first vertex matrix as an intermediate matrix; Decomposing the intermediate matrix by columns to obtain a number of intermediate vectors, and determining an intermediate number corresponding to each of the intermediate vectors; Calculate the quotient of each intermediate vector and its corresponding intermediate number to obtain a number of centroid vectors; Obtaining the plate centroid matrix according to the combination of all the centroid vectors; A simulation module is used to determine a target mesh according to the target vertex positions of all the triangular mesh units.
7. An electronic device, characterized in that: include: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the simulated cloth shape solidification method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that: The computer program is executed by a processor to implement the simulated cloth shape solidification method according to any one of claims 1 to 5.
9. A computer program product, characterized in that The computer program product includes a computer program code. When the computer program code is executed by a computer device, the computer device executes the simulated cloth shape solidification method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Clothing seam processing and fold reinforcing method based on mass point spring model
CN103366054A
Cloth simulation method based on dynamic reconstruction grid
CN103605823A
