*Article* **Loop Order Analysis of Weft-Knitted Textiles**

**Levi Kapllani 1,2 , Chelsea Amanatides <sup>2</sup> , Genevieve Dion 2,3 and David E. Breen 1,2,\***


**Abstract:** In this paper, we describe algorithms that perform loop order analysis of weft-knitted textiles, which build upon the foundational TopoKnit topological data structure and associated query functions. During knitting, loops of yarn may be overlayed on top of each other and then stitched together with another piece of yarn. Loop order analysis aims to determine the front-to-back ordering of these overlapping loops, given a stitch pattern that defines the knitted fabric. Loop order information is crucial for the simulation of electrical current, water, force, and heat flow within functional fabrics. The new algorithms are based on the assumption that stitch instructions are executed row-by-row and for each row the instructions can be executed in any temporal order. To make our algorithms knitting-machine-independent, loop order analysis utilizes precedence rules that capture the order that stitch commands are executed when a row of yarn loops are being knitted by a two-bed flat weft knitting machine. Basing the algorithms on precedence rules allows them to be modified to adapt to the analysis of fabrics manufactured on a variety of knitting machines that may execute stitch commands in different temporal orders. Additionally, we have developed visualization methods for displaying the loop order information within the context of a TopoKnit yarn topology graph.

**Keywords:** knitted textiles; topological modeling; contact neighborhood; loop order analysis; precedence rule; visualization

#### **1. Introduction**

Throughout history, knitting as a manufacturing technique has been mostly used for clothing. However, knitted textiles offer great promise in other applications due to their mechanical and physical properties. While knitted textiles have become increasingly important to many industries (e.g., medical, military, etc.) in the last decades, the lack of computer modeling and simulation tools have limited the ability of knitted textiles to be widely deployed. There is a need to robustly design and model knitted textiles in a manner similar to those used for vehicles, buildings, and bridges. The TopoKnit system [1,2] provides significant progress toward this goal by implementing a foundational topological representation of knitted fabrics that supports modeling, simulation, and analysis.

The work presented here builds upon the yarn-based topological structures available in TopoKnit by expanding its query and analysis capabilities, thus capturing additional topological relationships present in knitted fabrics manufactured on a two-bed flat weft knitting machine. Specifically, we present algorithms that implement loop order analysis of weft-knitted textiles. This analysis aims to determine the front-to-back ordering of overlapping yarn loops, given a stitch pattern that defines a knitted fabric.

Expanding our understanding of the topology of weft-knitted textiles, not only advances the correctness and robustness of their associated geometric models, but also contributes to the development and application of knitted structures. Loop order information is crucial for the simulation of electrical current, water, force, and heat flow, as well as

**Citation:** Kapllani, L.; Amanatides, C.; Dion, G.; Breen, D.E. Loop Order Analysis of Weft-Knitted Textiles. *Textiles* **2022**, *2*, 275–295. https:// doi.org/10.3390/textiles2020015

Academic Editors: Philippe Boisse and Laurent Dufossé

Received: 13 April 2022 Accepted: 11 May 2022 Published: 18 May 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

for determining fabric properties such as density and porosity [3–6]. Additionally, a loop order analysis capability contributes to the development of inverse design, the process of determining the stitch instructions that would produce a fabric with desired properties.

Since knitted textiles are composed of consecutive connected rows of intertwined yarn loops, we assume and observe that knitting machines execute stitch instructions row-by-row. However, the order in which these stitch instructions are executed within a row can be arbitrary, i.e., there is no inherent order in which stitch instructions must be carried out. Thus, the algorithms described in this paper are based on the assumption that stitch instructions in each row of a stitch pattern can be executed in any temporal order, depending on the type of the knitting machine performing the instructions. To keep our algorithms machine-independent, the loop order analysis utilizes precedence rules that capture the order that stitch commands are executed when a row of yarn loops are being knitted by a two-bed flat weft knitting machine. The loop order algorithm first determines which loops are brought to a specific location. Then, by analyzing the stitch instructions used to manipulate the loops and by applying the proper precedence rule, the front-toback ordering is determined. Additionally, we have developed visualization methods for displaying the order information within the context of a TopoKnit yarn topology graph. The precedence rules presented in this paper were derived by analyzing knitting simulations in the Shima Seiki SDS-One APEX3 KnitPaint system (Wakayama, Japan). Since the precedence rules are a variable in the algorithms, they can take different values when modeling/analyzing the fabrics produced by different two-bed flat weft knitting machines. This keeps our approach knitting-machine-independent.

The remainder of the paper is structured as the following. In Section 2, we present related work and its relationship to the presented work. In Section 3, we provide a description of the weft-knitting process and the stitch commands utilized during machine knitting. In Section 4, we give a summary of the TopoKnit system. In Section 5, we detail our algorithms for performing yarn order analysis. In Section 6, we describe the algorithms developed to visualize yarn order information with the context of TopoKnit's topology graph. In Section 7, we detail the tests that were performed to validate our yarn order analysis and include some of the test results. Finally, in Section 8, we summarize our research and present directions for future work.

#### **2. Related Work**

Meissner and Eberhardt developed KnitSim, a pioneering system in modeling and visualizing knitted fabrics [7,8]. This system takes Stoll knitting machine commands as input and outputs an explicit topological representation of the knitted textiles generated from the input commands. A 2D geometric layout of the knitted fabric is generated through a relaxation process making assumptions about the length of yarns between crossings. While this work was promising for its time, it does have some limitations. The approach required a full simulation of the knitting process and imposes constraints that limit the complexity of the modeled knitted structures. The lack of available technical detail hinders the evaluation of the generality and robustness of their approach.

Another similar approach that approximates the 2D layout of knitted textiles is presented by Counts [9]. The developed algorithms employ simulation of the knitting process to generate a graph-based topological representation of the resulting fabric and are able to extract knitting machine instructions from the graph representation. Similar to the Meissner et al. work, Counts' work requires a full knitting simulation to generate the graph. The choice to use loops as the fundamental primitive, as well as the small set of supported machine instructions, limits the yarn topology that can be represented.

There has been abundant work on the 3D geometric modeling of yarns in knitted textiles. In efforts to create more realistic models, Kyosev et al. [10] propose a model that considers yarn cross section properties by including the compression of the yarns in the loop. Sherburn, Lin, et al. [11,12] developed a multiscale modeling approach aiming to predict the mechanical properties of knitted textiles. To further explore the unique

mechanical properties of knitted textiles, Wadekar et al. [13] developed a yarn-level model for weft-knitted fabrics that can be used in finite element analysis simulations. In recent work, Knittel et al. [14] and Wadekar et al. [15,16] explore helicoid scaffolds as a framework for modeling and analyzing the structure and properties of knitted fabrics.

Kaldor et al.'s cutting-edge work [17,18] simulated entire knitted swatches and garments by modeling the geometry and physics of individual yarns in these items. Inspired by this work, Yuksel et al. [19] and Wu et al. [20] introduce a modeling technique that builds yarn-level geometric models of knitted clothing from polygonal models that represent the surface of the knitted cloth. Part of this work was adapted by Leaf et al. [21] to create an interactive design tool for simulating yarn-level patterns for knit and woven textiles.

Cirio et al. [22] define a topological representation of knitted textiles created by a set of limited stitch commands, some of which are not manufacturable on knitting machines. They introduce a compact and simplified representation of yarn geometry and mechanics, capturing essential yarn deformation in their virtual knitted textiles. Their simulation was integrated into a hybrid yarn-triangle model by Casafranca et al. [23]. In related work, Kapllani et al. [1] developed a topological model, TopoKnit, a process-oriented representation that defines a foundational data structure for representing the topology of weft-knitted textiles at the yarn scale. This representation allows for additional topological and manufacturability and stability analysis [2].

McCann et al. [24], Narayanan et al. [25,26] and Lin et al. [27] created algorithms for determining knitting machine commands given polygonal models. These algorithms facilitate interactive design and manufacturing of 3D knitted objects. Popescu et al. [28] described an approach for automatically generating a knitting pattern given a 3D model, without being constrained to developable surfaces. Motivated by Narayanan et al. [25], Kaspar et al. [29] introduced an interactive system which allows users of different skill levels to create and customize machine-knitted textiles. Nader et al. [30] introduced KnitKit, a flexible and customizable system aiming to simplify the knitting of 3D objects by isolating the high-level design from the low-level machine-specific knitting instruction generation.

Our work extends a previously developed topological model (Kapllani et al. [1,2]) to provide additional topological information about a knitted fabric based on the manipulations of its yarn loops. Specifically, in this paper, we present analysis algorithms that define and visualize the order of overlapping loops in a knitted fabric. While Cirio et al. [22], Meissner and Eberhardt [7], and Counts [9] presented work that represents yarn topology in knits, none of them performed any kind of loop ordering determination. Our work produces unique modeling information (loop order) that does not require a full simulation of the knitting process.

#### **3. Fabrication of Weft-Knitted Textiles**

A fundamental unit of knitted textiles is the yarn loop. A loop is created when a yarn is drawn through a previously existing loop, as seen in Figure 1. When this process is repeated across a row, and then subsequently again in other rows, the fabric is formed. The actions that create a loop or modify an existing loop are specified by stitch instructions. The two simplest/most common stitch instructions are the Knit and the Purl stitches. As viewed from the front side of the knitting machine, when a yarn is drawn through the loop(s) held on a needle from back to front to form a new loop, a Knit stitch is created, as shown in Figure 2b. When the direction that the yarn is drawn is front to back, a Purl stitch is created, as shown in Figure 3b. A Purl stitch is simply the back side of a Knit stitch. Additionally, a number of other stitch instructions can be executed, which may be combined to produce a vast variety of knitted textiles. These stitches include:

#### *3.1. Front and Back Transfer Stitches*

A Transfer stitch is produced when a Knit or Purl stitch is created and then its head loop is transferred, via a sequence of needle bed transfers and rackings, to another needle location. Whether the stitch created is a Knit or Purl determines the type of Transfer stitch. A Front Transfer stitch transfers the head of a Knit stitch and a Back Transfer stitch transfers the head of a Purl stitch (see Figures 4b and 5b respectively).

The Transfer stitches presented in Figures 4b and 5b transfer the loop one needle to the left; however, depending on the type of Transfer stitch, there can be up to three loop movements to the left or right. When a new yarn comes to the needle holding the transferred loop, both overlapping loops will be knit together. The transferred loops are highlighted in magenta in Figures 4b and 5b.

**Figure 1.** A single stitch, with its "legs" holding the "head" (upper loop) of the stitch below.

**Figure 2.** A Knit stitch is created by pulling a loop of yarn through a loop held from the previous row from back to front. (**a**) Row of loops. (**b**) Knit stitches produced from another row of stitches. (**c**) Topological representation. A single stitch is represented by the potential CNs (white disks) of its upper loop and the actualized CNs (gray disks) where its legs intertwine with the previous loop.

**Figure 3.** A Purl stitch is created by pulling a loop of yarn through a loop held from the previous row from front to back. (**a**) Row of loops. (**b**) Purl stitches produced from another row of stitches. (**c**) Topological representation. Note that an ACN produced by a Purl stitch is colored green, as compared to the gray disks of Knit-stitch-produced ACNs.

**Figure 4.** A Front Transfer stitch is created when the loop of a Knit stitch is transferred up to three needle positions away to the left or right. (**a**) Row of loops. (**b**) Two Knit stitches and a Front Transfer stitch produced from another row of stitches. (**c**) Topological representation.

**Figure 5.** A Back Transfer stitch is created when the loop of a Purl stitch is transferred up to three needle positions away to the left or right. (**a**) Row of loops. (**b**) Two Knit stitches and a Back Transfer stitch produced from another row of stitches. (**c**) Topological representation.

#### *3.2. Front and Back Tuck Stitches*

A Tuck stitch is created when a yarn is tucked onto the needle and pulled up, instead of being pulled through the held loop. The tucked loop is held on the needle together with the loop from the previous row, as shown in Figures 6b and 7b. Executing a Back or Front Tuck stitch will determine if the tucked loop is positioned in front of or in back of the held loop, respectively. The needle holds both loops, which will be knitted together when a stitch instruction is executed above it on the next row. The tucked loops are highlighted in magenta in Figures 6b and 7b.

**Figure 6.** A Front Tuck stitch is created by tucking a yarn onto a loop held by a needle on the front bed from the previous row, instead of creating a new stitch. (**a**) Row of loops. (**b**) Two Knit stitches and a Front Tuck stitch produced from another row of stitches. (**c**) Topological representation.

**Figure 7.** A Back Tuck stitch is created by tucking a yarn onto a loop held by a needle on the back bed from the previous row, instead of creating a new stitch. (**a**) Row of loops. (**b**) Two Knit stitches and a Back Tuck stitch produced from another row of stitches. (**c**) Topological representation.

#### *3.3. Front and Back Miss Stitches*

Similarly to the Tuck stitch, during the execution of a Miss stitch, the needle holds the loop from the previous row, but the new yarn is not hooked by the needle. Instead, the yarn passes by, creating a horizontal segment of yarn across the front or the back of the held loop. Executing a Back or Front Miss stitch will determine whether the yarn passes in front of or in back of the held loop, respectively. The resulting horizontal yarns are highlighted in magenta in Figures 8b and 9b.

**Figure 8.** A Front Miss stitch is created when a needle on the front bed holds a loop from a previous row as the yarn passes by, without knitting a new stitch, creating the magenta horizontal yarn. (**a**) Row of loops. (**b**) Two Knit stitches and a Front Miss stitch produced from another row of stitches. (**c**) Topological representation.

**Figure 9.** A Back Miss stitch is created when a needle on the back bed holds a loop from a previous row as the yarn passes by, without knitting a new stitch, creating the magenta horizontal yarn. (**a**) Row of loops. (**b**) Two Knit stitches and a Back Miss stitch produced from another row of stitches. (**c**) Topological representation.

#### *3.4. Empty Stitch*

An Empty stitch specifies that no machine operation will be executed for a specific needle. In our work, we assume that Empty stitches cannot be completely surrounded by non-Empty stitches, i.e., Empty stitches only occur outside the borders of the fabric. Therefore, no yarn passes by nor is looped on the needle at that stitch location.

These nine stitches (Knit, Purl, Front and Back Transfer, Front and Back Tuck, Front and Back Miss, and Empty) are the fundamental stitches needed to create most knitted textiles and can be combined to generate complicated knitted patterns. TopoKnit supports all of these stitches, thus allowing for a broad representation of intricate knitted fabrics.

#### **4. TopoKnit**

TopoKnit is a topological model of knitted textiles defined within a process-oriented space that represents aspects of the fabric itself, as well as the processes that manipulate the fabric during knitting (Kapllani et al. [1]). The primary primitives of this modeling space are yarn intertwinings and the yarns that connect them. The complexity of a yarn intertwining is encapsulated in a primitive called the Contact Neighborhood (CN). There are three types of CNs: the potential CN (PCN), the actualized CN (ACN), and the unanchored CN (UACN). When a loop is formed, two PCNs are created. When the yarn comes back to the location of these PCNs and is pulled through the existing loop to form a new loop (creating two intertwinings), the PCNs are actualized to ACNs. An ACN is defined by a contact point and four directed incident edges. See the gray (ACNs) and white (PCNs) disks in Figure 2c, which are defined by a Knit stitch. Depending on the loop manipulations during the knitting process, PCNs can be actualized at their creation location or at another location in the fabric grid. An example of the latter would be the PCNs created by Transfer stitches, as seen in Figures 4 and 5. The third CN type, a UACN, is created when the yarn is grabbed by the needle, but the loop's legs are not intertwined with (i.e., anchored by) another loop from directly below. The squares in Figure 10c represent UACNs. These CNs are connected horizontally with their neighbors along the magenta edge flowing from left to right and therefore are unanchored.

TopoKnit defines a data structure which stores information about these CNs, as well as their mappings, i.e., movements within the fabric grid. For each CN (*i*, *j*), four parameters are stored in the data structure. They are: stitch type (ST), actualization value (AV), movement vector (MV), and yarn path index (YPI). The first parameter is the only location-based parameter and it specifies the type of stitch executed at location (*i*, *j*) when a CN (created at or transferred to (*i*, *j*)) is actualized at the location. The actualization value and movement vector make up the mapping information for each CN. The actualization value shows if a CN has been created at a location (*i*, *j*) and if so defines its state. The four actualization parameter values are: PCN, ACN, UACN and E. 'E' implies that no CN was instantiated at the associated location, i.e., the CN is Empty. The movement vector [∆*i*,∆*j*] specifies if the CN is being moved vertically or horizontally and by how many units. The YPI parameter stores information about the CN's location in the yarn path list as a set of indices into the list. The yarn path list consists of a set of locations the yarn passes through in the fabric grid. Having this information stored in the data structure allows for constant-time information access during the analysis stage.

Given a stitch pattern composed of the stitch instructions supported by TopoKnit, populating the data structure is the first step toward the analysis stage. See Figure 10d. The analysis stage consists of algorithms developed to evaluate the data structure and support topological query functions. TopoKnit's main evaluation routine produces the path of the yarn through the fabric and stores it as a sequential list of grid locations in the fabric. The yarn path may be used to visualize the topology graph of the resulting knitted fabric, as seen in Figure 10c, which is produced from the stitch pattern in (a). Examples of supported topological queries include determining the final location of a CN in the fabric grid, identifying which CNs will ultimately be situated at a particular fabric grid location, returning a list of neighboring CNs, as well as providing a list of topological structures we call open loops. Our current work adds loop order determination to this list. In addition to yarn-level topological analysis, TopoKnit supports manufacturability and structural stability analysis (Kapllani et al. [2]).


**Figure 10.** Stitch pattern with a combination of Knit, Front Transfer, Back Transfer, Front Miss, Front Tuck, and Back Tuck stitches. (**a**) Stitch instructions. (**b**) Simulation of stitch pattern. (**c**) Topology graph. (**d**) Corresponding data structure after evaluation.

#### **5. Loop Order Analysis**

A new topological query has been added to the TopoKnit system, specifically the front-to-back order of yarn loops. Due to the manipulations of the yarn during the knitting process, multiple overlapping loops may end up at the same location in the fabric. The final spatial order of these loops (front-to-back) is determined by the temporal order that the loops were manipulated and placed during knitting. The loop order query makes use of this fact, along with the information stored in the TopoKnit data structure to define the spatial order of loops at a location (*i*, *j*) in the fabric grid. It is important to note that since we are trying to define the order of loops, our analysis only involves stitch instructions that create new loops, such as Knit (K), Purl (P), Front (FX) and Back (BX) Transfer, and Front (FT) and Back (BT) Tuck Stitch and excludes the Miss (M) stitch.

Both hand and machine knitting are row-by-row processes. Therefore, the loop order analysis algorithms assume that the stitch commands are processed row-by-row. The execution order for stitches within a row depends on the type of knitting machine performing them. To represent and isolate this machine dependency in our algorithms, precedence rules are introduced as input to the loop order algorithm. The precedence rules consist of a sequence of stitch instructions starting with the stitch instruction that is executed first in a row of instructions and ends with the stitch instruction that is executed last. The precedence rules can be easily changed when analyzing the fabric manufactured by a specific knitting machine.

The first step of the loop order query determines which loops are brought to the queried location in the fabric grid. The loops that end up at the location in the fabric may have originated from multiple lower rows in the fabric. When analyzing these loops, they are processed row-by-row, with lowest originating row being processed first. A precedence rule is then applied to determine the order of stitch command execution, and therefore the ordering of the associated yarn loops, for that row. The stacked loops from one row are then recursively concatenated with loops that are ordered from successive rows.

#### *5.1. Precedence Rules*

For each type of knitting machine, precedence rules specify the temporal order that stitch instructions in a single row of a stitch pattern are executed by the machine. The examples presented in this paper use precedence rules that were inferred by analyzing simulations of different stitch patterns in the Shima Seiki SDS-One APEX3 KnitPaint system. Over one hundred patterns were simulated and examined to determine the order that Shima Seiki knitting machines execute Knit, Purl, Front and Back Transfer, and Front and Back Tuck stitches in a row of stitches. The order that these stitches are executed depend on what types of stitches exist in a row. Knit, Purl, and Transfer (K-P-X) stitches are executed as a block. If the row contains a Back Tuck (BT), the K-P-X block is executed first, then followed by the execution of the BT stitch. This is seen at location (4,3) and (5,3) in Figures 11 and 12. If the row contains a Front Tuck (FT), the FT stitch is executed first and the K-P-X block of stitches is then executed.

**Figure 11.** Stitch pattern with a combination of Knit, Front and Back Transfer, and Back Tuck stitches: (**a**) Stitch instructions. (**b**) Simulated knitted pattern. (**c**) Topology graph displaying CN (loop) order.

**Figure 12.** Yarn order zoom-in at location (4, 3) in the yarn topology graph of Figure 11: (**a**) Simulated knitted pattern. (**b**) Corresponding zoom-in topology graph.

Therefore, there are two precedence rules for the K-P-X block of stitches, depending if the block contains Front Transfer (FX\*) or Back Transfer (BX\*) stitches. Knit stitches are always executed first and Purl stitches are executed last in the block. What determines the precedence of the block is the presence of Front Transfer stitches, with or without the inclusion of Back Transfer stitches. The first rule accounts for the existence of Front Transfer stitches in the row being processed, whereas the second accounts for all Transfer stitches in the row being Back Transfer stitches. Within these rules, the direction of the transfer, the number of needle positions shifted (shift units) and the stitch type (FX or BX) determine the execution order of the stitches. In the first rule, the smaller the shift unit, the higher the precedence of the Transfer stitch instruction, i.e., the sooner the stitch is executed (See locations (4, 2) and (5, 2) in Figures 13 and 14). For stitches with equal shift units, the left movement direction precedes the right one (See locations (6, 5) and (7, 5) in Figures 11 and 15), and for stitches with equal shift units and direction, Front Transfer stitches precede Back Transfer stitches. Given this information, the first precedence rule, from highest to lowest precedence, for K-P-X blocks is

(*K*, *FXL*, *BXL*, *FXR*, *BXR*, *FXL*2, *BXL*2, *FXR*2, *BXR*2, *FXL*3, *BXL*3, *FXR*3, *BXR*3, *P*).

Similar to the first rule, the second precedence rule uses shift units and movement direction to define the execution order of blocks containing only Knit, Purl, and Back Transfer stitches. However, contrary to the first rule, the higher the shift unit is, the higher the execution precedence of the stitch instruction is in the second rule. For stitches with equal shift units, the left movement direction precedes the right one. Given this information, the second rule for K-P-X blocks with only Back Transfers is

(*K*, *BXL*3, *BXR*3, *BXL*2, *BXR*2, *BXL*, *BXR*, *P*).

These precedence rules are codified in Algorithm 1.

**Figure 13.** Stitch pattern with a combination of Knit and Front and Back Transfer stitches: (**a**) Stitch instructions. (**b**) Simulated knitted pattern. (**c**) Topology graph displaying CN (loop) order.

**Figure 14.** Yarn order zoom-in at location (4, 2) in the yarn topology graph of Figure 13: (**a**) Simulated knitted pattern. (**b**) Corresponding zoom-in topology graph.
