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.

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 [37] 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 [1015], 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]:where is the energy of the entire fabric, is the potential energy of the fabric, represents the energy produced by tensile energy or compression of the fabric, represents the energy produced by shear, and 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 is described as follows [24]:where is the area of the 2D triangle, and are the tensile constants for the and directions, respectively, and and (see Section 4.1) are strains. Shear energy is described as follows [24]:

Similar to (2), is the area of the 2D triangle, is the shear constant, and (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 variable 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 , where is the spatial vertex set, , is the topological connection information of the mesh, and is the triangle of the surface mesh. The goal of mesh flattening is to obtain another triangular mesh , where is a 2D plane point set, , and corresponds to . 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.

To be flattened, triangle list , active triangle list , flattened triangle list , and initial flattening mesh 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 , and set and as empty.(ii)Step 2: Seed triangle is searched in list and then is flattened. Then, is added to the active list and removed from the available list . The selection of seed triangle is detailed in Section 3.1.(iii)Step 3: Perform a search in list to find all the triangles that share an edge with and insert them into the tail of list .(iv)Step 4: If the list is empty, stop processing. Otherwise, obtain the next triangle from the rest of list .(v)Step 5: Insert triangle into the tail of list and then mark as flattened. A search is performed in list to find all the triangles that share an edge with and are not marked as flattened, and then they are inserted into the tail of list . Return to Step 4.

To optimize vertex and optimize triangle set , initial vertex set 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 vertex from .(ii)Step 2: A search is performed in list to find the triangle set that contains vertex .(iii)Step 3: Each 2D triangle of triangle set proceeds with its corresponding 3D triangle of in the unified axis system and then obtains the energy of vertex .(iv)Step 4: Calculate the minimum value of the energy at the original position of vertex and its eight directions position. Thereafter, vertex is moved to the minimum energy position.(v)Step 5: If the vertices in K″ 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 Figure 2, is a 3D triangle and the vertices are arranged in reverse order. Edge has been flattened to edge and then vertex is flattened. The angle between the vector and the vector is calculated as follows:

Vector is obtained by rotating vector counterclockwise by angle . Then, vertex is located using the following expression:

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

Figures 3 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 and , and their radii are and , 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 and have been flattened, and our aim is to flatten triangle . We choose edge , and vertex is flattened to by using the unconstrained method in Section 3.2. Then we calculate their average coordinate as the flattened vertex, that is . The side length of the flattened triangle has been changed with respect to , which will produce elastic potential energy. Therefore, after the initial flattening, optimized flattening is required to release the elastic potential energy.

4. Optimized Flattening

4.1. Process of Obtaining a Unified Axis System

The detailed process of obtaining a unified axis system is shown in Figure 5. is a 2D triangle and is its corresponding 3D triangle. First, the 2D woven triangle without distortion is placed on a axis system. The corresponding 3D deformed triangle is then superimposed on the system under the same conditions. The 2D fabric undeformed triangle without energy, and its corresponding 3D fabric triangle with energy is generated after geometric deformation. The strain variables and , as well as the shear variable , transform position to and to , respectively.

As shown in the right part of Figure 5, is located at the origin of the coordinates. The three-side length of the 2D triangle is known, and the coordinates of and can be obtained using (6) and (7), where is the angle between axis and edge . is the angle between edge and edge . By setting the value of as 1/2, the flattening could achieve a better effect. The and coordinates of the 3D triangles can be obtained in the same way.

The unifying process completes the specification geometric transformation that a representative rectangle must undergo. This geometric transformation can also deform the triangle to . 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:

For a particular affine transformation, the affine transformation matrix will now be referred to as , where this matrix is comprised as follows:

The shape of a triangular fabric is deformed first by stretching and then by shearing; is therefore represented by a matrix:

For this special change, coordinate transforms to coordinate and coordinate transforms to :

The equation can be rewritten again as shown below:or , and this results in:

By comparing (10) and (13), the strain variables and and the shear variable are as follows:

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 the axes with equations (6) and (7)(4)According to the two unified triangular coordinates, acquire the strain variables and and the shear variable by applying equations (14)–(16)(5)Use equations (2) and (3) to obtain tensile energy and shear energy 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 Figure 6, we assumed that there are 2D vertices and adjacent vertices . The triangles formed with are . The energy of the vertex is obtained by the following expression, where is the energy of the th triangle connected to and is the number of triangles connected to vertex .

The eight directions of optimized flattening are , and the movement increment is . The next position of will slip to the minimum energy value direction. The minimum energy value can be obtained as follows:

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 Figure 7(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).

The specific representation of stitching is shown in Figure 7(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 is applied with a stitching force in the direction of , point is applied with a stitching force in the direction of , point and point 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 and , the stitching force can be calculated as follows:

Among them, 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; represents the distance direction vector from the stitching point to . 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 Figure 8. 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).

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 Figure 9(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).

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:where is the accuracy of the area after flattening the entire surface; is the ith triangle area before flattening and is its corresponding triangle after flattening; and is the number of triangles.

Shape accuracy:where is the accuracy of the shape after flattening the entire surface; is the ith edge length before flattening and is the length of its corresponding edge after flattening; and is the number of triangular mesh edges.

Energy accuracy:where is the energy accuracy of the entire surface after flattening; is the th triangle energy after flattening, and the corresponding triangle energy before flattening is zero; and is the number of triangles on the entire surface.

Table 1 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.

We compare our optimized method with the classical mass-spring energy relaxation method, and Figures 10(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).

The performance accuracy is listed in Table 2. 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.

The following two groups of experiments are applied in the garment design process. Figure 11(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 12(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.

To illustrate the flattening effect of our method, we added two group experiments of pant and vest in the garment design process. Figure 13(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 14(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.

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.

Data Availability

The research data used to support the findings of this study are available from the corresponding author upon request.

Disclosure

The authors have presented the manuscript in “2017 International Conference on Virtual Reality and Visualization (ICVRV).”

Conflicts of Interest

No conflicts of interest exist in the submission of this manuscript.

Acknowledgments

The authors thank Prof.Yanjun Peng at the Shandong University of Science and Technology for his valuable comments, Dr. Yingran Ma at the Shandong University of Science and Technology for his data collection, Mrs. Yuanhong Wang at the Shandong University of Science and Technology for her literation collection, and Assoc Prof. Mingmin Zhang at the Zhejiang University for discussion. This work was supported by the Key Science and Technology Research of Henan Province under Grant nos. 212102210516 and 212102210255, the National Natural Science Foundation of China under Grant no. 61976126, and the Natural Science Foundation of Shandong Province under Grant no. ZR2019MF003.