Yarn-level deformation for weft-knitted stitches

The essential purpose of this research is to exploit and innovate a yarn-level relaxation deformation method for weft-knitted stitches. Each loop formed by knitting yarns was taken as a mass respectively. Spring-mass model at the yarn level was established for several knitting rows and spatial coordinates were assigned to each mass. Based on the intermeshed relationship of loops in the longitudinal direction, the spring-mass model at the yarn level was transformed into a two-layer spring-mass model at the stitch level, with correspondence between the masses of the two models. Each mass was subjected to eight spring forces from different directions. The resultant force was calculated based on the yarn-level mass model, and the mass displacement was solved by the Verlet numerical integration method. According to the coordinates of masses, the geometric models of different knitting types were established, and a matrix operation method for the spatial rotation and translation of control points was proposed, which could quickly calculate the coordinates and accurately simulate the shape of loops. Finally, we simulated the relaxation deformation of five typical weft-knitted stitches. The results show that this method can accurately and effectively simulate the overall deformation effect of the knitted stitches, and the simulation results are similar to the actual results. The analysis results of the pattern size and the simulation efficiency indicate that the larger the pattern, the more loops there are, the overall simulation time is longer and the running memory occupied is larger.


Introduction
Under the catalysis of the global digital virtual simulation technology, 1,2 many concepts such as "digital fabrics" 3,4 and "virtual fashion" 5,6 have gradually entered the public eye, and have even sparked a digital wave in the textile and clothing industry.Knitted fabrics, 7,8 as a major category of textile and clothing, are deeply favored by consumers due to their complex structures and craftsmanship, fashionable colors, and the properties of soft and comfortable.Meanwhile, it also inspired the creative inspiration of developers to design various knitted fabrics and products.
However, how to implement creative inspiration and ideas into reality becomes a major challenge.
Textile digital technology provides a feasible solution to this difficulty. 9,10Based on three-dimensional (3D) computer-aided design (CAD) software, 11,12 cutting-edge simulation technology can be used to achieve virtual and realistic visualization of textile fabrics.Regarding complex knitted structures, it is necessary to develop more targeted simulation techniques and methods.In 2010, Kyosev and Renkens 13 outlined modeling methods for warp and weft knitted structures and discussed additional issues such as cross-section shape and irregularity of yarns.In recent years, the team with Yuksel et al. that has been dedicated to solving the virtual simulation of knitted structures and knitwear based on knitted mesh.In 2012, Yuksel et al. 14 established yarn-level models of complex knitwear for virtual models.The curve model was generated by stitch mesh, and then the final shape was calculated through yarn-level physical simulation, which could efficiently create yarn-level models of knitwear with rich and diverse patterns.To improve the stitchability of knitted mesh, Wu et al. 15 proposed a fully automated method for converting arbitrary 3D shapes into knitted meshes in 2018, followed by a two-step optimization process and topological operations to generate an efficient stitched mesh.In 2019, they were able to convert any stitched mesh into a knittable structure by introducing a shift path and correctly handling mismatched knitting directions. 15In the same year, Narayanan et al. 16 in the team also developed the first universal visual programing interface that can generate knittable enhanced meshes from 3D models, allowing users to edit the meshes.
During this period, other scholars also referred to their methods to improve the simulated algorithm for knitted structures.The main improvement content is divided into three research directions.8][19] With the help of the improved cuboid spring-mass system, they solved the defects of the traditional spring-mass model, which can effectively improve the simulation effect and promote the real-time simulation of weft-knitted fabrics. 20,21The second research direction is to improve the stitchability of the knitted meshes. 22,23Jones et al. 24 proposed an interactive mesh partitioning tool that can upgrade the stitchability of knitted meshes.Liu et al. 25 put forward a graph-based algorithm to generate 3D shapes of knitted meshes for garments that could be accurately captured and adopted a tiling algorithm to achieve the elastic distribution.Ruan et al. 26 raised a method for optimizing manual calculation and adjustment, utilizing graphic technology to deal with knitting parameters.The third research direction is to develop knitting design systems and instructions.Nader et al. 27 developed a flexible and customizable system for three-dimensional knitted textiles.However, the above research methods are mainly used for singlesided knitted stitches, without considering issues such as the regional uneven density of double-sided knitted stitches, which will affect the force deformation of the loops and the whole fabric.Therefore, the above methods have limitations in simulating double-sided knitted fabrics with regional uneven density.
Based on the characteristic of uneven density of weftknitted stitches and the principle of knitting, each knitted yarn was considered as an independent individual and a yarn-level spring-mass model was established.The yarnlevel model was converted into a stitch-level model according to the longitudinal intermeshed relationship of the loops.According to the two models, the forces on each mass were calculated strictly, and the virtual loops were drawn by the masses after the force deviation as the base point, and finally the yarn-level relaxation deformation of the whole stitch was realized.

Uneven stitch density
The longitudinal description of weft-knitted fabrics can be divided into pattern courses according to the fabric appearance result and knitting rows according to the knitting process.The loops in each course may come from different knitting rows, so the number of pattern courses in knitted fabrics is not equal to that of knitting rows.This means that a pattern course consists of several knitting rows.Furthermore, the ratio of pattern courses to knitting rows in different parts of a knitted stitch is not constant, resulting in the number of loops on the front and back of the fabric varying in different areas.After the combination of different knitting types, the interaction between the loops causes them to appear uneven in size.As a result, the stitch density showed uneven characteristics.As shown in Figure 1, a weft-knitted jacquard fabric is knitted with different jacquard effects in different areas, namely tricolor bird-eye jacquard and tricolor twill jacquard.These two jacquard effects result in a density ratio of 3:2 in the area they are located in.

Modeling
On account of the number of loops in each knitting wale is not consistent, it is impossible to simulate the microstructure deformation of the stitch simply by using a mesh model with a constant size.Therefore, in this research, the spring-mass model at the yarn level was established according to the knitting rule.Meanwhile, the doublelayer variable spring-mass model at the stitch level was constructed according to the intermeshed relationship of loops.There are usually three types of spring in the springmass model: structural spring, shear spring and bending springs.The structural spring connects adjacent masses horizontally and vertically, and its main function is to fix and maintain the overall structure of the model.The shear spring connects adjacent particles on the diagonal, mainly to prevent model spatial distortion and deformation.The bending spring connects horizontally or longitudinally spaced masses, which are spaced at a distance of one.Its main function is to provide a smooth surface for the model during spatial folding or deformation.According to the functions of each spring, we selected structural spring and shear spring in our model.Due to not considering the spatial bending of the fabric, the bending spring was ignored.Based on the spring-mass model, we also established the common geometric models for different knitting types.

Spring-mass modeling at the yarn level
In the process of knitting, yarns are interleaved in the front and back needle beds following the stitch rule.The yarns in each row are knitted independently, but the successively knitted loops on each needle are intermeshed.The front and back knitting needles were regarded as a group to form two knitting units.In this research, it was assumed that the width of the stitch is w, so there are w × 2 knitting units in a row.
The main part of the knitting diagram is the stitches.The horizontal part represents knitting wales.Vertically, it can be simply seen as composed of different knitting rows.Figure 2(a) shows the knitting diagram of a type of knitted structure, we divided each group of loops in the knitting diagram into a front knitting unit and a back knitting unit.According to the knitting types, masses were normally added for the looping type and assigned different spatial coordinates, but not for the floating type.The mass of the tucking type was subject to the mass of the next intermeshed loop.It may be that several yarns are knitted in the same pattern course.The reference height of yarns knitted in the same pattern is consistent, so the longitudinal reference coordinates of corresponding masses are consistent.A yarn-level spring-mass model was constructed by connecting masses in the same knitting row with spring connections successively (Figure 2(b)), in which odd-numbered columns represent front loops and even-numbered columns represent back loops.It should be noted in particular that in this research, each front loop of single-sided knitted fabric was also regarded as two knitting units, among which the back knitting unit was the floating type.The spring-mass mathematical model at the yarn level M yarn was established.
Where w × 2 is the number of knitting units in each row, H is the number of knitting rows and M j k , yarn represents the mass spatial coordinates of the k-th knitting unit at the j-th row.The spatial coordinates of masses are mainly related to three factors: grid width (g.w), grid height (g.h), and grid thickness (g.t).There is a relation c j ( ) between knitting row j and pattern course c.The coordinates of masses can be calculated by equation (2).The k \ 2 represents taking the remainder of k divided by 2.

M
x y z Weft knitting machine has two kinds of needle gating mode, they are interlock gating (needle-to-needle) and rib gating (needle-to-trick) respectively.In the calculation of x-coordinates of the back masses, it is necessary to calculate the lateral offset according to the needle gating, represented by offset x . .
When calculating the y-coordinates of masses, the initial coordinates were calculated according to the current pattern course c j ( ) .The longitudinal offset offset y . of mass coordinates was calculated according to the knitting sequence.For example, the interlock knitted structure shown in Figure 3 is the most typical one in which two knitting rows are merged into a pattern course.However, it can be seen that the two knitting rows are not exactly on the same horizontal line by observing the real microstructure.Due to the influence and constraint of the knitting sequence and the force between the loops, the two rows of loops differ by half a grid height.Based on this feature, we assumed that when a knitting rows are merged into one pattern course, each knitting row was successively raised by 1 a grid height during the actual knitting process.

Spring-mass modeling at the stitch level
The spring-mass model at the yarn level describes the transverse interaction of the loops.The longitudinal interaction of the loops is mainly related to the intermeshed loops in the longitudinal direction.And the intermeshed loops are usually in the same layer.As shown in Figure 2(c), the model was divided into the front layer and the back layer.The masses at the odd-numbered columns in the yarn-level spring-mass model are in the first layer and the masses at the even-numbered columns are in the second layer.In addition, the loops formed by longitudinal masses in the same column have an intermeshed relationship with each other.
It needs to be introduced in detail that due to the variable ratio of pattern courses to knitting rows in different stitch regions, as well as the presence of knitting types such as tucking and floating, the loops that are intermeshed on the same layer may come from different knitting rows.As a result, there is a difference in the number of front intermeshed loops and back intermeshed loops for each vertical wale.In this research, we used mh to represent the number of masses, where mh i k ( , ) represents the number of masses in the k-th wale of the i-th layer.
Based on this horizontal connection and vertical intermesh, the corresponding two-layer spring-mass model 17 at the stitch level M stitch was established.
Where, M i J k , , stitch represents the spatial coordinates of the mass at the i-th layer, the J-th pattern course, and the k-th wale.When i = 1, the mass is located in the front layer, and when i = 2, the mass is located in the back layer.
In the process of establishing the stitch-level springmass model based on the yarn-level spring-mass model, we determined the corresponding relationship J j stitch y arn = [ ] between stitch-level course J and yarn-level row j by traversing the matrix M yarn and calculating the intermeshed masses.Therefore, the stitch-level mass coordinates can be converted from the yarn-level mass coordinates using M M

Geometric modeling
The knitted loop, as the smallest unit in knitted structures, has a crucial effect on the microstructure and overall shape of knitted fabrics.There are three main knitting types in the weft-knitted structures, which are looping, tucking, and floating.The appearance effect of different structures can be formed through the combination of different knitting types.Geometric models were established for looping and tucking respectively.It should be noted in particular that the type of floating is formed through the natural connection of loops.To achieve the natural connection effect in the simulation research, geometric modeling of floating is not carried out.
Figure 4 shows the geometric modeling of a loop based on mass.In this research, it is assumed that the cross-section of the virtual yarn is a constant circle, which does not change with forces, and the radius is assumed to be r.
To calculate the most primitive spatial coordinates of the control points which are unaffected by the masses, we assumed that mass M 2 is at the origin of the spatial coordinates system with the coordinates (0,0,0).The masses M 1 , M 2 , M 3 are on the Y-axis, and original geometric modeling of the loop is conducted based on masses.The red lines represent the front looping formed at the mass M 2 position.Similarly, the blue lines represent the front tucking.For the type of looping, the shape of the loop is mainly affected by three masses M 1 , M 2 , and M 3 .Eight control points are added to maintain a nice loop shape, among which p 1 loop , p 2 loop , p 3 loop , and p 4 loop are symmetric with points p 8 loop , p 7 loop , p 6 loop , and p 5 loop respectively with the Y-axis.The difference is that only four control points are added to the type of tucking, and the four control points are only affected by the upper two masses M 2 and M 3 .The numerical relationship between the spatial coordinates of each control point and masses is shown in equations ( 6) and (7).Therefore, a constant matrix C type for the initial coordinates of the control points was established to describe different knitting types, where n represents the number of control points.It should be noted that constants refer to the spatial data after removing the spatial coordinates of masses M 2 and M 3 in equations ( 6) and (7).In the subsequent calculation process, the point coordinates of different loops are calculated based on different coordinates of masses M 2 and M 3 .

Implementation of simulation
The relaxation deformation of the weft-knitted stitches studied in this research is caused by the internal force generated by loops with different shapes, without any additional external forces.The forces are transmitted through the connected yarns and the intermeshed loops, therefore, we need to convert all the forces to the yarn level for unified calculation.

Force analysis and calculation of masses
A mass is subjected to a total of eight spring forces, including two structural spring forces from the transverse direction, two structural spring forces from the longitudinal direction, and four shear spring forces from the oblique direction.
Force analysis and calculation at the yarn level.As shown in Figure 5, masses on the same knitting row are mainly subjected to the forces F 1 from the left connecting mass and F 2 from the right connecting mass.The forces are the transverse structural spring forces, and the force calculation is shown in equation (9).Where, M j k , yarn is the coordinate of the current mass, M j k is the coordinate of the transverse adjacent mass, l j k j k , , 1 ↔ is the spring length, and K struct is the structural spring coefficient.
The length of the spring between the right and left adjacent masses is different due to the knitting types of tucking and floating.And the adjacent masses may be in different layers, so the length of the spring depends on the distances between masses in the x-direction and z-direction.The spring length is calculated by equation (10), where l j k j k x , , .
1 ↔ yarn represents the total length of the structural spring between masses in the x-direction and l j k j k z , , .
1 ↔ yarn represents the distance between masses in the z-direction.
Force analysis and calculation at the stitch level.In addition to the transverse structural spring forces at the yarn level, the masses are also subjected to the longitudinal structural spring forces F 3 and F 4 of the upper and lower intermeshed loop masses.There may be several knitting rows between the longitudinal intermeshed loop and the current loop, so it is necessary to use J j stitch y arn = [ ] to determine the corresponding knitting rows of the intermeshed masses and obtain the mass coordinates.The spring forces of the longitudinal structural spring are calculated according to equation (11).It is necessary to note that although the longitudinal structural forces are at the stitch level, the forces are also converted to the yarn-level forces for unified calculation.Similarly, the oblique shear forces are also converted into yarn-level forces.
In addition, due to the special bending shape of the knitted loops, the propagation of force causes the current mass to be subjected to the oblique shear forces F 5 , F 6 , F 7 , F 8 of adjacent connected masses, which can be calculated using equation (13).
, , yarn yarn shear (13)  Among them, stitch and M j k  K shear represents the shear spring coefficient.The oblique shear forces come from four directions, and the length of the shear springs is related to the distance between the masses in the x, y, and z directions, as shown in equation ( 14).

Calculation of mass coordinate movement
Without applying any external force to the stitch, the stitch undergoes relaxation deformation through the interaction between the loops.This deformation tends to be constant under the action of limited spring length and damping force.The calculation of damping force is shown in the equation (15).The resultant force on the mass is calculated by the equation ( 16).Among them, M t j k , ( ) and ) represent the mass coordinates at the current time and the previous time respectively, ∆ t represent the time step, and K damp is the damping In this research, Verlet numerical integration method 18 was used to solve the mass movement of the yarn-level spring-mass model.New mass coordinates were calculated by equation (17).Where m is the mass of a particle, and this study assumes that the mass of all particles is equal.

Calculation of spatial control points
Through the geometric modeling of the loop mentioned above, it can be seen that although the reference position of the loop is determined by a single mass, the control points will be offset by the influence of surrounding masses.We proposed a spatial rotation calculation method based on moved masses to calculate the offset spatial coordinates of control points.It should be noted that spatial rotation follows the right-hand coordinate system, with the z-axis perpendicular to the plane outward, so counterclockwise rotation is a positive rotation direction.As shown in Figure 6, the control points p 1 and p 8 are mainly influenced by the current mass and the lower mass, which rotate . The points p 2 to p 7 are mainly influenced by the current mass and the upper mass, which rotate . In addition, it can be found that the movement of the transverse adjacent connected masses also has an impact on the control points which are on the connection axis.To accurately calculate the spatial coordinates of the control points, points p 2 , p 7 , p 4 , and p 5 are rotated β 1 , β 2 , β 3 , All the above rotations are about the z-axis, and the rotation matrix 28 is shown in equation (18).
The control points first rotate based on the initial coordinates and then calculate the translation matrix (equation ( 19)) based on the reference mass.During the translation calculation of spatial coordinates, the control points p 1 , p 2 , p 7 , and p 8 are translated according to the current mass yarn , and the control points p 3 , p 4 , p 5 , and p 6 are translated according to the upper mass , Taking the eight-point loop as an example, the final coordinates of each control point are calculated using the equation (20).

Results and discussion
Based on the above method of spring-mass deformation and calculation of loop spatial points coordinate, this research realizes the yarn-level relaxation deformation for weft-knitted stitches.We used Visual C # and JavaScript to write application programs in a computer configuration of 64-bit Windows 10 system, Intel Core i7-8750H CPU and 8 GB RAM.

Comparison of simulation results
To verify the effectiveness of the yarn-level spring-mass model proposed in this study in simulating the deformation of real knitted stitches under internal forces, the pictures of the structural simulation were compared with pictures of real products.As shown in Figure 7(a) to (e), they are three-color jacquard stitch with birdseye backing, tucking stitch, 2 × 2 cable stitch, 3 × 3 cable stitch, and transfer-jacquard stitch respectively.
It is evident that the tricolor jacquard stitch with birdseye backing has different structural densities of the front side and the back side, with a density of 2:3. Figure 7(a 1 ) shows a structural simulation without deformation.The loops are in a regular and upright state, with a consistent loop width.The height of loops is related to the calculation offset y . of the knitting sequence.The simulation after relaxation deformation is displayed in Figure 7(a 2 ), which clearly demonstrates that according to the spring forces from eight different directions, the shape of loops is skewed, and the width and length of loops are also changed.As shown in Figure 7(a 3 ) of the real picture of the tricolor jacquard pattern, each loop has different sizes and shapes, and the pattern effect is more natural.
The jacquard stitches are designed by adding floating to make the loops suffer spring forces from various directions with different strengths, while the tucking stitches adjust the forces on the loop to achieve deformation by configuring the tucking.As shown in Figure 7(b), it is an uncomplicated tucking stitch that can form a mesh pattern by configuring the tucking according to a special design.Among them, Figure 7(b 1 ) shows an undeformed tucking stitch with regular and upright loops.The color boundaries are distinct and present a distinct straight effect.However, in Figure 7(b 3 ) of the real fabric, due to the effect of the tucking, the color boundary between the upper and lower parts is wavy, which also improves the pattern effect.By using the yarn-level relaxation deformation method, the influence of tucking on the shape of the surrounding loops can be visualized, and the result is more authentic.
Loop transfer, as a commonly used technique in knitted sweaters, changes the shape of the loop during the knitting process, thereby altering the forces on the loop and causing deformation of the surrounding loops. 29As shown in Figure 7(c) and (d), they are 2 × 2 cable stitch and 3 × 3 cable stitch respectively.By transferring the loops to the back needle bed and then to the front needle bed, the loops obtain the tilted and interlocked morphological structure.The length of the loops is extended from upright to inclined, which results in the change of the x-coordinates of the upper masses.With the original spring length unchanged, the actual loop length becomes longer.The loop undergoes deformation due to the force that tries to restore its original shape.To make the cable pattern more prominent and stereoscopic, several back loop wales can be arranged next to the cable pattern.
Similarly, the transfer-jacquard stitch shown in Figure 7(e) makes the front pattern protrude from the back stitch by transferring the front loops to the back needle bed.
Figure 7(e 1 ) shows the simulated structure without deformation.The ground stitch is a two-color horizontal jacquard, presenting a flat and straight effect without distortion.Figure 7(e 2 ) shows the result after the relaxation deformation.The loops of ground stitch present buckling due to the spring forces of the transferred loops, and the final buckling result is very similar to that in the actual Figure 7(e 3 ).Through the simulation and comparison of the above five common weft-knitted stitches, it can be seen that the yarn-level relaxation deformation method proposed in this study can effectively and accurately simulate the knitted structures, and obtain nice deformation results and visualized pattern effects.

Simulation efficiency
The time required for the deformation of knitted stitches is mainly divided into three parts, namely, the calculation of spring-mass forces, the calculation of spatial coordinates for control points, and the drawing and rendering of virtual yarns.Table 1 lists the pattern information and efficiency information of the knitted stitches in Figure 7, in which pattern size refers to w × H (pattern width × the number of knitting rows).By comparing the results, it can be seen that the simulation time is mainly related to the size of the patterns, and the larger the pattern, the longer the time.This is mainly because the size of the pattern determines the size of the yarn-level and the stitch-level spring-mass model, and the spring forces of each mass need to be calculated in eight directions.Furthermore, the pattern size affects the number of loops.The more loops there are, the more time it takes to calculate the spatial coordinates of control points.For the same reason, the drawing and rendering of virtual yarns require sequentially connecting the control points within each knitting row.The more loops there are, the longer the drawing and rendering time.Moreover, we compared the proportion of computation and rendering time in Table 1.The results indicate that as the number of loops increases, the calculation time accounts for a larger proportion of the rendering time.
To reveal the relationship between the number of loops and simulation time, we used Origin software to draw a scatter plot based on simulation data and generate a fitting curve, as shown in Figure 8(a).The results showed that the number of loops showed a linear relationship with simulation time, and the more loops, the linear increase in simulation time.Meanwhile, we also revealed the relationship between the number of loops and the simulation running memory, as shown in Figure 8(b).The results indicate that as the number of loops increases, the running memory increases exponentially.

Conclusion
A scientific and effective method to visualize the yarnlevel relaxation deformation of knitted stitches has been innovated based on the knitting principle.First of all, we explored the characteristics and mechanism of the uneven density of knitted stitches.Based on this, we considered each knitting row of yarns as an independent individual, and each loop formed by the yarns as an independent knitting unit.The spring-mass model at the yarn level was established by adding masses to the root of the loops, and corresponding spatial coordinates were assigned to each mass.According to the intermeshed relationship, a two-layer spring-mass model at the stitch level is generated by adding the longitudinal connection to the yarn-level model.The yarn-level and stitch-level spring-mass models can be converted to each other.During the force calculation process of the spring-mass model, each mass is subjected to eight spring forces from different directions.To facilitate the calculation, this research converted the forces on the stitch level into the yarn level to calculate the resultant force and used the Verlet numerical integration method to solve the mass deflection.Based on the spatial coordinates of the moved masses, loop geometry models are established, which can accurately simulate the spatial shape of the loops after the control points are rotated and translated into space.To verify the effectiveness of this research method, five typical weft-knitted stitches were selected for yarn-level relaxation deformation.The comparison with real fabrics shows that this approach can accurately simulate the overall relaxation deformation of the knitted stitches, and the visualized effect is satisfactory.In addition, we also analyzed the influence of pattern size on simulation efficiency, the results show that the larger the pattern, the more loops, and the longer the total simulation time and the larger the running memory occupied.Nevertheless, this research also has some deficiencies.For example, the overall realism of fabric appearance is related to the realism of virtual yarns, but the reality of yarn simulation is a challenge.In the process of simulation in this research, the simulation of details such as yarn hairiness and the twist was ignored, which will be further studied and innovated in future work.

Figure 2 .
Figure 2. Construction principle of spring-mass models of (a) knitting diagram, (b) spring-mass model at the yarn level, and (c) spring-mass model at the stitch level.

Figure 4 .
Figure 4. Geometric models of knitting types based on masses.

Figure 5 .
Figure 5. Schematic diagram of spring-mass force analysis of (a) at the yarn level, (b) at the stitch level, and (c) total forces.

1 yarn 1 ↔
both represent the coordinates of the longitudinal intermeshed masses, l i J k j k both represent the spring length.Similar to the calculation of the yarn-level transverse spring length, the longitudinal spring length is related to the distance between masses in the y-direction and z-direction.As calculated in equation (12), l i J k j of the structural spring between masses in the y-direction, and l i J k j between masses in the z-direction.
of the shear spring between masses and

Figure 6 .
Figure 6.Schematic diagram of spatial rotation of control points.

Figure 8 .
Figure 8.The relationship between the loops and simulation time/Running memory: (a) chart of loops-simulation time and (b) chart of loops-running memory.