A 3D Simulation Method for Wool Knitted Fabrics Based on Rotating Strip Slice Model

By defining the central axis path using a rotating strip slice model and NURBS curves, and combining view matrix and transparency optimization techniques, the problems of viewpoint dependence and low computational efficiency of yarn models are solved, realizing multi-view high-realism simulation of knitted fabrics, and reducing costs and technical barriers.

CN121561997BActive Publication Date: 2026-04-03CHANGSHU INSTITUTE OF TECHNOLOGY
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-22
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing yarn models suffer from distorted simulation results under multi-view observation, low computational efficiency, and high cost for high-precision modeling, making it difficult to achieve comprehensive and highly realistic simulation of knitted yarns.

Method used

A rotational strip slice model is adopted, the central axis path is defined by NURBS curves, and the rotation and texture rendering of the strip slices are realized by combining the view matrix. Alpha testing and multisampling coverage are used to optimize transparency processing, reduce computational load and improve the realism of simulation.

Benefits of technology

It enables real-time interactive simulation of knitted fabrics from multiple perspectives with high realism under ordinary computing resources, supporting all-round, distortion-free observation of yarn texture and hair details, thus reducing technical barriers and costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121561997B_ABST
    Figure CN121561997B_ABST
Patent Text Reader

Abstract

This paper presents a 3D simulation method for wool-like knitted fabrics based on a rotating strip slice model, belonging to the fields of computer graphics and computer-aided design technology in the textile industry. Specifically, it relates to a method and system for 3D modeling and real-time rendering of knitted fabrics based on a rotating strip slice model, achieving high-fidelity simulation of the knitted fabric and its yarn hair details from all angles. This method solves the core problems of existing technologies, such as limited perspective in simulation models and the difficulty in balancing realistic details with computational efficiency. The method includes generating a rotating strip slice model on each central axis, composed of multiple strip slices sequentially connected along each central axis, based on the sampling points. This model serves as the geometric model of the knitted fabric. This 3D simulation method for wool-like knitted fabrics based on the rotating strip slice model is particularly suitable for applications in the textile industry, such as computer-aided design, virtual sample development, e-commerce display, and education and training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer graphics and computer-aided design technology in the textile industry, and in particular to a method and system for three-dimensional modeling and real-time rendering of knitted fabrics based on a rotating strip slice model, so as to achieve a high-fidelity simulation of the details of knitted fabrics and their yarns and hairs. Background Technology

[0002] Knitted fabrics, due to their unique loop structure, exhibit superior flexibility, elasticity, and breathability compared to woven fabrics. These characteristics place higher demands on the realism and efficiency of simulation technology. High-precision yarn models are crucial for accurately reproducing the visual characteristics and physical behavior of knitted fabrics. Especially in weft-knitted fabric simulation, it is necessary to accurately simulate various stitches such as plain knit, tuck, float, and loop transfer. The core of this lies in establishing the connection relationship between the needle arc and the sinker arc within the loop, and expressing the topological structure between loops formed by continuous winding of the same yarn. Furthermore, since most weft-knitted yarns are short-fiber yarns, how to realistically reproduce the yarn twist and three-dimensional hairiness details in simulation has become one of the core challenges in improving simulation realism. Therefore, developing a simulation model that can realistically present yarn hairiness from multiple perspectives while meeting the needs of rapid response and iteration in industrial design is essential for improving the design efficiency and market competitiveness of knitted products.

[0003] To address these challenges, existing research has mainly developed the following representative models: tubular models, strip models, and trough models.

[0004] Tubular model and its limitations:

[0005] Traditional tubular models construct yarns using 3D solid modeling, offering the advantage of multi-angle observation in 3D space and providing a basic structural representation capability. However, this model suffers from significant drawbacks: its high computational complexity leads to slow simulation speeds, making it difficult to reproduce the complex fuzzy details of the yarn surface while maintaining real-time performance. Although some studies have attempted to add fuzzy structures to the tubular model, the simulation results still fall short of the physical morphology of real yarns, failing to meet the demands for highly realistic simulations.

[0006] Technical improvements and legacy issues of the strip model:

[0007] To overcome the computational bottleneck of tubular models, a ribbon yarn model was proposed. This model simplifies the solid tubular structure into ribbon-like patches while maintaining the three-dimensional spatial structure, thus significantly reducing the computational load and accelerating model construction and rendering. The ribbon model effectively reproduces the visual effects of the yarn core (blue part) and hairiness (green part) from a frontal viewpoint. However, its drawback lies in the limited viewing angle. When the viewing angle changes, such as from the left or above, the ribbon structure is compressed due to its geometric properties, resulting in yarn shape distortion and preventing a fully immersive and realistic observation.

[0008] Further optimization and unresolved issues of the trough model:

[0009] The grooved model represents a significant improvement over the strip model, enhancing realism by introducing interactive overlay functionality based on feather texture. By creating groove-like structures where some feathers protrude (purple areas) and overlap with the yarn core (green areas), the grooved model simulates the occlusion and coverage relationships between feathers to some extent, improving detail. However, the grooved model still fails to fundamentally solve the perspective dependency problem. In non-frontal perspectives (such as side and top views), the grooved model still exhibits visual compression and distortion, lacking a sense of depth, thus limiting its application in comprehensive observation and analysis.

[0010] In summary, existing yarn models have significant limitations in balancing simulation realism and computational efficiency:

[0011] Limited display effects: Whether it's a strip-shaped or groove-shaped model, the rendering effect is highly dependent on a specific viewing angle, and it cannot support multi-view, all-round lossless observation. The geometric compression caused by the change of viewing angle makes it difficult for the model to realistically reflect the three-dimensional structure of knitted fabrics (such as the effect of three-dimensional fur).

[0012] Realism and efficiency are difficult to balance: tubular models have a high computational load, low efficiency, and slow simulation speed; while strip and groove models, which have higher computational efficiency, still lack realism in simulating microscopic details such as hairiness and cannot accurately capture the true physical form of yarn.

[0013] Technical barriers and cost issues: Some existing technologies that attempt to improve performance through more accurate modeling or stronger computing power are often accompanied by high hardware costs and algorithmic complexity, raising the barrier to application of the technology.

[0014] Therefore, there is an urgent need in this field for a new technical solution that can achieve multi-view, high-fidelity simulation of knitted yarn models while maintaining high computational efficiency, especially for the accurate reproduction of three-dimensional feather details. Summary of the Invention

[0015] This invention proposes a three-dimensional simulation method for wool knitted fabrics based on a rotating strip slice model, which solves the core problems of limited perspective of existing simulation models and difficulty in balancing realistic details and computational efficiency.

[0016] Specifically, the existing technology mainly suffers from the following interrelated technical defects:

[0017] Multi-view distortion problem: Existing ribbon and groove yarn models have a strong viewpoint dependence. When the viewing angle deviates from the front of the model, its geometry will show obvious compression deformation, resulting in serious distortion of simulation results from angles such as the left view and the top view, making it impossible to achieve a realistic three-dimensional representation of the knitted fabric from all directions.

[0018] The contradiction between high realism and high efficiency: Traditional tubular models can maintain three-dimensional structures, but the computational load is huge and difficult to use. On the other hand, strip and groove models, which have higher computational efficiency, are significantly insufficient in simulating the realism of micro-details such as yarn hairiness. They cannot accurately simulate the twist and three-dimensional hairiness of short fiber yarns, which limits their application in high-end textile design and analysis.

[0019] The high barrier to entry for existing solutions: Some technical approaches that attempt to improve performance by increasing model complexity or improving hardware computing power are difficult to be widely applied and promoted in the field of industrial design due to their high cost and algorithm complexity.

[0020] In summary, the present invention aims to overcome the above-mentioned bottlenecks and provide a new technical solution that can realize multi-view, highly realistic and real-time interactive simulation of knitted fabrics under ordinary computing resources.

[0021] The model construction method for three-dimensional simulation of knitted fabrics according to the present invention includes the following steps:

[0022] Knitted fabric structure division steps: Based on the knitting pattern structure, divide the knitted fabric into one or more repeatable yarn segment structures;

[0023] Central axis definition steps: Based on the central axis path of a repeatable yarn segment structure of the knitted fabric, define the central axis of the repeatable yarn segment structure; the central axis is represented by a NURBS curve;

[0024] Overall path definition steps: If the knitted fabric is divided into only one repeatable yarn segment structure, then the central axis of the repeatable yarn segment structure is the overall NURBS curve of the knitted fabric.

[0025] If a knitted fabric is divided into multiple repeatable yarn segment structures, then the central axes of the multiple repeatable yarn segment structures are arranged and combined according to the knitting weave structure of the fabric to obtain the overall NURBS curve of the knitted fabric.

[0026] Sampling point determination steps: Determine a series of sampling points on the overall NURBS curve of the knitted fabric; the sampling points include the start and end points of each central axis; the sampling points are configured as follows:

[0027] If each central axis is stretched into a straight line segment, the spacing between each sampling point is equal;

[0028] Geometric model generation steps: Based on the sampling points, generate a rotating strip-shaped slice model on each central axis, which is composed of multiple strip-shaped slices connected sequentially along each central axis, as the geometric model of the knitted fabric;

[0029] On each central axis:

[0030] Each of the strip slices is a quadrilateral with its top and bottom sides intersecting the central axis. The intersection point is the sampling point and the midpoint of the top and bottom sides. Two adjacent strip slices share the same side.

[0031] Each of the said strip slices can rotate about the central axis.

[0032] Furthermore, a preferred embodiment is provided in which the strip slice is generated by introducing an observation vector through a view matrix, so that the strip slice rotates and transforms according to the observation viewpoint to always face the observer.

[0033] Furthermore, a preferred embodiment is provided, wherein the strip slice is generated by introducing the observation vector through a view matrix, using the following method:

[0034] Steps to obtain the view direction vector: Extract the unit view direction vector from the view matrix;

[0035] Steps to calculate the unit tangent vector: Calculate the tangent direction at each sampling point on each central axis, and the unit tangent vector at each sampling point;

[0036] Steps for calculating the unit normal vector: Based on the unit viewing direction vector and the unit tangent vector at each sampling point, calculate the unit normal vector at each sampling point that is perpendicular to the unit tangent vector and points to the side of the viewing direction; the unit normal vector is used to determine the direction of extension of the strip slice width;

[0037] Steps for calculating boundary vertex coordinates: Based on the three-dimensional coordinate vector and unit normal vector of each sampling point, calculate the vertex coordinates of the two sides of the strip slice, thereby defining the shape of the quadrilateral strip slice;

[0038] Each sampling point corresponds to a pair of boundary vertex coordinates; by connecting the boundary vertices of adjacent sampling points in sequence, a continuous strip geometry is generated as a continuous strip slice.

[0039] Furthermore, a preferred embodiment is provided in which the repeatable yarn segment structure is a single yarn loop or is composed of multiple horizontally arranged yarn loops connected sequentially.

[0040] Furthermore, a preferred embodiment is provided in which N strip-shaped slices are arranged sequentially on the central axis of each yarn loop;

[0041] Where N is the number of shards, which is 4 times the number of base shards, and the number of base shards is 6.

[0042] This invention also proposes a three-dimensional simulation method for wool knitted fabrics based on a rotating strip slice model, the method comprising the following steps:

[0043] Model building steps: The geometric model of the knitted fabric is built using the model building method for three-dimensional simulation of knitted fabrics described in any of the above embodiments;

[0044] Yarn texture rendering steps: Use triangular strips to render the yarn texture on the strip-shaped slices of the geometric model of the knitted fabric.

[0045] Furthermore, in a preferred embodiment, the yarn texture rendering step includes the following steps:

[0046] Steps to obtain the central axis and boundary vertices: Obtain the path of each central axis of the geometric model of the knitted fabric; obtain the 3D coordinate vector of each boundary vertex of each strip slice;

[0047] The steps for calculating texture coordinates are as follows: Assign texture coordinates to each boundary vertex so that the 2D texture image is correctly mapped onto the 3D geometry;

[0048] The rendering steps for constructing triangular strips are as follows: Each four adjacent boundary vertices that make up a quadrilateral strip are divided into two triangles by diagonal lines to form a continuous triangular strip; each triangle is rasterized and converted into a set of pixel fragments covering the screen, and the corresponding texture coordinates are calculated by interpolation for each pixel fragment;

[0049] Transparency and edge processing steps: For each pixel fragment, a combination of alpha testing and multisampling coverage is used to perform transparency testing and edge smoothing to obtain the final pixel color with smooth anti-aliased edges and semi-transparent feathering effect, thus completing the yarn texture rendering step.

[0050] Furthermore, a preferred embodiment is provided, wherein the transparency and edge processing steps include the following steps:

[0051] Texture sampling step: Using texture coordinates obtained by pixel fragment interpolation, sample from the yarn texture image to obtain color and transparency values;

[0052] Alpha testing steps: Compare the sampled transparency value with a preset transparency threshold:

[0053] If the sampled transparency value is lower than or equal to the preset transparency threshold, the pixel segment is discarded directly.

[0054] Otherwise, retain this pixel fragment;

[0055] Multisampling coverage conversion step: For the pixel fragments retained in the Alpha test step, their transparency values ​​are mapped to the multisampling sub-pixel coverage, and the average color of multiple sub-pixels is calculated as the final pixel color.

[0056] Furthermore, a preferred embodiment is provided in which the preset threshold for transparency is 0.25.

[0057] The present invention also proposes a three-dimensional simulation model of wool knitted fabric, which is obtained by simulation using the three-dimensional simulation method of wool knitted fabric based on the rotating strip slice model described in any of the above embodiments.

[0058] The 3D simulation method for wool knitted fabrics based on a rotating strip slice model described in this invention achieves significant progress in simulation realism, interactive efficiency, and applicability by integrating multiple innovative technologies. Specific beneficial effects are as follows:

[0059] 1. The model construction method for three-dimensional simulation of knitted fabrics described in this invention constructs a geometric model of a strip-shaped slice that can rotate around a central axis and introduces a view matrix to dynamically determine the observation direction, thereby realizing the real-time following of the viewpoint by the strip-shaped slice. This overcomes the viewpoint dependence of traditional strip-shaped and groove-shaped models and supports all-round, distortion-free observation of the texture and fur details of knitted fabrics.

[0060] 2. The model construction method for 3D simulation of knitted fabrics described in this invention defines the central axis path of the model based on a non-uniform rational B-spline curve and uses the de Boor algorithm for high-precision sampling, ensuring the accuracy and smoothness of the geometric contours of the yarn and fabric models, thus laying a precise geometric foundation for high-realism rendering.

[0061] 3. The three-dimensional simulation method for wool knitted fabrics based on a rotating strip slice model described in this invention employs a transparency processing technique that combines alpha testing with multi-sampling coverage. First, a pixel-level hard cropping is performed to remove transparent areas using an optimized threshold. Then, the remaining pixels are smoothly mapped to sub-pixel coverage. While ensuring rendering efficiency, this method achieves natural gradation and anti-aliasing effects on the edges of the yarn and wool, significantly improving the visual realism of the simulation.

[0062] 4. The three-dimensional simulation method for wool knitted fabrics based on a rotating strip slice model described in this invention optimizes and integrates the complex model building and rendering process by implementing the above technical solution in a high-efficiency three-dimensional rendering engine such as OpenGL. This enables dynamic and real-time display of three-dimensional models of knitted fabrics under ordinary computing resources, significantly reducing the threshold and cost of technology application.

[0063] 5. The three-dimensional simulation method for wool knitted fabrics based on a rotating strip slice model described in this invention provides a scalable construction method from yarn model to complete fabric model and supports the simulation of different weft knitting techniques (such as plain knit and rib knit), providing a universal and efficient solution for textile design, process optimization and product display.

[0064] The three-dimensional simulation method for wool knitted fabrics based on a rotating strip slice model described in this invention is particularly suitable for application scenarios such as computer-aided design, virtual sample development, e-commerce display, and education and training in the textile industry. It can effectively improve design efficiency, reduce physical sampling costs, and accelerate product launch cycles. Attached Figure Description

[0065] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0066] Figure 1 This is a schematic diagram illustrating the construction of a rotating strip-shaped slice model of a coil in one embodiment of the present invention; wherein, Figure 1 (a) represents the model unit; Figure 1 In the middle (b), the model is a rotating strip slice, where the blue marked points are the upper and lower interlacing points of the coil, used to mark the coil ratio and thus construct the NURBS curve path (loop model). Figure 1 (c) shows the model after straightening; Figure 1 In the middle (d), the model's central axis is represented, where the green dots represent sampling points on the central axis; Figure 1(e) is the rotating strip slice model from the original viewpoint, where the viewpoint observes the model from the left. At this time, each strip slice rotates around the central axis toward the left viewpoint. Figure 1 In the middle (f), the model unit changes with the viewpoint, where the viewpoint shifts from the original position of the No. 1 viewpoint camera to the position of the No. 2 viewpoint camera, and the strip slice changes from the original blue slice facing the No. 1 viewpoint camera to the green slice facing the No. 2 viewpoint camera. Figure 1 (g) is the rotating strip slice model from a new perspective, that is, the overall visual effect of the rotating strip slice model when the viewpoint is shifted to the position of the No. 2 viewpoint camera;

[0067] Figure 2 This is a schematic diagram illustrating the construction of a knitted fabric model using the weft-knit stitch in one embodiment of the present invention; wherein, Figure 2 In the middle (a), the loop geometry model of a single coil is shown, where the blue markers are the upper and lower interleaving points of the coil, and the green markers are the control points. Figure 2 In the middle (b), a single-row NURBS curve path is shown, where the coils are arranged horizontally and each coil is directly connected to its left and right adjacent coils (or loops); Figure 2 (c) is a front view of the NURBS curve path of the weft-flat needle tissue method, in which the upper and lower rows of coils are interlocked; Figure 2 The middle (d) view is a side view of the NURBS curve path of the weft-flat needle tissue needling technique; Figure 2 (e) is a front view of the standard geometric model of a knitted fabric using the plain weft stitch. Figure 2 (f) is a side view of the standard geometric model of a knitted fabric with a weft plain knit stitch.

[0068] Figure 3 This is a schematic diagram illustrating the process of generating a strip-shaped slice by introducing an observation vector through a view matrix and the process of texture rendering the strip-shaped slice, as described in one embodiment of the present invention; wherein, Figure 3 (a) shows the NURBS curve path (i.e., the central axis). Figure 3 In (b) and (e), the sampling points are calculated based on the NURBS curve path, and their (unit) tangent vector and (unit) normal vector are calculated. Figure 3 In (c), (f), and (g), the coordinates of the two boundary vertices are obtained based on the unit normal vector of the sampling point, the strip slice is constructed, and the texture coordinates are calculated. The left and right boundary vertices B1 and B2 are obtained through the sampling point B, and finally a strip slice geometry that can follow the viewpoint is formed. Figure 3 In the middle (d) and (h) images, texture rendering is performed using triangular stripes; for example... Figure 3As shown in (c), the cumulative arc length of sampling point D is xd, so the texture coordinates of the left and right boundary vertices of sampling point D are D0(xd, 0) and D1(xd, 1), respectively; the cumulative arc length of sampling point E is xe, so the texture coordinates of the left and right boundary vertices of sampling point E are E0(xe, 0) and E1(xe, 1), respectively; the cumulative arc length of sampling point F is xf, so the texture coordinates of the left and right boundary vertices of sampling point F are F0(xf, 0) and F1(xf, 1), respectively; the distance between sampling points D and E is x1, so the arc length x1 is taken as the difference between xd and xe; similarly, the arc length x2 is taken as the difference between xe and xf; as Figure 3 As shown in (d), the black dashed lines represent the left and right texture coordinates of the sampling points. The boundary points on the upper and lower sides, such as G0, G1, H0, H1, etc., are connected by gray straight lines (diagonal lines) to form continuous triangular strips.

[0069] Figure 4 This is a flowchart illustrating the transparency and edge processing steps in one embodiment of the present invention.

[0070] Figure 5 This is a top view of a traditional strip model with a changing perspective, as shown in one embodiment of the present invention. As can be seen from the figure, directly changing the perspective on the traditional strip model results in shape distortion at the tail of the model.

[0071] Figure 6 In one embodiment of the present invention, a top view of a rotating strip slice model with a changing perspective is provided. Figure 6 Used with Figure 5 A comparison demonstrates that achieving the perspective transformation mechanism on a rotating strip slice model is not a combination of conventional techniques.

[0072] Figure 7 This is a schematic diagram of an Alpha threshold definition experiment in one embodiment of the present invention;

[0073] Figure 8 This is a schematic diagram of a segmentation number determination experiment in one embodiment of the present invention;

[0074] Figure 9 This is a schematic diagram comparing SSIM values ​​under different numbers of fragments in one embodiment of the present invention;

[0075] Figure 10 In one embodiment of the present invention, the simulation result of a rib knit fabric is shown using a three-dimensional simulation method for wool knitted fabrics based on a rotating strip slice model; wherein, Figure 10 (a) shows the texture image used. Figure 10 (b) shows the initial state of the fabric. Figure 10 (c) represents an intermediate state of the fabric's motion. Figure 10 The middle (d) view is the main view of the simulation results. Figure 10 (e) is a top view of the simulation results. Figure 10 (f) is the left view of the simulation results;

[0076] Figure 11 In one embodiment of the present invention, a comparison of the simulation results of the fabric using a three-dimensional simulation method based on a rotating strip slice model, a strip model, and a groove model is shown; wherein, Figure 11 (a) is a top view of the simulation results using the strip model; Figure 11 (b) is the left view of the simulation results using the strip model; Figure 11 (c) is a top view of the simulation results using the trough model; Figure 11 (d) is the left view of the simulation results using the trough model; Figure 11 (e) is a top view of the simulation results of the three-dimensional simulation method for wool knitted fabrics based on the rotating strip slice model; Figure 11 (f) is the left view of the simulation results of the three-dimensional simulation method of wool knitted fabric based on the rotating strip slice model. As can be seen from the figure, compared with the strip model and the groove model, the three-dimensional simulation method of wool knitted fabric based on the rotating strip slice model can fully display the superior details of the fabric and is more realistic. In particular, from the side view and top view of the simulation results of the fabric, the three-dimensional simulation method of wool knitted fabric based on the rotating strip slice model significantly enhances the visual and structural display of the fabric texture.

[0077] Figure 12 In one embodiment of the present invention, a comparison image is provided between the simulation results of the fabric using a three-dimensional simulation method for wool knitted fabrics based on a rotating strip slice model and images of the actual yarn and its corresponding fabric; wherein, Figure 12 (a) is a true texture diagram of the actual yarn; Figure 12 (b) is a texture image obtained from actual yarn for simulation purposes; Figure 12 Image (c) shows three perspective images of the actual yarn and its corresponding fabric; Figure 12 (d) shows three perspective images of the simulation results; as can be seen from the figure, the simulation closely replicates the complex details of the actual yarn and its corresponding fabric, showing the hair details that the strip model and the groove model cannot achieve, and verifying that the simulation method achieves accurate modeling of textiles.

[0078] Figure 13 In one embodiment of the present invention, a schematic diagram illustrates the simulation results of different yarns and their corresponding fabrics using a three-dimensional simulation method for wool knitted fabrics based on a rotating strip slice model; wherein, Figure 13 Images (a), (b), and (c) show the texture images of three different yarns. Figure 13 Figures (d), (e), and (f) show the simulation results for three different yarns and their corresponding fabrics. Figure 13 Images (g), (h), and (i) are magnified images from three perspectives showing the simulation results of three different yarns and their corresponding fabrics. As can be seen from the images, the three-dimensional simulation method can simulate different yarns, demonstrating its versatility and robustness in textile modeling.

[0079] Figure 14 This is a comparison diagram of existing models (tubular, strip-shaped, groove-shaped) and a rotating strip-shaped slice model in one embodiment of the present invention; wherein, Figure 14 The middle (d) is a rotating strip slice model of a coil, with the blue part being the yarn core (corresponding to the central axis) and the green part being the hair (corresponding to the strip slice). Detailed Implementation

[0080] To make the technical solutions and advantages of the present invention clearer, the specific embodiments of the present invention will be described in further detail and completely below with reference to the accompanying drawings. The various embodiments described below are only some preferred embodiments of the present invention, and not all of them; the various embodiments described below are intended to explain the present invention and should not be construed as limiting the present invention; reasonable combinations of the technical features defined in the various embodiments of the present invention, as well as all other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort, are all within the scope of protection of the present invention.

[0081] Implementation Method 1: A model construction method for three-dimensional simulation of knitted fabrics, the method comprising the following steps:

[0082] Knitted fabric structure division steps: Based on the knitting pattern structure, divide the knitted fabric into one or more repeatable yarn segment structures;

[0083] Central axis definition steps: Based on the central axis path of a repeatable yarn segment structure of the knitted fabric, define the central axis of the repeatable yarn segment structure; the central axis is represented by a NURBS curve;

[0084] Overall path definition steps: If the knitted fabric is divided into only one repeatable yarn segment structure, then the central axis of the repeatable yarn segment structure is the overall NURBS curve of the knitted fabric.

[0085] If a knitted fabric is divided into multiple repeatable yarn segment structures, then the central axes of the multiple repeatable yarn segment structures are arranged and combined according to the knitting weave structure of the fabric to obtain the overall NURBS curve of the knitted fabric.

[0086] Sampling point determination steps: Determine a series of sampling points on the overall NURBS curve of the knitted fabric; the sampling points include the start and end points of each central axis; the sampling points are configured as follows:

[0087] If each central axis is stretched into a straight line segment, the spacing between each sampling point is equal;

[0088] Geometric model generation steps: Based on the sampling points, generate a rotating strip-shaped slice model on each central axis, which is composed of multiple strip-shaped slices connected sequentially along each central axis, as the geometric model of the knitted fabric;

[0089] On each central axis:

[0090] Each of the strip slices is a quadrilateral with its top and bottom sides intersecting the central axis. The intersection point is the sampling point and the midpoint of the top and bottom sides. Two adjacent strip slices share the same side.

[0091] Each of the said strip slices can rotate about the central axis.

[0092] In this embodiment, the NURBS curve is a non-uniform rational B-spline curve.

[0093] In this embodiment, the repeatable yarn segment structure is a continuous line segment structure (straight or curved line segment) woven from yarn, such as a yarn loop (or simply a loop) or a row of multiple consecutive loops.

[0094] In this embodiment, the model building method can build either a yarn loop model or a fabric model under complex stitching.

[0095] In this embodiment, the fabric model (fabric model) is constructed based on the yarn loop model.

[0096] In this embodiment, the fabric model constructed by the model construction method can accurately reproduce the texture and structural features of the fabric in three-dimensional space.

[0097] In this embodiment, the process of constructing a yarn loop model is as follows:

[0098] Knitted fabric structure classification: From the perspective of needlework structure, a yarn loop has only one repeatable yarn segment structure, that is, a loop.

[0099] Begin building a model of the coil, or yarn.

[0100] To construct a yarn model that allows for comprehensive observation of simulation details, a rotated strip slice model was used as the yarn model.

[0101] The rotating strip slice model consists of a central axis and strip slices.

[0102] The position of a strip slice (or strip slice structure, rotating strip slice, rotating strip slice geometry) is determined by adjacent sampling points on the central axis.

[0103] A structure that rotates a strip-shaped slice around its central axis is called a rotating strip-shaped slice structure unit, strip-shaped slice unit, or model unit. The strip-shaped slice unit rotates around a central axis, which ensures that the strip-shaped slice unit can always form a complete strip without breaking due to rotation.

[0104] If the entire coil is straightened, and the total length of its central axis path after straightening is L, and the number of segments is N, then the height of the strip slice is L / N.

[0105] Wherein, the number of slices N represents the total number of strip-shaped slices on the straightened coil (yarn model).

[0106] Each strip slice is a quadrilateral, with its top and bottom sides intersecting the central axis. The intersection point is the sampling point on the central axis, and this intersection point is also the midpoint of the top and bottom sides. Let r be the distance from the vertices of the top and bottom sides of the strip slice to their respective midpoints, then the width of the strip slice is 2r.

[0107] The sampling points on the central axis include the start and end points of the central axis. If the number of sampling points on the central axis is n, then the number of segments is equal to the number of sampling points minus one, i.e., N = n - 1.

[0108] The central axis is based on a non-uniform rational b-spline (NURBS) curve in 3D space as the path, referred to as a NURBS path or NURBS curve. The upper and lower interlacing points of the coils are used to identify the coil proportions, thereby constructing the NURBS curve path.

[0109] The NURBS path is generated based on a loop model (or loop geometry model) of the interleaving points and is described by piecewise rational polynomial vector functions:

[0110]

[0111] In the formula:

[0112]

[0113] Among them, weight factors With control points One-to-one correspondence, Let p be the normalized B-spline basis function, and let the node vectors be... The calculation results determine this. More specifically:

[0114] NURBS curve final path : is a vector function, given parameters It outputs the three-dimensional coordinates of a point on the curve.

[0115] Curve parameters : Independent variable, which varies within a certain interval and is used to traverse the entire curve.

[0116] Control Points : is a point in space that defines the shape of the curve. i is its index. If there are m control points, then n = m. 1. Control point indices i range from 0 to n.

[0117] Regarding control points: In Non-Uniform Rational B-Spline (NURBS) curves, control points are the most crucial elements defining the curve's shape. They can be imagined as a series of anchor points with gravitational pull, which, through precise mathematical rules, collectively "pull" and shape the final smooth curve. Control points determine the curve's direction, curvature, and shape. Each control point has its own coordinates and weights, influencing the curve's path through algorithms. For example, control points can be used to fit the central axis path of a coil to a NURBS curve.

[0118] Weight factors : with control points One-to-one correspondence. The larger the curve is, the more it is pulled towards The stronger the "gravity".

[0119] p-order normalized B-spline basis functions :yes The scalar function determines each control point. In parameters The weight of influence at each location.

[0120] The degree p of the B-spline basis function determines the smoothness of the curve and the range of local support.

[0121] Node vector A non-decreasing sequence of real numbers. It acts like a "ruler," dividing the parameter domain. Node vector. The value of the i-th node in .

[0122] The sampling points on the central axis are calculated using the deBoor algorithm:

[0123] The deBoor algorithm is the core algorithm for calculating the position of any parameter point on a NURBS curve.

[0124] The deBoor algorithm is used to sample 3D curve coordinate points along the NURBS curve with a specified precision. Its core iterative formula is:

[0125]

[0126]

[0127] Wherein, the NURBS curve is a cubic B-spline curve, p is 3; k is the node interval index where parameter t is located; r is the recursion level; This represents the number of nodes in the coil. The number of control points (or control vertices) is gradually reduced through linear interpolation to ultimately obtain the sampling points on the curve. More specifically:

[0128] The degree *p* determines the smoothness of the curve segment and the influence range of the local control points. Its function is that for a B-spline curve of degree *p*, the position and shape of the curve segment containing any parameter point *t* are determined by only *p+1* control points. In this example (*p*=3), each curve segment is determined by 4 control points.

[0129] The recursion level r starts from 1 and goes up to p (3 in this example). With each additional level, the number of points involved in the interpolation decreases by one, allowing for more precise control over the curve shape.

[0130] The iterative index i under the current recursive level r: runs in a nested loop whose range is i changing in directions from (r, r-1, ..., kp) etc. (depending on the implementation), with the aim of updating a set of intermediate control points.

[0131] Node vector The node sequence defines the key scale of the parameter space. It is an ordered sequence of values. The node sequence divides the entire parameter domain into multiple intervals. The distribution of the nodes (whether it is uniform or not) determines whether the curve is "uniform" or "non-uniform".

[0132] Parameter t: The parameter to calculate the position of the curve point. It is a specific value within the parameter range defined by the node sequence. Function: Just like entering an address when using GPS navigation, t is the "address" to find the curve's position. The algorithm will calculate the corresponding three-dimensional coordinates (x, y, z) on the curve based on this t value.

[0133] Node interval index k: The index (subscript) of the node interval into which parameter t falls. Purpose: Location. By finding k, the algorithm knows which segment of the curve the point to be calculated is located on, thus selecting only p+1 related control points for calculation, achieving "locality".

[0134] Control Points: These are the control points. In the de Boor algorithm, they are the initial values ​​for iterative calculations (when the recursion level r=0). These are the control points. They are the "gravitational source" that shapes the curve. The algorithm eventually "converges" to a point on the curve by continuously performing linear interpolation on these control points (and their iterative intermediate points).

[0135] Interpolation ratio due to : is a scaling factor between 0 and 1 that determines how two points should be mixed in a linear interpolation.

[0136] Formula (2) essentially performs a local parameterization: it maps the global parameter t to the small line segment currently being processed, defined by the node interval [knot[k-p+i], knot[k+1+ir]], and calculates the relative position of t on this small line segment; this relative position is the proportion. .

[0137] Formula (3) is a standard linear interpolation formula: it is based on the proportion Mixing point and This creates a new point, which will overwrite the original one. Alternatively, it can be stored in a new array as input for the next level of recursion.

[0138] The strip-shaped slicing unit rotates around the central axis, which ensures that the strip-shaped slicing unit can be assembled into a complete strip at any time without breaking due to rotation.

[0139] It should be noted that the strip-shaped slice unit can rotate around the central axis. Based on this, a rotated strip-shaped slice model that follows the change of viewpoint can be constructed, that is, viewpoint-dependent geometric transformation can be achieved:

[0140] The yarn structure of the knitted fabric (loop) can be observed from any angle, while ensuring that the ribbon-like slices of the yarn always face the observer, creating the effect of tubular yarn with realistic hair.

[0141] For example, when viewing the model from the left, each strip of slices rotates around the central axis toward the left viewpoint. Or, if the viewpoint shifts from the original position of camera 1 to camera 2, the strip of slices rotates around the central axis to follow the camera; after rotation, the strip of slices changes from blue slices facing camera 1 to green slices facing camera 2.

[0142] By employing a viewpoint-dependent geometric transformation mechanism, the model is ensured to follow viewpoint changes at any time, while also taking into account the rendering realism and speed of two-dimensional ribbon yarns, and achieving the visual effect of observing three-dimensional tubular yarns from multiple perspectives.

[0143] In this embodiment, the process of constructing a knitted fabric model is as follows:

[0144] The characteristics of knitted fabrics are mainly reflected in their unique manufacturing process and structural features. The most fundamental characteristic is that knitted fabrics are composed of a series of loops. These loops interweave to form the fabric, giving knitted fabrics unique physical and visual properties.

[0145] Assuming the knitted fabric uses a plain weft knit stitch, based on the corresponding stitch structure of this plain weft knit stitch, the knitted fabric can be divided as follows:

[0146] Knitted fabrics consist of multiple rows (or rows) of repeatable yarn segments. Each row of repeatable yarn segments is composed of multiple horizontally arranged loops connected sequentially, forming a continuous, meandering curve that does not intersect itself. Each loop can be called a loop, meaning that in each row of repeatable yarn segments, each loop is directly connected to its left and right adjacent loops without interruption.

[0147] For adjacent upper and lower rows of repeatable yarn segments, the loops (coils) of the upper and lower rows are interlocked.

[0148] Based on the repeatable yarn segment structure of each row, a single-row NURBS curve path is constructed to obtain the central axis of the single row. The central axes of the single rows of multiple repeatable yarn segment structures are arranged and combined according to the knitting weave structure (interlocking of the upper and lower rows) to obtain all the central axes of the entire knitted fabric, forming the overall NURBS curve path. The sampling points on the overall NURBS curve path are calculated to determine the arrangement position of the strip slices, and a rotating strip slice model of the knitted fabric is established.

[0149] More specifically:

[0150] The central axis path of each coil in each row of repeatable yarn segment structure is modeled using a third-order NURBS curve, each third-order NURBS curve being defined by nine control points and generated based on a loop model (of the interlacing points).

[0151] In each row of repeatable yarn segment structures, since the last control point of each loop model coincides with the first control point of the next loop model, each loop model actually consists of 8 control points.

[0152] The loop models of multiple coils are connected together in sequence to form a single row NURBS curve path (or single line NURBS curve path) of repeatable yarn segment structure, which is the central axis of the repeatable yarn segment structure.

[0153] According to the weft-knitted fabric structure, the central axis of multiple rows of repeatable yarn segments is arranged and combined to obtain the overall NURBS curve path of the knitted fabric, or the NURBS curve path of the weft-knitted fabric structure.

[0154] Based on the NURBS curve path of the weft-knitting stitch, the sampling points are calculated, the arrangement position of the rotating strip-shaped slice structural units is determined, and the rotating strip-shaped slice model of the weft-knitting stitch is established, which is the final standard geometric model of the knitted fabric.

[0155] In this embodiment, a rotating strip-shaped slice model was constructed to enable comprehensive observation of the simulation details of the yarn model. The main methods for constructing the model include: generating sampling points based on NURBS curve paths, rotating the strip-shaped slice units around the central axis, and using a viewpoint-dependent mechanism (or viewpoint-following mechanism).

[0156] To apply view-following mechanisms in the field of knitted fabrics, special processing of the yarn model is necessary; otherwise, new technical problems will arise. For example, directly performing view transformations on a traditional strip model can lead to issues such as distortion of the strip yarn shape. This is because traditional strip models are rendered on the entire NURBS strip model, which cannot properly display all the details of the yarn when implementing view-dependent geometric transformations, and cannot adapt to the special characteristics of yarn hairiness.

[0157] In contrast, by constructing a rotating strip-shaped slice model, special processing such as segmenting and rendering the strip-shaped yarn (such as coil) is performed. That is, multiple strip-shaped slices that can rotate around the central axis are divided to achieve view-dependent geometric transformation. At the same time, through a series of experiments, the optimal number of slices and the optimal yarn texture transparency are determined, balancing realism and simulation speed, and better showcasing details such as yarn hairiness.

[0158] Implementation Method 2: The strip slice is generated by introducing the observation vector through the view matrix, so that the strip slice rotates and transforms with the observation viewpoint to always face the observer.

[0159] In this embodiment, a strip slice is generated by introducing an observation vector through a view matrix. The strip slice can rotate and transform according to the observation viewpoint, that is, to realize viewpoint-dependent geometric transformation: ensuring that the model can follow the viewpoint change at any time, while taking into account the rendering realism and speed of the two-dimensional strip yarn, and realizing the visual effect of observing the three-dimensional tubular yarn from multiple perspectives.

[0160] Implementation Method 3: The strip slice is generated by introducing the observation vector through the view matrix, using the following method:

[0161] Steps to obtain the view direction vector: Extract the unit view direction vector from the view matrix;

[0162] Steps to calculate the unit tangent vector: Calculate the tangent direction at each sampling point on each central axis, and the unit tangent vector at each sampling point;

[0163] Steps for calculating the unit normal vector: Based on the unit viewing direction vector and the unit tangent vector at each sampling point, calculate the unit normal vector at each sampling point that is perpendicular to the unit tangent vector and points to the side of the viewing direction; the unit normal vector is used to determine the direction of extension of the strip slice width;

[0164] Steps for calculating boundary vertex coordinates: Based on the three-dimensional coordinate vector and unit normal vector of each sampling point, calculate the vertex coordinates of the two sides of the strip slice, thereby defining the shape of the quadrilateral strip slice;

[0165] Each sampling point corresponds to a pair of boundary vertex coordinates; by connecting the boundary vertices of adjacent sampling points in sequence, a continuous strip geometry is generated as a continuous strip slice.

[0166] In this embodiment, the step of obtaining the observation direction vector is as follows:

[0167] Extract the unit vector of the current viewing direction from the view matrix of a graphics rendering engine (such as OpenGL).

[0168] Input: View matrix V.

[0169] Processing and Output: The unit observation direction vector is It is obtained by normalizing the z-axis component of the view matrix.

[0170] It should be noted that the view matrix is ​​related to the viewing direction:

[0171] The view matrix is ​​a core concept in 3D graphics. It introduces the observer into 3D space and defines its position and orientation in 3D space.

[0172] The view matrix transforms points in 3D space from the world coordinate system to the view coordinate system with the viewing direction as the z-axis, so that all geometry is positioned relative to the observer.

[0173] OpenGL's 4×4 model-view matrix is ​​a homogeneous coordinate transformation matrix:

[0174]

[0175] Take the first row as an example. The rotation information and translation information are as follows: Xx represents the original x-axis. How much is the x-axis component of the rotated coordinate system in the viewing coordinate system? Yx represents the original y-axis. How much is the x-axis component of the rotated coordinate system in the viewing coordinate system? Zx represents the original z-axis. How much is the x-axis component of the rotated coordinate system in the viewing coordinate system? Tx represents how much the viewing coordinate system has moved in the original x direction. The same applies to the other two rows. The homogeneous coordinates are added to maintain the integrity of the matrix.

[0176] In a three-dimensional graphics coordinate system, the z-axis usually points to the observer. Therefore, by extracting the z-axis, the viewing direction can be known, that is, [Xz, Yz, Zz].

[0177] Finally, a new coordinate system with the observer as the origin is established. All geometric body coordinates are transformed from the original three-dimensional coordinate system to the viewing coordinate system, and the relative relationship between geometric bodies is ensured to remain unchanged. The coordinate transformation formula is:

[0178]

[0179] Among them, is the three-dimensional coordinate of the sampling point; is the three-dimensional coordinate point of the observer; is the view matrix.

[0180] Based on the NURBS curve (central axis) and the sampling points calculated on the central axis using the deBoor algorithm, a strip slice (or strip geometric body) that follows the perspective transformation needs to introduce the viewing vector [Xz, Yz, Zz] into the calculation process.

[0181] In this embodiment, the steps for calculating the unit tangent vector:

[0182] Calculate the tangent direction at each sampling point on each central axis (NURBS curve); here, P(s) is uniformly used to represent the three-dimensional coordinate vector of the th sampling point.

[0183] Input: The coordinates of a series of sampling points P(0), P(1), …, P(n).

[0184] Processing and formula:

[0185] For the internal sampling points of the central axis (0 < s < n, that is, the sampling points on a central axis except the starting point and the ending point), the central difference method is used:

[0186]

[0187] For the starting point sampling point of the central axis (s = 0), the forward difference method is used; for the ending point sampling point of the central axis (s = n), the backward difference method is used:

[0188]

[0189] Output: The Unit tangent vector at each sampling point .

[0190] in, and Respectively represent the first The three-dimensional coordinate vectors of the (s+1)th and (s-1)th adjacent sampling points; It represents the magnitude of the vector.

[0191] In this embodiment, the steps for calculating the unit normal vector are as follows:

[0192] Calculate the normal vector at each sampling point that is perpendicular to the tangent vector and points to the observer's "side". This vector determines the direction of the strip's width.

[0193] Input: unit tangent vector Unit observation direction vector .

[0194] Processing and Formula: The unit normal vector is obtained through vector cross product operation (cross product method) and normalization.

[0195]

[0196] Output: The Unit normal vector at each sampling point .

[0197] in, This represents the vector cross product operation.

[0198] The unit normal vector is used as the basis for the subsequent generation of boundary vertices of the strip geometry (strip slice) and the construction of triangle strips.

[0199] In this embodiment, the steps for calculating the boundary vertex coordinates are as follows:

[0200] Based on the three-dimensional coordinate vector and (unit) normal vector of the sampling point, the vertex coordinates of the two sides of the strip slice are calculated, thereby defining the shape of the quadrilateral strip slice.

[0201] Input: 3D coordinate vector P(s) of the sampling point, unit normal vector Given the width of the strip slice .

[0202] Processing and Formula: Offset by half a width in both the positive and negative directions of the normal vector to obtain the left and right boundary vertices:

[0203]

[0204] Where L(s) is the th The three-dimensional coordinate vector of the left boundary vertex of the sampling point; R(s) is the three-dimensional coordinate vector of the left boundary vertex of the sampling point; The three-dimensional coordinate vector of the right boundary vertex of each sampling point.

[0205] Left boundary vertex: L(s) = P(s) + N(s) × (w / 2)

[0206] Right boundary vertex: R(s) = P(s) N(s)×(w / 2)

[0207] New symbols L(s) and R(s) are introduced here to clearly distinguish between sampling points and boundary points, and to avoid confusion with B(s) or P(s).

[0208] Output: Each sampling point corresponds to a pair of boundary vertex coordinates L(s) and R(s). Connecting the boundary vertices of adjacent sampling points sequentially generates a continuous strip geometry (strip slice, or strip slice geometry, which has not yet been rendered).

[0209] Implementation method 4: The repeatable yarn segment structure is a single yarn loop or is composed of multiple horizontally arranged yarn loops connected in sequence.

[0210] Implementation method 5: For each yarn loop, N strip-shaped slices are arranged sequentially on its central axis;

[0211] Where N is the number of shards, which is 4 times the number of base shards, and the number of base shards is 6.

[0212] In this embodiment, the number of slices N is not arbitrarily determined, but is determined through a slice number definition experiment (or slice number determination experiment).

[0213] The experiment, which defines the number of segments, shows that for a single yarn loop:

[0214] If the number of its segments is less than the basic number of segments (i.e., 6 segments), the obtained model cannot form a coil shape;

[0215] If its number of slices is twice or three times the base number of slices, its coil shape will feel uneven.

[0216] If its number of slices is 4 times or 5 times the number of basic slices, its coil shape is smoother and the difference is not significant;

[0217] If the number of its segments is an odd multiple of the base number of segments, such as 3 times or 5 times, then its coil shape will show obvious disconnection.

[0218] Additionally, the Structural Similarity Index (SSIM) is a metric used to measure the similarity between two images. Its value ranges from -1 to 1, where 1 indicates that the two images are completely identical, and -1 indicates that the two images are completely different. Generally, a higher SSIM value indicates that the images are more similar and of better quality. By comparing the SSIM values ​​for different numbers of slices, it can be seen that the number of slices is directly proportional to the SSIM value: 2x and 3x the base number of slices show a significant difference in SSIM values ​​compared to 4x and 5x the base number of slices, but there is no significant difference in SSIM values ​​between 4x and 5x the base number of slices.

[0219] In summary, using 4 times the base number of segments N yields the best results, meaning that each yarn loop has 25 sampling points and 24 strip-shaped slices are arranged sequentially on its central axis. This setting balances realism and computational load to a certain extent.

[0220] Implementation Method 6: A 3D simulation method for wool knitted fabrics based on a rotating strip slice model, the method comprising the following steps:

[0221] Model building steps: The geometric model of the knitted fabric is built using the model building method for three-dimensional simulation of knitted fabrics described in any of the above embodiments;

[0222] Yarn texture rendering steps: Use triangular strips to render the yarn texture on the strip-shaped slices of the geometric model of the knitted fabric.

[0223] Implementation Method 7: The yarn texture rendering step includes the following steps:

[0224] Steps to obtain the central axis and boundary vertices: Obtain the path of each central axis of the geometric model of the knitted fabric; obtain the 3D coordinate vector of each boundary vertex of each strip slice;

[0225] The steps for calculating texture coordinates are as follows: Assign texture coordinates to each boundary vertex so that the 2D texture image is correctly mapped onto the 3D geometry;

[0226] The rendering steps for constructing triangular strips are as follows: Each four adjacent boundary vertices that make up a quadrilateral strip are divided into two triangles by diagonal lines to form a continuous triangular strip; each triangle is rasterized and converted into a set of pixel fragments covering the screen, and the corresponding texture coordinates are calculated by interpolation for each pixel fragment;

[0227] Transparency and edge processing steps: For each pixel fragment, a combination of alpha testing and multisampling coverage is used to perform transparency testing and edge smoothing to obtain the final pixel color with smooth anti-aliased edges and semi-transparent feathering effect, thus completing the yarn texture rendering step.

[0228] In this embodiment, yarn texture rendering aims to give the generated ribbon geometry a realistic yarn texture and to specially process its edges to simulate a feathery effect.

[0229] In this embodiment, the steps for calculating texture coordinates are as follows:

[0230] Assign texture coordinates (u, v) to each boundary vertex so that the 2D texture image can be correctly mapped onto the 3D geometry, achieving accurate and deformation-free attachment of the texture to the dynamic geometry.

[0231] Input: 3D coordinate vectors L(s) and R(s) of the boundary vertices, and the path of the central axis.

[0232] Processing and Formulas:

[0233] u-coordinates (along the central axis): based on cumulative arc length. The u-coordinate values ​​of boundary vertices L(s) and R(s) are equal to the values ​​from the path start point to the _____. The arc length U(s) of P(s) at each sampling point.

[0234]

[0235] v-coordinates (along the width of the strip): The v-coordinate of the left boundary vertex L(s) is fixed at 0, and the v-coordinate of the right boundary vertex R(s) is fixed at 1.

[0236] Output: Texture coordinates (U(s), 0) or (U(s), 1) for each boundary vertex. When the GPU interpolates the triangle strips during the rasterization stage, it generates smoothly transitioned texture coordinates for each segment (pixel) to guide how to obtain color from the texture map.

[0237] In this embodiment, the step of constructing triangular stripes for rendering is as follows:

[0238] Convert quadrilateral strip slices into triangular patches (or triangular strip meshes) for efficient GPU rendering.

[0239] Input: A sequence of boundary vertices of adjacent sampled points with assigned texture coordinates (..., L(s), R(s), L(s+1), R(s+1)...).

[0240] Processing: Every four adjacent boundary vertices (forming a quadrilateral) are divided into two triangles along the diagonal. All triangles are organized into a continuous strip sequence, i.e., triangle stripes. The GPU then rasterizes each triangle, i.e., converts it into a set of fragments covering the screen, and interpolates the corresponding texture coordinates, color, and other attributes for each fragment (or pixel fragment).

[0241] Output: Rasterized triangular mesh data, or fragment stream ready for shading.

[0242] This step converts the geometric model (strips of quadrilaterals) into primitives (triangles) that the GPU can render efficiently. Triangular strips are the optimal primitive structure for rendering strips, minimizing data transfer and computational overhead while ensuring rendering efficiency.

[0243] Each quadrilateral (strip slice) is composed of four adjacent boundary points, divided into two triangles by diagonals. This structure ensures the continuity of the strip geometry and the seamless connection of the texture.

[0244] In this embodiment, the transparency processing step combines alpha testing and multisampling coverage:

[0245] Each segment undergoes transparency testing and edge smoothing to create a smooth, semi-transparent transition at the edges of the yarn texture, rather than a harsh cut, to simulate a realistic feather effect.

[0246] Input: Each fragment obtained after rasterization and its interpolated texture coordinates.

[0247] Segment-by-segment processing:

[0248] (1) Texture sampling: Using the texture coordinates obtained by fragment interpolation, sample from the yarn texture image to obtain color values ​​(RGB) and transparency values ​​(Alpha).

[0249] (2) Alpha test: The sampled alpha value is compared with a preset threshold (optimized experimentally, preferably 0.25). If the alpha value is lower than or equal to the preset threshold, the segment is discarded directly (considered completely transparent); if it is higher than the preset threshold, it is retained and proceeds to the next stage. This step efficiently removes completely transparent areas.

[0250] (3) Multisampling anti-aliasing: For segments that pass the alpha test, their alpha values ​​are converted into coverage weights for multiple sub-pixels and then mixed for calculation (the final pixel color is determined by the average color of these sub-pixels). This produces a smooth gradient effect at the texture edges, effectively eliminating jaggedness and harsh edges.

[0251] Output: Final pixel color with smooth anti-aliased edges and a translucent feather effect.

[0252] This step is key to enhancing the visual effect, specifically designed to smooth the edges of the yarn fuzz, making them smooth and natural rather than harsh.

[0253] The combination of alpha testing and multi-sampling anti-aliasing techniques achieves edge smoothing effects far exceeding those of traditional alpha blending or simple alpha testing while maintaining texture clarity, greatly enhancing the realism of yarn simulation.

[0254] It should be noted that there is a difference between the 3D coordinate vectors of the boundary vertices and the texture coordinates:

[0255] Boundary vertex coordinates (3D coordinate vector): A set of points in 3D space, such as (0.5, 1.2, -0.3), which defines the outline and position of the strip slice in the virtual world.

[0256] Function: By introducing the observation vector through the view matrix, a strip slice is generated, resulting in a "white model" of pure geometric shape; this white model only contains shape information and has no color, pattern or surface details; it determines "where" and "what shape" of the object, that is, it is used to define shape and spatial location.

[0257] The function of texture coordinates: a set of two-dimensional coordinates, usually ranging from [0, 1], such as (0.75, 0.25), which defines which point on the texture image should be pasted onto which vertex.

[0258] Function: Texture coordinates are the bridge connecting the geometric model (white model) and the texture image (appearance); they answer the question of "which part of the texture should appear in which position on the model"; the GPU combines the 3D geometric model and the 2D texture image based on the texture coordinates, that is, it is used to define the mapping of surface details on the geometric model.

[0259] A complete rendering process is as follows:

[0260] Vertex shader stage: Assigning attributes to "vertices", including texture coordinates (U, V).

[0261] Rasterization stage: Interpolation from "vertex" to "fragment":

[0262] Operation object: Triangle (or triangular strip) formed by the boundary vertices;

[0263] Processing: The GPU converts the triangular mesh into individual pixel fragments (which can be understood as candidate pixels on the final screen). At this time, the GPU automatically performs interpolation calculations on all attributes of the three vertices of the triangle (including position, color, and assigned texture coordinates) to generate a unique, smoothly transitioned attribute value (such as the texture coordinates obtained after interpolation) for each fragment.

[0264] Fragment shader stage: Texture sampling for "pixels":

[0265] Target of operation: Each pixel segment.

[0266] Processing: The fragment shader obtains the texture coordinates after interpolation (the texture coordinates now belong to this pixel fragment), then uses these texture coordinates to sample the texture image, obtain the color value, and finally determine the final color of the pixel.

[0267] Implementation Method 8: The transparency and edge processing steps include the following steps:

[0268] Texture sampling step: Using texture coordinates obtained by pixel fragment interpolation, sample from the yarn texture image to obtain color and transparency values;

[0269] Alpha testing steps: Compare the sampled transparency value with a preset transparency threshold:

[0270] If the sampled transparency value is lower than or equal to the preset transparency threshold, the pixel segment is discarded directly.

[0271] Otherwise, retain this pixel fragment;

[0272] Multisampling coverage conversion step: For the pixel fragments retained in the Alpha test step, their transparency values ​​are mapped to the multisampling sub-pixel coverage, and the average color of multiple sub-pixels is calculated as the final pixel color.

[0273] In this embodiment, the transparency value is referred to as the Alpha value.

[0274] In this embodiment, the transparency and edge processing steps are used to address the challenges faced by complex edge textures such as yarn in 3D simulation: while maintaining texture clarity, a smooth semi-transparent transition of the edge is achieved, avoiding edge blurring and color distortion caused by traditional alpha blending, or the harsh jagged edges produced by simple alpha testing.

[0275] In this embodiment, the alpha testing step involves obtaining the alpha value (α) of the pixel (pixel fragment) to be processed after texture sampling. This alpha value is then compared with a preset transparency threshold (optimally 0.25, based on experimental optimization). If the alpha value is ≤ 0.25, the pixel is discarded to avoid writing depth and color into the transparent area (i.e., the pixel is determined to be a completely transparent area and will not participate in any subsequent calculations). If the alpha value is > 0.25, the pixel is retained (i.e., the pixel is determined to be a valid area to be displayed) and proceeds to the subsequent multisampling coverage conversion step. This step serves as an efficient preprocessing step, quickly eliminating a large number of unnecessary completely transparent fragments and significantly improving rendering efficiency.

[0276] In this embodiment, during the multiple sampling coverage conversion step:

[0277] Input: Pixel fragments that pass the alpha test and their alpha values.

[0278] Processing: The alpha value of a pixel (fragment) is mapped to a multi-sampled sub-pixel coverage weight, sub-pixel selection and activation are performed, and finally the sub-pixel results are averaged to synthesize a single pixel color, achieving a rendering effect that traditional transparency processing cannot achieve; where:

[0279] Multiple sampling involves randomly sampling sub-pixels. The coverage weight determines the proportion of sub-pixels (or sub-sampling points) that should be activated (covered) among the multiple sub-pixels (or sub-sampling points) corresponding to that pixel.

[0280] Subpixel processing (selection and activation): Based on coverage weighting, activate a corresponding number of subpixels randomly or according to the pattern.

[0281] Composite: The color results of all sub-pixels are weighted and averaged to synthesize the final color of the pixel.

[0282] Function: Within the effective pixels preserved by hard cropping, it performs refined edge smoothing to generate a natural semi-transparent gradient effect, thereby eliminating jagged edges.

[0283] In contrast, traditional alpha blending produces blurred edges and color distortion, and simple alpha testing produces harsh, hard edges; while combining alpha testing with multisampling coverage can provide smooth edge transitions while maintaining texture clarity, making it suitable for processing textures with complex edge structures, such as knitted fabrics.

[0284] In this implementation, the key to combining alpha testing with multisampling coverage is to first use alpha testing to perform hard clipping, removing most of the transparent pixels; then, multisampling is used to smoothly transform the remaining pixels. The core advantage of this combination of techniques lies in its use of a multisampling mechanism to convert alpha values ​​into a random sampling mode for subpixels, thereby producing a natural gradient effect at the texture edges.

[0285] Implementation method 9: The preset threshold for transparency is 0.25.

[0286] In this embodiment, the preset transparency threshold is obtained through an Alpha threshold definition experiment: if the Alpha value is 0, the Alpha test is invalid, so the initial Alpha value is set to 0.05, and it increases by 0.2 in each experiment.

[0287] Experimental results show that: when the alpha value is 0.05, although it shows a limited visual enhancement effect, it requires a certain increase in time complexity; when the alpha value is 0.05 or 0.25, the simulation effect of yarn hairiness is not significantly different; when the alpha value is 0.45, hairiness loss occurs, and the realism decreases; when the alpha value is 0.65, the hairiness loss phenomenon is more obvious. Based on the above experimental results, those skilled in the art will know that choosing an alpha value of 0.25 for alpha testing can effectively balance the realism of the simulation and computational efficiency.

[0288] In this embodiment, the three-dimensional simulation method constructs a three-dimensional model of knitted fabric based on a rotating strip slice model, which solves the shortcomings of traditional strip models and other models; Improvement: With the support of three-dimensional rendering engines such as OpenGL (view matrix), the display effect is greatly improved, and the three-dimensional knitted fabric can be displayed in real time in a three-dimensional dynamic form, highlighting the realistic effect and dynamic characteristics of the knitted fabric.

[0289] In this embodiment, the three-dimensional simulation method is an efficient simulation method used to improve the display effect of knitted fabric simulation and realize dynamic visualization. This technology has great potential in textile design and production, making it easier for designers to optimize yarn selection, especially in improving design efficiency and accelerating new product development. This provides an efficient and economical solution for the field of textile simulation and analysis. It achieves the following beneficial effects: (1) High-precision simulation: Three-dimensional modeling and realistic fabric rendering significantly improve the detail expression of knitted fabrics. (2) Interactive design: All-round dynamic presentation allows designers to verify the effect of knitted fabrics in real time. (3) Cost reduction and efficiency improvement: Real-time preview effect is provided, reducing the cost of trial and error in textiles and improving design efficiency.

[0290] Implementation Method 10: A three-dimensional simulation model of a wool knitted fabric, wherein the model is obtained by simulation using the three-dimensional simulation method of wool knitted fabric based on a rotating strip slice model as described in any of the above implementation methods.

[0291] Further, in one embodiment, a model building apparatus for three-dimensional simulation of knitted fabrics is provided, the apparatus comprising the following modules: a knitted fabric structure division module: dividing the knitted fabric into one or more repeatable yarn segment structures according to the knitting weave structure; a center axis definition module: defining the center axis of a repeatable yarn segment structure based on the center axis path of the repeatable yarn segment structure of the knitted fabric; the center axis is represented by a NURBS curve; and an overall path definition module: if the knitted fabric is divided into only one repeatable yarn segment structure, then the center axis of the repeatable yarn segment structure is the overall NURBS curve of the knitted fabric; if the knitted fabric is divided into multiple repeatable yarn segment structures, then the center axes of the multiple repeatable yarn segment structures are defined according to the knitting weave structure of the knitted fabric. The method involves arranging and combining the structural elements to obtain the overall NURBS curve of the knitted fabric; a sampling point determination module determines a series of sampling points on the overall NURBS curve of the knitted fabric; the sampling points include the start and end points of each central axis; the sampling points are configured as follows: if each central axis is stretched into a straight line segment, the spacing between each sampling point is equal; a geometric model generation module generates a rotating strip-shaped slice model on each central axis based on the sampling points, which is composed of multiple strip-shaped slices connected sequentially along each central axis, serving as the geometric model of the knitted fabric; on each central axis: each strip-shaped slice is a quadrilateral and its upper and lower sides intersect the central axis respectively, the intersection point being a sampling point and the midpoint of the upper and lower sides; two adjacent strip-shaped slices share a common edge; each strip-shaped slice can rotate around the central axis.

[0292] Furthermore, in one embodiment, a computer device is provided, comprising: a processor and a memory, the memory being used to store executable instructions of the processor, the processor being configured to execute, via executing the executable instructions, the model building method for three-dimensional simulation of knitted fabrics described in the above embodiments and / or the three-dimensional simulation method for wool knitted fabrics based on a rotating strip slice model described in the above embodiments.

[0293] Furthermore, in one embodiment, a computer storage medium is provided, wherein a computer program is stored in the storage medium, and when the computer program is executed, the model construction method for three-dimensional simulation of knitted fabrics described in the above embodiments and / or the three-dimensional simulation method for wool knitted fabrics based on a rotating strip slice model described in the above embodiments are executed.

[0294] Furthermore, in one embodiment, a computer program product is provided, including a computer program / instruction that, when executed by a processor, implements the steps of the model building method for three-dimensional simulation of knitted fabrics described in the above embodiments and / or the three-dimensional simulation method for wool knitted fabrics based on a rotating strip slice model described in the above embodiments.

[0295] Implementation Method 11: A comparative experiment is provided to compare and analyze the simulation results of the strip model, the groove model, and the three-dimensional simulation method for wool knitted fabrics based on the rotated strip slice model:

[0296] The strip-shaped model is described in patent document CN202410536823.X, a method for realistic simulation of knitted fabrics based on a strip-shaped model; the groove-shaped model is described in patent document CN118780094A, a method for realistic simulation of weft-knitted fabrics based on a groove-shaped yarn model. The realism of the three simulation results is determined by calculating the image similarity between the three simulation results and images of the actual yarn and its fabric. The image similarity can be compared using the AI ​​Image SimilarityChecker website. The AI ​​Image SimilarityChecker website uses AI algorithms to calculate image similarity by integrating measurement methods such as cosine similarity and Euclidean distance (LPIPS international perception index).

[0297] The image similarity calculation results are as follows:

[0298] From a side view: the simulation results based on the rotated strip slice model have a 70% similarity to the actual yarn and fabric images; the simulation results based on the strip model have a 47% similarity; and the simulation results based on the groove model have a 49% similarity. From a top view: the simulation results based on the rotated strip slice model have a 67% similarity; the simulation results based on the strip model have a 45% similarity; and the simulation results based on the groove model have a 54% similarity. The results show that the simulation results based on the rotated strip slice model have a better detail retention rate in both the side and top views than those based on the strip and groove models. Compared to strip and groove models, the 3D simulation method for wool knitted fabrics based on a rotated strip slice model can comprehensively showcase the superior details of the fabric and achieve a more realistic feel, especially in side and top views. The rotating strip slice model significantly enhances the visual and structural representation of the fabric texture. Furthermore, all three simulations were performed on the same hardware. The frame rate of the simulation based on the rotating strip slice model was only 0.705% lower than that based on the strip model, while the groove model simulation showed no significant difference in frame rate (based on rendering time). This demonstrates that the rotating strip slice model-based 3D simulation method for wool knitted fabrics can improve the display of fabric details and realism with low computational load. It should be noted that by establishing a causal relationship between "model structure design → perspective adaptability → simulation effect defects," the visual distortion problem of existing knitted yarn simulation models can be clearly deduced: Traditional tubular models, while supporting multi-view observation, suffer from a significant increase in computational load due to their complex 3D solid structure, making it difficult to reproduce the fine details of the yarn fibers, and the appearance of the fibers differs significantly from real yarn. While ribbon models reduce computational load through structural simplification and offer good fiber representation in the front view, their static structure leads to yarn compression distortion when the view is switched to side or top views, failing to reproduce the true fiber morphology from non-frontal perspectives. Although grooved models improve the interactive coverage effect of the fibers, their fixed perspective design limits realism to specific viewpoints, and fiber layers are prone to misalignment when the viewpoint shifts. The common problem with these models is "insufficient dynamic adaptation of model structure to perspective changes," meaning that the fixed-angle model design cannot respond to perspective adjustments, resulting in simulation distortion from non-designed perspectives. This invention uses a rotational strip slice and a viewpoint-dependent geometric transformation mechanism to allow the strip slice display surface to follow the viewpoint direction in real time, fundamentally solving the distortion problems such as compression and misalignment caused by the fixed viewpoint in existing models, and achieving all-round realistic simulation.

[0299] The above description of several specific embodiments further details the technical solution provided by the present invention in order to highlight the advantages and benefits of the technical solution provided by the present invention. However, the above-described specific embodiments are not intended to limit the present invention. Any reasonable modifications and improvements to the present invention, reasonable combinations of embodiments, and equivalent substitutions based on the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A model construction method for three-dimensional simulation of knitted fabrics, characterized in that, The method includes the following steps: Knitted fabric structure division steps: Based on the knitting pattern structure, divide the knitted fabric into one or more repeatable yarn segment structures; Central axis definition steps: Based on the central axis path of a repeatable yarn segment structure of the knitted fabric, define the central axis of the repeatable yarn segment structure; the central axis is represented by a NURBS curve; Overall path definition steps: If the knitted fabric is divided into only one repeatable yarn segment structure, then the central axis of the repeatable yarn segment structure is the overall NURBS curve of the knitted fabric. If a knitted fabric is divided into multiple repeatable yarn segment structures, then the central axes of the multiple repeatable yarn segment structures are arranged and combined according to the knitting weave structure of the fabric to obtain the overall NURBS curve of the knitted fabric. Sampling point determination steps: Determine a series of sampling points on the overall NURBS curve of the knitted fabric; the sampling points include the start and end points of each central axis; the sampling points are configured as follows: If each central axis is stretched into a straight line segment, the spacing between each sampling point is equal; Geometric model generation steps: Based on the sampling points, generate a rotating strip-shaped slice model on each central axis, which is composed of multiple strip-shaped slices connected sequentially along each central axis, as the geometric model of the knitted fabric; On each central axis: Each of the strip slices is a quadrilateral with its top and bottom sides intersecting the central axis. The intersection point is the sampling point and the midpoint of the top and bottom sides. Two adjacent strip slices share the same side. Each of the strip slices can rotate about the central axis.

2. The model construction method for three-dimensional simulation of knitted fabrics according to claim 1, characterized in that, The strip slice is generated by introducing the observation vector through the view matrix, so that the strip slice rotates and transforms according to the observation viewpoint to always face the observer.

3. The model construction method for three-dimensional simulation of knitted fabrics according to claim 2, characterized in that, The strip slices are generated by introducing observation vectors through a view matrix, using the following method: Steps to obtain the view direction vector: Extract the unit view direction vector from the view matrix; Steps to calculate the unit tangent vector: Calculate the tangent direction at each sampling point on each central axis, and the unit tangent vector at each sampling point; Steps to calculate the unit normal vector: Based on the unit view direction vector and the unit tangent vector at each sampling point, calculate the unit normal vector at each sampling point that is perpendicular to the unit tangent vector and points to the side of the view direction. The unit normal vector is used to determine the direction of extension of the strip slice width; Steps for calculating boundary vertex coordinates: Based on the three-dimensional coordinate vector and unit normal vector of each sampling point, calculate the vertex coordinates of the two sides of the strip slice, thereby defining the shape of the quadrilateral strip slice; Each sampling point corresponds to a pair of boundary vertex coordinates; by connecting the boundary vertices of adjacent sampling points in sequence, a continuous strip geometry is generated as a continuous strip slice.

4. The model construction method for three-dimensional simulation of knitted fabrics according to claim 1, characterized in that, The repeatable yarn segment structure is a single yarn loop or composed of multiple horizontally arranged yarn loops connected sequentially.

5. The model construction method for three-dimensional simulation of knitted fabrics according to claim 1, characterized in that, For each yarn loop, N strip-shaped slices are arranged sequentially on its central axis; Where N is the number of shards, which is 4 times the number of base shards, and the number of base shards is 6.

6. A three-dimensional simulation method for wool knitted fabrics based on a rotating strip slice model, characterized in that, The method includes the following steps: Model building steps: The geometric model of the knitted fabric is built using the model building method for three-dimensional simulation of knitted fabrics as described in any one of claims 2 to 5; Yarn texture rendering steps: Use triangular strips to render the yarn texture on the strip-shaped slices of the geometric model of the knitted fabric.

7. The three-dimensional simulation method for wool knitted fabrics based on a rotating strip slice model according to claim 6, characterized in that, The yarn texture rendering step includes the following steps: Steps to obtain the central axis and boundary vertices: Obtain the path of each central axis of the geometric model of the knitted fabric; obtain the 3D coordinate vector of each boundary vertex of each strip slice; The steps for calculating texture coordinates are as follows: Assign texture coordinates to each boundary vertex so that the 2D texture image is correctly mapped onto the 3D geometry; The rendering steps for constructing triangular strips are as follows: Each four adjacent boundary vertices that make up a quadrilateral strip are divided into two triangles by diagonal lines to form a continuous triangular strip; each triangle is rasterized and converted into a set of pixel fragments covering the screen, and the corresponding texture coordinates are calculated by interpolation for each pixel fragment; Transparency and edge processing steps: For each pixel fragment, a combination of alpha testing and multisampling coverage is used to perform transparency testing and edge smoothing to obtain the final pixel color with smooth anti-aliased edges and semi-transparent feathering effect, thus completing the yarn texture rendering step.

8. The three-dimensional simulation method for wool knitted fabrics based on a rotating strip slice model according to claim 7, characterized in that, The transparency and edge processing steps include the following steps: Texture sampling step: Using texture coordinates obtained by pixel fragment interpolation, sample from the yarn texture image to obtain color and transparency values; Alpha testing steps: Compare the sampled transparency value with a preset transparency threshold: If the sampled transparency value is lower than or equal to the preset transparency threshold, the pixel segment is discarded directly. Otherwise, retain this pixel fragment; Multisampling coverage conversion step: For the pixel fragments retained in the Alpha test step, their transparency values ​​are mapped to the multisampling sub-pixel coverage, and the average color of multiple sub-pixels is calculated as the final pixel color.

9. The three-dimensional simulation method for wool knitted fabrics based on a rotating strip slice model according to claim 8, characterized in that, The preset threshold for transparency is 0.

25.

10. A three-dimensional simulation model of a wool knitted fabric, characterized in that, The model was obtained by simulation using the three-dimensional simulation method for wool knitted fabrics based on the rotating strip slice model as described in any one of claims 6 to 9.

Citation Information

Patent Citations

  • Knitted fabric reality sense simulation method based on banded model

    CN118485760A

  • Weft-knitted fabric reality sense simulation method based on groove-shaped yarn model

    CN118780094A

  • Knitting weft knitting coil three-dimensional simulation modeling technology

    CN112906085A

  • Creo-based 1 +1 rib fabric three-dimensional model simulation method

    CN115408916A