3D Modeling-Based Embroidery Simulation Method and System

Through three-dimensional modeling and lighting technology, the lack of three-dimensional display in the existing technology is solved, and an efficient and interactive embroidery design experience is achieved, which improves design accuracy and efficiency.

CN119939684BActive Publication Date: 2025-07-08CHANGSHU INSTITUTE OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510413377.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-07-08
Estimated Expiration
2045-04-03

AI Technical Summary

Technical Problem

Existing CAD software lacks three-dimensional dynamic effects and realism in embroidery design, and cannot accurately reflect the three-dimensional effect of embroidery patterns. The design efficiency is inefficient and difficult to achieve customization.

Method used

The embroidery simulation method based on three-dimensional modeling is adopted to generate a three-dimensional geometric model by analyzing the embroidery plate making files, combining fabric model and lighting technology to simulate the natural state of wind blowing through the fabric, and achieve dynamic display of the embroidery effect.

Benefits of technology

Improves the accuracy and efficiency of embroidery design, provides an interactive simulation experience, allowing designers to preview and adjust embroidery effects in real time, reducing material waste and time costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119939684B_ABST
    Figure CN119939684B_ABST
Patent Text Reader

Abstract

An embroidery simulation method and system based on three-dimensional modeling, belonging to the technical field of embroidery process simulation, solve the problems that the existing technology lacks three-dimensional dynamic effects and realism when simulating the embroidery process, and that current embroidery simulations can usually only achieve two-dimensional graphics or static models, unable to accurately reflect the true three-dimensional presentation effect of embroidery patterns, resulting in limitations in design. The method includes: collecting embroidery plate-making files; constructing a three-dimensional geometric body model based on Three.js, and generating independent embroidery thread models by parsing the stitch coordinates in the plate-making files; parsing the embroidery plate-making files to generate embroidery patterns; constructing a fabric model, overlaying fabric materials, and restoring the fabric effect; simulating the natural state of the fabric when the wind blows to obtain the display effect of the pattern on the dynamically fluctuating fabric; using a technology engine to render the embroidery result in real time in a virtual environment to complete the simulation. The present invention is applicable to the embroidery product design scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of embroidery process simulation, and particularly relates to an interactive embroidery simulation and rendering technology. Background Art

[0002] Embroidery is a complex traditional handicraft that requires experienced designers to manually complete embroidery operations, resulting in low efficiency and difficulty in achieving large-scale customized designs. In modern industry, CAD software is widely used for designing embroidery patterns and embroidery plate making, and machine embroidery has become a new mode of industrial development. However, current CAD (Computer-Aided Design) software still has deficiencies in the design and analysis of embroidery patterns, mainly manifested in the following aspects:

[0003] Two-dimensional rendering limitation: Traditional CAD software mostly designs embroidery patterns based on a two-dimensional plane, lacking the display of deep three-dimensional effects.

[0004] Lack of dynamic feedback: The current system cannot provide a dynamic simulation function, resulting in poor display effects.

[0005] Therefore, there is an urgent need for a method for generating and simulating embroidery patterns that can achieve high precision and efficiency, helping designers to more intuitively display the finished embroidery products and improve design efficiency. Summary of the Invention

[0006] The present invention proposes an embroidery simulation method and system based on three-dimensional modeling, aiming to solve the problems that the existing technology lacks three-dimensional dynamic effects and realism in the process of simulating embroidery, and the current embroidery simulation usually can only achieve two-dimensional graphics or static models, unable to accurately reflect the true three-dimensional presentation effect of embroidery patterns, resulting in limitations in design.

[0007] The embroidery simulation method based on three-dimensional modeling proposed by the present invention includes the following steps:

[0008] S1: Collect embroidery plate-making files;

[0009] S2: Build a three-dimensional geometric model based on Three.js, and generate independent embroidery thread models by parsing the stitch coordinates in the plate-making file;

[0010] S3: Parse the embroidery plate-making file to generate an embroidery pattern;

[0011] S4: Build a fabric model, overlay fabric materials, and restore the fabric effect;

[0012] S5: Simulate the natural state of the fabric when the wind blows, and obtain the display effect of the pattern on the dynamically fluctuating fabric;

[0013] S6: Use a technology engine to render the embroidery result in real time in a virtual environment to complete the simulation.

[0014] Furthermore, a preferred solution is provided: S2 includes:

[0015] S21: Define two-dimensional coordinate points through a Catmull-Rom spline curve to generate a rotation baseline;

[0016] S22: Rotate the rotation baseline around the Y-axis to generate a three-dimensional geometric body with rotational symmetry.

[0017] Furthermore, a preferred solution is provided: Adjust the length parameter of the three-dimensional geometric body according to the adjacent stitch point spacing, and control the thickness of the embroidery thread through the maximum radius parameter.

[0018] Furthermore, a preferred solution is provided: S3 generates a stitch model according to the stitch point information in the embroidery pattern file to form a complete embroidery pattern, including:

[0019] Parse the DSB pattern file. The DSB pattern file includes a file header and a file body. The file header contains the pattern name, the number of sewing frames, the number of colors, the number of boundary steps, the number of vector steps, reserved characters, and spaces. The file body contains the embroidery path, the stitch positions, and the color change data. By parsing the ABC three bytes of each key frame in the file body, obtain the function code and the stitch displacement code, so as to control the embroidery machine to execute operations and determine the stitch positions.

[0020] Furthermore, a preferred solution is provided: S4 includes:

[0021] Create a plane geometric body through PlaneGeometry and divide it into 50×50 segments;

[0022] Dynamically adjust the vertex Z coordinate using the sine function to simulate the natural swing of the fabric;

[0023] Synchronously update the normal data to ensure the authenticity of light reflection.

[0024] Furthermore, a preferred solution is provided: S5 includes: Simulate the natural state of the fabric being blown by the wind, add vertices to the fabric model, dynamically adjust the vertex positions and load textures, adjust the vertex Z coordinate according to the sine function to simulate the fabric undulation, synchronously update the normals to ensure accurate lighting effects, and adjust the starting and ending Z coordinates of the geometric body in the pattern to achieve the simulation effect of the pattern on the undulating surface.

[0025] Furthermore, a preferred solution is provided: S5 also includes: Adopt lighting technology and texture mapping technology to enhance the realism, including:

[0026] Add white ambient light as the basic lighting;

[0027] Set the directional light to simulate a parallel light source and generate a shadow effect;

[0028] By combining MeshStandardMaterial with roughness, metallicity parameters, and texture maps, the gloss simulation of embroidery thread materials is achieved.

[0029] The present invention also proposes a computer device, which includes a memory and a processor. A computer program is stored in the memory. When the processor runs the computer program stored in the memory, the processor executes the above-mentioned three-dimensional modeling-based embroidery simulation method in any one or more combinations of the above solutions.

[0030] The present invention also proposes a computer-readable storage medium, which is used to store a computer program. The computer program executes the above-mentioned three-dimensional modeling-based embroidery simulation method in any one or more combinations of the above solutions.

[0031] The three-dimensional modeling-based embroidery simulation system proposed by the present invention is implemented based on the above-mentioned three-dimensional modeling-based embroidery simulation method in any one or more combinations of the above solutions. The system includes:

[0032] Data acquisition module: used to acquire embroidery plate-making files;

[0033] Three-dimensional modeling module: constructs a three-dimensional geometric body model based on Three.js, and generates independent embroidery thread models by parsing the stitch coordinates in the plate-making file;

[0034] File parsing module: used to parse embroidery plate-making files and generate embroidery patterns;

[0035] Fabric restoration module: used to construct a fabric model, overlay fabric materials, and restore the fabric effect;

[0036] Interactive simulation module: used to simulate the natural state of the fabric when the wind blows, and obtain the display effect of the pattern on the dynamically fluctuating fabric;

[0037] Real-time rendering module: uses a technology engine to render the embroidery result in real time in a virtual environment to complete the simulation.

[0038] Compared with the prior art, the advantages of the present invention are:

[0039] Existing simulation systems usually only display embroidery patterns in a two-dimensional plane, lacking three-dimensional dynamic effects and the three-dimensional real effects of embroidery. The interactive ability is poor, and it is difficult for existing solutions to interact with operators to achieve customized design.

[0040] To address the above shortcomings, the present invention proposes a technical solution that combines 3D modeling, plate-making file parsing, fabric rendering, and interactive feedback. By parsing the embroidery plate-making file to combine 3D models to generate embroidery patterns, and on the fabric model, ultimately realizing the function of dynamically displaying embroidery patterns. This method solves the problems of low precision and static nature in traditional technologies, improves design efficiency, and provides an interactive simulation experience.

[0041] The specific advantages of the present invention are as follows:

[0042] The present invention utilizes 3D modeling technology to construct a 3D geometric body model, simulate real stitches, and enable the embroidery pattern to be displayed in real time in the form of a 3D animation. The simulation of the gloss of embroidery threads, rendering under different lighting conditions, and the dynamic fluctuation effect of the fabric model all make the embroidery display more realistic and vivid, breaking through the limitations of traditional 2D displays and bringing a brand-new visual experience to users.

[0043] By accurately parsing the needle point information in the embroidery plate-making file to generate patterns with regular color changes and no extra connecting lines, combined with high-precision fabric rendering, the present invention can present rich details of the embroidery pattern, improve the accuracy and quality of the display, and enable users to more clearly understand the overall picture of the embroidery work.

[0044] The interactive simulation function of the present invention allows designers to view the embroidery effect in real time, discover problems in a timely manner during the design process, and make adjustments. This immediate feedback mechanism makes the design process more flexible and efficient, enabling designers to optimize the design scheme at any time according to their creativity and requirements.

[0045] The method described in the present invention provides a dynamic interactive experience. Designers can preview the combined effect of textile products and embroidery, meeting the customized design needs of different users. Users can choose different fabrics and embroidery patterns according to their personal preferences to achieve personalized design.

[0046] The method proposed by the present invention allows users to preview the embroidery effect in a virtual environment, avoiding material waste and increased time costs caused by design problems in actual production. By discovering and solving design defects in advance, it reduces the unnecessary trial-and-error process, lowers production costs, and improves production efficiency.

[0047] The present invention is applicable to the design scenario of embroidery products. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0049] Figure 1 Flow chart of the embroidery simulation method based on 3D modeling according to the first embodiment of the present invention;

[0050] Figure 2 Contour curve graph according to the first specific embodiment of the present invention;

[0051] Figure 3 Schematic diagram of the basic embroidery thread model according to the first specific embodiment of the present invention;

[0052] Figure 4 Schematic diagram of lighting simulation in modeling according to the first specific embodiment of the present invention;

[0053] Figure 5 Schematic diagram of texture mapping according to the first specific embodiment of the present invention. Specific embodiments

[0054] In the following description, for the purpose of illustration rather than limitation, specific details such as specific system structures and technologies are proposed to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.

[0055] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0056] It should also be understood that the terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification of the present application and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms.

[0057] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the scope of protection of the present application.

[0058] In the following description, numerous specific details are set forth to provide a thorough understanding of the present application. However, the present application may be implemented in other ways different from those described herein. Those skilled in the art can make similar generalizations without departing from the spirit of the present application. Therefore, the present application is not limited by the specific embodiments disclosed below.

[0059] Embodiment 1:

[0060] Refer to Figure 1 、 Figure 2 、 Figure 3 、 Figure 4 、 Figure 5 to illustrate this embodiment.

[0061] This embodiment proposes an embroidery simulation method based on 3D modeling, including the following steps:

[0062] S1: Collect embroidery plate-making files;

[0063] S2: Build a 3D geometric body model based on Three.js, and generate independent embroidery thread models by parsing the stitch coordinates in the plate-making file;

[0064] S3: Parse the embroidery plate-making file to generate an embroidery pattern;

[0065] S4: Build a fabric model, overlay fabric materials, and restore the fabric effect;

[0066] S5: Simulate the natural state of the fabric when the wind blows, and obtain the display effect of the pattern on the dynamically fluctuating fabric;

[0067] S6: Use a technology engine to render the embroidery result in real time in a virtual environment to complete the simulation.

[0068] Specifically:

[0069] This embodiment first imports the embroidery plate-making file, parses the model structure, defines the working area of the embroidery machine as a two-dimensional plane coordinate system, and each position of the stitch is represented by coordinates. In embroidery design, the position of each stitch point is recorded in the coordinate system, so that the embroidery machine can accurately locate each needle dropping point. During the embroidery process, the trajectory of the embroidery needle moving with the embroidery thread on the embroidery fabric generates the embroidery stitch, that is, the embroidery path. The embroidery path usually consists of a series of line segments, and each line segment connects two consecutive stitch points. Therefore, two points can determine the generation of an embroidery thread model.

[0070] First, obtain the pattern information. Starting from the 512th byte, each time 3 bytes of stitch point data are read. Each byte (8 bits) is read and converted into a decimal integer. Byte A is used to store some flag bits, and Byte B and Byte C represent the Y and X coordinates respectively.

[0071] Convert the A byte into an 8-bit binary string, and extract the second and third bits. The second bit determines whether Y takes a negative value, and the third bit determines whether X takes a negative value.

[0072] Starting from the initial coordinates (0, 0, 0), accumulate the parsed stitch coordinates one by one to generate the final three-dimensional space coordinates. Calculate the distance between every two adjacent points to obtain the position, orientation, and length of the geometry, and generate the embroidery thread geometry model. By reading the color-changing information in the A byte, determine whether to change the color before generating the geometry. Read the jump stitch and thread cutting information in the A byte to determine whether to generate the geometry, preventing the generation of complicated connecting lines. Finally, generate a pattern with regular color changes and no redundant connecting lines.

[0073] S2 described in this embodiment includes:

[0074] Simulate a real stitch. Establish a basic embroidery thread model through an encapsulated function. This function defines a set of two-dimensional coordinate points through a Catmull-Rom spline curve, and obtains several points from the curve as the rotation baseline. And use LatheGeometry (rotation geometry) in Three.js to rotate these points 360° around the Y axis, thereby generating a three-dimensional geometry with rotational symmetry.

[0075] The contour curve is the basis for constructing the rotating geometry. The shape of the embroidery thread model depends on the distribution of the initial points and the settings of the spline curve. Use the Catmull-Rom spline curve to interpolate a series of control points to generate a smooth curve. The effect is as Figure 2 shown.

[0076] Figure 2 A total of 5 control points are selected in the figure, and the specific definitions are as follows:

[0077] Top center point: ;

[0078] Top transition point: ;

[0079] Maximum radius position: ;

[0080] Bottom transition point: ;

[0081] Bottom center point: ;

[0082] Among them, L is the total length of the geometry. R is the maximum radius. These points are arranged in order from top to bottom. After being connected by a spline curve, a contour line is formed. Among them, A and A', B and B' are symmetric about the X axis. Adjust the parameters of L and R, with the distance between two adjacent stitch points in the stitch displacement code of the embroidery file as the value of L, and the value of R is 0.75.

[0083] To construct a rotating geometric body, it is necessary to extract a point set from the contour curve. Using the getPoints method provided by Three.js, uniform sampling can be performed on the curve path. The curve is evenly divided into 10 discrete points. Through the LatheGeometry class provided by Three.js, the above point set can be rotated around the Y-axis to generate a three-dimensional geometric body with rotational symmetry. One full rotation is divided into 8 slices. The LatheGeometry class calculates the rotational coordinates of each point in sequence through the discretization of the contour points and rotation around the specified axis, connects these coordinates into a triangular mesh, and finally generates the rotating geometric body to complete the geometric modeling. The effect is as Figure 3 shown.

[0084] The luster of the embroidery thread comes from its fiber material and twisting process. When light shines on the surface of the embroidery thread, a soft reflection effect will be produced, making the embroidery pattern more vivid and three-dimensional. The luster can not only enhance the visual beauty of the embroidery, but also present different color levels according to the change of the light angle, increasing the texture and layering of the pattern. Effectively simulating the reflection characteristics of the embroidery thread geometric body under different lighting conditions and showing its luster, the Bidirectional Reflectance Distribution Function (BRDF) is a key concept. Its core is to accurately simulate the behavior of light interacting with the object surface in the real world through mathematical functions. By calculating the outgoing radiance value of each point on the material surface in sequence, the true texture of the object surface can be drawn.

[0085] Adding white ambient light provides basic lighting for the entire scene. It has no direction, so it can illuminate all objects, balance the overall brightness, and make the surface of the embroidery thread geometric body have luster and specular highlights. A directional light is created, which simulates a distant parallel light source (similar to sunlight) and illuminates the scene from the upper right. All illuminated objects will produce parallel shadows in the specified direction, making the embroidery pattern more vivid and realistic with shadows. As Figure 4 shown.

[0086] Texture mapping is a technique for mapping a 2D image onto the surface of a 3D object. Specific textures and colors are applied to the surface of the embroidery thread model to realistically simulate the appearance details of the embroidery thread. In Three.js, by establishing an embroidery thread model to give the embroidery thread a certain three-dimensional sense, and then applying the texture image file of the embroidery thread to the surface of the embroidery thread model through the mapping technique. The MeshStandardMaterial is used for material parsing. This material not only supports efficient lighting calculations, controls the base color of the object through material properties, and can produce rich light and shadow interaction effects in combination with other properties such as roughness and metallicity, but also can be combined with a variety of texture maps to achieve a more realistic rendering effect.

[0087] Extract the texture of the Z-twist two-ply embroidery thread to create a seamless texture map. After establishing the embroidery thread model according to the shape of the embroidery thread, by combining the texture map with the material color, the system can automatically mix them, thus bringing color tones to the texture while retaining texture details. Apply it to the surface mesh of the embroidery thread geometric model to create a more complex and realistic material effect, such as Figure 5 as shown

[0088] The following further elaborates on S3 described in this embodiment:

[0089] The embroidery machine needs to receive the embroidery pattern process information file to control the machine embroidery position and needle selection. The pattern file formats of different computer embroidery machines vary. For example, a certain embroidery software has its own pattern file format as RPF (Richpeace Embroidery Pattern File), and another embroidery software uses the file format EMB (Embroidery), etc. However, these embroidery softwares all support multiple other embroidery file formats, such as DST (Data Stitch Tajima), DSB (Data Stitch BERNINA), DSZ (Data Stitch ZSK), etc., which is convenient for compatibility with different brands of embroidery machines.

[0090] Among them, DST and DSB have almost become universal formats due to their wide application, and the DSB pattern file is favored for its simplicity, comprehensibility, and ease of storage. In this embodiment, the information data of the embroidery pattern is understood by parsing the DSB pattern file.

[0091] The embroidery pattern file usually consists of two main parts: the file header and the file body. The file header part is located at the beginning of the file and usually occupies a fixed number of bytes. The file body part follows immediately after the file header, and its size varies according to the complexity of the specific embroidery pattern design and the number of sewing frames. Each sewing frame consists of a hexadecimal code occupying 3 bytes, including a function code and a stitch displacement code.

[0092] The pattern file header is used to store some descriptive information about the embroidery pattern. The file header in DSB format is the first 512 bytes of the file. Analyzing the file in hexadecimal shows that the file header contains the following information:

[0093] (1) Pattern name: Identifies the name of the design for easy management and identification.

[0094] (2) Number of sewing frames: The number of embroidery frames included in the design, indicating the number of stitches per frame.

[0095] (3) Number of colors: The total number of colors used in the embroidery design.

[0096] (4) Boundary Steps (xmax, xmin, ymax, ymin): The number of steps from the starting sewing point to the embroidery design boundary (left, right, top, bottom), used to determine the size and position of the embroidery.

[0097] (5) Vector Steps: The starting and ending vector steps of the embroidery design in the horizontal and vertical directions.

[0098] (6) Reserved Characters and Spaces: Used to reserve extended information or placeholders.

[0099] In the pattern file, numerical information such as the number of sewing frames and steps is processed as a string and stored in the file in ASCII code; while for character information such as the pattern name, it can be directly stored in the file in ASCII code form.

[0100] The pattern file body contains specific embroidery instructions for controlling the embroidery machine to complete complex embroidery patterns. The file body part mainly records details such as embroidery paths, stitch positions, and color changes. Each needle drop point for controlling the operation of the embroidery machine is a key frame, and each key frame consists of three bytes of hexadecimal code. The file body part in the DSB file, that is, the stitch data part, uses the ABC three-byte description for the format of each key frame. Converting each hexadecimal byte to binary is 8-bit numbers, and the specific expression is shown in Table 1. These three bytes contain a function code and a stitch displacement code.

[0101] Table 1 Byte Information in DSB File

[0102]

[0103] The function code is used to control the embroidery machine to perform specific operations, such as skip stitches, thread changes, stops, ends, etc. Various pattern files are represented by the different bits of a certain byte in binary as shown in Table 2. The DSB file control code is the 8-bit number of the A byte in binary, and the value of the function code determines the running function of the stitch.

[0104] Table 2 Stitch Information in DSB File

[0105]

[0106] The stitch displacement code is used to control the precise position of each stitch in the embroidery pattern, that is, the movement of the needle head in the X and Y axis directions. Let and respectively represent the relative number of steps that the current needle moves relative to the previous needle in the X and Y axis directions. Is represented by the C byte, The value is represented by the B byte. The positive direction of the X axis is horizontal to the right, and the positive direction of the Y axis is vertical upward. Represented by bits A5 and A6 in the A byte and The positive and negative directions of the value, where 0 is the positive direction and 1 is the negative direction. For each needle movement, one stitch is generated, and the displacement between the front and rear needles is the true length of a single stitch.

[0107] The following further explains S4 described in this embodiment:

[0108] Based on the plane geometry in Three.js, use PlaneGeometry to create a plane geometry with a size of 1000 x 1000. Prepare various fabric materials, including cotton, wool, silk, linen, etc. Load the fabric texture and set it to a repeatable pattern so that the fabric surface spreads repeatedly on the plane, increasing the realism. In the material, MeshStandardMaterial is used, combined with appropriate roughness and metallicity parameters to present the texture of the fabric, and at the same time allow double-sided rendering so that the fabric surface can be seen from any angle.

[0109] The following further explains S5 described in this embodiment:

[0110] In the real environment, the embroidery pattern on the clothing fabric will deform as the clothes swing or wrinkle. By simulating the natural state of the wind blowing through the fabric, the display effect of the pattern on the dynamically fluctuating fabric is simulated. The vertex number of the fabric model is increased by a segmentation number of 50 x 50 to make the wave effect smoother. The fabric fluctuation is simulated by dynamically adjusting the vertex positions and loading the texture. Finally, by adjusting the Z coordinate of each vertex in the animation loop, fluctuating according to the sine function, the entire plane forms a dynamic wave effect. The mathematical principle of the sine wave is based on the sine function in trigonometric functions, and its graph is a smooth and periodically undulating curve.

[0111] Synchronously update the normal vector to ensure the accuracy of the lighting effect, thus simulating the effect of the dynamic fabric constantly fluctuating. Obtain the starting point and ending point of each single-needle geometry in the pattern. And adjust the Z coordinates of the starting point and ending point of the geometry according to the wave state to make it consistent with the wave surface, realizing the simulation effect of the pattern on the fluctuating surface. And set an interactive button to independently control the start of the dynamic fluctuation effect. Provide a dynamic interactive experience, and designers can view the embroidery effect in real time.

[0112] This embodiment reduces the implementation cost by simplifying 3D modeling and optimizing real fabric rendering technology. Although there are other 3D modeling software or rendering engine options, technologies such as three.js are efficient enough in the current situation and do not need to replace the existing solutions.

[0113] Embodiment 2:

[0114] This embodiment proposes an embroidery simulation system based on 3D modeling. The system is implemented based on the embroidery simulation method based on 3D modeling as described in Embodiment 1. The system includes:

[0115] Data acquisition module: used to acquire embroidery plate-making files;

[0116] 3D modeling module: constructs a 3D geometric body model based on Three.js, and generates independent embroidery thread models by parsing the stitch coordinates in the plate-making file;

[0117] File parsing module: used to parse embroidery plate-making files and generate embroidery patterns;

[0118] Fabric restoration module: used to construct a fabric model, overlay fabric materials, and restore the fabric effect;

[0119] Interactive simulation module: used to simulate the natural state of the fabric when the wind blows, and obtain the display effect of the pattern on the dynamically fluctuating fabric;

[0120] Real-time rendering module: uses a technology engine to render the embroidery result in real time in a virtual environment to complete the simulation.

[0121] Those skilled in the art can understand that the above is only the preferred embodiment of the present invention. The features described in each embodiment and / or claim of the present disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly recorded in the present disclosure. It is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, for those skilled in the art, they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

[0122] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications once they know the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.

[0123] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.

[0124] Those skilled in the art should understand that the embodiments of the present disclosure can be provided as a method, a system, or a computer program product. Therefore, the present disclosure can take the form of an all-hardware embodiment, an all-software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present disclosure can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0125] The present disclosure is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for realizing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks. These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing devices to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that realizes the functions specified in Figure 1 one or more of the flows Figure 1 or blocks.

[0126] These computer program instructions can also be loaded onto a computer or other programmable data processing devices, such that a series of operation steps are executed on the computer or other programmable devices to generate a computer-implemented process, so that the instructions executed on the computer or other programmable devices provide steps for realizing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks.

[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure rather than to limit the scope of its protection. Although the present disclosure has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that after reading the present disclosure, various changes, modifications, or equivalent replacements can still be made to the specific embodiments of the invention, but these changes, modifications, or equivalent replacements are all within the scope of the protection of the pending claims of the disclosure.

Claims

1. An embroidery simulation method based on three-dimensional modeling, characterized in that, The method includes: S1: Collect the embroidery pattern-making file; S2: Build a three-dimensional geometric model based on Three.js, and generate an independent embroidery thread model by parsing the stitch coordinates in the pattern-making file; S3: Parse the embroidery pattern-making file to generate an embroidery pattern; S4: Build a fabric model, overlay fabric materials, and restore the fabric effect; S5: Simulate the natural state of the wind blowing through the fabric to obtain the display effect of the pattern on the dynamically fluctuating fabric; S6: Use a technology engine to render the embroidery result in real time in a virtual environment to complete the simulation; The S4 includes: Create a plane geometry through PlaneGeometry and divide it into 50×50 segments; Dynamically adjust the vertex Z coordinates using the sine function to simulate the natural swing of the fabric; Synchronously update the normal data to ensure the authenticity of light reflection; The S5 includes: Simulate the natural state of the wind blowing through the fabric, add vertices to the fabric model, dynamically adjust the vertex positions and load textures, adjust the vertex Z coordinates according to the sine function to simulate the fabric fluctuation, synchronously update the normals to ensure the accuracy of the lighting effect, and adjust the starting and ending Z coordinates of the geometry in the pattern to achieve the simulation effect of the pattern on the fluctuating surface.

2. The embroidery simulation method based on three-dimensional modeling according to claim 1, wherein The S2 includes: S21: Define two-dimensional coordinate points through Catmull-Rom spline curves to generate a rotation baseline; S22: Rotate the rotation baseline around the Y axis to generate a three-dimensional geometry with rotational symmetry.

3. The embroidery simulation method based on 3D modeling according to claim 2, wherein Adjust the length parameter of the three-dimensional geometry according to the adjacent stitch point spacing, and control the thickness of the embroidery thread through the maximum radius parameter.

4. The embroidery simulation method based on 3D modeling according to claim 1, wherein The S3 is to generate a stitch model based on the stitch point information in the embroidery pattern-making file to form a complete embroidery pattern, including: Parse the DSB pattern file. The DSB pattern file includes a file header and a file body. The file header contains the pattern name, the number of sewing frames, the number of colors, the number of boundary steps, the number of vector steps, reserved characters, and spaces. The file body contains the embroidery path, the stitch positions, and the color switching data. By parsing the ABC three bytes of each key frame in the file body, obtain the function code and the stitch displacement code, so as to control the embroidery machine to execute operations and determine the stitch positions.

5. The embroidery simulation method based on 3D modeling according to claim 1, characterized in that The S5 also includes: Adopt lighting technology and texture mapping technology to enhance the realism, including: Add white ambient light as the basic lighting; Set the directional light to simulate a parallel light source to generate a shadow effect; Through MeshStandardMaterial combined with roughness, metallicity parameters, and texture maps, realize the gloss simulation of the embroidery thread material.

6. A computer device, characterized in that, It includes a memory and a processor. A computer program is stored in the memory. When the processor runs the computer program stored in the memory, the processor executes the three-dimensional modeling-based embroidery simulation method according to any one of claims 1-5.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program, and the computer program executes the three-dimensional modeling-based embroidery simulation method according to any one of claims 1-5.

8. An embroidery simulation system based on 3D modeling, characterized in that The system is implemented based on the three-dimensional modeling-based embroidery simulation method according to any one of claims 1-5. The system includes: Data acquisition module: used to collect the embroidery pattern-making file; 3D Modeling Module: Construct 3D geometric models based on Three.js, and generate independent embroidery thread models by parsing the stitch coordinates in the plate-making file; File Parsing Module: Used to parse embroidery plate-making files and generate embroidery patterns; Fabric Restoration Module: Used to construct fabric models, overlay fabric materials, and restore fabric effects; Interactive Simulation Module: Used to simulate the natural state of the fabric when the wind blows, and obtain the display effect of the pattern on the dynamically fluctuating fabric; Real-time Rendering Module: Use the technology engine to render the embroidery results in real time in a virtual environment to complete the simulation.

Citation Information

Patent Citations

  • Embroidery image rendering using parametric texture mapping

    CN103180880A

  • Knitted fabric simulation based on data and model combined driving

    CN117371250A