Embroidery simulation method and system based on three-dimensional modeling
Through three-dimensional modeling technology based on Three.js and high-precision fabric rendering, the problem of lack of three-dimensional dynamic effects in the existing technology is solved, real three-dimensional display and interactive design of embroidery patterns are realized, and design efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202510413377.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-04-03
AI Technical Summary
The existing technology lacks three-dimensional dynamic effects and realism when simulating the embroidery process, and cannot accurately reflect the true three-dimensional presentation effect of the embroidery pattern, resulting in limitations in the design.
Three.js-based three-dimensional modeling technology is adopted to generate a three-dimensional geometric model by analyzing the embroidery plate making file, simulating the natural state of wind blowing through the fabric, and combining high-precision fabric rendering and interactive feedback to achieve the function of dynamically displaying embroidery patterns.
It realizes three-dimensional dynamic display of embroidery patterns, breaks through the limitations of traditional two-dimensional display, improves design efficiency and accuracy, provides an interactive simulation experience, and meets customized design needs.
Smart Images

Figure CN119939684A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of embroidery process simulation, and in particular 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 the embroidery operation, which is inefficient and difficult to achieve large-scale customized design. In modern industry, CAD software is widely used to design embroidery patterns and embroidery plates, and machine embroidery has become a new mode of industrial development. Current CAD (computer-aided design) software still has shortcomings in the design and analysis of embroidery patterns, mainly manifested in the following points: Limitations of 2D rendering: Traditional CAD software mostly designs embroidery patterns based on 2D planes, lacking in depth and three-dimensional effects.
[0003] Lack of dynamic feedback: The current system cannot provide dynamic simulation functions and the display effect is poor.
[0004] Therefore, there is an urgent need for a high-precision and high-efficiency embroidery pattern generation and simulation method to help designers more intuitively display embroidery products and improve design efficiency. Summary of the invention
[0005] The present invention proposes an embroidery simulation method and system based on three-dimensional modeling, aiming to solve the problem that the prior art lacks three-dimensional dynamic effects and realism when simulating the embroidery process, and the current embroidery simulation can usually only realize two-dimensional graphics or static models, which cannot accurately reflect the real three-dimensional presentation effect of embroidery patterns, resulting in the problem that the design has limitations.
[0006] The embroidery simulation method based on three-dimensional modeling proposed by the present invention comprises the following steps: S1: Collect embroidery plate making files; S2: constructing a three-dimensional geometric model based on Three.js, and generating an independent embroidery thread model by parsing the stitch coordinates in the plate-making file; S3: parse the embroidery plate-making file and generate the embroidery pattern; S4: Build fabric model, superimpose fabric materials, and restore fabric effect; S5: Simulate the natural state of wind blowing through fabric to obtain the display effect of patterns on dynamically fluctuating fabrics; S6: Use the technology engine to render the embroidery results in real time in a virtual environment to complete the simulation.
[0007] Furthermore, a preferred solution is provided: S2 includes: S21: Define two-dimensional coordinate points through Catmull-Rom spline curve and generate rotation baseline; S22: Rotate the rotation baseline around the Y axis to generate a three-dimensional geometric body with rotational symmetry.
[0008] Furthermore, a preferred solution is provided: the length parameter of the three-dimensional geometric body is adjusted according to the distance between adjacent needle points, and the thickness of the embroidery thread is controlled by the maximum radius parameter.
[0009] Furthermore, a preferred solution is provided: S3 generates a stitch model according to the needle point information in the embroidery plate-making file to form a complete embroidery pattern, including: The DSB pattern file is parsed, and 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, and the file body contains the embroidery path, the stitch position, and the color switching data. By parsing the ABC three bytes of each key frame in the file body, the function code and the stitch displacement code are obtained, so as to control the embroidery machine to perform operations and determine the stitch position.
[0010] Furthermore, a preferred solution is provided: S4 includes: Create a plane geometry through PlaneGeometry and divide it into 50×50 segments; Use the sine function to dynamically adjust the vertex Z coordinate to simulate the natural swing of the cloth; Normal data is updated synchronously to ensure the authenticity of light reflection.
[0011] Furthermore, a preferred solution is provided: S5 includes: simulating the natural state of wind blowing through the cloth, adding vertices to the cloth model, dynamically adjusting the vertex positions and loading textures, adjusting the vertex Z coordinates according to the sine function, simulating cloth fluctuations, synchronously updating normals, ensuring accurate lighting effects, adjusting the starting and ending Z coordinates of the geometric bodies in the pattern, and realizing the simulation effect of the pattern on the fluctuating surface.
[0012] Furthermore, a preferred solution is provided: the S5 further includes: using lighting technology and texture mapping technology to enhance the sense of reality, including: Add white ambient light as base lighting; Set the directional light to simulate parallel light sources and generate shadow effects; By combining MeshStandardMaterial with roughness, metalness parameters and texture mapping, the gloss simulation of embroidery thread material can be achieved.
[0013] The present invention also proposes a computer device, which includes a memory and a processor, wherein a computer program is stored in the memory. When the processor runs the computer program stored in the memory, the processor executes the embroidery simulation method based on three-dimensional modeling described in any one or more combinations of the above-mentioned schemes.
[0014] The present invention also proposes a computer-readable storage medium, which is used to store a computer program, and the computer program executes the embroidery simulation method based on three-dimensional modeling described in any one or more combinations of the above-mentioned solutions.
[0015] The embroidery simulation system based on three-dimensional modeling proposed by the present invention is implemented based on the embroidery simulation method based on three-dimensional modeling described in any one or more of the above schemes, and the system includes: Data collection module: used to collect embroidery plate-making files; 3D modeling module: construct a 3D geometric model based on Three.js, and generate an independent embroidery model 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 build fabric models, superimpose fabric materials, and restore fabric effects; Interactive simulation module: used to simulate the natural state of wind blowing through fabric, and obtain the display effect of patterns on dynamically fluctuating fabrics; Real-time rendering module: Use the technology engine to render the embroidery results in real time in a virtual environment to complete the simulation.
[0016] Compared with the prior art, the advantages of the present invention are: Existing simulation systems usually only display embroidery patterns in a two-dimensional plane, lacking three-dimensional dynamic effects and the three-dimensional real effect of embroidery. The interactive ability is poor, and it is difficult for existing solutions to interact with operators and realize customized design.
[0017] In view of the above shortcomings, the present invention proposes a technical solution combining 3D modeling, plate-making file parsing, cloth rendering and interactive feedback. The embroidery pattern is generated by parsing the embroidery plate-making file and combining the 3D model, and finally the function of dynamically displaying the embroidery pattern is realized on the cloth model. This method solves the low-precision and static problems of traditional technology, improves design efficiency and provides an interactive simulation experience.
[0018] The specific advantages of the present invention are as follows: The present invention uses 3D modeling technology to construct a 3D geometric model, simulate real stitches, and display embroidery patterns in real time in the form of 3D animation. The simulation of the glossiness of the embroidery thread, the 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 display and bringing a new visual experience to users.
[0019] By accurately parsing the needle point information in the embroidery plate-making file, generating patterns with regular color changes and no redundant connecting lines, and combining with high-precision fabric rendering, the present invention can present the rich details of the embroidery pattern, improve the accuracy and quality of the display, and allow users to understand the overall picture of the embroidery work more clearly. The interactive simulation function of the present invention allows designers to view the embroidery effect in real time, find problems in time and make adjustments during the design process. This instant feedback mechanism makes the design process more flexible and efficient, and designers can optimize the design plan at any time according to their own creativity and needs. The method of the present invention provides a dynamic interactive experience, and the designer can preview the combination effect of textile products and embroidery to meet the customized design needs of different users. Users can choose different fabrics and embroidery patterns according to their personal preferences to achieve personalized design. The method proposed by the present invention allows users to preview embroidery effects 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, unnecessary trial and error processes are reduced, production costs are reduced, and production efficiency is improved. The present invention is suitable for embroidery product design scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0021] Figure 1 It is a flow chart of the embroidery simulation method based on three-dimensional modeling according to the first embodiment of the present invention; Figure 2 The contour curve diagram described in the first specific embodiment of the present invention; Figure 3 This is a schematic diagram of a basic embroidery thread model described in a specific implementation mode 1 of the present invention; Figure 4 A schematic diagram of lighting simulation in modeling according to a first specific implementation mode of the present invention; Figure 5 This is a schematic diagram of texture mapping described in a first specific implementation mode of the present invention. DETAILED DESCRIPTION
[0022] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may 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 prevent unnecessary details from obstructing the description of the present application.
[0023] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0024] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in this application specification and the appended claims, the singular forms "a", "an" and "the" are intended to include plural forms unless the context clearly indicates otherwise.
[0025] The following is a clear and complete description of the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0026] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present application. Therefore, the present application is not limited to the specific implementation methods disclosed below.
[0027] Implementation method 1: Reference Figure 1 , Figure 2 , Figure 3 , Figure 4 , Figure 5 This embodiment will be described.
[0028] This embodiment proposes an embroidery simulation method based on three-dimensional modeling, comprising the following steps: S1: Collect embroidery plate making files; S2: constructing a three-dimensional geometric model based on Three.js, and generating an independent embroidery thread model by parsing the stitch coordinates in the plate-making file; S3: parse the embroidery plate-making file and generate the embroidery pattern; S4: Build fabric model, superimpose fabric materials, and restore fabric effect; S5: Simulate the natural state of wind blowing through fabric to obtain the display effect of patterns on dynamically fluctuating fabrics; S6: Use the technology engine to render the embroidery results in real time in a virtual environment to complete the simulation.
[0029] Specifically: This implementation method first imports the embroidery plate-making file, parses the model structure, and defines the embroidery machine working area as a two-dimensional plane coordinate system, and each position of the stitch is represented by a coordinate. In the embroidery design, the position of each stitch point is recorded in the coordinate system, so that the embroidery machine can accurately locate each needle drop point. During the embroidery process, the trajectory of the embroidery needle moving with the embroidery thread on the embroidery cloth generates the embroidery stitch, that is, the embroidery path. The embroidery path is usually composed of a series of line segments, each of which connects two consecutive stitch points. Therefore, two points can determine the generation of an embroidery thread model.
[0030] First, get the pattern information, starting from the 512th byte, read one stitch point data each time, that is, 3 bytes of data. Each byte (8 bits) is read and converted into a decimal integer. The A byte is used to store some flags, and the B and C bytes represent the Y and X coordinates respectively.
[0031] Convert the A byte into an 8-bit binary string and extract bits 2 and 3. Bit 2 determines whether Y is negative, and bit 3 determines whether X is negative.
[0032] Starting from the initial coordinates (0,0,0), the coordinates of the needle points are accumulated one by one to generate the final three-dimensional space coordinates. The distance between each two adjacent points is calculated to obtain the position, orientation and length of the geometric body, and the embroidery line geometric body model is generated. By reading the color change information in the A byte, it is determined whether to change the color before generating the geometric body. The stitch skipping and thread cutting information in the A byte is read to determine whether to generate the geometric body, to prevent the generation of complicated connecting lines, and finally to generate a pattern with regular color change and no redundant connecting lines.
[0033] The S2 described in this embodiment includes: To simulate real stitches, a basic embroidery model is established through a package function, which defines a set of two-dimensional coordinate points through a Catmull-Rom spline curve, obtains several points from the curve as a rotation baseline, and uses LatheGeometry (rotation geometry) in Three.js to rotate these points 360° around the Y axis, thereby generating a three-dimensional geometry with rotational symmetry.
[0034] The contour curve is the basis for constructing a rotational geometry. The shape of the embroidery model depends on the distribution of the initial points and the settings of the spline curve. The Catmull-Rom spline curve is used to interpolate a series of control points to generate a smooth curve. The effect is as follows Figure 2 shown.
[0035] Figure 2 The CPC selected 5 control points, which are defined as follows: Top center point: ; Top transition point: ; Maximum radius position: ; Bottom transition point: ; Bottom center point: ; Where L is the total length of the geometric body. R is the maximum radius. These points are arranged from top to bottom and connected by spline curves to form a contour line. A and A', B and B' are symmetrical about the X axis. Adjust the parameters of L and R, so that the distance between two adjacent needle points in the stitch displacement code of the embroidery file is the value of L, and the value of R is 0.75.
[0036] In order to construct a rotated geometry, it is necessary to extract a point set from the contour curve. Using the getPoints method provided by Three.js, you can sample evenly on the curve path. Divide the curve into 10 discrete points. Using the LatheGeometry class provided by Three.js, you can rotate the above point set around the Y axis to generate a three-dimensional geometry with rotational symmetry. One rotation is divided into 8 slices. The LatheGeometry class discretizes the contour points and rotates around the specified axis, calculates the rotation coordinates of each point in turn, connects these coordinates into a triangular mesh, and finally generates a rotated geometry to complete the geometric modeling. The effect is as follows: Figure 3 shown.
[0037] The glossiness of embroidery thread comes from its fiber material and twisting process. When light shines on the surface of embroidery thread, it produces a soft reflective effect, making the embroidery pattern more vivid and three-dimensional. The glossiness not only enhances the visual beauty of embroidery, but also presents different color levels according to the angle of light, increasing the texture and layering of the pattern. The light reflection distribution function (BRDF) is a key concept to effectively simulate the reflection characteristics of embroidery thread geometry under different lighting conditions and show its glossiness. Its core is to accurately simulate the interaction between light and the surface of an object in the real world through mathematical functions. By calculating the outgoing radiation brightness value of each point on the material surface in turn, the real texture of the object surface can be drawn.
[0038] A white ambient light is added to provide basic lighting for the entire scene. It has no direction, so it can illuminate all objects and balance the overall brightness, making the surface of the embroidery geometry have gloss and highlights. A directional light is created, which simulates a long-distance 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. Figure 4 shown.
[0039] Texture mapping is a technology that maps 2D images to the surface of 3D objects. Specific textures and colors are applied to the surface of the embroidery model to realistically simulate the appearance details of the embroidery. In Three.js, the embroidery model is established to give the embroidery a certain three-dimensional sense, and then the texture image file of the embroidery is applied to the surface of the embroidery model through mapping technology. The physical mesh material MeshStandardMaterial is used for material analysis. This material not only supports efficient lighting calculations, but also controls the basic color of the object through material properties. Combined with other properties such as roughness, metallicity, etc., it can produce rich light and shadow interaction effects. It can also be combined with a variety of texture maps to achieve more realistic rendering effects.
[0040] Extract the texture of Z-twisted 2-ply embroidery thread and make a square continuous texture map. After building the embroidery thread model according to the shape of the embroidery thread, the system can automatically mix the texture with the material color by combining the map texture, thereby retaining the texture details while bringing color tones to the texture. Apply it to the surface mesh of the embroidery thread geometric model to create more complex and realistic material effects, such as Figure 5 shown.
[0041] The following further describes S3 described in this embodiment: The embroidery machine needs to receive the embroidery pattern process information file to control the machine embroidery position and needle selection. Different computer embroidery machines have different pattern file formats. For example, a certain embroidery software has its own pattern file format RPF (RichpeaceEmbroidery Pattern File), and another embroidery software uses the file format EMB (Embroidery). However, these embroidery software all support a variety of 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 embroidery machines of different brands.
[0042] Among them, DST and DSB have become almost universal formats due to their wide application, while DSB pattern files are favored for their simplicity, ease of understanding and ease of storage. This implementation method understands the information data of the embroidery pattern by parsing the DSB pattern file.
[0043] Embroidery pattern files usually consist of two main parts: the file header and the file body. The file header is located at the beginning of the file and usually occupies a fixed number of bytes. The file body follows the file header and its size varies depending on the complexity of the specific embroidery pattern design and the number of sewing frames. Each sewing frame consists of a 3-byte hexadecimal code, including a function code and a stitch displacement code.
[0044] The pattern file header is used to store some information about the embroidery pattern. The DSB format file header is the first 512 bytes of the file. The hexadecimal analysis of the file shows that the file header contains the following information: (1) Pattern name: The name of the logo design for easy management and identification.
[0045] (2) Number of sewing frames: The number of embroidery frames included in the design, indicating the number of stitches in each frame.
[0046] (3) Number of colors: The total number of colors used in the embroidery design.
[0047] (4) Boundary steps (xmax, xmin, ymax, ymin): The number of steps from the sewing start point to the embroidery design boundary (left, right, top, bottom), which is used to determine the size and position of the embroidery.
[0048] (5) Vector steps: The starting and ending vector steps of the embroidery design in the horizontal and vertical directions.
[0049] (6) Reserved characters and spaces: used to reserve extended information or placeholders.
[0050] In the pattern file, numerical information such as the number of sewing frames and steps is processed into character strings and stored in the file in ASCII code; while character information such as the pattern name can be directly stored in the file in ASCII code.
[0051] The pattern file body contains specific embroidery instructions, which are used to control the embroidery machine to complete complex embroidery patterns. The file body mainly records detailed data such as embroidery path, stitch position, color switching, etc. Each needle drop point that controls 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 of the DSB file, that is, the stitch data part, uses ABC three bytes to describe the format of each key frame. Each hexadecimal byte is converted into binary as an 8-bit number. The specific expression is shown in Table 1. These three bytes contain function codes and stitch displacement codes.
[0052] Table 1 Byte information in DSB file
[0053] Function codes are used to control the embroidery machine to perform specific operations, such as skipping, thread change, stop, end, etc. Various pattern files are represented by different bits of a certain byte binary, see Table 2. The DSB file control code is an 8-bit number of A byte binary, and the value of the function code determines the running function of the stitch.
[0054] Table 2 Pin information in DSB file
[0055] 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 in the X-axis and Y-axis directions. and Respectively represent the relative steps of the current needle moving in the X and Y axis directions relative to the previous needle. Represented by C byte, The value is represented by the B byte, with the X axis horizontally to the right being positive and the Y axis vertically upward being positive. and The value is positive or negative, 0 is positive and 1 is negative. Each time a needle is moved, a stitch is generated, and the displacement between the front and back needles is the actual length of a single stitch.
[0056] The S4 described in this embodiment is further described below: Based on the plane geometry in Three.js, use PlaneGeometry to create a plane geometry of size 1000 x1000. Prepare various fabric materials, including cotton, wool, silk, linen, etc. Load the fabric texture and set it to a repeatable mode so that the surface of the cloth is repeatedly spread on the plane to increase the sense of reality. In the material, MeshStandardMaterial is used, combined with appropriate roughness and metalness parameters to present the texture of the cloth, and double-sided rendering is allowed so that the cloth surface can be seen from any angle.
[0057] The S5 described in this embodiment is further described below: In the real world, embroidery patterns on clothing fabrics will deform as the clothes swing or wrinkle. By simulating the natural state of wind blowing through the fabric, the display effect of the pattern on the dynamically fluctuating fabric is simulated. The fabric model is divided into 50 x 50 segments to increase the number of vertices to make the wave effect smoother. The fabric fluctuation is simulated by dynamically adjusting the vertex position and loading textures. Finally, by adjusting the Z coordinate of each vertex in the animation loop, according to the sine function fluctuation, the entire plane forms a dynamic wave effect. The mathematical principle of sine fluctuation is based on the sine function in trigonometric function, and its graph is a smooth, periodically undulating curve.
[0058] Synchronously update the normals to ensure the accuracy of the lighting effect, thereby simulating the effect of the dynamic fabric constantly fluctuating. Get the starting and ending points of each single-needle geometric body in the pattern. And adjust the Z coordinates of the starting and ending points of the geometric body according to the wave state to make them consistent with the wave surface, so as to achieve the simulation effect of the pattern on the wave surface. And set an interactive button to autonomously control the opening of the dynamic fluctuation effect. Provide a dynamic interactive experience, and designers can view the embroidery effect in real time.
[0059] This implementation reduces the implementation cost by simplifying 3D modeling and optimizing real cloth rendering technology. Although there are other 3D modeling software or rendering engine options, technologies such as three.js are already efficient enough in the current situation and do not need to replace existing solutions.
[0060] Implementation method 2: This embodiment proposes an embroidery simulation system based on three-dimensional modeling, and the system is implemented based on the embroidery simulation method based on three-dimensional modeling as described in the first embodiment, and the system includes: Data collection module: used to collect embroidery plate-making files; 3D modeling module: construct a 3D geometric model based on Three.js, and generate an independent embroidery model 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 build fabric models, superimpose fabric materials, and restore fabric effects; Interactive simulation module: used to simulate the natural state of wind blowing through fabric, and obtain the display effect of patterns on dynamically fluctuating fabrics; Real-time rendering module: Use the technology engine to render the embroidery results in real time in a virtual environment to complete the simulation.
[0061] Those skilled in the art will appreciate that the above are only preferred embodiments of the present invention, and the various embodiments of the present disclosure and / or the features described in the claims may be combined or combined in various ways, even if such combinations or combinations are not explicitly described 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 aforementioned embodiments, those skilled in the art may still modify the technical solutions described in the aforementioned embodiments, or perform equivalent substitutions on some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.
[0062] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0063] 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 equivalents, the present invention is also intended to include these modifications and variations.
[0064] It should be understood by those skilled in the art that the embodiments of the present disclosure may be provided as methods, systems or computer program products. Therefore, the present disclosure may be implemented in the form of a complete hardware implementation, a complete software implementation or an implementation combining software and hardware. Moreover, the present disclosure may be implemented in 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.) containing computer-usable program code. The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram and the combination of processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes. These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes. Finally, it should be noted that the above implementation modes are only used to illustrate the technical solutions of the present disclosure rather than to limit its protection scope. Although the present disclosure has been described in detail with reference to the above implementation modes, ordinary technicians in the relevant field should understand that after reading the present disclosure, those skilled in the art can still make various changes, modifications or equivalent substitutions to the specific implementation modes of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the disclosed claims to be approved.
Claims
1. An embroidery simulation method based on three-dimensional modeling, characterized in that: The method comprises: S1: Collect embroidery plate making files; S2: constructing a three-dimensional geometric model based on Three.js, and generating an independent embroidery thread model by parsing the stitch coordinates in the plate-making file; S3: parse the embroidery plate-making file and generate the embroidery pattern; S4: Build fabric model, superimpose fabric materials, and restore fabric effect; S5: Simulate the natural state of wind blowing through fabric to obtain the display effect of patterns on dynamically fluctuating fabrics; S6: Use the technology engine to render the embroidery results in real time in a virtual environment to complete the simulation.
2. The embroidery simulation method based on three-dimensional modeling according to claim 1, characterized in that: The S2 includes: S21: Define two-dimensional coordinate points through Catmull-Rom spline curve and generate rotation baseline; S22: Rotate the rotation baseline around the Y axis to generate a three-dimensional geometric body with rotational symmetry.
3. The embroidery simulation method based on three-dimensional modeling according to claim 2, characterized in that: Adjust the length parameters of the three-dimensional geometric body according to the distance between adjacent needle points, and control the thickness of the embroidery thread through the maximum radius parameter.
4. The embroidery simulation method based on three-dimensional modeling according to claim 1, characterized in that: S3 generates a stitch model according to the needle point information in the embroidery plate-making file to form a complete embroidery pattern, including: The DSB pattern file is parsed, and 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, and the file body contains the embroidery path, the stitch position, and the color switching data. By parsing the ABC three bytes of each key frame in the file body, the function code and the stitch displacement code are obtained, so as to control the embroidery machine to perform operations and determine the stitch position.
5. The embroidery simulation method based on three-dimensional modeling according to claim 1, characterized in that: The S4 includes: Create a plane geometry through PlaneGeometry and divide it into 50×50 segments; Use the sine function to dynamically adjust the vertex Z coordinate to simulate the natural swing of the cloth; Normal data is updated synchronously to ensure the authenticity of light reflection.
6. The embroidery simulation method based on three-dimensional modeling according to claim 1, characterized in that: The S5 includes: simulating the natural state of wind blowing through the cloth, adding vertices to the cloth model, dynamically adjusting the vertex positions and loading textures, adjusting the vertex Z coordinates according to the sine function, simulating cloth fluctuations, synchronously updating normals to ensure accurate lighting effects, adjusting the starting and ending Z coordinates of the geometric bodies in the pattern, and realizing the simulation effect of the pattern on the fluctuating surface.
7. The embroidery simulation method based on three-dimensional modeling according to claim 6, characterized in that: The S5 also includes: using lighting technology and texture mapping technology to enhance the sense of reality, including: Add white ambient light as base lighting; Set the directional light to simulate parallel light sources and generate shadow effects; By combining MeshStandardMaterial with roughness, metalness parameters and texture mapping, the gloss simulation of embroidery thread material can be achieved.
8. Computer device, characterized in that It comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor runs the computer program stored in the memory, the processor executes the embroidery simulation method based on three-dimensional modeling according to any one of claims 1-7.
9. 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 embroidery simulation method based on three-dimensional modeling according to any one of claims 1 to 7.
10. The embroidery simulation system based on three-dimensional modeling is characterized by: The system is implemented based on the embroidery simulation method based on three-dimensional modeling as described in any one of claims 1 to 7, and the system includes: Data collection module: used to collect embroidery plate-making files; 3D modeling module: construct a 3D geometric model based on Three.js, and generate an independent embroidery model 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 build fabric models, superimpose fabric materials, and restore fabric effects; Interactive simulation module: used to simulate the natural state of wind blowing through fabric, and obtain the display effect of patterns on dynamically fluctuating fabrics; 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
Simulation method of ball B-spline-based weft knitted fabric model
CN104933216A
Knitted fabric simulation based on data and model combined driving
CN117371250A
Three-dimensional wrinkle model dynamic generation method based on WebGL and Lamb-Session classification
CN118298119A
Embroidery image rendering using parametric texture mapping
US20120101790A1
Cited By
Embroidery process version generation system capable of automatically identifying personalized customization order
CN121998591A
Automatic pattern generation system for embroidery techniques in customized orders
CN121998591B