# Research on the Flattening Method of an Energy-Based Fabric Deformation Model in Garment Design

Authors: Yuxiang Zhu; Gangqiang Li; Yanjun Peng; Mingmin Zhang; Yingran Ma; Yuanhong Wang
Journal: Complexity
 (2022)

---

## Abstract

Surface flattening plays an important role in the whole process of garment design. We proposed a novel method by using three-dimensional triangle mesh flattening in this study. First, the three-dimensional triangle mesh is flattened to a two-dimensional plane to approximate the original surface. The initial flattening results are then used as preliminary guesses for subsequent optimizations. Considering that the deformation energy in the real woven fabric is related to tensile or shear deformation, a simplified fabric deformation model based on energy is proposed to update the energy distribution to determine the best two-dimensional pattern. An innovative unified axis system process is proposed to obtain the deformation energy, and energy relaxation in local flattening is proposed to release the distortion of flattening. Finally, the experimental results show that complex surfaces such as garments could achieve better flattening results. Compared with other energy-based methods in garment design, our proposed methods are more flexible and practical.


---

## Body

## 1. Introduction

Three-dimensional computer-aided design(CAD) tools have developed rapidly in the fashion design industry [1, 2] and achieved better results in recent years. However, what garment industry need is a two-dimensional design rather than three-dimensional model. So, surface flattening [3–7] plays an important role in the whole garment design process. Almost all garments are nondevelopable [8], and the flattening of a nondevelopable is a complicated process and local distortions are inevitable. While, the existing surface flattening methods for triangulated surfaces have several limitations. A major problem is the existence of gaps and overlaps in the resulting mesh.For this phenomenon, a flattening method of energy-based fabric deformation model is proposed in this study. The area representation method is more likely to prevent the triangle area from being reduced to zero during flattening than models that only consider edge deformation energy. Therefore, the fabric energy acquisition method based on area representation is adopted. Traditional energy-based fabric deformation models [9] need to be converted to weft and warp axes before energy can be obtained, which can be cumbersome. In this article, a simplified model of fabric deformation based on energy is proposed. A simplified energy-based fabric deformation model simplifies the calculations; at the same time, the energy relaxation in local flattening eliminates local deformation.The properties of the materials need to be considered when flattening, so energy-based or physics-based methods are generally used in the flattening process. In the field of computer graphics, flattening is mainly used to expand a three-dimensional grid into a two-dimensional grid to facilitate texture mapping. This process is also called grid parameterization. To obtain good texture mapping quality, the mesh should be prevented from being deformed as much as possible, and the flattening method based on the problem of minimizing the deformation is often used. There are many flattening methods [10–15], and we briefly summarize the development of flattening methods over the past few decades.Levy [16] proposed a quasi-conformal parameterization method based on least squares approximation. This method uses an objective function to minimize the angular deformation. First, the complex surface is decomposed into a series of developable surface elements, and then these developed surfaces are decomposed into another series of developable surface elements. After the elements are expanded, they are combined to obtain the final parameterized result. When the elements are expanded, the original orientation of the triangles can be maintained, so there will be no triangle inversion. However, when the boundaries of the elements intersect in the texture space, they may overlap. In this case, we could subdivide the face element until there is no overlap. Wang et al. [17] proposed a new wire warping method for flattening surfaces using feature curves retained by length. In addition, the progressive deformation scheme for local shape control and the global deformation scheme for highly curved surfaces were introduced. Since the invariant length of feature curves were used to generate the 2D patterns, these strictly controlled lengths were inappropriate when highly nondevelopable 3D surfaces were required. Zhang et al. [18] improved Wang’s wire warping algorithm by replacing the constant length of the feature curve with an elastic feature curve. We could use this new feature curve to control the shape of a flattening 2D pattern.Energy-based or physics-based methods are often used in surface flattening. There are many methods to obtain energy [19, 20]. In [21], Afzal proposed a neutrosophic statistical approach to analyze the resistance of conducting material for big data. In [22], Afzal adopted neutrosophic statistical methods; they were more informative, flexible, and adequate than classical statistics for analyzing the measured values of data. McCartney et al. [23] proposed a flattening algorithm to obtain a planar development by minimizing strain energy. The algorithm uses an energy model to deform the edges of the triangle mesh. In addition, darts or gussets can be handled in a triangular mesh to assist in the fitting process. Based on McCartney’s algorithm, Wang et al. [24] introduced a spring-mass system from a geometric point of view, in which the forces generated by the elastic deformation energy stored in the spring-mass system could be used to move these points. The Lagrange equation was applied to release energy and the penalty function was used to prevent overlap. In addition, the energy distribution is displayed using the interpolation function, which is determined by the surface cutting line. Li et al. [25] introduced cross-springs to reduce the deformation of the final surface. The central triangle improves the levelling efficiency and proposes a local correction method to overcome the overlapping problem. Zhong et al. [26] introduced a novel method of surface flattening by opening the curved configuration of each winged triangle pair. The 2D final pattern is generated on the collision plane, and the strain control mechanism is introduced to preserve the area and size of the original 3D surface.


## 2. The Flattening Process of the Energy-Based Fabric Deformation Model

### 2.1. A Simplified Energy-Based Fabric Deformation Model

Fabric deformation produces energy. Because of shearing, bending, gravity, and tension, a piece of fabric is thought to have an energy component. Each energy component is represented by one term in the energy equation [24]:(1)Etotal=Egravitional+Etensile+Eshear+Ebending,where Etotal is the energy of the entire fabric, Egravitional is the potential energy of the fabric, Etensile represents the energy produced by tensile energy or compression of the fabric, Eshear represents the energy produced by shear, and Ebending is the energy produced by bending of the fabric.In the process of flattening, a single triangle is flattened at a time. The triangle of the 3D shape is designed to be fixed, and its corresponding 2D triangle is variable during the flattening process. Therefore, the energy model will calculate the energy generated by transforming the triangle of the 2D shape to its corresponding 3D triangle. The summation of the shear energy and tensile strain energy indicates the total internal energy of a triangle [24]. Therefore, this fabric model only considers the variation associated with shear and tensile stress. At the same time, it is assumed that the energy generated by the bending is a constant. Tensile energy Etensile is described as follows [24]:(2)Etensile=∬12KsuSu−12dudv+∬12KsvSv−12dudv=12AKsuSu−12+KsvSv−12,where A is the area of the 2D triangle, Ksu and Ksv are the tensile constants for the U and V directions, respectively, and Su and Sv (see Section 4.1) are strains. Shear energy Eshear is described as follows [24]:(3)Eshear=∬12Krϕv2dudv=12AKrϕv2.Similar to (2), A is the area of the 2D triangle, Kr is the shear constant, and ϕv (see Section 4.1) is the strain.To obtain the energy based on fabric deformation, a transition stage of converting 2D pattern coordinates to weft and warp coordinates is necessary in the traditional model. In addition, tedious calculations could take a considerable amount of time. To reduce the tedious work, we propose a novel simplified model that instead uses the variableRratio during this stage. Based on this simplified energy model, we propose an innovative unified axis system in Section 4.1 that will simplify computation and innovate energy relaxation in Section 4.2, which will increase the convergence speed. While energy data come from uncertain energy, we adopt some neutrosophic statistical methods [27, 28].


### 2.2. Flattening Process

Given a triangular meshΩK,P, where K=K1,K2,…,Kn is the spatial vertex set, Ki∈ℜ3, P=T,1T2,…,Tn is the topological connection information of the mesh, and T=vi,vj,vk is the triangle of the surface mesh. The goal of mesh flattening is to obtain another triangular mesh Ω′K′,P, where K′=K1′,K2′,…,K′n is a 2D plane point set, Ki′∈ℜ2, and Ki corresponds to Ki′. The area of each triangle and the length of each side remain unchanged after flattening. In addition, the entire algorithm flow is shown in Figure 1.Figure 1
Algorithm flow chart.To be flattened, triangle listV, active triangle list A, flattened triangle list F, and initial flattening mesh ΘK″,P are introduced in an initial flattening algorithm.Initial flattening algorithm (its aim is to obtain the initial flattening meshΘ of Ω) is as follows:(i)
Step 1: Initially, add all triangles inΩ to V, and set A and F as empty.(ii)
Step 2: Seed triangleTs is searched in list V and then Ts is flattened. Then, Ts is added to the active list A and removed from the available list V. The selection of seed triangle is detailed in Section 3.1.(iii)
Step 3: Perform a search in listV to find all the triangles that share an edge with Ts and insert them into the tail of list A.(iv)
Step 4: If the listA is empty, stop processing. Otherwise, obtain the next triangle T from the rest of list A.(v)
Step 5: Insert triangleT into the tail of list F and then mark T as flattened. A search is performed in list V to find all the triangles that share an edge with T and are not marked as flattened, and then they are inserted into the tail of list A. Return to Step 4.To optimize vertexVk and optimize triangle set Tset, initial vertex set K″ is introduced in the optimal flattening algorithm.Optimal flattening algorithm (its aim is to obtain the optimal flattening meshΩ′ of Ω) is as follows:(i)
Step 1: Obtain the first vertexVk from K″.(ii)
Step 2: A search is performed in listF to find the triangle set Tset that contains vertex Vk.(iii)
Step 3: Each 2D triangle of triangle setTset proceeds with its corresponding 3D triangle of Ω in the unified axis system and then obtains the energy of vertex Vk.(iv)
Step 4: Calculate the minimum value of the energy at the original position of vertexVk and its eight directions position. Thereafter, vertex Vk is moved to the minimum energy position.(v)
Step 5: If the vertices inK″ are all traversed, go to Step 6. Otherwise, take the next vertex Vk. Return to Step 2.(vi)
Step 6: Iterate Steps 1–5, until all vertex positions are unchanged.


## 2.1. A Simplified Energy-Based Fabric Deformation Model

Fabric deformation produces energy. Because of shearing, bending, gravity, and tension, a piece of fabric is thought to have an energy component. Each energy component is represented by one term in the energy equation [24]:(1)Etotal=Egravitional+Etensile+Eshear+Ebending,where Etotal is the energy of the entire fabric, Egravitional is the potential energy of the fabric, Etensile represents the energy produced by tensile energy or compression of the fabric, Eshear represents the energy produced by shear, and Ebending is the energy produced by bending of the fabric.In the process of flattening, a single triangle is flattened at a time. The triangle of the 3D shape is designed to be fixed, and its corresponding 2D triangle is variable during the flattening process. Therefore, the energy model will calculate the energy generated by transforming the triangle of the 2D shape to its corresponding 3D triangle. The summation of the shear energy and tensile strain energy indicates the total internal energy of a triangle [24]. Therefore, this fabric model only considers the variation associated with shear and tensile stress. At the same time, it is assumed that the energy generated by the bending is a constant. Tensile energy Etensile is described as follows [24]:(2)Etensile=∬12KsuSu−12dudv+∬12KsvSv−12dudv=12AKsuSu−12+KsvSv−12,where A is the area of the 2D triangle, Ksu and Ksv are the tensile constants for the U and V directions, respectively, and Su and Sv (see Section 4.1) are strains. Shear energy Eshear is described as follows [24]:(3)Eshear=∬12Krϕv2dudv=12AKrϕv2.Similar to (2), A is the area of the 2D triangle, Kr is the shear constant, and ϕv (see Section 4.1) is the strain.To obtain the energy based on fabric deformation, a transition stage of converting 2D pattern coordinates to weft and warp coordinates is necessary in the traditional model. In addition, tedious calculations could take a considerable amount of time. To reduce the tedious work, we propose a novel simplified model that instead uses the variableRratio during this stage. Based on this simplified energy model, we propose an innovative unified axis system in Section 4.1 that will simplify computation and innovate energy relaxation in Section 4.2, which will increase the convergence speed. While energy data come from uncertain energy, we adopt some neutrosophic statistical methods [27, 28].


## 2.2. Flattening Process

Given a triangular meshΩK,P, where K=K1,K2,…,Kn is the spatial vertex set, Ki∈ℜ3, P=T,1T2,…,Tn is the topological connection information of the mesh, and T=vi,vj,vk is the triangle of the surface mesh. The goal of mesh flattening is to obtain another triangular mesh Ω′K′,P, where K′=K1′,K2′,…,K′n is a 2D plane point set, Ki′∈ℜ2, and Ki corresponds to Ki′. The area of each triangle and the length of each side remain unchanged after flattening. In addition, the entire algorithm flow is shown in Figure 1.Figure 1
Algorithm flow chart.To be flattened, triangle listV, active triangle list A, flattened triangle list F, and initial flattening mesh ΘK″,P are introduced in an initial flattening algorithm.Initial flattening algorithm (its aim is to obtain the initial flattening meshΘ of Ω) is as follows:(i)
Step 1: Initially, add all triangles inΩ to V, and set A and F as empty.(ii)
Step 2: Seed triangleTs is searched in list V and then Ts is flattened. Then, Ts is added to the active list A and removed from the available list V. The selection of seed triangle is detailed in Section 3.1.(iii)
Step 3: Perform a search in listV to find all the triangles that share an edge with Ts and insert them into the tail of list A.(iv)
Step 4: If the listA is empty, stop processing. Otherwise, obtain the next triangle T from the rest of list A.(v)
Step 5: Insert triangleT into the tail of list F and then mark T as flattened. A search is performed in list V to find all the triangles that share an edge with T and are not marked as flattened, and then they are inserted into the tail of list A. Return to Step 4.To optimize vertexVk and optimize triangle set Tset, initial vertex set K″ is introduced in the optimal flattening algorithm.Optimal flattening algorithm (its aim is to obtain the optimal flattening meshΩ′ of Ω) is as follows:(i)
Step 1: Obtain the first vertexVk from K″.(ii)
Step 2: A search is performed in listF to find the triangle set Tset that contains vertex Vk.(iii)
Step 3: Each 2D triangle of triangle setTset proceeds with its corresponding 3D triangle of Ω in the unified axis system and then obtains the energy of vertex Vk.(iv)
Step 4: Calculate the minimum value of the energy at the original position of vertexVk and its eight directions position. Thereafter, vertex Vk is moved to the minimum energy position.(v)
Step 5: If the vertices inK″ are all traversed, go to Step 6. Otherwise, take the next vertex Vk. Return to Step 2.(vi)
Step 6: Iterate Steps 1–5, until all vertex positions are unchanged.


## 3. Key Procedure for Initial Flattening

### 3.1. Selection of Seed Triangle

Before flattening, selecting the seed triangle is an important process. The order in which triangles are flattened depends on the selected seed triangle, so selecting the seed triangle can effectively reduce the number of iterations and running time. Li et al. [25] used integer indices to mark all vertices in the mesh. Also, Liu et al. [29] applied the integer index to label all triangular faces in the mesh. However, we use a novel labelling standard that relies on the triangular edges. In addition, the selection algorithm is detailed as follows:(1)
Set the triangle mesh edge index on the boundary to 0.(2)
Search all unlabelled triangle mesh edges that have the same vertices as the labelled edge and increase the unlabelled edge index number by 1.(3)
Repeat Step 2 until all triangular mesh edges are fully labelled.(4)
Select the largest sum of the three edge indices as the seed triangle. If there is more than one, choose one of them.


### 3.2. Unconstrained Triangle Flattening

In the phase of surface flattening, there are two kinds of flattening methods: the unconstrained triangle flattening method and the constrained triangle flattening method. When one edge of a triangle has been flattened, the third vertex can be located using the unconstrained triangle flattening method. As shown in Figure2, Tv0,v1,v2 is a 3D triangle and the vertices are arranged in reverse order. Edge v0v1 has been flattened to edge v0′v1′ and then vertex v2 is flattened. The angle between the vector v0v1⟶ and the vector v0v2⟶ is calculated as follows:(4)θ=arccosv0v1⟶,v0v2⟶.Figure 2
Unconstrained triangle flattening.Vectorτ is obtained by rotating vector v0′v1′⟶ counterclockwise by angle θ. Then, vertex v2′ is located using the following expression:(5)v2′=v0′+v0v2⟶τ.As a result of flattening, the length of the triangle edge has no change without producing elastic potential energy, which is known as unconstrained triangle flattening.


### 3.3. Constrained Triangle Flattening

Figures3 and 4 show two different constrained flattening methods, Figure 4 is a classic traditional method [25] of calculating the intersection point of two circles with two central points and two radii. These circles are centered at v0′ and v1′, and their radii are r02 and r12, respectively, as shown in Figure 4. However, this method will produce two intersections. A point within the flattening range needs to be discarded. We use another method to find the third point, as shown in Figure 3. Triangles T0 and T1 have been flattened, and our aim is to flatten triangle Tv0,v1,v2. We choose edge v0′v1′, and vertex v2 is flattened to v2″ by using the unconstrained method in Section 3.2. Then we calculate their average coordinate as the flattened vertex, that is v2′=1/2v2′+v0″. The side length of the flattened triangle T′v0′,v1′,v2′ has been changed with respect to T, which will produce elastic potential energy. Therefore, after the initial flattening, optimized flattening is required to release the elastic potential energy.Figure 3
Novel constrained triangle flattening.Figure 4
Traditional constrained triangle flattening.


## 3.1. Selection of Seed Triangle

Before flattening, selecting the seed triangle is an important process. The order in which triangles are flattened depends on the selected seed triangle, so selecting the seed triangle can effectively reduce the number of iterations and running time. Li et al. [25] used integer indices to mark all vertices in the mesh. Also, Liu et al. [29] applied the integer index to label all triangular faces in the mesh. However, we use a novel labelling standard that relies on the triangular edges. In addition, the selection algorithm is detailed as follows:(1)
Set the triangle mesh edge index on the boundary to 0.(2)
Search all unlabelled triangle mesh edges that have the same vertices as the labelled edge and increase the unlabelled edge index number by 1.(3)
Repeat Step 2 until all triangular mesh edges are fully labelled.(4)
Select the largest sum of the three edge indices as the seed triangle. If there is more than one, choose one of them.


## 3.2. Unconstrained Triangle Flattening

In the phase of surface flattening, there are two kinds of flattening methods: the unconstrained triangle flattening method and the constrained triangle flattening method. When one edge of a triangle has been flattened, the third vertex can be located using the unconstrained triangle flattening method. As shown in Figure2, Tv0,v1,v2 is a 3D triangle and the vertices are arranged in reverse order. Edge v0v1 has been flattened to edge v0′v1′ and then vertex v2 is flattened. The angle between the vector v0v1⟶ and the vector v0v2⟶ is calculated as follows:(4)θ=arccosv0v1⟶,v0v2⟶.Figure 2
Unconstrained triangle flattening.Vectorτ is obtained by rotating vector v0′v1′⟶ counterclockwise by angle θ. Then, vertex v2′ is located using the following expression:(5)v2′=v0′+v0v2⟶τ.As a result of flattening, the length of the triangle edge has no change without producing elastic potential energy, which is known as unconstrained triangle flattening.


## 3.3. Constrained Triangle Flattening

Figures3 and 4 show two different constrained flattening methods, Figure 4 is a classic traditional method [25] of calculating the intersection point of two circles with two central points and two radii. These circles are centered at v0′ and v1′, and their radii are r02 and r12, respectively, as shown in Figure 4. However, this method will produce two intersections. A point within the flattening range needs to be discarded. We use another method to find the third point, as shown in Figure 3. Triangles T0 and T1 have been flattened, and our aim is to flatten triangle Tv0,v1,v2. We choose edge v0′v1′, and vertex v2 is flattened to v2″ by using the unconstrained method in Section 3.2. Then we calculate their average coordinate as the flattened vertex, that is v2′=1/2v2′+v0″. The side length of the flattened triangle T′v0′,v1′,v2′ has been changed with respect to T, which will produce elastic potential energy. Therefore, after the initial flattening, optimized flattening is required to release the elastic potential energy.Figure 3
Novel constrained triangle flattening.Figure 4
Traditional constrained triangle flattening.


## 4. Optimized Flattening

### 4.1. Process of Obtaining a Unified Axis System

The detailed process of obtaining a unified axis system is shown in Figure5. P is a 2D triangle and P′ is its corresponding 3D triangle. First, the 2D woven triangle without distortion is placed on a uv axis system. The corresponding 3D deformed triangle is then superimposed on the system under the same conditions. The 2D fabric undeformed triangle P without energy, and its corresponding 3D fabric triangle P′ with energy is generated after geometric deformation. The strain variables Su and Sv, as well as the shear variable ϕv, transform position v1 to v1′ and v2 to v2′, respectively.Figure 5
Process of unify axis coordinate.As shown in the right part of Figure5, v0 is located at the origin of the coordinates. The three-side length of the 2D triangle P is known, and the coordinates of v1 and v2 can be obtained using (6) and (7), where θ is the angle between axis u and edge v0v2. ∂ is the angle between edge v0v1 and edge v0v2. By setting the value of Rratio as 1/2, the flattening could achieve a better effect. The v1′ and v2′ coordinates of the 3D triangles can be obtained in the same way.(6)Rratio=v0v2sinθv0v2sinθ+v0v1sin∂−θ,(7)∂=arccosv0v12+v0v22−v1v222v0v1v0v2.The unifying process completes the specification geometric transformation that a representative rectangle must undergo. This geometric transformation can also deform the triangleP to P′. The total energy required for the distortion can be calculated by determining the energy to distort the representative weave element. Thereafter, considering it in its entirety, we utilized the same transformation for the triangle. The distortion of the representative woven element can be represented by an affine transformation. The scaling factor and shear angle can be calculated from affine transformation [30]. The general representation of an affine transformation is as follows:(8)u′v′1=uv1a11a120a21a220a31a320.For a particular affine transformation, the affine transformation matrix will now be referred to asM, where this matrix is comprised as follows:(9)u′v′1=uv1M.The shape of a triangular fabric is deformed first by stretching and then by shearing;M is therefore represented by a matrix:(10)M=Su000Sv0000100sinϕvcosϕv0001=Su00sinϕvSvcosϕv0001.For this special change, coordinatev1 transforms to coordinate v1′ and coordinate v2 transforms to v2′:(11)v11,v12⟶v11′,v12′,v21,v22⟶v21′,v22′.The equation can be rewritten again as shown below:(12)001v11′v12′1v21v22′1=001v11v121v21v221a11a120a21a220a31a321,or U′=UA, and this results in:(13)A=1v11v22−v21v12×v22v11′−v12v21′v22v12′−v12v22′0v11v21′−v21v11′v11v22′−v21v12′000v11v22−v21v12.By comparing (10) and (13), the strain variables Su and Sv and the shear variable ϕv are as follows:(14)Su=v22v11′−v12v21′v11v22−v21v12,(15)ϕv=tan−1v11v21′−v21v11′v11v22′−v21v12′,(16)Sv=v11v21′−v21v11′v11v22−v21v12sinϕv.The steps for the energy of the triangular fabric deformation are given as follows:(1)
Obtain 3D coordinates of the triangle(2)
Obtain the 2D coordinates of the triangle(3)
Unify the 3D and 2D triangles into theU,V axes with equations (6) and (7)(4)
According to the two unified triangular coordinates, acquire the strain variablesSu and Sv and the shear variable ϕv by applying equations (14)–(16)(5)
Use equations (2) and (3) to obtain tensile energy Etensile and shear energy Eshear respectively


### 4.2. Energy Relaxation Process in Partial Flattening

Energy relaxation plays an important role through the flattening process, which determines the efficiency of flattening and the effect of flattening. In previous studies, most works have been conducted to determine how to use the energy released to achieve a satisfactory flattening result. Wang et al. [24] used the spring force obtained by the Lagrange equation to move the vertex, and a better result could be achieved after many iterations, but the obvious drawback is the time-consuming process. However, we propose an innovative method of simplifying fabric deformation based on energy in Section 2.1. As this method adds four orthogonal directions in the specific node, it shows the weighted optimization efficiency and optimization effect. The original position of the node is considered when calculating the next position of the node; the details of the process are described below.As shown in Figure6, we assumed that there are 2D vertices P and adjacent vertices P1,P2,…,P5. The triangles formed with P are T0,T1,…,T4. The energy of the vertex P is obtained by the following expression, where Eenergyi is the energy of the ith triangle connected to P and n is the number of triangles connected to vertex P.(17)EP=∑i=0n−1Eenergyi.Figure 6
Energy relaxation procedure.
(a)(b)(c)The eight directions of optimized flattening aren⟶,n+1⟶,…,n+7⟶, and the movement increment is Δd. The next position of P will slip to the minimum energy value direction. The minimum energy value Emin can be obtained as follows:(18)Emin=minEp,E⟶op+n⟶,E⟶op+n+1⟶,E⟶op+n+2⟶,…E⟶op+n+7⟶.


## 4.1. Process of Obtaining a Unified Axis System

The detailed process of obtaining a unified axis system is shown in Figure5. P is a 2D triangle and P′ is its corresponding 3D triangle. First, the 2D woven triangle without distortion is placed on a uv axis system. The corresponding 3D deformed triangle is then superimposed on the system under the same conditions. The 2D fabric undeformed triangle P without energy, and its corresponding 3D fabric triangle P′ with energy is generated after geometric deformation. The strain variables Su and Sv, as well as the shear variable ϕv, transform position v1 to v1′ and v2 to v2′, respectively.Figure 5
Process of unify axis coordinate.As shown in the right part of Figure5, v0 is located at the origin of the coordinates. The three-side length of the 2D triangle P is known, and the coordinates of v1 and v2 can be obtained using (6) and (7), where θ is the angle between axis u and edge v0v2. ∂ is the angle between edge v0v1 and edge v0v2. By setting the value of Rratio as 1/2, the flattening could achieve a better effect. The v1′ and v2′ coordinates of the 3D triangles can be obtained in the same way.(6)Rratio=v0v2sinθv0v2sinθ+v0v1sin∂−θ,(7)∂=arccosv0v12+v0v22−v1v222v0v1v0v2.The unifying process completes the specification geometric transformation that a representative rectangle must undergo. This geometric transformation can also deform the triangleP to P′. The total energy required for the distortion can be calculated by determining the energy to distort the representative weave element. Thereafter, considering it in its entirety, we utilized the same transformation for the triangle. The distortion of the representative woven element can be represented by an affine transformation. The scaling factor and shear angle can be calculated from affine transformation [30]. The general representation of an affine transformation is as follows:(8)u′v′1=uv1a11a120a21a220a31a320.For a particular affine transformation, the affine transformation matrix will now be referred to asM, where this matrix is comprised as follows:(9)u′v′1=uv1M.The shape of a triangular fabric is deformed first by stretching and then by shearing;M is therefore represented by a matrix:(10)M=Su000Sv0000100sinϕvcosϕv0001=Su00sinϕvSvcosϕv0001.For this special change, coordinatev1 transforms to coordinate v1′ and coordinate v2 transforms to v2′:(11)v11,v12⟶v11′,v12′,v21,v22⟶v21′,v22′.The equation can be rewritten again as shown below:(12)001v11′v12′1v21v22′1=001v11v121v21v221a11a120a21a220a31a321,or U′=UA, and this results in:(13)A=1v11v22−v21v12×v22v11′−v12v21′v22v12′−v12v22′0v11v21′−v21v11′v11v22′−v21v12′000v11v22−v21v12.By comparing (10) and (13), the strain variables Su and Sv and the shear variable ϕv are as follows:(14)Su=v22v11′−v12v21′v11v22−v21v12,(15)ϕv=tan−1v11v21′−v21v11′v11v22′−v21v12′,(16)Sv=v11v21′−v21v11′v11v22−v21v12sinϕv.The steps for the energy of the triangular fabric deformation are given as follows:(1)
Obtain 3D coordinates of the triangle(2)
Obtain the 2D coordinates of the triangle(3)
Unify the 3D and 2D triangles into theU,V axes with equations (6) and (7)(4)
According to the two unified triangular coordinates, acquire the strain variablesSu and Sv and the shear variable ϕv by applying equations (14)–(16)(5)
Use equations (2) and (3) to obtain tensile energy Etensile and shear energy Eshear respectively


## 4.2. Energy Relaxation Process in Partial Flattening

Energy relaxation plays an important role through the flattening process, which determines the efficiency of flattening and the effect of flattening. In previous studies, most works have been conducted to determine how to use the energy released to achieve a satisfactory flattening result. Wang et al. [24] used the spring force obtained by the Lagrange equation to move the vertex, and a better result could be achieved after many iterations, but the obvious drawback is the time-consuming process. However, we propose an innovative method of simplifying fabric deformation based on energy in Section 2.1. As this method adds four orthogonal directions in the specific node, it shows the weighted optimization efficiency and optimization effect. The original position of the node is considered when calculating the next position of the node; the details of the process are described below.As shown in Figure6, we assumed that there are 2D vertices P and adjacent vertices P1,P2,…,P5. The triangles formed with P are T0,T1,…,T4. The energy of the vertex P is obtained by the following expression, where Eenergyi is the energy of the ith triangle connected to P and n is the number of triangles connected to vertex P.(17)EP=∑i=0n−1Eenergyi.Figure 6
Energy relaxation procedure.
(a)(b)(c)The eight directions of optimized flattening aren⟶,n+1⟶,…,n+7⟶, and the movement increment is Δd. The next position of P will slip to the minimum energy value direction. The minimum energy value Emin can be obtained as follows:(18)Emin=minEp,E⟶op+n⟶,E⟶op+n+1⟶,E⟶op+n+2⟶,…E⟶op+n+7⟶.


## 5. Realization of the Virtual Try-On Process

The realization of the virtual stitching process is an important step of the virtual try-on. Before virtual garment is flattened, the virtual human body needs to be tried-on.


### 5.1. Virtual Stitching

When user selects the stitching edge, if the start point and the end point of the two corresponding edges are selected in the same direction (clockwise or counterclockwise), the corresponding relationship between the points on the two edges is correct, as shown in Figure7(a). If different directions are chosen, that is, one side selects the start and end points in a clockwise direction, and the other side selects the start and end points in a counterclockwise direction, the corresponding relationship between the points on the two sides will be wrong, as shown in Figure 7(b).Figure 7
Diagram of virtual stitching information: (a)correct correspondence, (b)incorrect correspondence, and (c)diagram of stitching.
(a)(b)(c)The specific representation of stitching is shown in Figure7(c). The brown dots represent discrete mass points of the garment piece, and Dis represents the distance between the two mass points. Among them, point A is applied with a stitching force in the direction of AB⟶, point B is applied with a stitching force in the direction of BA⟶, point A and point B will gradually approach each other. The stitching force is defined as a linear function corresponding to the distance between stitching points. For two stitching points A and B, the stitching force can be calculated as follows:(19)Fstitching​​​​​​​​force⟶=−k•l⟶.Among them,k is the stitching force coefficient, which is related to the stitching performance of the fabric. Generally, a larger stitching force coefficient is used for fabrics that are more difficult to deform; l⟶ represents the distance direction vector from the stitching point A to B. The closer the distance between the stitching points, the smaller the stitching force.


### 5.2. Virtual Try-On

The complete virtual stitching process is shown in Figure8. First, seam lines are explicitly specified by choosing pairs of panel boundary edges. Then, the designed coats are assembled and linked by seaming lines to simulate clothing behavior on the 3D mannequin. By applying elastic force on the seam lines, the garment patterns can be connected to each other during the stitching process, as shown in Figure 8(a). After stitching, the virtual human completes the 3D virtual garment try-on, as shown in Figure 8(b).Figure 8
Diagram of virtual dressing process: (a) virtual stitching in progress and (b) virtual stitching completed.
(a)(b)


## 5.1. Virtual Stitching

When user selects the stitching edge, if the start point and the end point of the two corresponding edges are selected in the same direction (clockwise or counterclockwise), the corresponding relationship between the points on the two edges is correct, as shown in Figure7(a). If different directions are chosen, that is, one side selects the start and end points in a clockwise direction, and the other side selects the start and end points in a counterclockwise direction, the corresponding relationship between the points on the two sides will be wrong, as shown in Figure 7(b).Figure 7
Diagram of virtual stitching information: (a)correct correspondence, (b)incorrect correspondence, and (c)diagram of stitching.
(a)(b)(c)The specific representation of stitching is shown in Figure7(c). The brown dots represent discrete mass points of the garment piece, and Dis represents the distance between the two mass points. Among them, point A is applied with a stitching force in the direction of AB⟶, point B is applied with a stitching force in the direction of BA⟶, point A and point B will gradually approach each other. The stitching force is defined as a linear function corresponding to the distance between stitching points. For two stitching points A and B, the stitching force can be calculated as follows:(19)Fstitching​​​​​​​​force⟶=−k•l⟶.Among them,k is the stitching force coefficient, which is related to the stitching performance of the fabric. Generally, a larger stitching force coefficient is used for fabrics that are more difficult to deform; l⟶ represents the distance direction vector from the stitching point A to B. The closer the distance between the stitching points, the smaller the stitching force.


## 5.2. Virtual Try-On

The complete virtual stitching process is shown in Figure8. First, seam lines are explicitly specified by choosing pairs of panel boundary edges. Then, the designed coats are assembled and linked by seaming lines to simulate clothing behavior on the 3D mannequin. By applying elastic force on the seam lines, the garment patterns can be connected to each other during the stitching process, as shown in Figure 8(a). After stitching, the virtual human completes the 3D virtual garment try-on, as shown in Figure 8(b).Figure 8
Diagram of virtual dressing process: (a) virtual stitching in progress and (b) virtual stitching completed.
(a)(b)


## 6. Experiments and Discussion

This article introduces an energy-based fabric deformation algorithm, which is implemented by the object-oriented Visual C++ language. It is implemented on a PC with a Core i5 CPU and 4 GB RAM. A series of triangular mesh object surfaces are presented to measure the performance of our algorithm. As classical geometrically shaped parts of a torus, the garment shapes of coats and pants are selected as our example.We used the typical 36-sided cone model as an example to test our optimized flattening method. The 3D model is shown in Figure9(a). The initial flattening result is shown in Figure 9(b) and Figure 9(c) shows the optimized flattening results after 170 iterations. The final flattening result is shown in Figure 9(d).Figure 9
Optimized flattening for the 36-sided cone model: (a) 3D original Mesh, (b) initial flattening, (c) optimized iteration after 170 times, and (d) final flattening result.
(a)(b)(c)(d)Three criteria are used to evaluate the surface accuracy after flattening, including area accuracy, shape accuracy, and energy accuracy. The area accuracy and shape accuracy were proposed by Wang et al. [24]. The energy accuracy is presented in this study based on an energy-based fabric deformation model.Area accuracy:(20)Earea=∑i=0n−1ai−ai′∑i=0n−1ai,where Earea is the accuracy of the area after flattening the entire surface; ai is the ith triangle area before flattening and ai′ is its corresponding triangle after flattening; and Eenergy is the number of triangles.Shape accuracy:(21)Eedge=∑i=0m=1ei−ei′∑i=0m=1ei,where Eedge is the accuracy of the shape after flattening the entire surface; n is the ith edge length before flattening and ei′ is the length of its corresponding edge after flattening; and m is the number of triangular mesh edges.Energy accuracy:(22)Eenergy=∑i=0n−1Eenergyi,where Eenergy is the energy accuracy of the entire surface after flattening; Eenergyi is the ith triangle energy after flattening, and the corresponding triangle energy before flattening is zero; and n is the number of triangles on the entire surface.Table1 shows the 36-sided cone measurement accuracy data using the three kinds of surface accuracy methods. As we can see from Table 1, the three measurement accuracies will decrease during the optimized flattening process, and the minimum value is achieved in the final process. The value of area accuracy, shape accuracy, and energy accuracy in the final process is 0.397%, 1.053%, and 5.1, respectively.Table 1
Accuracy statistic of the 36-sided cone.
InitialOptimized (1)Optimized (2)FinalArea (%)0.8970.6820.5640.397Shape (%)1.6421.4351.2111.053Energy (Nmm)23.112.27.95.1We compare our optimized method with the classical mass-spring energy relaxation method, and Figures10(a)–10(d) show the flattening result of the partial torus. Figure 10(a) is the original 3D mesh model of a part of the torus. As shown in Figure 10(b), the initial flattening result has great distortion. Figure 10(c) is the result of optimization based on the fabric deformation model proposed in this study, and the result of mass-spring energy relaxation is shown in Figure 10(d). From the appearance point of view, the optimization result in Figure 10(c) is slightly better than that in Figure 10(d).Figure 10
Comparison of optimization with the woven fabric method and mass-spring method: (a) original 3D mesh, (b) initial flattening, (c) optimized with woven fabric method, and (d) optimized with mass-spring method.
(a)(b)(c)(d)The performance accuracy is listed in Table2. In our experiment, the area accuracy, shape accuracy, and energy accuracy after mass-spring energy relaxation are 1.201%, 1.533%, and 20.2 Nmm, respectively. The value of the area accuracy, shape accuracy, and energy accuracy after the woven fabric-based method is 1.073%, 1.342%, and 10.3Nmm, respectively.Table 2
Accuracy statistics of a torus.
InitialWoven fabricMass-springArea (%)1.9321.0731.201Shape (%)2.531.3421.533Energy (Nmm)62.110.320.2The following two groups of experiments are applied in the garment design process. Figure11(a) shows the 3D triangular mesh surface of a skirt, with 3414 triangular faces and 1851 vertices. Figure 11(b) shows the flattening result after optimization.Figure 11
Energy-based flattening method for a skirt: (a) original 3D mesh of a skirt and (b) final 2D flattening pattern of a skirt.
(a)(b)Figure12(a) shows the 3D triangular mesh surface of a coat, with 3492 triangular faces and 1965 vertices. Figure 12(b) is the result of its optimized flattening.Figure 12
Energy-based flattening method for a coat: (a) original 3D mesh of a coat and (b) final 2D flattening of a coat.
(a)(b)To illustrate the flattening effect of our method, we added two group experiments of pant and vest in the garment design process. Figure13(a) shows the 3D triangular mesh surface of a pant, with 3852 triangular faces and 1963 vertices. Figure 13(b) shows the flattening result after optimization.Figure 13
Energy-based flattening method for a pant: (a) original 3D mesh of a pant and (b) final 2D flattening pattern of a pant.
(a)(b)Figure14(a) shows the 3D triangular mesh surface of a vest, with 3752 triangular faces and 1857 vertices. Figure 14(b) is the result of its optimized flattening.Figure 14
Energy-based flattening method for a vest: (a) original 3D mesh of a vest and (b) final 2D flattening pattern of a vest.
(a)(b)


## 7. Conclusion and Future Work

In this article, an optimized flattening method based on the fabric energy deformation model is proposed. First, the 3D triangle mesh is flattened. The selection of seed triangles can effectively reduce the number of iterations and runs. A new markup algorithm using the edges of triangles is adopted, and the constraint triangle flattening method generates the elastic potential energy and then optimizes the initial flattening results. Second, in the process of optimizing flattening, a new unified axis system process is proposed to obtain the deformation energy, and an energy relaxation method is used to release energy to eliminate the local deformation caused by initial flattening. Finally, based on the model of fabric deformation, which is determined by the energy, a new energy precision is proposed in this study to evaluate the surface accuracy after flattening. The experimental results show that the complex surface of clothing can obtain a better flattening effect. Our approach is more flexible and practical in clothing design than other energy-based methods. In the future, we will consider different materials and other physical parameters of the material in the optimized flattening process for better flattening results.



---

*Source: 4918640-2022-04-16.xml*