Abstract

The existing knitted fabric simulation methods cannot be effectively applied to three-dimensional (3D) modeling and simulation of weft knitted garments due to the lack of simple and convenient 3D dynamic simulation models for weft knitted fabrics. This paper presents a method of constructing a loop model by coupling the grid model with the spring mass model. The simulation of weft knitted fabric with real effects was achieved through the coupled model construction of the loop model combined with the yarn simulation generation algorithm and yarn collision response algorithm. The method presented in this paper can quickly and simply simulate the design of weft knitted clothing with loop structure. It provides a reference for the 3D simulation design of weft knitted fabric.

1. Introduction

The modeling and simulation of knitted fabric structure are a convenient tool of understanding the fabric properties. For example, a geometrical model of knitted fabric can be used to predict the stress-strain curve [1] and the spherical deformation [2] of the fabric, as well as the tensile behaviour of compression garments created from the fabric model [3]. The modeling and simulation tool can also be used to display the design effect of weft knitted garments. The simulation results can be used to intuitively examine whether the designed knitted clothing meets the expected design requirements or not.

Loop modeling of knitted fabrics is critical in simulation of knitted fabrics. Because the Peirce loop model is too ideal, a relatively fixed model based on the loop shape is not quite consistent with the actual loop deformation [4]. Therefore, many studies have used NURBS or Bezier curves to shape the loop model through control points to complete the modeling of weft knitted loops [58]. Because two spline curves do not pass through every control point, the loop shape preservation is poor. In order to control the shape of the loop more accurately, a loop model was established by using the cubic spline interpolation function through each control point. The model can be more convenient and faster to modify the constructed weft knitted loop model with good shape preservation.

The modeling of weft knitted fabric is limited not only to establishing the appearance model but also to considering the interaction of the forces between the loops to establish a more realistic loop mechanical model. Finite element analysis was reported to complete the analysis of the force between the loop models by setting the boundary conditions and adding the preset force [912]. The finite element analysis model can be used to accurately get the stress of each part of the loop, but it requires a lot of computing power for the calculation.

The simulation calculation based on the spring mass model is fast. The control point coordinates are calculated according to the four vertices of the spring mass model, and the loop modeling combined with the spline curve can conveniently achieve the real-time deformation simulation of weft knitting loop [1315]. The deformation of weft knitting loops is also studied by means of spiral, elastic rod, and topological loop deformation modeling methods [9, 16, 17]. But these methods mostly stay in the modeling and simulation of flat weft knitted fabrics.

Three-dimensional (3D) simulation of weft knitted fabrics can greatly facilitate the fabric design. Hence, the 3D simulation of weft knitted fabrics can be achieved by establishing the loop model of weft knitted fabrics on the surface [18, 19]. The fabric surface is subdivided quadrilaterals on a simple cylindrical surface, and then the loop model is constructed by the vertex of the grid to achieve the modeling and simulation of the simple tubular weft knitted fabric. Three-dimensional modeling can be achieved by designing surface division for more complex surfaces [20]. However, these models do not take into account the dynamic effect of weft knitted fabrics; hence, they do not have the effect of dynamic simulation.

In order to overcome the insufficient research on 3D dynamic modeling of weft knitted fabrics, in this paper, through the analysis and calculation of the model data, the loop grid of weft knitted fabric is divided. On this basis, the spring mass model is coupled with the grid model, and the real-time dynamic simulation of weft knitted fabric is completed by real-time force analysis. A yarn collision detection algorithm proposed in this paper is introduced in the simulation of weft knitting loops to achieve the deformation of yarn in the collision area.

2. Loop Model

2.1. Grid Loop Model

The determination of a weft knitting loop is completed by using the grid model, which can determine the contour of the loop trunk through the four vertices of a quadrilateral grid in space. According to the four vertices of the grid, we can calculate the coordinates of all the control points of a loop. This paper adopts the 3D spatial grid model, as shown in Figure 1. The four points of the grid can be approximately regarded as a plane, but the values of x, y, and z will vary greatly in different planes at different grid points. Therefore, the calculation of loop control points in space cannot be completed by simple calculation between grid points coordinates.

This paper introduces vector to assist the calculation. At two points in space, the vector clearly represents the direction of the line segment. Through the eight points, D1, D2, D3, D4, D5, D6, D7, and D8, as shown in Figure 2(a), we can figure out the space vector of any two of these eight points. For example, to calculate the coordinates of point A in Figure 2(b), we first calculate the vector and vector and then combine the geometric relation on this basis to obtain the 3D coordinates of point A, , using the following equation (1) (where and are the parameters of the loop obtained from the actual simulation experiment):

According to the spatial relationship, we can easily calculate the 3D coordinates of the 11 control points A–K shown in Figure 2(b). The coordinates of each data point (the center of yarn cross section) and the ring points in the space can then be calculated according to the interpolation algorithm between the 3D space points. In this paper, the piecewise cubic Hermite interpolation algorithm is adopted [21]. Compared with Nurbs curve [22] and cubic interpolation algorithm, the piecewise cubic Hermite interpolation algorithm does not require continuous second derivative, and the trunk of the loop can pass through each control point [23, 24]. Hence, it is more convenient to simulate different forms of the loop. After the completion of the loop trunk model modeling, it is necessary to further complete the loop 3D simulation, which is to accomplish the yarn 3D simulation design on the loop trunk structure.

2.2. Simulation of Yarn

In order to achieve a more realistic yarn simulation effect, compared with the traditional graph element splicing to simulate the shape of yarn [25], we adopted a more flexible method to achieve yarn simulation by determining the points on the circumference of yarn cross section (hereafter referred to as ring points) and then creating surfaces by connecting the points between neighboring rings to form triangles (i.e. ΔD1D3D4 and ΔD1D2D4 in Figure 3). As shown in Figure 3, the whole simulation of yarn is completed by the triangular surfaces, e.g., connecting points D1, D2, and D4, as well as D1, D3, and D4 to form two subdivided triangular surfaces and so on.

By triangular splicing of the ring points corresponding to the data points, the quasicylindrical connection of any two points in space can be realized, and this connection is tightly stitched. The connection between the three points is without any defects. The 3D loop model after yarn simulation is shown in Figure 4. At the middle of the connecting loops, the two sides visually have a slightly different slope because the view is in 3D, but they are actually symmetrical. In fact, each loop can be a repeating unit or a different unit with yarn irregularity for a more realistic yarn simulation effect. Such simulated fabric with 3D visual appearance is an advantage of the simulation.

In the current research, a 3D loop is used as the basic unit in the modeling and simulation of weft knitted fabric. Since a simulated loop is independent from other loops, the loop needs to connect to adjacent loops. If the connection is not smooth, the connection part of adjacent loops, as shown in Figure 4, may show an abrupt gap, which affects the actual simulation effect. Especially in the subsequent loop deformation process, the gap will become more obvious with the loop deformation. Therefore, it is necessary to modify the connection algorithm between the loops to realize smooth connection between the loops in a real sense and improve the simulation effect.

2.3. The Algorithm for Connecting the Loops

In order to eliminate the gap in the connection between the loops, the principle similar to the yarn simulation algorithm is adopted to retain the corresponding ring point of the last data point of the previous loop and the ring point of the first data point of the latter loop in the adjacent loop. The triangular plane between the two data points and the corresponding normal vector is calculated through the simulation algorithm similar to the yarn, thus achieving the real sense of the connection between adjacent loops. The effect diagram after implementation is shown in Figure 5.

We found that the simulation effect was not as expected and there was still a “dark shadow” at the loop connecting point. When we further enlarged the gap, as shown in Figure 6, we can see the connection between the loops, but the connections of left and right ring points are misaligned, resulting in the distortion of the triangular surface.

Figure 7(a) shows the correct connection sequence, and Figure 7(b) shows the disconnection between two ring points. The essence of this is that the ring points generated by the upper and lower rings are numbered differently. In an ideal case, the adjacent loops should have the same number of data points, i.e., 8 ring data points, as shown in Figure 7(a), and each ring point should be connected to its closest point on the neighboring ring and then to complete the triangular surface connection and the corresponding normal vector calculation. In Figure 7(b), the closest ring points are numbered differently, which leads to the intersection in the subsequent connection of triangular surfaces not meeting the expected yarn simulation effect, and the connection of adjacent loops is not smooth. Therefore, it is necessary to reorder the sequence number of the ring points to have the effect of Figure 7(a) before connecting them to ensure a smooth yarn surface. The method adopted in this topic is to calculate the distance between the ring data point on a loop and all the ring points of the connecting loop. The point with the smallest distance is taken as the starting point, and then the position of the ring points is numbered. As shown in Figure 7(b), the ring point with the serial number of 1 on the upper edge is used as the benchmark to calculate the distance to all the ring points below. The point with the smallest distance is taken as the starting point, and it can be seen that the lower ring point with the serial number of 5 is closest to it. Finally, the connection between loops can be made as shown in Figure 7(a), and the effect is shown in Figure 8.

As can be seen from Figure 8, the method described in this section to complete the connection between adjacent loops is a practical connection through the subdivision surface. Such connection greatly facilitates the subsequent uncertain situation caused by various deformations, as shown in Figure 9. No matter how the relationship between adjacent loops changes, as long as the coordinates of the ring points can be obtained, they can be connected together by the subdividing surfaces.

2.4. Collision Detection between Yarns

In the real situation, there is friction and collision between yarns, which is not considered in most studies, and no treatment is done for the collision between yarns. Therefore, in the process of simulation, the phenomenon of mold penetration often affects the actual effect of simulation [26]. In this paper, an algorithm of interyarn collision detection and automatic deformation based on the yarn generation algorithm is proposed. The algorithm can automatically detect the collision with the surrounding yarns to complete the automatic deformation of the yarn collision area.

First of all, we are based on a grid model in which the loops will only collide with neighboring loops, and we find that this is true in most cases. Therefore, for the data point of the loop (with ring point in the i row and the j column) in the grid model, the yarn formed by the data point is composed of a circle of points around them, and the distance between the data point and the corresponding ring points is the radius of the yarn (r), as shown in Figure 10. To detect whether there is a collision, it means to detect whether the distance between the ring point corresponding to the current loop data point and the data point of the adjacent loop is less than the radius r. For example, for a general loop, we detect the set of data points of loop , , , and , i.e.,where i is the number of rows of the loop in the grid model, j is the number of columns, and k is the serial number of the data point of the current type in the current loop. We check the distance between the current data point and each data point on the four loops.

For the loop , we calculate the distance between two points using the following equation:

The distance function calculates the Euclidean distance between the two points, which in the absence of collision should be less than the specified radius r of the yarn. If  < r, the yarn is judged to have collided.

The adaptive yarn deformation algorithm is used to simulate the deformation of the yarn when the collision is detected to avoid the situation of mold penetration between yarns. The adaptive yarn deformation algorithm is based on collision detection to further constrain the yarn shape.

If the ring point corresponding to the data point of the loop shape of the current front loop detects that the distance from the data point of the loop shape of the surrounding loop is less than the radius of the yarn r, their difference value d and the movement direction of the ring point can be solved first with the following equations:

In order to avoid the collision between yarns, the minimum displacement of the ring point can be determined by the following equations:where is the original coordinates of the ring points and q is the coordinates after moving the displacement ∆x of the ring point.

The above method can complete the detection of the collision between yarns and the deformation of the collision area of yarns. However, it is undoubtedly a computationally heavy work to calculate the distance between the ring point on each loop and the surrounding loop one by one. Therefore, on this basis, we adopt a one-step preprocessing method to realize the simplification of the computation with the algorithm.

For the loop , we first check whether the distance between its data point and the data point of the surrounding loop is less than the yarn diameter, but not each ring point.

For the loop , we calculate the distance between two points with the following equation:

If  < yarn diameter, there is a collision between the two loops.

At this time, we can calculate the distance between the ring point corresponding to the current data point and the adjacent loop data point to determine which data points have collision. By this preprocessing method, we do not need to calculate the distance between each ring point and the adjacent data point of the loop, which simplifies the calculation.

The general principle is shown in Figure 11. If collision is detected at the ring point D1, the movement direction of D1 is found first, and the deformed model is constructed by moving point D1 in this direction. In this case, the other ring points are still in their original positions. Further modeling work will be conducted to reflect the change of the actual ring shape by repositioning the points adjacent to D1.

3. Three-Dimensional Dynamic Simulation Algorithm

3.1. Model Import and Calculation

In order to import the model more conveniently and achieve the simulation of weft knitted clothing, the mass points of the grid model in this paper were imported from the predesigned grid model file, which is composed of vertex coordinates and vertex number. It is necessary to analyze and calculate the vertices in the predesigned grid model file after importing it to build a grid model for loop control point calculation. To simplify the calculation, the method described in this paper requires that all the mass points are evenly distributed on the n layer, which is convenient for the subsequent establishment of loop model and spring mass system.

For the imported vertex set , the height of all points is read first as , and the height of the points is analyzed and assessed. The points with similar heights are divided into a set , and the grid model and spring mass model are constructed with the adjacent point sets.

After the circles of each layer are divided, the points on the two adjacent circles need to correspond one by one in order to build the grid model and the spring mass model. The method adopted is to select (where i is the number of layers where the point is located and j is the index number of the point in this layer) for calculation. For example, we select the point of the first layer as the starting point, rearrange all the points clockwise, and calculate with equation (7) the distance () between them and the points in the circle point set of the upper layer:where m is the number of points on the circle in each layer.

We then select the nearest point as the starting point of the second layer and rearrange all the points clockwise to calculate, analyze, and reorder the circle points of all the layers according to the above method.

The reordered points can be very convenient to construct the grid model and spring mass model. Taking as the starting point of a single grid and forming a single grid with , the spring mass model can then be used to construct the force between four mass points.

3.2. Coupling of Spring Mass Model with Grid Model

To achieve a more realistic dynamic effect, a coupled grid-spring mass coupling model is constructed by combining the spatial grid model and the improved spring mass model. It can be seen from Figure 12 that the vertex of each subdivision quadrilateral in space is coupled with the mass point of the spring mass model. The vertex of the grid model is taken as the mass of the spring mass model, and the connected springs are set between each mass to build the grid-spring mass coupling model. Based on these mass points, the spring mass model in 3D space can be easily constructed, and Figure 12 shows the resulting grid-spring mass coupling model.

In the grid-spring mass coupling model, the improved part of the spring mass model is shown in the rectangle box in Figure 12. To achieve a more effective tangential force transmission, a connecting spring to the adjacent mass points on the tangential side is added when the spring mass model is constructed. The spring mass model before and after improvement is shown in Figure 13.

To complete the coupling between the grid model and the spring mass model, the spring mass model needs to be in the same closed state as the grid model in space. In the spatial grid model, the adjacent corner points are connected by structural springs, the separated corner points are connected by bending springs, the diagonal corner points are connected by shear springs, and the separated corner points in the diagonal direction are connected by shear springs. All corner points are regarded as mass points in the spring mass model constructed in 3D space. In this model, mass points are mainly affected by spring elasticity and space gravity.

The grid-spring mass coupling model greatly facilitates 3D modeling and simulation of weft knitted fabrics in space. In particular, it can easily complete the dynamic simulation of weft knitted fabrics. Only different model files are needed to achieve fast loop modeling and ideal simulation effects.

4. Simulation Results

Figure 14(a) shows the image of the simulation loop, and Figure 14(b) shows the simulation image of the yarn under the front collision yarn. It can be seen that the yarn is not deformed in the collision area. Figure 14(c) shows the yarn deformation in the collision area after yarn collision detection is added. The yarn has produced serious deformation in the collision area, suggesting that the algorithm has achieved collision detection and collision response. However, the yarn indentation caused by collision is obvious in Figure 14(c). Since yarn is elastic, deformation in one place will lead to deformation in the surrounding area. It is complicated to model the total effect of yarn collisions. Hence, this paper only calculates deformation in the place of collision to illustrate the concept. To advance the algorithm, yarn elasticity should be considered, and the surrounding area deformation should be visualized, making the simulation more realistic.

Figure 15 shows the schematic diagram of the garment loop structure simulation process using the spring mass coupling model. Firstly, the grid-spring mass coupling model is established (Figure 15(a)), then the loop is drawn according to the grid-spring mass coupling model (Figure 15(b)), and finally the overall simulation is carried out (Figure 15(c)). Figure 15(b) shows the simulation effect diagram of the garment loop structure drawn according to the grid model. The loop within each unit can be drawn successively through the grid model to complete the simulation design of the overall garment loop structure. Figure 15(c) shows the schematic diagram of clothing simulation after hiding the grid model.

Figure 16 shows the style and posture of clothing at different stages. Figure 16(a) shows the state of the skirt at the initial moment. Under the gravity and action of the spring mass model, the shape of the grid model constantly changes, resulting in the shape of the clothing loop constantly changing (Figures 16(b) and 16(c)). This simulates dynamically the stress of clothing under different states.

Figure 17(a) shows the obj physical simulation model of a pleated skirt, and Figure 17(b) is the simulation model with loop structure simulated by the method in this paper. It can be seen that the method in this paper can also be applied to the simulation design of these clothing models with slightly more complex structures.

5. Summary

In this paper, a set of loop structure simulation method for weft knitted fabrics and garments is proposed. Firstly, through reading and analyzing the predesigned grid model file, the grid model of a knitted garment is constructed, and the grid-spring mass coupling model is based on it. The loop model can be determined by the grid-spring mass coupling model, and the real shape of the yarn can be simulated by combining the yarn simulation algorithm. Then, the force between the loops can be calculated in real time by the spring mass model, and the overall simulation of the three-dimensional loop structure of knitted clothing can be realized.

In general, this paper has the following three contributions to new knowledge: (1) it introduced the integrated simulation method of knitwear. This method can quickly achieve the modeling and simulation of different weft knitted fabrics with the help of grid model files; (2) in the three-dimensional simulation of knitted clothing, the grid model and spring mass model are combined to carry out real-time dynamic calculation and status update, achieving the dynamic effect of clothing; (3) a new method of yarn collision detection is proposed, which lays the foundation for achieving more realistic yarn simulation. By means of the method reported in this paper, 3D modeling and dynamic simulation of weft knitted fabrics can be completed quickly. The result provides a more intuitive reference for the design of weft knitted fabrics and garments.

Data Availability

The data supporting the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that they have no conflicts of interest.