Fabric Self-Intersection Repair Method, Device, Storage Medium and Apparatus

By constraining and iterative updates on the vertex positions of the fabric triangle, the problem of poor physical simulation and animation rendering results caused by fabric self-intersection is solved, and the repair of fabric self-intersection is achieved, and the simulation and rendering quality is improved.

CN114723868BActive Publication Date: 2025-08-01MIGU CO LTD +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210477995.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-29
Publication Date
2025-08-01
Estimated Expiration
2042-04-29

AI Technical Summary

Technical Problem

During the animation rendering and physical simulation of fabrics and clothing, the intersecting of fabrics and different areas of itself leads to poor physical simulation and animation rendering effects.

Method used

By constraining the triangular vertex position of the fabric to be repaired, the candidate vertex position is obtained, and the new fabric self-crossing is determined based on the triangular vertex position and candidate vertex position is repaired, and then iteratively updates the target vertex position to finally generate the target fabric without self-crossing.

Benefits of technology

Effectively repair self-intersection in fabric simulation, improve the effects of physical simulation and animation rendering, and ensure the physical properties and visual quality of the fabric.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114723868B_ABST
    Figure CN114723868B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of fabric simulation technology, and discloses a fabric self-intersection repair method, device, storage medium and apparatus. The method includes: constraining the triangular vertex positions of the fabric to be repaired to obtain candidate vertex positions, determining the newly added fabric self-intersection of the fabric to be repaired according to the triangular vertex positions and the candidate vertex positions, repairing the newly added fabric self-intersection to obtain target vertex positions, iteratively updating the target vertex positions to obtain repaired vertex positions, and generating a target fabric according to the repaired vertex positions; since the present invention avoids newly added fabric self-intersection based on continuous collision detection and repairs the original fabric self-intersection based on a geometric self-intersection repair method, it can repair the fabric self-intersection in fabric simulation, and thus can improve the effects of physical simulation and animation rendering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of fabric simulation, and in particular to a fabric self-intersection repair method, device, storage medium and device. Background Art

[0002] Currently, computer animation rendering and physical simulation can be performed on fabrics and clothing to obtain the wearing effects of fabrics and clothing. However, when performing animation rendering and physical simulation on fabrics and clothing, self-intersection of different regions of the fabric itself may occur, resulting in poor physical simulation and animation rendering effects. Summary of the Invention

[0003] The main object of the present invention is to provide a fabric self-intersection repair method, device, storage medium and device, aiming to solve the technical problem that when performing animation rendering and physical simulation on fabrics and clothing in the prior art, self-intersection of different regions of the fabric itself may occur, resulting in poor physical simulation and animation rendering effects.

[0004] To achieve the above object, the present invention provides a fabric self-intersection repair method, and the fabric self-intersection repair method includes the following steps:

[0005] Constrain the triangular vertex positions of the fabric to be repaired to obtain candidate vertex positions;

[0006] Determine the newly added fabric self-intersection of the fabric to be repaired according to the triangular vertex positions and the candidate vertex positions, and repair the newly added fabric self-intersection to obtain target vertex positions;

[0007] Iteratively update the target vertex positions to obtain repaired vertex positions, and generate a target fabric according to the repaired vertex positions.

[0008] Optionally, the step of constraining the triangular vertex positions of the fabric to be repaired by distance to obtain candidate vertex positions includes:

[0009] Obtain the fabric thickness of the fabric to be repaired;

[0010] Constrain the triangular vertex positions of the fabric to be repaired based on the fabric thickness to obtain candidate vertex positions.

[0011] Optionally, the step of constraining the triangular vertex positions of the fabric to be repaired based on the fabric thickness to obtain candidate vertex positions further includes:

[0012] Constraining the positions of the triangular vertices based on the fabric thickness through a preset elastic material equation to obtain candidate vertex positions, where the preset elastic material equation is an elastic material equation added with a collision support spring model, and the collision support spring model is used to constrain the distance between different parts of the fabric to be repaired to be not less than the fabric thickness.

[0013] Optionally, the step of determining the self-intersection of the newly added fabric of the fabric to be repaired according to the triangular vertex positions and the candidate vertex positions, and repairing the self-intersection of the newly added fabric to obtain the target vertex positions includes:

[0014] Constructing vertex trajectory line segments according to the triangular vertex positions and the candidate vertex positions;

[0015] Obtaining the bounding sphere cylinder of the triangle corresponding to the triangular vertex positions;

[0016] When the vertex trajectory line segment intersects with the bounding sphere cylinder, determining the self-intersection time point of the self-intersection of the newly added fabric of the fabric to be repaired;

[0017] Repairing the self-intersection of the newly added fabric according to the self-intersection time point to obtain the target vertex positions.

[0018] Optionally, the step of iteratively updating the target vertex positions to obtain repaired vertex positions, and generating the target fabric according to the repaired vertex positions includes:

[0019] Obtaining the edge triangle pairs with self-intersection in the fabric to be repaired, and constructing a line segment set according to the edge triangle pairs;

[0020] Iteratively updating the target vertex positions based on the line segment set to obtain repaired vertex positions;

[0021] Generating the target fabric according to the repaired vertex positions.

[0022] Optionally, the step of iteratively updating the target vertex positions based on the line segment set to obtain repaired vertex positions includes:

[0023] Detecting whether the vertex positions of each line segment set are consistent, and determining a connected set according to the detection result;

[0024] Deleting the connected set from the line segment set until the line segment set is an empty set;

[0025] Iteratively updating the target vertex positions based on the connected set to obtain repaired vertex positions.

[0026] Optionally, the step of generating the target fabric according to the repaired vertex positions includes:

[0027] Iteratively approximate the repaired vertex position from the candidate vertex positions until self - intersection occurs in the cloth to be repaired;

[0028] Optimize the repaired vertex position according to the iterative approximation result, and generate the target cloth according to the optimization result.

[0029] In addition, to achieve the above - mentioned purpose, the present invention also provides a cloth self - intersection repair device. The cloth self - intersection repair device includes a memory, a processor, and a cloth self - intersection repair program stored on the memory and operable on the processor. The cloth self - intersection repair program is configured to implement the cloth self - intersection repair method as described above.

[0030] In addition, to achieve the above - mentioned purpose, the present invention also provides a storage medium. A cloth self - intersection repair program is stored on the storage medium. When the cloth self - intersection repair program is executed by a processor, it implements the cloth self - intersection repair method as described above.

[0031] In addition, to achieve the above - mentioned purpose, the present invention also provides a cloth self - intersection repair device. The cloth self - intersection repair device includes: a position constraint module, a collision repair module, and an iterative update module;

[0032] The position constraint module is used to constrain the triangular vertex positions of the cloth to be repaired to obtain candidate vertex positions;

[0033] The collision repair module is used to determine the newly added cloth self - intersection of the cloth to be repaired according to the triangular vertex positions and the candidate vertex positions, and repair the newly added cloth self - intersection to obtain the target vertex positions;

[0034] The iterative update module is used to iteratively update the target vertex positions to obtain the repaired vertex positions, and generate the target cloth according to the repaired vertex positions.

[0035] In the present invention, it is disclosed to constrain the triangular vertex positions of the cloth to be repaired to obtain candidate vertex positions, determine the newly added cloth self - intersection of the cloth to be repaired according to the triangular vertex positions and the candidate vertex positions, repair the newly added cloth self - intersection to obtain the target vertex positions, iteratively update the target vertex positions to obtain the repaired vertex positions, and generate the target cloth according to the repaired vertex positions. Since the present invention avoids newly added cloth self - intersection based on continuous collision detection and repairs the original cloth self - intersection based on the geometric self - intersection repair method, it can repair the cloth self - intersection in cloth simulation, and thus can improve the effects of physical simulation and animation rendering. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 is a schematic structural diagram of a cloth self - intersection repair device in a hardware operating environment related to the embodiment solution of the present invention;

[0037] Figure 2 Schematic flow diagram of the first embodiment of the self-intersection repair method for the fabric of the present invention;

[0038] Figure 3 Schematic flow diagram of the second embodiment of the self-intersection repair method for the fabric of the present invention;

[0039] Figure 4 Schematic diagram of the fabric after collision spring constraint in an embodiment of the self-intersection repair method for the fabric of the present invention;

[0040] Figure 5 Schematic diagram of the fabric after iterative update in an embodiment of the self-intersection repair method for the fabric of the present invention;

[0041] Figure 6 Schematic flow diagram of the third embodiment of the self-intersection repair method for the fabric of the present invention;

[0042] Figure 7 Schematic diagram of the physical material properties of the repaired fabric in an embodiment of the self-intersection repair method for the fabric of the present invention;

[0043] Figure 8 Block diagram of the structure of the first embodiment of the self-intersection repair device for the fabric of the present invention.

[0044] The realization, functional characteristics and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. Detailed implementation manners

[0045] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0046] Refer to Figure 1 , Figure 1 Schematic diagram of the structure of the fabric self-intersection repair device in the hardware operating environment related to the embodiment solution of the present invention.

[0047] Such as Figure 1As shown, the fabric self-intersection repair device may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display). Optionally, the user interface 1003 may further include a standard wired interface and a wireless interface. For the wired interface of the user interface 1003, it may be a USB interface in the present invention. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be a high-speed Random Access Memory (RAM) or a stable memory (Non-volatile Memory, NVM), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0048] Those skilled in the art can understand that Figure 1 the structure shown in does not constitute a limitation on the fabric self-intersection repair device, and it may include more or fewer components than shown, or combine some components, or have different component arrangements.

[0049] As Figure 1 shown, the memory 1005, which is regarded as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a fabric self-intersection repair program.

[0050] In Figure 1 the fabric self-intersection repair device shown in , the network interface 1004 is mainly used to connect to the background server and communicate with the background server for data; the user interface 1003 is mainly used to connect to the user device; the fabric self-intersection repair device calls the fabric self-intersection repair program stored in the memory 1005 through the processor 1001 and executes the fabric self-intersection repair method provided by the embodiments of the present invention.

[0051] Based on the above hardware structure, an embodiment of the fabric self-intersection repair method of the present invention is proposed.

[0052] Referring to Figure 2 , Figure 2 which is a schematic flowchart of the first embodiment of the fabric self-intersection repair method of the present invention, the first embodiment of the fabric self-intersection repair method of the present invention is proposed.

[0053] In the first embodiment, the fabric self-intersection repair method includes the following steps:

[0054] Step S10: Constrain the triangular vertex positions of the cloth to be repaired to obtain candidate vertex positions.

[0055] It should be understood that the execution subject of the method in this embodiment can be a cloth self-intersection repair device with data processing, network communication, and program running functions, such as a computer, etc., or other electronic devices that can achieve the same or similar functions. This embodiment does not limit this.

[0056] It can be understood that currently, computer animation rendering and physical simulation can be performed on cloth and clothing to obtain the wearing effects of cloth and clothing. However, when performing animation rendering and physical simulation on cloth and clothing, it is inevitable that there will be intersections between different regions of the cloth itself (i.e., cloth self-intersection).

[0057] And cloth self-intersection has a very large impact on physical simulation, computer animation, and rendering. Because on the one hand, self-intersection destroys the physical properties of the cloth, making the subsequent simulation results even more incorrect. On the other hand, self-intersection will be reflected in animation rendering, resulting in visually visible defects.

[0058] Therefore, to overcome the above defects, in this embodiment, by constraining the triangular vertex positions of the cloth to be repaired to obtain candidate vertex positions, determining the newly added cloth self-intersection of the cloth to be repaired according to the triangular vertex positions and the candidate vertex positions, repairing the newly added cloth self-intersection to obtain target vertex positions, iteratively updating the target vertex positions to obtain repaired vertex positions, and generating the target cloth according to the repaired vertex positions, it is possible to repair the cloth self-intersection in cloth simulation, and thus improve the effects of physical simulation and animation rendering.

[0059] It should be noted that in cloth simulation, the cloth is composed of multiple triangles in the grid. The triangular vertex positions can be the vertex positions of the above triangles. In this embodiment, the triangular vertex positions can be the vertex positions of the cloth at the previous moment. In this embodiment and other embodiments, it is represented by p [t-1] for.

[0060] It should be understood that in order to avoid large-scale cloth self-intersection, in this embodiment, first, the triangular vertex positions of the cloth to be repaired are constrained to obtain candidate vertex positions.

[0061] It can be understood that constraining the triangular vertex positions of the cloth to be repaired can be to determine the distances between the triangular vertices according to the triangular vertex positions of the cloth to be repaired, and constrain the distances between the triangular vertices to ensure that the distances between the triangular vertices are not too small, thereby avoiding large-scale cloth self-intersection.

[0062] Step S20: Determine the self - intersection of the newly added fabric of the fabric to be repaired based on the triangular vertex positions and the candidate vertex positions, and repair the self - intersection of the newly added fabric to obtain the target vertex positions.

[0063] It should be understood that determining the self - intersection of the newly added fabric of the fabric to be repaired based on the triangular vertex positions and the candidate vertex positions can be to perform continuous collision detection based on the triangular vertex positions and the candidate vertex positions, and determine the self - intersection of the newly added fabric of the repaired fabric according to the detection results.

[0064] In a specific implementation, for example, collect the vertex positions p at time t - 1 of the input [t-1] to the candidate point positions All vertex - triangle pairs that generate self - intersections, calculate the exact positions of the self - intersections, update to a state without self - intersections, and output the target vertex positions

[0065] Updating to a state without self - intersections can be that if the position p of a certain vertex at time t - 1 [t-1] has no self - intersection while the candidate point position at time t has a self - intersection, then it is certain that an exact position where the self - intersection occurs can be calculated, and thus the vertex can be moved back to the position before the self - intersection occurs to achieve the purpose of avoiding self - intersections.

[0066] Step S30: Iteratively update the target vertex positions to obtain the repaired vertex positions, and generate the target fabric according to the repaired vertex positions.

[0067] It can be understood that in practical applications, based on the self - intersection time point, only the self - intersection of the newly added fabric of the fabric can be repaired, and the original fabric self - intersection of the fabric cannot be repaired. Therefore, in this embodiment, in order to repair the original fabric self - intersection of the fabric, it is also necessary to iteratively update the target vertex positions to repair the original fabric self - intersection.

[0068] In the first embodiment, it is disclosed that the triangular vertex positions of the fabric to be repaired are constrained to obtain candidate vertex positions, the self - intersection of the newly added fabric of the fabric to be repaired is determined based on the triangular vertex positions and the candidate vertex positions, the self - intersection of the newly added fabric is repaired to obtain the target vertex positions, the target vertex positions are iteratively updated to obtain the repaired vertex positions, and the target fabric is generated according to the repaired vertex positions; since this embodiment is based on continuous collision detection to avoid the self - intersection of the newly added fabric and is based on the geometric self - intersection repair method to repair the original fabric self - intersection, it can thus repair the fabric self - intersection in fabric simulation, and further improve the effects of physical simulation and animation rendering.

[0069] Refer to Figure 3 , Figure 3 which is the flowchart of the second embodiment of the fabric self - intersection repair method of the present invention. Based on the above Figure 2The first embodiment shown proposes a second embodiment of the fabric self-intersection repair method of the present invention.

[0070] In the second embodiment, step S10 includes:

[0071] Step S101: Obtain the fabric thickness of the fabric to be repaired.

[0072] It should be understood that, in order to ensure that the vertex position constraint meets the requirements of real simulation, in this embodiment, the fabric thickness of the fabric to be repaired is also obtained, and the triangular vertex positions of the fabric to be repaired are constrained based on the fabric thickness to obtain candidate vertex positions.

[0073] Step S102: Constrain the triangular vertex positions of the fabric to be repaired based on the fabric thickness to obtain candidate vertex positions.

[0074] It can be understood that constraining the triangular vertex positions of the fabric to be repaired based on the fabric thickness to obtain candidate vertex positions can be to constrain the triangular vertex positions of the fabric to be repaired based on the fabric thickness so that the distance between different parts of the fabric to be repaired is not less than the fabric thickness to obtain candidate vertex positions.

[0075] In the second embodiment, it is disclosed that the fabric thickness of the fabric to be repaired is obtained, and the triangular vertex positions of the fabric to be repaired are constrained based on the fabric thickness to obtain candidate vertex positions, thereby ensuring that the vertex position constraint meets the requirements of real simulation.

[0076] Furthermore, in order to improve the accuracy of the vertex position constraint, step S102 includes:

[0077] Constraining the triangular vertex positions based on the fabric thickness through a preset elastic material equation to obtain candidate vertex positions, where the preset elastic material equation is an elastic material equation added with a collision support spring model, and the collision support spring model is used to constrain the distance between different parts of the fabric to be repaired to be not less than the fabric thickness.

[0078] It should be understood that, in order to improve the accuracy of the vertex position constraint, in this embodiment, an elastic material equation including a collision support spring model is introduced, and the triangular vertex positions are constrained based on the fabric thickness through the preset elastic material equation.

[0079] It should be noted that the collision support spring model can, when the distance between different parts of the fabric to be repaired is less than the fabric thickness s, constrain the distance between these parts to be not less than s as much as possible, thereby minimizing the possibility of fabric self-intersection.

[0080] In a specific implementation, for example, for each vertex p of the fabric grid i, calculate the distances between this vertex and all non - adjacent triangular patches of the cloth grid. All vertices and triangles with distances less than the cloth thickness s form a set \(\{(p i , f j )\}. The method for calculating the distance between a vertex and a triangle is as follows:

[0081]

[0082] In the formula, is the point in the triangular patch f j that is closest to p i . It can be obtained by calculating the projection point of p i onto the patch f j and constraining it within the triangular region.

[0083] For each vertex - triangle pair \((p i , f j )\) in the set \(\{(p i , f j )\}, introduce a collision spring between the vertex p i and the closest point . The total compression energy of all collision springs can be calculated according to Hooke's law:

[0084]

[0085] In the formula, \(E(p)\) is the collision - support spring model, which is used to represent the total compression energy of the collision springs. \(k\) is the elastic coefficient. This energy is only effective for spring compression and does not restrict spring stretching. Therefore, it can effectively reduce the possibility of collisions between cloths.

[0086] Adding the collision - support spring model to the common elastic material equation, the obtained preset elastic material equation can specifically be:

[0087]

[0088] In the formula, \(h\) is the time step, \(M\) is the mass matrix, \(v [t-1] represents the velocity, \(W(p)\) represents the internal - force energy between adjacent vertices of the cloth, and \(E(p)\) is the collision - support spring model.

[0089] It can be understood that by using the preset elastic material equation to constrain the positions of the triangular vertices, it can ensure that the candidate vertex positions conform to the elastic material equation of cloth physics. And due to the collision - spring constraint, large - scale new cloth self - intersections can be avoided.

[0090] For ease of understanding, reference Figure 4 is used for illustration, but it does not limit this solution. Figure 4This is a schematic diagram of the cloth after collision spring constraints. After this step, the candidate point locations obtained conform to the elastic material equations of cloth physics. The collision spring constraints also prevent large-scale self-intersections. However, since spring energy is a soft constraint, there's no guarantee that self-intersections will be eliminated. Furthermore, existing self-intersections in the input state cannot be fixed. In the figure, self-intersections between triangles can be seen within the black box.

[0091] In the second embodiment, step S20 includes:

[0092] Step S201: constructing vertex trajectory segments according to the triangle vertex positions and the candidate vertex positions.

[0093] It should be understood that in actual applications, since spring energy is a soft constraint, it is impossible to guarantee that there will be no self-intersection. Therefore, in this embodiment, continuous collision detection is also required to avoid self-intersection of the newly added cloth.

[0094] It can be understood that the vertex position p at time t-1 from the input is collected [t-1] To the candidate point For all vertex-triangle pairs that produce self-intersections, calculate the exact position of the self-intersection, update to a state without self-intersection, and output the target vertex position If the position of a vertex at time t-1 is p [t-1] There is no self-intersection and the candidate point position at time t If there is a self-intersection, then we can definitely calculate the exact location where the self-intersection occurs, and then move the vertex back to the position before the self-intersection occurs, so as to avoid the self-intersection.

[0095] In a specific implementation, for example, the vertex position p at time t-1 of the input is collected [t-1] To the candidate point All self-intersecting vertex-triangle pairs are connected into a line segment: the trajectory of each vertex in the time period [t-1, t].

[0096] Step S202: Obtain the enclosing spherical cylinder of the triangle corresponding to the triangle vertex position.

[0097] In a specific implementation, for example, the bounding sphere trajectory of each triangle in the time period [t-1, t] is connected into a spherical cylinder.

[0098] Step S203: when the vertex trajectory segment intersects the enclosing spherical cylinder, determining a self-intersection time point of the newly added cloth of the cloth to be repaired.

[0099] In the specific implementation, for example, vertex p i The trajectory segment Any point on it is expressed as a function of time δ: Similarly, the three vertices of triangle f can also be expressed as p0(δ), p1(δ), p2(δ); then solve the following intersection judgment equation:

[0100]

[0101] where n(δ) is the normal vector of triangle f; there are multiple roots for this equation, and the root with the minimum modulus length can be taken.

[0102] Step S204: Repair the self - intersection of the newly added fabric according to the self - intersection time point to obtain the target vertex position.

[0103] It should be understood that repairing the self - intersection of the newly added fabric according to the self - intersection time point can be to move the candidate vertex position back to the position before the self - intersection occurs according to the self - intersection time point, so as to achieve the purpose of avoiding self - intersection.

[0104] In a specific implementation, for example, update to a non - self - intersecting state: according to the self - intersection time point δ of the accurately solved self - intersection position * , let take the value of p(δ * - ε), where ε = 10 -3 ; in the case where p [t-1] has no self - intersection, since δ * is the earliest moment of self - intersection, this step can update the result to a state without self - intersection.

[0105] The second embodiment constructs vertex trajectory line segments based on the triangular vertex positions and candidate vertex positions, obtains the bounding sphere cylinder of the triangle corresponding to the triangular vertex positions, determines the self - intersection time point of the self - intersection of the newly added fabric of the fabric to be repaired when the vertex trajectory line segments intersect with the bounding sphere cylinder, repairs the self - intersection of the newly added fabric according to the self - intersection time point, and obtains the target vertex position, so as to avoid the self - intersection of the newly added fabric.

[0106] In the second embodiment, the step S30 includes:

[0107] Step S301: Obtain the edge - triangle pairs with self - intersection in the fabric to be repaired, and construct a line segment set according to the edge - triangle pairs.

[0108] It should be understood that in practical applications, based on the self - intersection time point, only the self - intersection of the newly added fabric of the fabric can be repaired, and the self - intersection of the original fabric of the fabric cannot be repaired. Therefore, in order to repair the self - intersection of the original fabric of the fabric, in this embodiment, a geometric self - intersection repair method is also used to repair the self - intersection of the original fabric.

[0109] In a specific implementation, for example, collect the edge - triangle pairs with self - intersection {(e i, f j )}, since each edge has multiple adjacent triangles, and the intersection result of triangle and triangle is a line segment, all the intersection results form a line segment set {l ij}.

[0110] Step S302: Iteratively update the target vertex position based on the line segment set to obtain the repaired vertex position.

[0111] It can be understood that iteratively updating the target vertex position based on the line segment set to obtain the repaired vertex position can be to group the line segment set to obtain a connected set, separately update the relevant mesh vertices for each connected set, reduce the total length of the line segments in the connected graph set, and obtain the repaired vertex position.

[0112] Step S303: Generate the target fabric according to the repaired vertex position.

[0113] It should be understood that generating the target fabric according to the repaired vertex position can be to perform fabric simulation according to the repaired vertex position to generate the target fabric.

[0114] For the sake of easy understanding, refer to Figure 5 for illustration, but it does not limit the present solution. Figure 5 For the schematic diagram of the fabric after iterative update, in the figure, after continuous collision detection and geometric self-intersection repair method, the fabric at the vertex position no longer contains self-intersection. In contrast Figure 4 it can be seen that all the existing fabric self-intersections have been repaired.

[0115] In the second embodiment, it discloses obtaining the edge-triangle pairs with self-intersection in the fabric to be repaired, constructing a line segment set according to the edge-triangle pairs, iteratively updating the target vertex position based on the line segment set to obtain the repaired vertex position, and generating the target fabric according to the repaired vertex position; since this embodiment repairs the original fabric self-intersection based on the geometric self-intersection repair method, it can repair the original fabric self-intersection while repairing the newly added fabric self-intersection.

[0116] Refer to Figure 6 , Figure 6 is the flowchart of the third embodiment of the fabric self-intersection repair method of the present invention. Based on the above Figure 3 shown second embodiment, the third embodiment of the fabric self-intersection repair method of the present invention is proposed.

[0117] In the third embodiment, the step S302 includes:

[0118] Step S3021: Detect whether the vertex positions of each line segment set are consistent, and determine the connected set according to the detection result.

[0119] It should be understood that, in order to ensure the reliability of geometric self - intersection repair, in this embodiment, by detecting whether the vertex positions of each line segment set are consistent, determining the connected sets according to the detection results, iteratively updating the target vertex positions based on the connected sets to obtain the repaired vertex positions, and iteratively updating the target vertex positions based on the connected sets to obtain the repaired vertex positions.

[0120] Step S3022: Delete the connected sets from the line segment set until the line segment set becomes an empty set.

[0121] In a specific implementation, for example, for each line segment in the set {l ij}, check whether its vertices have the same coordinates as the vertices of some other line segment. If they are the same, the two line segments are marked as connected. Use depth - first search to gradually connect more line segments until the total number of line segments remains unchanged. Take all the connected line segments as the connected set {l k}; then delete {l ij} from the line segment set {l k}, and further perform similar operations cyclically until {l ij} becomes an empty set.

[0122] Step S3023: Iteratively update the target vertex positions based on the connected sets to obtain the repaired vertex positions.

[0123] In a specific implementation, for example, for each connected set {l k}, for each line segment l k of it, this line segment is generated by the intersection of the adjacent triangular patch f a of the edge e and another triangular patch f b ; calculate the displacement gradient where l is the direction vector of this line segment and n is the normal vector of the triangular patch f b ; calculate the smoothed displacement gradient Translate all the vertices a of the triangular patch f by the operation For all the vertices b of the triangular patch f perform the reverse translation operation to obtain the repaired vertex positions.

[0124] In the third embodiment, it is disclosed to detect whether the vertex positions of each line segment set are consistent, determine the connected sets according to the detection results, delete the connected sets from the line segment set until the line segment set becomes an empty set, and iteratively update the target vertex positions based on the connected sets to obtain the repaired vertex positions; since in this embodiment, the connected sets are specifically used to iteratively update the target vertex positions, the reliability of geometric self - intersection repair is ensured.

[0125] In the third embodiment, step S303 includes:

[0126] Step S3031: Iteratively approximate the repaired vertex position from the candidate vertex position until self - intersection occurs in the cloth to be repaired.

[0127] It should be understood that in practical applications, since neither the continuous collision detection nor the geometric self - intersection repair method considers the physical material properties of the cloth itself, after the above two steps, the physical material properties of the cloth may be damaged to a certain extent, thus affecting the stability of physical simulation. Therefore, in order to further repair the physical material properties of the cloth while ensuring no self - intersection and guarantee the stability of physical simulation, this embodiment also solves an optimization problem with stability constraints based on the candidate vertex position and the repaired vertex position.

[0128] Step S3032: Optimize the repaired vertex position according to the iterative approximation result, and generate the target cloth according to the optimization result.

[0129] In a specific implementation, for example, the input of this step includes the candidate point position and the vertex position of self - intersection repair The former, as the result of solving the physical material equation, can ensure compliance with the physical material properties, but may have self - intersection; the latter can ensure no self - intersection, but may damage the physical material properties to a certain extent. The core idea of this step is to start from the vertex position and solve the optimization problem with stability constraints, iteratively approximating the candidate point position until self - intersection cannot be avoided. This idea can be described as the following constrained optimization problem:

[0130]

[0131]

[0132] where λ is the adaptive regularization term parameter; Ω(p) represents the set of all non - self - intersecting positions.

[0133] In the above - mentioned constrained optimization problem, ensuring the physical material properties is simplified to ensuring that the side length of each edge of the mesh does not change with respect to the selected point position during the optimization process; this simplification reduces the computational complexity of this step and can effectively ensure the stability of the local properties of the cloth mesh.

[0134] To solve the above - mentioned optimization problem, this step designs the following iterative optimization strategy:

[0135] Initialization λ←1;

[0136] Solve the unconstrained optimization problem:

[0137]

[0138] Perform a line search:

[0139]

[0140]

[0141] If δ * <10 -4 , assign p [t] ← p * , and jump out of the iteration;

[0142] λ ← 0.8λ, and jump to the initialization step where λ ← 1.

[0143] For ease of understanding, refer to Figure 7 for illustration, but this does not limit the present solution. Figure 7 For the schematic diagram of repairing the physical material properties of the fabric, Figure 7 the left part is the initial state of the fabric, and the fabric falls onto a sharp cone at a very high speed; Figure 7 the middle part is the result of the physical material properties of the fabric without repair. It can be seen that although the fabric has been repaired for new fabric self - intersection and original fabric self - intersection, and there is no interpenetration or self - intersection in the fabric, there are serious non - physical deformations in the fabric at the tip of the cone; Figure 7 the right part is the result after processing the physical material properties of the repaired fabric, which can not only ensure no self - intersection but also maintain the physical material properties of the fabric. Maintaining such physical material properties is very important for multi - frame physical simulation. Otherwise, obvious jitter can be easily seen in the time sequence of the physical simulation, resulting in instability.

[0144] In the third embodiment, it is disclosed that the repaired vertex position is iteratively approximated from the candidate vertex position until self - intersection occurs in the fabric to be repaired. The repaired vertex position is optimized according to the iterative approximation result, and the target fabric is generated according to the optimization result. Since this embodiment also solves the optimization problem with stability constraints based on the candidate vertex position and the repaired vertex position, it can further repair the physical material properties of the fabric while ensuring no self - intersection, thus ensuring the stability of the physical simulation.

[0145] In addition, an embodiment of the present invention also proposes a storage medium, on which a fabric self - intersection repair program is stored, and when the fabric self - intersection repair program is executed by a processor, it implements the fabric self - intersection repair method as described above.

[0146] In addition, refer toFigure 8 , an embodiment of the present invention further provides a fabric self-intersection repair device, which includes a position constraint module 10, a collision repair module 20, and an iterative update module 30;

[0147] The position constraint module 10 is used to constrain the triangular vertex positions of the fabric to be repaired to obtain candidate vertex positions.

[0148] It can be understood that currently, computer animation rendering and physical simulation can be performed on fabrics and clothing to obtain the wearing effects of fabrics and clothing. However, during the animation rendering and physical simulation of fabrics and clothing, self-intersection of different regions of the fabric with itself (i.e., fabric self-intersection) will inevitably occur.

[0149] Fabric self-intersection has a very large impact on physical simulation, computer animation, and rendering. Because on the one hand, self-intersection destroys the physical properties of the fabric, making subsequent simulation results even more incorrect. On the other hand, self-intersection will be reflected in animation rendering, resulting in visually visible defects.

[0150] Therefore, to overcome the above defects, in this embodiment, by constraining the triangular vertex positions of the fabric to be repaired to obtain candidate vertex positions, determining the new fabric self-intersection of the fabric to be repaired based on the triangular vertex positions and the candidate vertex positions, repairing the new fabric self-intersection to obtain target vertex positions, iteratively updating the target vertex positions to obtain repaired vertex positions, and generating a target fabric based on the repaired vertex positions, it is possible to repair fabric self-intersection in fabric simulation, and thus improve the effects of physical simulation and animation rendering.

[0151] It should be noted that in fabric simulation, the fabric is composed of multiple triangles in a grid, and the triangular vertex positions can be the vertex positions of the above triangles. In this embodiment, the triangular vertex positions can be the vertex positions of the fabric at the previous moment. In this embodiment and other embodiments, it is represented by p [t-1] for presentation.

[0152] It should be understood that in order to avoid large-scale fabric self-intersection, in this embodiment, the triangular vertex positions of the fabric to be repaired are first constrained to obtain candidate vertex positions.

[0153] It can be understood that constraining the triangular vertex positions of the fabric to be repaired can be to determine the distances between the triangular vertices based on the triangular vertex positions of the fabric to be repaired, and to constrain the distances between the triangular vertices to ensure that the distances between the triangular vertices are not too small, thereby avoiding large-scale fabric self-intersection.

[0154] The collision repair module 20 is configured to determine the newly added self - intersection of the cloth to be repaired based on the triangular vertex positions and the candidate vertex positions, and repair the newly added self - intersection of the cloth to obtain the target vertex positions.

[0155] It should be understood that determining the newly added self - intersection of the cloth to be repaired based on the triangular vertex positions and the candidate vertex positions can be to perform continuous collision detection according to the triangular vertex positions and the candidate vertex positions, and determine the newly added self - intersection of the repaired cloth according to the detection results.

[0156] In a specific implementation, for example, collect the vertex positions p at the t - 1 moment of the input [t-1] to the candidate point positions All vertex - triangle pairs that generate self - intersections, calculate the exact positions of the self - intersections, update to a state without self - intersections, and output the target vertex positions

[0157] Updating to a state without self - intersections can be that if there is no self - intersection at the position p of a certain vertex at the t - 1 moment [t-1] but there is a self - intersection at the candidate point position at the t moment then it is certain that an exact position where the self - intersection occurs can be calculated, and then the vertex can be moved back to the position before the self - intersection occurs to achieve the purpose of avoiding self - intersections.

[0158] The iterative update module 30 is configured to iteratively update the target vertex positions to obtain the repaired vertex positions, and generate the target cloth according to the repaired vertex positions.

[0159] It can be understood that in practical applications, based on the self - intersection time points, only the newly added self - intersections of the cloth can be repaired, and the original self - intersections of the cloth cannot be repaired. Therefore, in order to repair the original self - intersections of the cloth, in this embodiment, it is also necessary to iteratively update the target vertex positions to repair the original self - intersections of the cloth.

[0160] In this embodiment, it is disclosed that the triangular vertex positions of the cloth to be repaired are constrained to obtain candidate vertex positions, the newly added self - intersections of the cloth to be repaired are determined according to the triangular vertex positions and the candidate vertex positions, the newly added self - intersections are repaired to obtain the target vertex positions, the target vertex positions are iteratively updated to obtain the repaired vertex positions, and the target cloth is generated according to the repaired vertex positions; since this embodiment avoids newly added self - intersections based on continuous collision detection and repairs the original self - intersections of the cloth based on the geometric self - intersection repair method, it can repair the self - intersections of the cloth in cloth simulation, and thus can improve the effects of physical simulation and animation rendering.

[0161] It should be noted that in this text, the term "comprise", "include" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or system comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or system. Without further limitation, an element defined by the phrase "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or system comprising such element.

[0162] The serial numbers of the above embodiments of the present invention are only for description and do not represent the superiority or inferiority of the embodiments.

[0163] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as a Read Only Memory image (ROM) / Random Access Memory (RAM), magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0164] The above are only the preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.

Claims

1. A fabric self-healing method, characterized in that The fabric self-intersection repair method includes the following steps: Constrain the triangular vertex positions of the fabric to be repaired to obtain candidate vertex positions; Determine the new fabric self-intersection of the fabric to be repaired based on the triangular vertex positions and the candidate vertex positions, and repair the new fabric self-intersection to obtain target vertex positions; Iteratively update the target vertex positions to obtain repaired vertex positions, and generate a target fabric based on the repaired vertex positions; The step of determining the new fabric self-intersection of the fabric to be repaired based on the triangular vertex positions and the candidate vertex positions, and repairing the new fabric self-intersection to obtain target vertex positions includes: Construct vertex trajectory line segments based on the triangular vertex positions and the candidate vertex positions; Obtain the bounding sphere cylinder of the triangle corresponding to the triangular vertex positions; When the vertex trajectory line segments intersect with the bounding sphere cylinder, determine the self-intersection time point of the new fabric self-intersection of the fabric to be repaired; Repair the new fabric self-intersection according to the self-intersection time point to obtain target vertex positions; The step of iteratively updating the target vertex positions to obtain repaired vertex positions, and generating a target fabric based on the repaired vertex positions includes: Obtain the edge triangle pairs with self-intersection in the fabric to be repaired, and construct a line segment set based on the edge triangle pairs; Iteratively update the target vertex positions based on the line segment set to obtain repaired vertex positions; Generate a target fabric based on the repaired vertex positions; The step of iteratively updating the target vertex positions based on the line segment set to obtain repaired vertex positions includes: Detect whether the vertex positions of each line segment set are consistent, and determine a connected set according to the detection result; Delete the connected set from the line segment set until the line segment set is an empty set; Iteratively update the target vertex positions based on the connected set to obtain repaired vertex positions; The step of generating a target fabric based on the repaired vertex positions includes: Iteratively approximate the repaired vertex positions from the candidate vertex positions until self-intersection occurs in the fabric to be repaired; Optimize the repaired vertex positions according to the iterative approximation result, and generate a target fabric according to the optimization result.

2. The fabric self-crosslinking repair method according to claim 1, characterized in that, The step of constraining the triangular vertex positions of the fabric to be repaired to obtain candidate vertex positions includes: Obtain the fabric thickness of the fabric to be repaired; Constrain the triangular vertex positions of the fabric to be repaired based on the fabric thickness to obtain candidate vertex positions.

3. The fabric self-healing method according to claim 2, characterized in that, The step of constraining the triangular vertex positions of the fabric to be repaired based on the fabric thickness to obtain candidate vertex positions further includes: Constrain the triangular vertex positions based on the fabric thickness through a preset elastic material equation to obtain candidate vertex positions. The preset elastic material equation is an elastic material equation added with a collision support spring model, and the collision support spring model is used to constrain the distance between different parts of the fabric to be repaired to be not less than the fabric thickness.

4. A fabric self-healing device, characterized in that, The fabric self-intersection repair device includes: a memory, a processor, and a fabric self-intersection repair program stored on the memory and executable on the processor. When the fabric self-intersection repair program is executed by the processor, it implements the fabric self-intersection repair method according to any one of claims 1 to 3.

5. A storage medium, characterized in that, A fabric self-intersection repair program is stored on the storage medium. When the fabric self-intersection repair program is executed by a processor, it implements the fabric self-intersection repair method according to any one of claims 1 to 3.

6. A fabric self-healing device, characterized in that, The fabric self-intersection repair device includes: a position constraint module, a collision repair module, and an iterative update module; The position constraint module is used to constrain the triangular vertex positions of the fabric to be repaired to obtain candidate vertex positions; The collision repair module is used to determine the newly added fabric self-intersection of the fabric to be repaired according to the triangular vertex positions and the candidate vertex positions, and repair the newly added fabric self-intersection to obtain target vertex positions; The iterative update module is used to iteratively update the target vertex positions to obtain repaired vertex positions, and generate a target fabric according to the repaired vertex positions; Among them, the collision repair module is further used to construct vertex trajectory line segments according to the triangular vertex positions and the candidate vertex positions; obtain the circumscribed sphere cylinder of the triangle corresponding to the triangular vertex positions; when the vertex trajectory line segments intersect with the circumscribed sphere cylinder, determine the self-intersection time point of the newly added fabric self-intersection of the fabric to be repaired; repair the newly added fabric self-intersection according to the self-intersection time point to obtain target vertex positions; The iterative update module is further used to obtain the edge triangle pairs with self-intersection in the fabric to be repaired, and construct a line segment set according to the edge triangle pairs; iteratively update the target vertex positions based on the line segment set to obtain repaired vertex positions; generate a target fabric according to the repaired vertex positions; The iterative update module is further used to detect whether the vertex positions of each line segment set are consistent, and determine a connected set according to the detection result; delete the connected set from the line segment set until the line segment set is an empty set; iteratively update the target vertex positions based on the connected set to obtain repaired vertex positions; The iterative update module is further used to iteratively approximate the repaired vertex positions from the candidate vertex positions until self-intersection occurs in the fabric to be repaired; optimize the repaired vertex positions according to the iterative approximation result, and generate a target fabric according to the optimization result.

Citation Information

Patent Citations

  • Non-stretch cloth simulation oriented mass-spring model constraint method

    CN102324108A