A realistic simulation method for weft knitted fabrics based on grooved yarn model

Through the realistic simulation method of weft knitted fabric based on the groove-shaped yarn model, the problem of difficult to capture the randomness and density of hairy yarns is solved, and high-quality realistic simulation of knitted fabrics is achieved, reducing costs and complexity, and improving the quality of knitted fabrics is achieved. Simulation efficiency and sense of reality.

CN118780094BActive Publication Date: 2024-11-15CHANGSHU INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411263606.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2024-11-15
Estimated Expiration
2044-09-10

AI Technical Summary

Technical Problem

The prior art is difficult to effectively capture and reproduce the randomness and density of hairy yarns, resulting in the lack of high quality and visual authenticity in knitted fabric simulations, and traditional methods rely on high cost and complex technologies.

Method used

Using the realistic simulation method of weft knitted fabric based on the groove-shaped yarn model, the minimum repeating unit of the yarn texture is determined by obtaining the yarn image, calculating the yarn diameter, and constructing a groove-shaped yarn model, combining physics Rendering technology allows rendering to accurately simulate the interactive modes and details of yarns.

Benefits of technology

It improves the visual accuracy and realistic sense of knitted fabrics, reduces cost and complexity, and enhances simulation efficiency and market competitiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118780094B_ABST
    Figure CN118780094B_ABST
Patent Text Reader

Abstract

The present invention proposes a realistic simulation method of weft knitted fabrics based on a grooved yarn model, and relates to the technical field of knitted fabric simulation. In view of the technical problem of how to effectively capture and reproduce the randomness and density of hairy yarns in simulation, as well as their influence on yarn diameter and fabric texture, so as to achieve a higher quality realistic simulation of knitted fabrics in the prior art, the present invention obtains two-way continuous yarn texture images and transparency maps, and then obtains the proportion of hairy pixels in the outer area of ​​the yarn trunk by adding auxiliary lines, and then calculates a more accurate yarn diameter; when constructing a yarn model, a grooved yarn model with a regular hexagonal cross-sectional shape is used, which can accurately capture and simulate the complex interactions between yarn hairiness, which not only enhances the realism of the simulation, but also the method is simple to handle and fast to calculate, further optimizing the simulation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of knitted fabric simulation, and in particular to a realistic simulation method of weft knitted fabric based on a grooved yarn model. Background Art

[0002] In the home textile and apparel industries, yarns with rich hairiness are favored for their soft, fluffy properties and excellent thermal insulation properties. However, traditional simulation techniques are limited in capturing the randomness and density of hairiness, which restricts design flexibility and production efficiency. In knitted fabric simulation technology, although the two-dimensional coil model has an advantage in the speed of texture mapping, it is insufficient in simulating details and light and shadow interactions, making it difficult to meet the requirements of high quality and visual authenticity. In addition, although the method of adjusting the yarn image can reproduce the three-dimensional shape, it still cannot fully show the three-dimensional sense and detail changes. Although the programmed model fitting technology can provide a fine simulation of the light and shadow effects of the yarn, it relies on high-cost and complex technologies such as CT scanning, which increases the economic and technical burden.

[0003] Therefore, developing a new yarn model that can accurately capture the characteristics of knitted fabrics and adapt to industrial production speed is of great significance for improving production efficiency and enhancing market competitiveness. Summary of the invention

[0004] The present invention provides a realistic simulation method of weft knitted fabrics based on a grooved yarn model, so as to solve the existing technical problem of how to effectively capture and reproduce the randomness and density of hairy yarns and their influence on yarn diameter and fabric texture in simulation, thereby achieving higher quality realistic simulation of knitted fabrics.

[0005] A method for simulating the realism of a weft knitted fabric based on a grooved yarn model specifically comprises the following steps:

[0006] Step S1, obtaining a yarn image and performing preprocessing to obtain a yarn texture image;

[0007] Step S2, determining the minimum repeating unit of the yarn texture according to the yarn texture image, and obtaining two-way continuous yarn texture images according to the minimum repeating unit;

[0008] Step S3, obtaining a transparency map according to the two continuous yarn texture images;

[0009] Step S4, calculating the yarn diameter according to the transparency map;

[0010] Step S5, determining the cross-sectional shape of the yarn model, and constructing the yarn model according to the cross-sectional shape;

[0011] Step S6, inputting the yarn diameter and the cross-sectional shape into a modeling software to obtain a weft knitted fabric model based on a grooved yarn model;

[0012] Step S7, rendering the acquired weft knitted fabric model.

[0013] Furthermore, the preprocessing includes image cropping and binarization.

[0014] Furthermore, the step S2, according to the yarn texture image, determines the minimum repeating unit of the yarn texture, specifically:

[0015] For the yarn texture image with texture cycle regularity, at least one complete yarn texture change cycle is taken as the minimum repeating unit;

[0016] For yarn images without texture recurrence, a yarn texture with a length greater than K times the yarn diameter is taken as the minimum repeating unit.

[0017] Furthermore, the step S4, calculating the yarn diameter according to the transparency map, is specifically:

[0018] Step S41, obtaining the ratio A of the total number of pixels N and the number of opaque pixels in the transparency map;

[0019] Step S42, obtaining the number X of yarn trunk pixels in the transparency map;

[0020] Step S43, calculating the proportion C of hairiness pixels in the area outside the yarn trunk;

[0021] Step S44, calculating the yarn diameter D according to the total number of pixels N, the ratio A of the number of opaque pixels, the number X of yarn trunk pixels and the proportion C.

[0022] Furthermore, in step S43, the proportion C of hairiness pixels in the outer area of ​​the yarn trunk is calculated, specifically:

[0023] Step S431, obtaining the number of row pixels parallel to the main direction of the yarn according to the transparency map;

[0024] Step S432, adding n auxiliary lines parallel to the yarn trunk in the outer area of ​​the yarn trunk;

[0025] Step S433, calculating the number of hairiness pixels on each auxiliary line;

[0026] Step S434, calculating the proportion C of the hairiness pixels outside the yarn trunk area according to the number of row pixels parallel to the yarn trunk direction and the number of hairiness pixels on each auxiliary line.

[0027] Furthermore, in step S44, the yarn diameter D is calculated as:

[0028] D = X / M;

[0029] X = N × (AC) / (1-C);

[0030] Where M is the number of row pixels parallel to the main direction of the yarn.

[0031] Furthermore, in step S434, the calculation formula for the proportion C of the hairiness pixels in the outer area of ​​the yarn trunk is:

[0032] ;

[0033] Where n is the number of auxiliary lines, m is i is the number of hairiness pixels on the i-th auxiliary line, and M is the number of row pixels parallel to the main direction of the yarn.

[0034] Furthermore, in step S5, the cross-sectional shape is a regular hexagon.

[0035] Furthermore, in step S5, the yarn model is a groove-shaped yarn model.

[0036] Furthermore, in the step S7, when rendering the acquired weft knitted fabric model, a two-dimensional texture filtering technology is used to smooth the shadow edge of the weft knitted fabric model.

[0037] Compared with the prior art, the beneficial effects of the present invention are:

[0038] First, automatic calculation of diameter based on yarn transparency map: The present invention automatically calculates the actual diameter of the yarn by analyzing the opacity changes in the yarn transparency map, which solves the diameter mismatch problem that occurs when dealing with inconsistent hairiness lengths. It not only improves the visual accuracy of the model, but also avoids the need for manual adjustment, further improving the efficiency and accuracy of the overall simulation.

[0039] Second, accurate simulation of complex interaction patterns: The grooved yarn model design in the present invention can accurately capture and simulate the complex interactions between yarn hairiness, such as the natural coverage and interaction of hairiness, which not only enhances the realism of the simulation, but also reduces the processing complexity by scientifically simplifying the calculation, thereby optimizing the simulation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 It is a structural diagram of a realistic simulation method of weft knitted fabrics based on a grooved yarn model;

[0042] Figure 2 Schematic diagram of the results of the yarn image preprocessing stage in an embodiment of the present invention, (a) is the original yarn image, (b) is the brightness processed image, (c) is the binary yarn image, and (d) is the two-way continuous yarn texture image;

[0043] Figure 3 : maps of the yarn image in the embodiment of the present invention, (a) is a color map, (b) is a height map, (c) is a normal map, (d) is a metalness map, (e) is a roughness map, (f) is an ambient occlusion map, and (g) is a transparency map;

[0044] Figure 4 This is a comparison diagram of different yarn diameters of yarn images of the same size in an embodiment of the present invention;

[0045] Figure 5 A schematic diagram of the position of auxiliary lines in an embodiment of the present invention;

[0046] Figure 6 1 is a diagram of the yarn states in the fabric according to an embodiment of the present invention, wherein (a) is the yarn position state in the fabric, (b) is the hairiness state of adjacent yarns, and (c) is the hairiness area of ​​adjacent yarns;

[0047] Figure 7 : are cross sections of yarn models in the embodiments of the present invention, (a) is a cross section of a smooth ribbon-shaped yarn model, (b) is a cross section of a groove-shaped yarn model, (c) is cross section data of a groove-shaped yarn model, (d), (e), and (f) are cross sections of groove-shaped yarn models with the same yarn diameter and different hairiness lengths;

[0048] Figure 8 The coil model and the weft knitted fabric model generated based on the grooved yarn model, (a) is the front view of the coil model, (b) is the side view of the coil model, (c) is the front view of the fabric model, and (d) is the side view of the fabric model;

[0049] Fig. 9Comparison of simulation effects of common yarn plain weft stitch based on smooth ribbon yarn model and groove yarn model. (a) is the original image of the yarn, (b) and (e) are real fabric images and details, (c) and (f) are simulation effects and details of the smooth ribbon yarn model, and (d) and (g) are simulation effects and details of the groove yarn model.

[0050] Fig.10 Comparison of simulation effects of the smooth ribbon yarn model and the groove yarn model for the plain weft stitch structure of hairy yarn. (a) is the original image of the yarn, (b) and (e) are the real fabric images and details, (c) and (f) are the simulation effects and details of the smooth ribbon yarn model, and (d) and (g) are the simulation effects and details of the groove yarn model. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0052] The specific implementation of the present invention is described below with reference to the accompanying drawings.

[0053] In response to the technical problem of how to effectively capture and reproduce the randomness and density of hairy yarns and their influence on yarn diameter and fabric texture in simulation in the prior art, so as to achieve higher quality realistic simulation of knitted fabrics, the present invention has developed and verified a grooved yarn model, which significantly improves the authenticity and detail performance of knitted fabric simulation by strengthening the interactive coverage function of the hairy part. Using consumer-grade camera equipment and physically based rendering methods, not only the cost-effectiveness and ease of operation of the technology are significantly improved, but also the instantaneous simulation speed can be achieved while maintaining high-quality simulation effects, showing great potential in real-time rendering and dynamic simulation applications.

[0054] Example 1

[0055] like Figure 1 As shown, the present invention proposes a realistic simulation method for weft knitted fabrics based on a grooved yarn model, which specifically includes the following steps:

[0056] Step S1, obtaining a yarn image and performing preprocessing to obtain a yarn texture image.

[0057] The preprocessing stage of the yarn image starts with the original yarn image taken by using a common mobile phone camera on the market, which can show the texture characteristics of the yarn. Figure 2Part (a) in the figure is the original image of the yarn. The yarn image is cropped to focus on the yarn and exclude unnecessary background elements, and then brightness processing is performed to ensure that only the area directly related to the yarn is processed, such as Figure 2 In order to highlight the main body of the yarn, binarization processing is applied. By setting the threshold E, the pixel values ​​greater than or equal to E are set to 1, and the pixel values ​​less than E are set to 0. The image after binarization processing is shown in Figure 2 This method is shown in part (c) of the figure. By this method, the area containing only the yarn is effectively extracted from the original image while excluding the background.

[0058] The present invention significantly simplifies the data collection process by using ordinary mobile phone cameras to obtain yarn images. The low threshold characteristics of this method not only make the technology easy to popularize, but also greatly reduce costs, so that image acquisition and preprocessing can be performed efficiently even in resource-limited situations. By binarizing the image and determining the minimum repeating unit of the texture, the method not only improves the processing speed, but also ensures the continuity and consistency of the yarn map during the rendering process. This simple and efficient preprocessing step is particularly important for large-scale production and fast rendering, providing a cost-effective solution for the textile industry.

[0059] Step S2, determining the minimum repeating unit of the yarn texture according to the yarn texture image, and obtaining a two-way continuous yarn texture image according to the minimum repeating unit.

[0060] Determine the minimum repeating unit of the yarn texture. This step is to ensure the continuity and consistency of the yarn map during the rendering process, which is especially important in large-area rendering. The selection of this unit is based on the natural repeating pattern of the texture in the yarn image, that is, to find an image area that can be visually repeated seamlessly without visible boundaries or inconsistencies. Finally, ensure that these texture units are bidirectionally continuous in the horizontal direction to ensure that the seams are seamlessly connected when the texture is applied to the 3D model, without breaks or repetitions, thereby creating a continuous and realistic surface effect visually. The bidirectional continuous yarn texture image is as follows: Figure 2 These processing steps together ensure that the physical and visual properties of the yarn are accurately and realistically represented during the rendering process.

[0061] According to the yarn texture image, the minimum repeating unit of the yarn texture is determined, specifically:

[0062] For the yarn texture image with texture cycle regularity, at least one complete yarn texture change cycle is taken as the minimum repeating unit;

[0063] For yarn images without texture recurrence, a yarn texture with a length greater than K times the yarn diameter is taken as the minimum repeating unit. In the embodiment of the present invention, the value of K is 5, which can take into account both the yarn texture and the image size.

[0064] Step S3, obtaining a transparency map according to the two-way continuous yarn texture images.

[0065] In order to better simulate the texture and surface characteristics of yarn, the data obtained from the yarn image preprocessing stage can be converted into a variety of key maps, including color map, height map, normal map, metalness map, roughness map, ambient occlusion map and transparency map, etc. Figure 3 As shown in the figure. These maps describe the basic color, surface roughness and reflectivity of the material, which are an indispensable part of PBR technology. In addition, the microstructure of the yarn is simulated by the height map, which enhances the three-dimensional sense and detail depth of the texture.

[0066] The specific method for obtaining the map is a common method in this field and will not be explained in detail.

[0067] Step S4, calculating the yarn diameter according to the transparency map.

[0068] In fabric simulation, the visual diameter of the yarn is significantly affected by the length of the hairiness. Even if the actual pixels of two yarn textures are the same, the different lengths of the hairiness will make their actual diameters different, such as Figure 4 shown.

[0069] To address this problem, the present invention proposes an automatic diameter calculation method based on yarn transparency map. This method calculates the actual diameter of the yarn by analyzing the opacity changes in the yarn transparency map, ensuring that the diameter of the yarn model remains consistent visually even when the hairiness length is inconsistent, thereby improving the accuracy of the simulation map and the overall visual effect.

[0070] First, key data are extracted from the yarn transparency map, including the opaque pixel ratio A and the transparent pixel ratio T. The transparent pixel ratio T refers to the area ratio of the background or non-yarn part, A+T=1.

[0071] In order to accurately evaluate the diameter of the yarn trunk and ensure that the hairiness area is accurately identified in the image processing, auxiliary lines are introduced to ensure that the auxiliary line area mainly contains hairiness rather than the yarn trunk, so as to further analyze the yarn hairiness area, such as Figure 5 shown.

[0072] The yarn diameter is calculated according to the transparency map, specifically:

[0073] Step S41, obtaining the ratio A of the total number of pixels N and the number of opaque pixels in the transparency map;

[0074] Step S42, obtaining the number X of yarn trunk pixels in the transparency map;

[0075] Step S43, calculating the proportion C of hairiness pixels in the outer area of ​​the yarn trunk; specifically:

[0076] Step S431, obtaining the number of row pixels parallel to the main direction of the yarn according to the transparency map;

[0077] Step S432, adding n auxiliary lines parallel to the yarn trunk in the outer area of ​​the yarn trunk;

[0078] Step S433, calculating the number of hairiness pixels on each auxiliary line;

[0079] Step S434, according to the number of row pixels parallel to the main direction of the yarn and the number of hairiness pixels on each auxiliary line, calculate the proportion C of hairiness pixels outside the main area of ​​the yarn, and the calculation formula is:

[0080] ;

[0081] Where n is the number of auxiliary lines, m is i is the number of hairiness pixels on the i-th auxiliary line, and M is the number of row pixels parallel to the main direction of the yarn.

[0082] Step S44, calculating the yarn diameter D according to the total number of pixels N, the ratio A of the number of opaque pixels, the number X of yarn trunk pixels and the proportion C.

[0083] The proportion C of opaque pixels (i.e., the hairiness of the yarn) relative to the whole is calculated on the pixel row where the auxiliary line of the yarn transparency map is located. This proportion is the basis for calculating the actual number of pixels X in the yarn trunk, where X is obtained through the following analysis:

[0084] The number of opaque pixels = N × A, where A is the proportion of opaque pixels in the yarn part calculated from the transparency map;

[0085] The number of hairiness pixels = (NX) × C;

[0086] The number of opaque pixels = the number of yarn trunks + the number of hairiness pixels.

[0087] That is, N×A=X+(NX)×C;

[0088] Then, X = N × (AC) / (1-C);

[0089] Because the calculation formula of the yarn diameter D is: D=X / M, M is the number of row pixels parallel to the main direction of the yarn, therefore, the yarn diameter D can be calculated.

[0090] Through the above analysis, the diameter D of the yarn can be calculated. This method ensures that the simulated yarn is not only accurate in geometric dimensions, but also visually consistent with the actual situation, which enhances the authenticity and application value of the simulation model.

[0091] Step S5, determining the cross-sectional shape of the yarn model, and constructing the yarn model according to the cross-sectional shape, wherein the cross-sectional shape is a regular hexagon, and the yarn model is a grooved yarn model.

[0092] The arrangement of the yarns presents a highly complex interactive pattern in the fabric, not just a simple juxtaposition or overlap. Figure 6 is a diagram of the yarn state in the fabric in an embodiment of the present invention, Figure 6 Part (a) shows the cross-sectional state of adjacent yarns when they are interlaced. Figure 6 Part (b) shows that the hairiness of adjacent yarns overlaps each other in front of the yarn trunk. Figure 6 Part (c) shows a simplified cross-section of the yarn morphology when it is not affected by hairiness, and how the hairiness overlaps between yarns. This complex interaction pattern requires the model to not only reproduce the basic geometry of the yarn, but also capture the interaction between the yarn hairiness.

[0093] In order to simulate this complex physical behavior more realistically, the cross section of the yarn model is first set to a straight line, such as Figure 7 As shown by the green line in part (a) of the figure, the cross-section of this smooth ribbon model can only simulate the covering effect of the feathers in a single direction and fails to achieve the full overlap between the feathers.

[0094] In order to solve the limitation of the hairiness covering effect, the hairiness part of the smooth ribbon yarn model was adjusted to make it tilted toward the front of the yarn trunk. At the same time, in order to scientifically simplify the calculation and maintain the practicality of the model, the cross-section of the yarn was designed as an equilateral hexagon. Figure 7 Part (b) shows the cross-sectional state of the grooved yarn model. Figure 7 Part (c) in FIG. 1 is the cross-sectional data of the grooved yarn model, in which the hairiness part extends in different ways along the edge of the hexagon according to its length, such as Figure 7As shown in parts (d), (e), and (f) of the figure. There is a difference between the theoretical width of the yarn (i.e., the yarn diameter) and the actual width (i.e., the yarn texture width), the grooved yarn model therefore needs to take these two dimensions into account. In this model, the yarn diameter is marked as 2r, and the actual width of the entire yarn texture is marked as H. The distance from the edge of the yarn trunk to the edge of the yarn cross section represents the width of the yarn hairiness. This design not only ensures the geometric accuracy of the model, but also enables the hairiness to correctly simulate its covering effect on adjacent yarns in the simulation. Figure 7 As shown in part (f) of the figure, by tilting the yarn hairiness, the hairiness can cover adjacent yarns more naturally in three-dimensional space, simulating the interaction of yarns in the real world.

[0095] Step S6, inputting the yarn diameter and the cross-sectional shape into a modeling software to obtain a weft knitted fabric model based on the grooved yarn model.

[0096] In the present invention, each coil of the fabric is defined by nine control points. The coil models of the tubular and smooth ribbon yarn models are based on the same path. The former model only reflects the information of the yarn trunk, while the latter contains the information of the yarn trunk and hairiness. The hairiness part overlaps in the sinking arc part of the coil. The comparison of the two models shows that when viewed from the front angle, the yarn trunk morphology of the two is consistent, but the smooth ribbon yarn model increases the width of the coil by adding the hairiness part. However, when viewed from the side angle, their visual performance is different due to the different structures of the yarn models. Because the smooth ribbon yarn model lacks volume in its structure, the performance of the side view is significantly different with the change of the path in the Z-axis direction: when the path changes slightly in the Z-axis direction, the side view is linear; when the path changes greatly in the Z-axis direction, the side view is surface-like.

[0097] The loop model of the slot yarn model is based on the loop model of the smooth ribbon yarn model. In the cross section of the yarn, the hairiness of the yarn is extended along the edge of the adjacent yarn trunk along the simplified hexagon. From the front view, the yarn trunk morphology of the two is consistent, but because the hairiness of the yarn in the slot yarn model is tilted toward the positive direction of the Z axis, the loop model of the slot yarn model is slightly smaller than the loop model of the smooth ribbon yarn model in overall width.

[0098] The coil model is constructed by utilizing NURBS (Non-Uniform Rational B-Spline) curves in three-dimensional space as the generation path, with nine control points to define each coil.

[0099] Figure 8 The coil model and weft knitted fabric model generated based on the grooved yarn model. The front and side views of the coil model are shown in Figure 8As shown in parts (a) and (b) of Figure 1, after establishing a single coil model, the next task is to arrange these coils in a specific way according to the weft plain stitch structure. In the weft plain stitch structure, the coils are arranged in the horizontal direction, and each coil is not only connected to the coils adjacent to it on the left and right, but also to the coils above and below it, thus forming a complete fabric structure, as shown in Figure 1. Figure 8 As shown in parts (c) and (d) of the figure. Due to the particularity of the grooved yarn model, the visibility of the yarn trunk in the fabric is determined by the length and density of the yarn hairiness, which significantly improves the visual authenticity of the knitted fabric with rich hairiness. The model accurately captures the details of the yarn trunk and its hairiness, thereby truly reflecting the physical and visual properties of the yarn in the fabric.

[0100] Step S7, rendering the acquired weft knitted fabric model.

[0101] During rendering, two-dimensional texture filtering technology is used to smooth the shadow edge of the weft knitted fabric model.

[0102] For the visual simulation of textiles, the present invention adopts Physically Based Rendering (PBR) technology. Compared with the traditional simplified lighting model and texture mapping method, PBR technology provides a more accurate and realistic simulation method. This method renders according to the microscopic surface structure of the material and its physical properties of light scattering, reflection, refraction and absorption, and can reproduce the gloss and texture details of the textile surface in detail. In actual implementation, the properties of each yarn material are expressed by corresponding maps. These maps are designed based on the physical properties of the material to ensure that the interaction of the material with light can be accurately simulated, thereby enhancing the authenticity and visual depth of the rendering effect. In this way, the simulation system can more accurately capture and present the visual characteristics of textiles, improve the realism and application value of the simulation.

[0103] In the 3D simulation of fabrics, accurate configuration of the lighting model is crucial to ensure the realistic presentation of material properties. To this end, ambient light and directional parallel light sources are used in combination to simulate natural and artificial lighting conditions. Ambient light simulates diffuse light without a specific direction, providing basic illumination for the scene and avoiding excessive shadows. Parallel light simulates sunlight or other distant light sources from a specific direction. Its characteristics are uniform and consistent light, while adjusting the light intensity and color to adapt to different simulation scenes and material properties. This setting not only ensures the adaptability and flexibility of lighting, but also accurately reproduces the sheen of yarns and fabrics and their complex texture details by simulating the reflection, refraction and absorption reactions of different materials to light.

[0104] In the present invention, the shadow processing of grooved and strip-shaped geometric bodies is optimized. Due to the volume-free characteristics of such geometric bodies, traditional shadow processing methods are prone to produce ripples and other artifacts during the rendering process. Especially in the calculation of self-shadows, the relative position relationship between the light source and the geometric body and the shape of the geometric body must be processed very accurately to avoid visual distortion. To meet this challenge, the Variance Shadow Maps (VSM) technology is used, which determines whether a pixel is in the shadow by analyzing the depth value and its variance, thereby creating a more natural gradient effect at the edge of the shadow. The implementation of this technology is accelerated by GPU hardware, and standard two-dimensional texture filtering technology is used to achieve smooth processing of the shadow edge, which significantly improves rendering efficiency.

[0105] The grooved yarn model allows the use of real yarn textures, thereby visually accurately reproducing the complexity and irregularities of the yarn edges, close to the real physical properties of the yarn, including the three-dimensional sense of the hairiness, and the mutual coverage effect of the hairiness between yarns will be more realistic. Fig. 9 and Fig.10 The simulation results of weft knitted fabrics with yarn models of different cross-sectional shapes for two types of hairiness are shown. For ordinary yarns with shorter and less hairiness, the cross-sectional shape of the yarn model has little effect on the simulation results, but the grooved yarn model is more natural than the ribbon yarn model, such as Fig. 9 For yarns with longer and richer hairiness, the grooved ribbon model is more complex and delicate in simulating the microstructure and texture level of the yarn, and is closer to the real fabric, as shown in Figure 2. Fig.10 shown.

[0106] Taking the modeling of weft knitted fabric as an example, as shown in Table 1, in terms of simulation speed, the present invention shows excellent efficiency while maintaining high-quality simulation effects. This speed advantage not only demonstrates the efficiency of the method of the present invention, but also provides feasibility for real-time fabric rendering and dynamic simulation.

[0107] Table 1 Modeling time of weft knitted fabrics

[0108]

[0109] The invention uses physically based rendering (PBR) technology to allow accurate rendering based on the physical properties of materials. This method can reproduce the gloss and texture details of the textile surface in detail. By accurately simulating the material's reaction to light, the visual realism of the simulation results is significantly improved, while maintaining an efficient rendering speed, which is suitable for real-time rendering and dynamic simulation.

[0110] Example 2

[0111] The present invention further provides a weft knitted fabric realistic simulation system based on a groove-shaped yarn model, which adopts the weft knitted fabric realistic simulation method based on a groove-shaped yarn model described in any one of Embodiment 1, and specifically includes the following modules:

[0112] The yarn image processing module is used to obtain the yarn image and perform preprocessing to obtain the yarn texture image;

[0113] A minimum repeating unit acquisition module, used to determine the minimum repeating unit of the yarn texture according to the yarn texture image, and to acquire two-way continuous yarn texture images according to the minimum repeating unit;

[0114] A transparency map acquisition module, used to obtain a transparency map according to the two continuous yarn texture images;

[0115] A yarn diameter calculation module, used for calculating the yarn diameter according to the transparency map;

[0116] A yarn model building module, used for building a yarn model according to the cross-sectional morphology;

[0117] A weft knitted fabric model building module, used for inputting the yarn diameter and the cross-sectional shape into a modeling software to obtain a weft knitted fabric model based on a grooved yarn model;

[0118] The rendering module is used to render the acquired weft knitted fabric model.

[0119] Example 3

[0120] An electronic device, comprising:

[0121] Processor and memory;

[0122] The processor is used to execute the steps of the realistic simulation method of weft knitted fabric based on the grooved yarn model as described in any one of the embodiments 1 by calling the program or instructions stored in the memory.

[0123] Example 4

[0124] A computer-readable storage medium, comprising computer program instructions, wherein the computer program instructions enable a computer to execute the steps of a method for realistic simulation of a weft knitted fabric based on a groove-shaped yarn model as described in any one of Embodiment 1.

[0125] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0126] It should be noted that the terms used in the present invention are only for describing specific embodiments, rather than limiting the scope of the present invention. As shown in the present specification, unless the context clearly indicates an exception, the words "one", "a", "a kind of" and / or "the" do not specifically refer to the singular, but may also include the plural. The terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method or device. In the absence of more restrictions, the elements defined by the sentence "include one..." do not exclude the presence of other identical elements in the process, method or device including the elements.

[0127] It should also be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. Unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", etc. should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the technical solutions of the embodiments of the present invention.

Claims

1. A method for simulating the realism of a weft knitted fabric based on a grooved yarn model, characterized in that: The steps include: Step S1, obtaining a yarn image and performing preprocessing to obtain a yarn texture image; Step S2, determining the minimum repeating unit of the yarn texture according to the yarn texture image, and obtaining two-way continuous yarn texture images according to the minimum repeating unit; Step S3, obtaining a transparency map according to the two continuous yarn texture images; Step S4, calculating the yarn diameter according to the transparency map; specifically: Step S41, obtaining the ratio A of the total number of pixels N and the number of opaque pixels in the transparency map; Step S42, obtaining the number X of yarn trunk pixels in the transparency map; Step S43, calculating the proportion C of hairiness pixels in the area outside the yarn trunk; Step S44, calculating the yarn diameter D according to the total number of pixels N, the ratio A of the number of opaque pixels, the number X of yarn trunk pixels and the proportion C; the calculation formula of the yarn diameter D is: D = X / M; X = N × (AC) / (1-C); Where M is the number of row pixels parallel to the main direction of the yarn; Step S5, determining the cross-sectional shape of the yarn model, and constructing the yarn model according to the cross-sectional shape; Step S6, inputting the yarn diameter and the cross-sectional shape into a modeling software to obtain a weft knitted fabric model based on a grooved yarn model; Step S7, rendering the acquired weft knitted fabric model.

2. A realistic simulation method for weft knitted fabrics based on a grooved yarn model according to claim 1, characterized in that: The preprocessing includes image cropping and binarization.

3. The method for realistically simulating a weft knitted fabric based on a grooved yarn model according to claim 1, characterized in that: The step S2, determining the minimum repeating unit of the yarn texture according to the yarn texture image, is specifically: For the yarn texture image with texture cycle regularity, at least one complete yarn texture change cycle is taken as the minimum repeating unit; For yarn images without texture recurrence, a yarn texture with a length greater than K times the yarn diameter is taken as the minimum repeating unit.

4. The method for realistically simulating a weft knitted fabric based on a grooved yarn model according to claim 1, characterized in that: The step S43 is to calculate the proportion C of the hairiness pixels in the area outside the yarn trunk, specifically: Step S431, obtaining the number of row pixels parallel to the main direction of the yarn according to the transparency map; Step S432, adding n auxiliary lines parallel to the yarn trunk in the outer area of ​​the yarn trunk; Step S433, calculating the number of hairiness pixels on each auxiliary line; Step S434, calculating the proportion C of the hairiness pixels outside the yarn trunk area according to the number of row pixels parallel to the yarn trunk direction and the number of hairiness pixels on each auxiliary line.

5. The method for realistically simulating a weft knitted fabric based on a grooved yarn model according to claim 4, characterized in that: In step S434, the calculation formula for the proportion C of hairiness pixels in the area outside the yarn trunk is: ; Where n is the number of auxiliary lines, m is i is the number of feather pixels on the i-th auxiliary line.

6. The method for realistically simulating a weft knitted fabric based on a grooved yarn model according to claim 1, characterized in that: In the step S5, the cross-section is in the shape of a regular hexagon.

7. The method for realistically simulating a weft knitted fabric based on a grooved yarn model according to claim 1, characterized in that: In the step S7, when rendering the acquired weft knitted fabric model, a two-dimensional texture filtering technology is used to smooth the shadow edge of the weft knitted fabric model.