Abstract
Abstract
With advances in the automated segment filling insertion technique, there is a need for a jacquard CAD/CAM system that can be applied to the segment filling insertion technique. Automatically generating pattern designs in pattern information graphics requires overcoming the primary challenge of automating the rational and efficient division of pattern designs. This process is guided by the principles of the segment filling insertion technique, which involves a unique approach. Existing CAD systems only use simple division algorithms for different colors. These algorithms cannot handle the complex requirements of automatic weaving in the segment filling intersection technique. In addition, the divisions produced by these algorithms often result in numerous floating yarns and entanglement problems between wefts, which adversely affect fabric quality. An algorithmic approach to classifying optimal regions within pattern designs is presented in this research. A modified depth-first search algorithm was used to divide the pattern design into contiguous regions. A longest vertical growth algorithm was then introduced to further subdivide these contiguous regions, providing the theoretical basis for the automated generation of pattern information graphics containing critical parameters for controlling weaving machine operations. The need for the algorithm described in this article was been valuated through comparative experiments. Its effectiveness was validated through weaving patterns, and its feasibility and applicability were evaluated through several types of pattern designs. The proposed algorithm provides a theoretical base for future tasks and a novel concept for the subsequent development of CAD/CAM for segment filling insertion fabrics.
Keywords
Computer-aided design (CAD) and computer-aided manufacturing (CAM) systems have played a pivotal role in the textile industry, offering significant improvements in design creation and weaving productivity.1,2 Contemporary industrial production has used numerous CAD/CAM systems, such as Jc5 (ZDJW, China), DesignScopeVictor (EAT, Germany), and NedGraphicsTextile (NedGraphics, The Netherlands).3,4 These systems have mainly processed pattern designs in the editing module, set parameters in the process design module, and then converted them into machine files in the CAM module to automate the weaving process. However, existing CAD/CAM systems are primarily based on the normal filling insertion technique, 5 with the process design module relying predominantly on parameter configurations relating to this technique. Once these parameters have been transferred to the machine files by the CAM module, the automated weaving process is executed through five main loom movements, as shown in Figure 1(a). However, a significant difference 6 between the fabrics woven using normal filling insertion and those woven using segment filling insertion during the weaving process is the filling insertion methods used, which represents a significant departure from normal filling insertion operations. Whether using a shuttle filling insertion or a shuttleless filling insertion as shown in Figure 1(b), the yarn is continuously moved from one side to the other without interruption within the row, resulting in woven fabrics, as shown in Figure 2(a).

Normal filling insertion. (a) Diagram of automated weaving and (b) Diagram of shuttleless filling insertion.

Different filling insertion fabrics. (a) Normal shuttleless filling insertion fabric and (b) Segment filling insertion fabric.
The use of segment filling insertion fabrics requires the flexible back-and-forth movement of identical weft yarns within a specific region, as shown in Figure 2(b). The manufacturing process of segment filling insertion fabrics is characterized by its labor-intensive and time-consuming nature, mainly due to the intricate weaving technique used, which requires manual weaving by skilled workers, as shown in Figure 3(a). 7 By 2019, Yuling Li 8 made significant progress in modifying the filling insertion mechanism to enable automated weaving of segment filling insertion fabrics, as shown in Figure 3(b). In contrast to the previous approach, which relied on manual labor, significant progress was achieved with the current technique.

Simple segment filling insertion process. (a) Handloom for the segment filling insertion technique and (b) The segment filling insertion mechanism.
In Table 1, the “✓” symbol denotes parameters that are necessary for the automated weaving process, whereas the “×” symbol signifies parameters that are not required. The existing CAD/CAM systems are not suitable for generating automated weaving parameters for the automated weaving of segment filling insertion fabrics. Unlike automated weaving with normal filling insertion, automated weaving with segment filling insertion requires parameters for the start and end positions of the filling insertion within a given segment, as well as the grabbing direction of the shuttle. Therefore, more parameters need to be calculated and planned for segment filling insertion weaving than for regular weaving.
Information on automated weaving parameters
Although automation has been achieved in the weaving of segment insertion fabrics, it is still limited by the fact that the necessary pattern information has to be manually designed and the parameters manually entered into the computerized manufacturing system. The complete pattern information must be meticulously and carefully created by the fabric designers according to their respective pattern designs. The design and preparation phases of weaving are time-consuming and inefficient. Therefore, it is imperative to develop a CAD/CAM system based on the segment filling insertion technique and capable of autonomously generating pattern information graphics from pattern designs. This paper proposes an optimal division algorithm based on the segment filling insertion technique, thereby providing a theoretical basis for the core algorithm of automatically generating the pattern information graph from the pattern design within the segment filling insertion CAD/CAM system. The paper is structured as follows. In the next section, the research background and related work will be introduced. The third section deals with the design of the algorithm. The fourth section is dedicated to the experimental validation. Finally, the results and conclusions of the paper are presented.
Background and related work
A diagram of the automated weaving of fabrics using the segment filling insertion technique is provided in Figure 4. 9 In this illustration, each color region is woven by a specialist weft insertion shuttle. Within each segmented area, the weft yarns traverses precise distances and follows specific directions throughout the weft insertion process. In the context of automated processing for segment filling insertion fabrics with pattern design, the initial step is to differentiate between the various colors within the region for accurate segmentation. In particular, a suitable method for managing the continuity of regions with the same color in the pattern design must be identified as a prerequisite for the subsequent preparation of the shuttle assignment.

Filling sequence of the 9th and 10th rows in automated weaving. (a) The first segment in row 9. (b) The second segment in row 9. (c) The third segment in row 9. (d) The first segment in row 10. (e) The second segment in row 10 and (f) The third segment in row 10.
In the division of the pattern design regions, it is crucial both to identify continuous color regions and to address the issue of floating yarns. This occurs when the same color is interrupted by other colors within the same row. In the example illustrated in Figure 5, where the color of the same row is interrupted by another color, two segments of purple yarn incorporate a pink segment in the middle. If the same shuttle is utilized for weft insertion persistently in the interrupted zone, the purple part of the first segment crosses over to the purple part of the second segment, resulting in the formation of a floating yarn along the pink weft segment, as illustrated in Plan B. However, if the zone where the second purple segment is interrupted by the pink segment but another shuttle is selected for the second part of the purple segment, this would result in the noncreation of a floating yarn, as shown in Plan A. Therefore, a logical and intelligent division of the color blocks in the pattern design, as well as a rational arrangement of the shuttles, is necessary to ensure the automation of the computer-aided design.

Different segment filling insertion plans in row 9.
The automated processing of pattern designs fundamentally revolves around the question of image segmentation. A variety of algorithms have been employed in the field of image segmentation, including the Canny algorithm, 10 graph-based segmentation, 11 deep learning-based segmentation, 12 active learning for segmentation, 13 depth-first search (DFS) algorithm, 14 and region growing algorithm. 15
The Canny edge detection algorithm has been successfully applied in a number of fields, 16 including computer vision, image processing, and robotics, due to its capability of detecting edges in images with high accuracy 17 and low noise. 18 Its advantages include precise edge localization and reduced sensitivity to noise. 19 Nevertheless, although the Canny algorithm is adept at performing edge detection on various images, its double threshold requires debugging, 20 and its accuracy in the context of detecting intricate contours did not meet the specified requirements.
Graph-based segmentation algorithms have been found to have applications 21 in image and video processing, medical image analysis, and more.22,23 They excel in preserving object boundaries and handling complex scenes. 24 However, they frequently require manual parameter adjustments and occasionally face challenges with highly textured or complex images, making them less effective in situations where pattern designs and other image parameters exhibit variability.
Deep learning-based algorithms have been applied in various fields, 25 including image recognition, natural language processing, and autonomous driving, due to their ability to extract intricate patterns from large datasets. 26 Nonetheless, their effectiveness is limited 27 by the pressing need for large amounts of computational resources, large amounts of meticulously labeled data, and an inherent lack of interpretability. 28 As a result, these algorithms are much less applicable to the task of dividing pattern designs. This method has been found to be unsuitable for the task of pattern design segmentation, primarily because pattern design images are flexible and freestyle, making pattern design less suitable for limited datasets and tasks that require interpretability. Furthermore, the division performance obtained by training on such datasets remains unstable.
Active learning segmentation algorithms 29 have been employed in a number of fields, including medical image analysis, 30 autonomous driving, and natural language processing. The advantages 31 of this approach include a reduction in the costs associated with labeling and an improvement in the performance of the model with a minimal amount of labeled data. However, the methodology is not without its limitations. 32 These include the necessity for expert annotators, the potential for bias in sample selection, and an increased computational burden due to iterative sampling. 33
The DFS algorithm 34 has been widely used as a graph traversal algorithm, 35 where a graph is explored by visiting a vertex and recursively traversing 36 its unvisited neighbors. Its advantages lie in its simplicity and memory efficiency. However, DFS has encountered problems 11 in the past, where it has got stuck in infinite loops within graphs with cycles and did not guarantee the determination of the shortest path. However, this problem could be solved by setting certain internal parameters. DFS initiates exploration from an initial node and systematically delves as deeply as possible along each branch before backtracking. This intrinsic characteristic makes it highly suitable for solving the pattern division problem by incorporating constraint conditions aligned with the segment filling insertion technique.
The region growing algorithm 37 has been widely used in medical image segmentation, remote sensing, and computer vision. 38 One of its most notable advantages 39 is its inherent ability to automatically segment regions of interest based on seed points. This makes it an excellent choice for a range of tasks, including the detection of tumors. However, it is important to note that the algorithm’s sensitivity 40 to seed selection can occasionally lead to inaccuracies in the segmentation results. 41 This is due to the potential for regions of varying intensity to challenge the algorithm’s performance.
This paper introduces an algorithm capable of automatically segmenting patterns, ensuring that the image segmentation area is minimized, while at the same time eliminating any occurrence of floating yarns. Based on the principle of the segment filling insertion technique, the CAD/CAM system of segment filling insertion fabrics to be designed should consider not only the principle of manual weaving of weft fabrics but also the limitations of the filling insertion mechanism and the beating mechanism. The design of an algorithm to automatically generate segment filling insertion fabric weaving information presented a formidable challenge, primarily in terms of the reasonable division of color blocks.
This challenge necessitated accurate definition of color regions within the design in addition to satisfying the inherent constraints of the segment filling insertion technique. As a result, the algorithm had to meet the following essential conditions. First, the minimum number of regions into which the pattern was to be divided had to be determined to ensure the absence of any floating yarns. Second, the assured accuracy in the division of regions had to be guaranteed.
Automatic division method
The core algorithm primarily involved the efficient and accurate identification of contiguous regions of color within the pattern design using a modified DFS algorithm. Subsequently, the longest vertical growth algorithm, based on the constraints of the segment filling insertion technique, was applied to calculate a minimum partition without generating floating lines. The principles of the modified DFS algorithm and the algorithm for the longest vertical growth are explained in the following sections. In this study, the proposed algorithm was validated by both weaving experimental validation and Python coding to ascertain the accuracy and feasibility of its implementation.
Experimental workflow design
According to the characteristics of the segment filling insertion technique, an automated pattern design division process was developed as follows. This process was designed to uphold the relative integrity of the primary features of the division pattern, concurrently ensuring the elimination of floating yarns.
Figure 6 illustrates the complete workflow and the relevant diagrams for the automated pattern design division algorithm. First, the image was converted to gray scale, and then the different color regions were isolated into individual matrices, as shown in Figure 6(b). The pattern design was created as a 7 × 7 matrix of equal scale for illustrative purposes, with different numbers used to represent different colors. A modified DFS algorithm was used to detect contiguous color regions within each matrix. This procedural step effectively partitioned color-connected regions into distinct matrices, laying the groundwork for subsequent subdivisions. The implementation was validated using Python coding, ensuring both accuracy and feasibility. After identifying the contiguous region, it was imperative to determine the presence of an embedded structure within this region, as it had a significant impact on the floating yarn. To maintain the stability of the design characteristics, a longest vertical growth algorithm was developed to provide a continuous color matrix for continuous processing, as shown in Figure 6(b), which depicts the purple matrix. In cases where the weft direction of the color was interrupted by other colors, resulting in noncontinuity, the purple matrix had to be continuously subdivided until it was uninterrupted, which not only ensured the preservation of the design’s primary features to minimize the floating yarn generation but also increased the precision of the obtained process parameters. A flowchart of this process is shown in Figure 6(a).

Flowchart and schematic diagram of automatic pattern design division. (a) Flowchart and (b) Diagram of the compression matrix.
In the following, we provide a comprehensive exposition of the modified DFS algorithm and the longest vertical growth algorithm, elucidating their details in depth.
Detecting contiguous regions with the modified DFS algorithm
The DFS algorithm, a widely used method for graph traversal,
42
is well known for its effectiveness in systematically exploring potential solutions in combinatorial optimization problems. The principle of DFS is as follows. Let
Before the process of detecting contiguous regions, the different colors are divided into different matrices. This approach ensures that the colored components are represented by nonzero values, while the background region is marked as zero. The starting point (

Selected node with eight positions and the stack priorities. (a) Priority of incoming stacks and (b) Priority of outgoing stacks.
The concept of connectivity in contiguous regions, particularly when considering nonzero numbers in eight directions, can be represented as follows. A 2D grid is defined, where each cell
Take the purple area as an example. Figure 8 presents the process of searching for a continuous region, where the purple color represents positions that had already been processed, the dark-gray color represents positions that had been placed in the stack but had not yet been processed, and the white color represents positions that had not been visited. The red color represents positions that were regions that did not require detection.

Connected region search.
The modified algorithm for this section was implemented using Python, with the pseudocode listed in Table 2.
Pseudo-code for the modified DFS algorithm for the search of continuous regions
In this way, accurate identification of the contiguous regions of identical color was accomplished, thereby establishing the foundation for the subsequent subdivision of the finest regions. This method, characterized by its precision, established a robust foundation for the upcoming division processes. The identification of same-colored regions, performed with the highest precision, positioned the system for the upcoming partitioning of the smallest regions. The approach taken, after successfully identifying the connected regions, set the stage for the subsequent stages of the division, ensuring a systematic and methodical progression in the analysis of visual data.
Longest vertical growth algorithm
A logical algorithm called the “longest vertical growth algorithm” was proposed after the contiguous regions were calculated. The designed division method ensured that no floating yarn was created when each division area was assigned a shuttle. Figure 9 shows a relatively simple example of a pattern design form in which the primary vertical line for each region is accurately identified and then the corresponding region determined.

Minimum region division. (a) Purple contiguous region and (b) Contiguous region of the same color.
The pattern design was divided into distinct colored regions, and the contiguous regions were completed. In the process of identifying the longest continuous vertical line of region, the underlying principle was to identify the longest continuous straight line. Within the matrix, regions of interest were represented by nonzero values, which required the identification of the longest continuous nonzero line segment. The vertical line identified in this way was then used as a reference baseline for the horizontal exploration of continuous color regions, thereby facilitating the detection of the required subdivided region.
In the preceding step, the input matrix
The first and last two points of
Going horizontally to the left and right from
The coordinates of the two points of the branch baseline were obtained from the last line above as
The first and last two points of
Going horizontally to the left and right from
The above analysis identified n branches, denoted as
The elements associated with these regions were then extracted from the original matrix. The algorithm was terminated when all nonzero positions in the matrix had been processed. Finally, the n-minimal region was obtained by the above method:
In the case of a more complex pattern design, as shown in Figure 10, where the shape of the pattern showed a remarkable degree of flexibility and variability, it was observed that the longest identified main vertical line did not necessarily include the entirety of the actual primary region. To further refine the main region, a systematic search was made for branching vertical lines. Specifically, by traversing from the bottom to the top of the main region to its last line, the existence of any connected pixel points was detected in the line directly above the last line of the main region. If there was no such connection, it indicated that there were no branching regions to be included in the main region. Conversely, if a connection was found, the search for the longest branching vertical line within this region continued. Once this was identified, this line was marked as the center for subsequent exploration in the direction of this vertical line. A systematic search was made for contiguous points in the horizontal direction and combined the discovered branch region with the main region to promote the growth of a branch, as shown in Figure 10(b). After the detection of three branches, the division of the minimum region was finally completed.

Longest vertical growth division algorithm. (a) Flowchart of longest vertical growth division algorithm and (b) Corresponding pattern design processing.
The longest vertical growth division algorithm, as presented here, is proposed to enable professional and accurate division of pattern designs with remarkable efficiency. This algorithm uniquely determines the segment filling insertion technique, ensuring a high degree of accuracy in the division.
Experimental phase and evaluation
In the experimental phase of this investigation, the focus was on validating the effectiveness of the proposed optimized partitioning algorithm in segmenting continuous regions within pattern designs. To achieve this goal, a set of representative uncomplicated pattern designs was prepared for empirical analysis, which facilitated systematic evaluation of the algorithm’s performance and effectiveness. The primary objective of this study was to analyze and confirm the method of dividing the pattern into the minimal regions that could have been created without generating floating yarns.
Comparative experimental verification of the practicality of the algorithm
First, the effectiveness of the vertical growth division algorithm was demonstrated through comparative experiments. These experiments were done on an automatic segment filling insertion dobby loom with the weaving parameters listed in Table 3.
Parameters of weaving
The existing color-separation algorithms in jacquard CAD systems are only capable of dividing different colors, as presented in Table 4. As demonstrated in diagram 1-1, the previously mentioned algorithm is also used for the division of pattern design. As illustrated in diagram 1-2, by comparing different divisions of the same pattern, it can be seen that fabrics without divisions produce many floating yarns, while fabrics with divisions produced by weaving have a good appearance, as shown in Figure 11.
Automatic division results

Fabrics with a nondivision scheme and a division scheme. (a) Front of fabric 1-1. (b) Back of fabric 1-1. (c) Front of fabric 1-2 and (d) Back of fabric 1-2.
Weaving verification after pattern division
In this section, two different patterns were selected to be divided before weaving to examine the feasibility and applicability of the algorithm under different patterns. The two selected patterns are represented by a bitmap file with a resolution of 100 × 100 pixels, as shown in Figure 12.

Pattern designs and fabrics. (a) Pattern design 1. (b) Front of the fabric 1. (c) Back of fabric 1. (d) Pattern design 2. (e) Front of fabric 2 and (f) Back of fabric 2.
It should be noted that the experiments described used fabric that was 15 cm wide. In the actual design, greater flexibility is permitted with regard to the size of the fabric.
Division evaluation
Pattern designs ranging from simple to complex were selected, as presented in Table 5. These designs were selected because they were considered representative in terms of complexity and continuous region characteristics. For example, patterns 1 and 2 had simple geometric shapes, patterns 3 and 4 had embedded structures of different colors, and pattern 5 had complex geometric shapes. Please refer to Table 6 for the experimental results of other pattern designs that combined complex geometric shapes with embedded structures. These patterns were selected as a representation of these different characteristics.
Automatic division results for simple geometric pattern designs
Experimental results of other pattern designs that combined complex geometric shapes with embedded structures
The results obtained by automatic division were found to be consistent with those obtained by manual division, indicating that the proposed algorithm was feasible (Table 7). The use of algorithms for automated division took into account extremely detailed considerations, while at the same time guaranteeing the assured accuracy of the results.
Automatic division results
By comprehensive analysis of experimental and algorithmic performance under different conditions, the objective of this study was to propose an improved and systematic optimization approach in the field of pattern design. This contribution has the potential to provide support and valuable guidance for pattern design in industrial manufacturing.
Results
The results of this study can be summarized as follows. Initially, a comprehensive analysis of the CAD/CAM process for segment filling insertion fabrics was conducted, including the integration of the segment filling insertion technique. Then, an algorithm for automatic division of pattern designs was proposed.
Throughout the experimental process, the proposed modified DFS algorithm and the longest vertical growth algorithm on individual pattern designs were implemented, and the resulting division results were closely observed. Our primary focus was to evaluate the algorithms’ ability to accurately partition contiguous regions while adhering to specified constraints. In order to ascertain the effectiveness and accuracy of these algorithms, a comparative analysis was conducted between the existing jacquard CAD system’s color-division methods and our color-division method based on the segment filling insertion technique. A comparison was made between the experimental results and the predicted contiguous regions. This approach enabled an effective evaluation of the accuracy and reliability of the algorithms.
Additionally, traditional designs often rely heavily on empirical knowledge and iterative experimentation, lacking a systematic and quantifiable optimization technique. The experimental validation demonstrated that the algorithms can effectively determine the optimal division of segment filling insertion pattern designs, thereby ensuring the high-quality production of fabrics. In contrast, the modified DFS algorithm and the longest vertical growth algorithm rely on mathematical modeling to derive improved design solutions for pattern design within given constraints. The presentation of empirical results provides a clear visual illustration. In the context of pattern design, the superior optimization capabilities of the modified DFS algorithm and the longest vertical growth algorithm are demonstrated.
Conclusions
The modified DFS algorithm and the longest vertical growth algorithm offer compelling advantages for pattern design division such as improved computational accuracy. This approach not only improves the accuracy of the division but also eliminates the need for manual processing. It was possible to achieve high-quality division results for the contiguous region of the pattern design by following the sequence of processing steps described previously. It was also verified by weaving experiments. The algorithm can be extremely computationally intensive, especially for large images. Balancing accuracy and efficiency is a constant concern when using this algorithm. This study was highly demanding in terms of accuracy, resulting in a time-consuming calculation process.
In summary, the process of pattern design transformation has been redefined and designed meticulously according to the design principle of the segment filling insertion technique. This has enabled digital designing to be achieved through the implementation of a new algorithmic approach. The primary purpose of this study was to introduce an algorithm that optimized the division of different regions, thus representing a key step in the automation of pattern design to pattern grid within a CAD/CAM system for segment filling insertion fabrics. In addition, this effort also provided critical support for the shuttle arrangement setup within the subsequent CAD/CAM system, particularly with regard to the automatic generation of pattern information graphics. This fundamental work was essential in establishing a theoretical framework for subsequent automation research. The algorithm presented in this paper serves as a crucial component within the core of the segment filling insertion CAD system. It provides fundamental support for subsequent processes, including the acquisition and calculation of grabbing parameters, the computation of jacquard opening information, and the generation of pattern information graphics.
For future research, the algorithms could be improved to handle more complex patterns and larger datasets. By introducing advanced image processing techniques and machine learning algorithms for comparison, the algorithm performance could be improved. Exploring the challenges of integrating algorithm scalability and other parameters into real production environments, considering distributed computing and real-time data processing methods, validating algorithms in real production environments, and collecting data and performing performance evaluations are all worthy of further investigation.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
This research was supported by ‘China Scholarship Council’ and ‘Young Scientists Fund of the National Natural Science Foundation of China’ (Grant No.: 71704021).
