A method for embroidering vector font library based on cubic Bezier curve
By using a vector font library method based on cubic Bézier curves, the problem of rigid font structure in embroidery machines was solved, achieving a flexible font library structure and high embroidery efficiency, thus improving the embroidery efficiency of embroidery machines.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN THAI WISDOM TECH CO LTD
- Filing Date
- 2023-02-03
- Publication Date
- 2026-04-28
AI Technical Summary
In existing embroidery machine technology, the font structure in the embroidery vector font library is rigid and cannot support complex strokes. Furthermore, font model acquisition is time-consuming and prone to errors, making it unable to support the embroidery of a large number of pictographic characters with many fonts, resulting in low embroidery efficiency of the embroidery machine.
An embroidery vector font method based on cubic Bézier curves is adopted. By defining the font file structure, the embroidery stitches of the embroidered characters are generated. By using the cubic Bézier curve segment control line structure, a flexible font structure is generated, which improves the embroidery efficiency of the embroidery machine.
It improves the speed of text pattern generation, simplifies the method of font library structure acquisition, enhances the embroidery efficiency of embroidery machines, and enables efficient embroidery without the need for an internet connection.
Smart Images

Figure CN116127917B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of embroidery machine technology, and in particular to a method for embroidery vector font library based on cubic Bézier curves. Background Technology
[0002] An embroidery machine is an automated device that uses computer programming to automate the traditional, millennia-old art of embroidery. It includes a frame, color-changing mechanism, motor drive, and main control system.
[0003] The working principle of an embroidery machine: The main shaft drives the needle bar, and through a series of mechanical transmissions such as cams, the circular motion is converted into the reciprocating motion of the needle bar. The embroidery thread passes through the needle bar and forms a loop with the shuttle below to secure the thread to the fabric, creating stitches. A series of stitches of different colors are combined to form the desired graphic outline. During use, it has been found that text appears very frequently in embroidery work due to the existence of various beautiful artistic fonts and the special meanings of words such as "LOVE" and "name".
[0004] However, current embroidery machine technology still suffers from problems such as rigid font structures in embroidery vector font libraries, which cannot support complex stroke variations, and time-consuming and error-prone font acquisition, making it unable to support the embroidery of a large number of pictographic characters with diverse fonts, resulting in low embroidery efficiency of embroidery machines. Therefore, we propose a method based on cubic Bézier curves for embroidery vector font libraries to solve the above problems. Summary of the Invention
[0005] The purpose of this invention is to solve the problems of existing embroidery machine technology, such as rigid font structures in embroidery vector font libraries that cannot support complex strokes, time-consuming and error-prone font acquisition, and inability to support the embroidery of a large number of pictographic characters, resulting in low embroidery efficiency of embroidery machines. Therefore, this invention proposes a method for embroidery vector font libraries based on cubic Bézier curves.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] A method for creating an embroidery vector font based on cubic Bézier curves includes the following steps:
[0008] S1: Define: The font file structure is defined by professionals;
[0009] S2: Definition Representation: The definition representation structure of the font file structure obtained by professionals through definition;
[0010] S3: Regulations: Regulations are made based on the structure of the text and the embroidery technique;
[0011] S4: Perform processing: Generate embroidery stitches for the strokes of the embroidered text through the obtained definition representation structure.
[0012] Preferably, in S1, a professional defines the font file structure, which includes a file header, a character information table, and font data. The file header is used to define the font name, file size, coordinate system, number of characters, original font size, and font library version. The original font size uses millimeters as the unit. The character information table is used to record the unicode encoding of each character and the offset position of its font data in the third part of the file, and is used to index the font data. The font data is used to define the specific structure of all characters in the font library. The storage format of the font data follows the tree structure definition of the characters. The tree structure is defined as the character structure being composed of strokes. During the definition of the tree structure, it is defined that the character '人' consists of two strokes, a '丿' and a '捺'. The stroke structure is composed of a bottom line and control lines. The bottom line is used for the pre-embroidered stitches to prevent wrinkles during embroidery and is empty in the font library. There are two control lines. By following the writing stroke of the character, the boundary line on the left side of the stroke is defined as control line 1, and the boundary line on the right side of the stroke is defined as control line 2. The shape of the entire stroke is determined by the control lines on both sides. At the same time, there are no strokes with a width of 0 for the control lines. For a solid period dot, its shape is determined by the control edges of two semi-circles.
[0013] Preferably, in S2, a professional obtains the definition representation structure of the font file structure through definition. The definition representation structure of the file header is
[0014] FontName; / / Font name
[0015] FileSize; / / Number of bytes of the font file size
[0016] CharSum; / / Total number of characters contained in the font library
[0017] Coordinate; / / Type of coordinate system used by the font library
[0018] FontHeight; / / Font height
[0019] FontWidth; / / Font width
[0020] Version; / / Font version
[0021] Reserve
[121] . The file header occupies a total of 512 bytes. The Reserve field is a reserved field that is not used temporarily and is used for subsequent version expansion. The definition representation structure of the character information table is
[0022] Unicode; / / Unicode encoding of text
[0023] DataPos; / / The offset address of the character pattern data in the file, where the offset address of the character pattern data in the file must start from the beginning of the file, and the file storage structure of the character pattern data is defined as follows:
[0024] CharSize; / / Size of character data (in bytes)
[0025] CStrokNum; / / Number of strokes in the character
[0026] SBaseNum; / / Number of baseline points
[0027] pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point)
[0028] pCoorX; / / X coordinate of point
[0029] pCoorY; / / Y coordinate of the point
[0030] SCtrlNum1; / / Number of control line 1s
[0031] pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point)
[0032] pCoorX; / / X coordinate of point
[0033] pCoorY; / / Y coordinate of the point
[0034] SCtrlNum2; / / Number of control lines (2 points)
[0035] pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point)
[0036] pCoorX; / / X coordinate of point
[0037] pCoorY; / / Y coordinate of the point;
[0038] Preferably, in step S3, the structure of the characters and the embroidery process are specified. The specified content is that the number of strokes is not less than 1, and the leader line of a stroke can be empty. A stroke has two control lines. A cubic Bézier curve is formed by four points: interpolation point + backward control point + forward control point + interpolation point. The leader line / control line has one or more Bézier curve segments. At the same time, storage space is saved by sharing the middle interpolation point in the point linked list between the two Bézier curve segments.
[0039] Preferably, in S4, the embroidery stitches of the embroidery text strokes are generated by processing the obtained definition representation structure. Among them, the embroidery stitches are generated through the control line structure, and the control line structure is composed of control segments, and each control segment is a cubic Bezier curve segment. According to the characteristics of the Bezier curve, and through the relationship between the control points and the interpolation points, the current segment is controlled to be a straight line segment or a curve segment. The number of control segments divided by the control line 1 and the control line 2 is the same, and the generation of the embroidery stitches when embroidering the text strokes is determined by the division of the corresponding control segments of the control line 1 and the control line 2. When used in the embroidery process, the corresponding Bezier curve segments on both sides of the control line 1 and the control line 2 need to be extracted to form the opposite-side input method in the embroidery plate-making software, and the corresponding stitch algorithm is adopted to generate the text embroidery stitches.
[0040] Compared with the prior art, the beneficial effects of the present invention are:
[0041] 1. By improving the method, the generation speed of the text pattern plate is increased, and the embroidery machine does not need to be connected to the network when in use. Moreover, a more flexible and simple font library structure is obtained by improving the font library structure and the acquisition method, thus improving the embroidery efficiency of the embroidery machine.
[0042] The purpose of the present invention is to increase the generation speed of the text pattern plate by improving the method, and the embroidery machine does not need to be connected to the network when in use. Moreover, a more flexible and simple font library structure is obtained by improving the font library structure and the acquisition method, thus improving the embroidery efficiency of the embroidery machine. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flowchart of a method for an embroidery vector font library based on a cubic Bezier curve proposed by the present invention;
[0044] Figure 2 It is a flowchart of the font pattern organizational structure of a method for an embroidery vector font library based on a cubic Bezier curve proposed by the present invention;
[0045] Figure 3 It is a diagram of the regular script Chinese character 'Jun' in the font library format production of a method for an embroidery vector font library based on a cubic Bezier curve proposed by the present invention;
[0046] Figure 4 It is a working diagram of collecting font pattern data of a method for an embroidery vector font library based on a cubic Bezier curve proposed by the present invention;
[0047] Figure 5 It is a text stitch diagram of a method for an embroidery vector font library based on a cubic Bezier curve proposed by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0048] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments.
[0049] Embodiment 1
[0050] Referring to Figure 1-5 , a method for an embroidered vector font library based on cubic Bezier curves, includes the following steps:
[0051] S1: Definition: A professional defines the font library file structure, where the font library file structure includes three parts: a file header, a character information table, and font pattern data. The file header is used to define the font name, file size, coordinate system, number of characters, original font size, and font library version. The original font size uses millimeters as the unit. The character information table is used to record the unicode encoding of each character and the offset position of its font pattern data in the third part of the file, and is used to index the font pattern. The font pattern data is used to define the specific structure of all characters in the font library. The storage format of the font pattern data follows the tree-like structure definition of characters. The tree-like structure defines that the character structure is composed of strokes. During the definition of the tree-like structure, it is defined that the character "person" is composed of two strokes: a "left-falling stroke" + a "right-falling stroke". The stroke structure is composed of a bottom line and control lines. The bottom line is used for the stitch of pre-embroidery to prevent wrinkles during embroidery and is empty in the font library. There are two control lines. The boundary line on the left side of the stroke is defined as control line 1 according to the writing stroke of the character, and the boundary line on the right side of the stroke is defined as control line 2. The shape of the entire stroke is determined by the control lines on both sides. At the same time, there is no stroke with a width of 0 for the control lines. For the solid period dot, its shape is determined by the control edges of two semi-circles;
[0052] S2: Definition representation: A professional obtains the definition representation structure of the font library file structure through definition. The definition representation structure of the file header is
[0053] FontName; / / Font name
[0054] FileSize; / / Number of bytes of the font file size
[0055] CharSum; / / Total number of characters included in the font library
[0056] Coordinate; / / Type of coordinate system used by the font library
[0057] FontHeight; / / Font pattern height
[0058] FontWidth; / / Font pattern width
[0059] Version; / / Font pattern version
[0060] Reserve
[121] , the file header occupies a total of 512 bytes, the Reserve field is a reserved field that is not currently used, and the Reserve field is used for subsequent version expansion, the definition of the text information table represents the structure as follows
[0061] Unicode; / / Unicode encoding of text
[0062] DataPos; / / The offset address of the character pattern data in the file, where the offset address of the character pattern data in the file must start from the beginning of the file, and the file storage structure of the character pattern data is defined as follows:
[0063] CharSize; / / Size of character data (in bytes)
[0064] CStrokNum; / / Number of strokes in the character
[0065] SBaseNum; / / Number of baseline points
[0066] pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point)
[0067] pCoorX; / / X coordinate of point
[0068] pCoorY; / / Y coordinate of the point
[0069] SCtrlNum1; / / Number of control line 1s
[0070] pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point)
[0071] pCoorX; / / X coordinate of point
[0072] pCoorY; / / Y coordinate of the point
[0073] SCtrlNum2; / / Number of control lines (2 points)
[0074] pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point)
[0075] pCoorX; / / X coordinate of point
[0076] pCoorY; / / Y coordinate of the point;
[0077] S3: Make regulations: Make regulations according to the framework structure of the characters and the embroidery process. When making regulations, the content of the regulations is that the number of strokes is not less than 1, and the lead line of one stroke can be empty. One stroke has two control lines. A cubic Bézier curve segment is formed by a total of four points: interpolation point + backward control point + forward control point + interpolation point. And there is 1 or more Bézier curve segments in the lead line / control line. At the same time, the storage space is saved by using the interpolation points in the middle of the common point linked list of the front and back two Bézier curves;
[0078] S4: Perform processing: Generate the embroidery stitches of the embroidery character strokes through the obtained definition representation structure. Among them, the embroidery stitches are generated through the control line structure. The control line structure is composed of control segments, and each control segment is a cubic Bézier curve segment. According to the characteristics of the Bézier curve, and through the relationship between the control points and the interpolation points, control the current segment to be a straight line segment or a curve segment. The number of control segments divided by control line 1 and control line 2 is the same. And the generation of the embroidery stitches when embroidering the character strokes is determined by the division of the corresponding control segments of control line 1 and control line 2. When used in the embroidery process, it is necessary to extract the corresponding Bézier curve segments on both sides of control line 1 and control line 2 to form the opposite side input method in the embroidery plate-making software, and adopt the corresponding stitch algorithm to generate the character embroidery stitches.
[0079] Embodiment 2
[0080] Refer to Figure 1-5 , A method for an embroidery vector font library based on cubic Bézier curves, comprising the following steps:
[0081] S1: Make definitions: Professionals make definitions for the font library file structure. The font library file structure includes three parts: a file header, a character information table, and font data. The file header is used to define the font name, file size, coordinate system, number of characters, original font size, and font library version. The original font size uses millimeters as the unit. The character information table is used to record the unicode encoding of each character and the offset position of its font data in the third part of the file, and is used to index the font data. The font data is used to define the specific structure of all characters in the font library in detail. The storage format of the font data follows the tree structure definition of the characters. The tree structure definition is that the character structure is composed of strokes. And in the process of the tree structure definition, it is defined that the character "person" is composed of two strokes: a "left-falling stroke" + a "right-falling stroke". And the stroke structure is composed of a bottom line and control lines. The bottom line is used for the stitches embroidered in advance to prevent wrinkles during embroidery, and is empty in the font library. There are two control lines. Define the boundary line on the left side of the stroke as control line 1 by following the writing stroke of the character, and define the boundary line on the right side of the stroke as control line 2;
[0082] S2: Definition Representation: The definition representation structure of the font file structure is obtained by professionals through definition, wherein the definition representation structure of the file header is as follows:
[0083] FontName; / / Font name
[0084] FileSize; / / Size of the font file in bytes
[0085] CharSum; / / Total number of characters contained in the font library
[0086] Coordinate; / / The coordinate system type used by the font library
[0087] FontHeight; / / Font height
[0088] FontWidth; / / Font width
[0089] Version; / / Font version
[0090] Reserve
[121] , the file header occupies a total of 512 bytes, the Reserve field is a reserved field that is not currently used, and the Reserve field is used for subsequent version expansion, the definition of the text information table represents the structure as follows
[0091] Unicode; / / Unicode encoding of text
[0092] DataPos; / / The offset address of the character pattern data in the file, where the offset address of the character pattern data in the file must start from the beginning of the file, and the file storage structure of the character pattern data is defined as follows:
[0093] CharSize; / / Size of character data (in bytes)
[0094] CStrokNum; / / Number of strokes in the character
[0095] SBaseNum; / / Number of baseline points
[0096] pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point)
[0097] pCoorX; / / X coordinate of point
[0098] pCoorY; / / Y coordinate of the point
[0099] SCtrlNum1; / / Number of control line 1s
[0100] pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point)
[0101] pCoorX; / / X coordinate of point
[0102] pCoorY; / / Y coordinate of the point
[0103] SCtrlNum2; / / Number of control lines (2 points)
[0104] pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point)
[0105] pCoorX; / / X coordinate of point
[0106] pCoorY; / / Y coordinate of the point;
[0107] S3: Regulations: Regulations are made based on the structure of the text and the embroidery technique. The regulations stipulate that the number of strokes is no less than 1, and the leader line of a stroke can be empty. A stroke has two control lines. A cubic Bézier curve is formed by four points: interpolation point + backward control point + forward control point + interpolation point. The leader line / control line has one or more Bézier curve segments. Storage space is saved by sharing the middle interpolation point in the point linked list between the two Bézier curve segments.
[0108] S4: Processing: The obtained definition representation structure is processed to generate embroidery stitches for embroidered text strokes. The embroidery stitches are generated through a control line structure, which consists of control segments, each of which is a cubic Bézier curve segment. Based on the characteristics of the Bézier curve, the relationship between control points and interpolation points controls whether the current segment is a straight line segment or a curve segment. Control line 1 and control line 2 divide the control segments into the same number of segments. The division of the corresponding control segments of control line 1 and control line 2 determines the generation of embroidery stitches when embroidering text strokes. When used in embroidery, the corresponding Bézier curve segments on both sides of control line 1 and control line 2 need to be extracted to form the opposite side input method in the embroidery pattern making software, and the corresponding stitch algorithm is adopted to generate the text embroidery stitches.
[0109] Example 3
[0110] Reference Figure 1-5 A method for creating an embroidery vector font based on cubic Bézier curves includes the following steps:
[0111] S1: Definition: Professionals define the font library file structure, which includes three parts: a file header, a character information table, and font data. The file header is used to define the font name, file size, coordinate system, number of characters, original font size, and font library version. The original font size uses millimeters as the unit. The character information table is used to record the unicode encoding of each character and the offset position of its font data in the third part of the file, and is used to index the font data. The font data is used to define the specific structure of all characters in the font library. The storage format of the font data follows the tree structure definition of characters, where the tree structure is defined as the character structure being composed of strokes. During the definition of the tree structure, it is defined that the character 'person' consists of two strokes, a 'left-falling stroke' and a 'right-falling stroke'. The stroke structure is composed of a bottom line and control lines. The bottom line is used for the stitch of pre-embroidery to prevent wrinkles during embroidery and is empty in the font library. There are two control lines. By following the writing stroke of the character, the boundary line on the left side of the stroke is defined as control line 1, and the boundary line on the right side of the stroke is defined as control line 2. The shape of the entire stroke is determined by the control lines on both sides. At the same time, there is no stroke with a width of 0 for the control lines. For the solid period dot, its shape is determined by the control edges of two semi-circles;
[0112] S2: Definition Representation: Professionals obtain the definition representation structure of the font library file structure through definition. The definition representation structure of the file header is
[0113] FontName; / / Font name
[0114] FileSize; / / Number of bytes of the font file size
[0115] CharSum; / / Total number of characters contained in the font library
[0116] Coordinate; / / Type of coordinate system used by the font library
[0117] FontHeight; / / Font height
[0118] FontWidth; / / Font width
[0119] Version; / / Font version
[0120] Reserve
[121] . The file header occupies a total of 512 bytes. The Reserve field is a reserved field that is not used temporarily and is used for subsequent version expansion. The definition representation structure of the character information table is
[0121] Unicode; / / Unicode encoding of the character
[0122] DataPos; / / The offset address of the character pattern data in the file, where the offset address of the character pattern data in the file must start from the beginning of the file, and the file storage structure of the character pattern data is defined as follows:
[0123] CharSize; / / Size of character data (in bytes)
[0124] CStrokNum; / / Number of strokes in the character
[0125] SBaseNum; / / Number of baseline points
[0126] pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point)
[0127] pCoorX; / / X coordinate of point
[0128] pCoorY; / / Y coordinate of the point
[0129] SCtrlNum1; / / Number of control line 1s
[0130] pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point)
[0131] pCoorX; / / X coordinate of point
[0132] pCoorY; / / Y coordinate of the point
[0133] SCtrlNum2; / / Number of control lines (2 points)
[0134] pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point)
[0135] pCoorX; / / X coordinate of point
[0136] pCoorY; / / Y coordinate of the point;
[0137] S3: Processing: The obtained definition representation structure is processed to generate embroidery stitches for embroidered text strokes. The embroidery stitches are generated through a control line structure, which consists of control segments, each of which is a cubic Bézier curve segment. Based on the characteristics of the Bézier curve, the relationship between control points and interpolation points controls whether the current segment is a straight line segment or a curve segment. Control line 1 and control line 2 divide the control segments into the same number of segments. The division of the corresponding control segments of control line 1 and control line 2 determines the generation of embroidery stitches when embroidering text strokes. When used in embroidery, the corresponding Bézier curve segments on both sides of control line 1 and control line 2 need to be extracted to form the opposite side input method in the embroidery pattern making software, and the corresponding stitch algorithm is adopted to generate the text embroidery stitches.
[0138] Example 4
[0139] Refer to Figure 1-5 , a method for an embroidery vector font library based on cubic Bezier curves, comprising the following steps:
[0140] S1: Define: Professional personnel define the font library file structure, where the font library file structure includes three parts: a file header, a character information table, and font pattern data. The file header is used to define the font name, file size, coordinate system, number of characters, original font size, and font library version. The original font size uses millimeters as the unit. The character information table is used to record the unicode encoding of each character and the offset position of its font pattern data in the third part of the file, and is used to index the font pattern. The font pattern data is used to define the specific structure of all characters in the font library. The storage format of the font pattern data follows the tree structure definition of characters. The tree structure definition is that the character structure is composed of strokes. During the definition of the tree structure, it is defined that the character 'person' is composed of two strokes: a 'left-falling stroke' + a 'right-falling stroke'. The stroke structure is composed of a bottom line and control lines. The bottom line is used for the stitch of pre-embroidery to prevent wrinkles during embroidery and is empty in the font library. There are two control lines. By following the writing stroke of the character, the boundary line on the left side of the stroke is defined as control line 1, and the boundary line on the right side of the stroke is defined as control line 2. The shape of the entire stroke is determined by the control lines on both sides. At the same time, there is no stroke with a width of 0 for the control lines. For the solid period dot, its shape is determined by the control edges of two semi-circles;
[0141] S2: Define the representation: Professional personnel obtain the definition representation structure of the font library file structure through definition. The definition representation structure of the file header is
[0142] FontName; / / Font name
[0143] FileSize; / / Number of bytes of the font file size
[0144] CharSum; / / Total number of characters contained in the font library
[0145] Coordinate; / / Type of coordinate system used by the font library
[0146] FontHeight; / / Font pattern height
[0147] FontWidth; / / Font pattern width
[0148] Version; / / Font pattern version
[0149] Reserve
[121] , the file header occupies a total of 512 bytes, the Reserve field is a reserved field that is not currently used, and the Reserve field is used for subsequent version expansion, the definition of the text information table represents the structure as follows
[0150] Unicode; / / Unicode encoding of text
[0151] DataPos; / / The offset address of the character pattern data in the file, where the offset address of the character pattern data in the file must start from the beginning of the file, and the file storage structure of the character pattern data is defined as follows:
[0152] CharSize; / / Size of character data (in bytes)
[0153] CStrokNum; / / Number of strokes in the character
[0154] SBaseNum; / / Number of baseline points
[0155] pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point)
[0156] pCoorX; / / X coordinate of point
[0157] pCoorY; / / Y coordinate of the point
[0158] SCtrlNum1; / / Number of control line 1s
[0159] pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point)
[0160] pCoorX; / / X coordinate of point
[0161] pCoorY; / / Y coordinate of the point
[0162] SCtrlNum2; / / Number of control lines (2 points)
[0163] pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point)
[0164] pCoorX; / / X coordinate of point
[0165] pCoorY; / / Y coordinate of the point;
[0166] S3: Make regulations: Make regulations according to the structure of the characters and the embroidery process. When making regulations, the regulation content is that the number of strokes is not less than 1, the lead of a stroke can be empty, there are two control lines for a stroke, a cubic Bezier curve segment is formed by four points: interpolation point + backward control point + forward control point + interpolation point, and there is 1 or more Bezier curve segments in the lead / control line. At the same time, save storage space by using the interpolation points in the common point linked list of the front and back Bezier curves;
[0167] S4: Process: Process through the obtained definition representation structure to generate the embroidery stitches of the embroidery text strokes.
[0168] Example Five
[0169] Refer to Figure 1-5 , a method for an embroidered vector font library based on cubic Bezier curves, includes the following steps:
[0170] S1: Define: Professionals define the font library file structure. The font library file structure includes three parts: a file header, a character information table, and font data. The file header is used to define the font name, file size, coordinate system, number of characters, original font size, and font library version. The original font size uses millimeters as the unit. The character information table is used to record the unicode encoding of each character and the offset position of its font data in the third part of the file, and is used to index the font data. The font data is used to define the specific structure of all characters in the font library in detail. The storage format of the font data follows the tree structure definition of the characters. The tree structure definition is that the character structure is composed of strokes. During the tree structure definition, it is defined that the character "person" is composed of two strokes: a "left-falling stroke" + a "right-falling stroke". The stroke structure is composed of a bottom line and control lines. The bottom line is the stitch for preventing wrinkles during embroidery and is empty in the font library. There are two control lines. Define the left boundary line of the stroke as control line 1 and the right boundary line of the stroke as control line 2 according to the writing stroke of the character. The shape of the entire stroke is determined by the control lines on both sides. At the same time, there is no stroke with a width of 0 in the control lines. For the solid period dot, its shape is determined by the control edges of two semi-circles;
[0171] S2: Make regulations: Make regulations according to the structure of the characters and the embroidery process. When making regulations, the regulation content is that the number of strokes is not less than 1, the lead of a stroke can be empty, there are two control lines for a stroke, a cubic Bezier curve segment is formed by four points: interpolation point + backward control point + forward control point + interpolation point, and there is 1 or more Bezier curve segments in the lead / control line. At the same time, save storage space by using the interpolation points in the common point linked list of the front and back Bezier curves;
[0172] S3: Processing: The obtained definition representation structure is processed to generate embroidery stitches for embroidered text strokes. The embroidery stitches are generated through a control line structure, which consists of control segments, each of which is a cubic Bézier curve segment. Based on the characteristics of the Bézier curve, the relationship between control points and interpolation points controls whether the current segment is a straight line segment or a curve segment. Control line 1 and control line 2 divide the control segments into the same number of segments. The division of the corresponding control segments of control line 1 and control line 2 determines the generation of embroidery stitches when embroidering text strokes. When used in embroidery, the corresponding Bézier curve segments on both sides of control line 1 and control line 2 need to be extracted to form the opposite side input method in the embroidery pattern making software, and the corresponding stitch algorithm is adopted to generate the text embroidery stitches.
[0173] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for creating an embroidery vector font based on cubic Bézier curves, characterized in that, Includes the following steps: S1: Define: The font file structure is defined by professionals; S2: Definition Representation: The definition representation structure of the font file structure obtained by professionals through definition; S3: Regulations: Regulations are made based on the structure of the text and the embroidery technique; S4: Processing: Process the obtained definition representation structure to generate embroidery stitches for embroidered text strokes; In S1, the font file structure is defined by professionals, and the font file structure includes three parts: file header, text information table and font pattern data. The file header is used to define the font name, file size, coordinate system, number of characters, original font size, and font version. The original font size is in millimeters. The text information table is used to record the Unicode encoding of each character and the offset position of its font data in the third part of the file, and is used to index the font. The font data is used to define the specific structure of all characters in the font library in detail. The font data storage format follows the tree structure definition of characters, where the tree structure is defined as the character structure consisting of strokes, and the stroke structure consists of a bottom line and control lines. The bottom line is used for pre-embroidered stitches to prevent wrinkles during embroidery and is empty in the font library. There are two control lines: the left boundary line of the stroke is defined as control line 1, and the right boundary line of the stroke is defined as control line 2, and the shape of the entire stroke is determined by the control lines on the left and right sides. At the same time, there are no strokes with a width of 0 in the control lines. For solid periods, the shape is determined by two semi-circular control edges.
2. The method for an embroidery vector font library based on cubic Bézier curves according to claim 1, characterized in that, In step S2, a professional defines the representation structure of the font file structure, wherein the definition representation structure of the file header is as follows: FontName; / / Font name FileSize; / / Size of the font file in bytes CharSum; / / Total number of characters contained in the font library Coordinate; / / Coordinate system type used by the font library FontHeight; / / Font height FontWidth; / / Font width Version; / / Font version Reserve[121], the file header occupies a total of 512 bytes, the Reserve field is a reserved field that is not currently used, and the Reserve field is used for subsequent version expansion, the definition of the text information table represents the structure as follows Unicode; / / Unicode encoding of text DataPos; / / Offset address of the character pattern data in the file, where the offset address of the character pattern data in the file must start from the beginning of the file, and the file storage structure of the character pattern data is defined as follows: CharSize; / / Size of the character pattern data (in bytes) CStrokNum; / / Number of strokes in the character SBaseNum; / / Number of baseline points pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point) pCoorX; / / X coordinate of point pCoorY; / / Y coordinate of the point SCtrlNum1; / / Number of control lines (1 point) pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point) pCoorX; / / X coordinate of point pCoorY; / / Y coordinate of the point SCtrlNum2; / / Number of control lines (2 points) pType; / / Point type ( / 0 Interpolation point / 1 Front control point / 2 Back control point) pCoorX; / / X coordinate of point pCoorY; / / Y coordinate of the point.
3. The method for an embroidery vector font library based on cubic Bézier curves according to claim 1, characterized in that, In S3, the structure of the characters and the embroidery process are specified. The specified content is that the number of strokes is not less than 1, the leader line of a stroke can be empty, a stroke has two control lines, and a cubic Bézier curve is formed by four points: interpolation point + backward control point + forward control point + interpolation point. The leader line / control line has one or more Bézier curve segments. At the same time, storage space is saved by sharing the middle interpolation point in the point linked list between the two Bézier curve segments.
4. The method for an embroidery vector font library based on cubic Bézier curves according to claim 1, characterized in that, In step S4, the embroidery stitches for embroidered text strokes are generated by processing the obtained definition representation structure. The embroidery stitches are generated through a control line structure, which consists of control segments. Each control segment is a cubic Bézier curve segment. Based on the characteristics of the Bézier curve, the relationship between control points and interpolation points controls whether the current segment is a straight line segment or a curve segment. The number of control segments divided by control line 1 and control line 2 is the same. The generation of embroidery stitches when embroidering text strokes is determined by the division of the corresponding control segments of control line 1 and control line 2.
5. The method for an embroidery vector font library based on cubic Bézier curves according to claim 4, characterized in that, When used in embroidery, the corresponding Bézier curve segments on both sides of control line 1 and control line 2 need to be extracted to form the opposite side input method in the embroidery pattern making software, and the corresponding stitch algorithm is used to generate text embroidery stitches.
Citation Information
Patent Citations
Character editing and automatic pattern generation device of household computerized embroidery machine and method thereof
CN101446893A