A 3D text / icon model generation method, device and equipment
By analyzing the svg file and setting 3D model parameters, 3D text/icon model is generated, which solves the inefficiency problem caused by the 3D printer's inability to automatically parse the svg file, and realizes efficient 3D text/icon printing.
Patent Information
- Application Number
- CN202110324435.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-26
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2041-03-26
AI Technical Summary
3D printers cannot automatically parse the svg file format when printing 3D text/icons, resulting in low printing efficiency.
By obtaining the vector glyph of the 3D text/icon to be printed, parsing the svg file format data, setting 3D model parameters, and performing 3D modeling processing to generate a 3D text/icon modeling. The specific steps include detecting the text/icon parameters entered by the user, generating vector glyphs, extracting the outline of the text, setting model parameters such as the height of the straight edge, oblique offset, surface arc type, etc., using the ear cutting algorithm to process the outline, and generating a 3D model.
It realizes automatic conversion of ordinary text into vector glyphs and 3D models, improves work efficiency, reduces manual adjustment time for each glyph, and improves the efficiency of 3D text/icon printing.
Smart Images

Figure CN113470164B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of 3D printing technology, and in particular to a method, device and equipment for generating a 3D text / icon model. Background Art
[0002] 3D printer, also known as three-dimensional printer, is a kind of machine of cumulative manufacturing technology, that is, rapid prototyping technology. It is based on a digital model file, using special wax materials, powdered metal or plastic and other adhesive materials to print layers of adhesive materials to make three-dimensional objects. At present, 3D printers are used to manufacture products, and the technology of constructing objects by printing layer by layer. The principle of 3D printer is to put data and raw materials into the 3D printer, and the machine will make the product layer by layer according to the program.
[0003] The biggest difference between 3D printers and traditional printers is that the "ink" they use is real raw materials, and there are many different forms of stacked thin layers. The types of media that can be used for printing are diverse, from a variety of plastics to metals, ceramics, and rubber-like substances. Some printers can also combine different media to make the printed object hard on one end and soft on the other.
[0004] When a 3D printer prints 3D text / icons, it cannot automatically parse the svg file format, which reduces the efficiency of 3D text / icon printing.
[0005] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0006] In view of the above-mentioned deficiencies in the prior art, an object of the present invention is to provide a 3D text / icon model generation method, device and equipment, aiming to solve the technical problem of low efficiency of 3D text / icon printing in the prior art.
[0007] The technical solution of the present invention is as follows:
[0008] A 3D text / icon model generation method, applied to a 3D printer, the method comprising:
[0009] Get the vector glyph of the 3D text / icon to be printed;
[0010] Get the corresponding svg file format data according to the vector glyph;
[0011] Parse the svg file format data and set the 3D model parameters for the parsed data;
[0012] Perform 3D modeling processing according to 3D model parameters to generate 3D text / icon models.
[0013] Furthermore, the step of obtaining the vector font of the 3D text / icon to be printed includes:
[0014] Detecting the 3D text / icon to be printed input by the user, obtaining the text / icon parameters set by the user, and generating the vector glyph of the 3D text / icon according to the text / icon parameters; or obtaining the vector glyph of the 3D text / icon to be printed generated by the user dragging from the drawing software.
[0015] Further preferably, the detecting that the user inputs the 3D text to be printed, obtaining the text parameters set by the user, and generating the vector glyph of the 3D text according to the text parameters includes:
[0016] Detecting a text input instruction, obtaining the language type and font type set by the user, and generating a corresponding text font;
[0017] Extract the outline of the text according to the text font, and generate svg file format data based on the outline and parameters of the text.
[0018] Further preferably, the 3D text model includes a straight edge portion and a bevel edge portion, and setting 3D model parameters for the parsed data includes:
[0019] Set the upper straight edge height, lower straight edge height, bevel offset, bevel height, surface arc type, surface arc curvature, bevel direction, and character splitting status of the 3D text / icon model in the parsed vector data.
[0020] Preferably, the performing 3D modeling processing according to the 3D model parameters to generate a 3D text / icon model includes:
[0021] Calculate the actual hypotenuse side area based on the upper straight edge height, lower straight edge height, and hypotenuse height;
[0022] Generate the current offset according to the actual hypotenuse side area and the hypotenuse offset;
[0023] Get the bevel direction and adjust the current offset according to the bevel direction;
[0024] The contour of the model is obtained by parsing the current offset, upper straight edge height, lower straight edge height, bevel edge height, surface arc type, surface arc curvature, bevel edge direction, and character splitting status, and the contour of the model is processed according to the ear cutting algorithm;
[0025] Generate 3D text / icon models through vector dimensionality increase.
[0026] Furthermore, the method of obtaining the contour of the model by parsing the current offset, the upper straight edge height, the lower straight edge height, the bevel edge height, the curved surface arc type, the curved surface arc curvature, the bevel edge direction, and the character splitting state further includes:
[0027] Get the type of the hypotenuse by the arc of the surface;
[0028] If the degree of the surface arc is 0, the hypotenuse is determined to be a straight line;
[0029] If the degree of the surface arc is not 0, the hypotenuse is determined to be a curve.
[0030] Furthermore, the method of obtaining the contour of the model by parsing the current offset, the upper straight edge height, the lower straight edge height, the bevel edge height, the curved surface arc type, the curved surface arc curvature, the bevel edge direction, and the character splitting state further includes:
[0031] The total height of the model is generated by superimposing the upper straight edge height, the lower straight edge height, and the bevel edge height.
[0032] Another embodiment of the present invention provides a 3D text / icon model generation device, the device comprising:
[0033] A vector font acquisition module, used to acquire the vector font of the 3D text / icon to be printed;
[0034] A format data acquisition module is used to acquire corresponding svg file format data according to the vector glyph;
[0035] The data parsing module is used to parse the svg file format data and set the 3D model parameters for the parsed data;
[0036] The 3D model generation module is used to perform 3D modeling processing according to 3D model parameters and generate a 3D text / icon model.
[0037] Another embodiment of the present invention provides a 3D text / icon model generation device, the device comprising at least one processor; and
[0038] a memory communicatively connected to the at least one processor; wherein,
[0039] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned 3D text / icon model generation method.
[0040] Another embodiment of the present invention further provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the one or more processors can execute the above-mentioned 3D text / icon model generation method.
[0041] Beneficial effects: The embodiment of the present invention can realize the conversion of ordinary text into vector glyphs, and after setting the vector glyphs, finally generate the effect of a 3D model, without manually spending time to adjust the vector glyphs of each word, which greatly improves work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0043] Figure 1 A flowchart of a preferred embodiment of a 3D text / icon model generation method of the present invention;
[0044] Figure 2 A schematic diagram of a 3D text model of a preferred embodiment of a 3D text / icon model generation method of the present invention;
[0045] Figure 3 A schematic diagram of a model of 3D text and a character cover of a preferred embodiment of a 3D text / icon model generation method of the present invention;
[0046] Figure 4 A schematic diagram of an interface for setting text fonts in a preferred embodiment of a 3D text / icon model generation method of the present invention;
[0047] Figure 5 A schematic diagram of an interface for setting model parameters of a preferred embodiment of a 3D text / icon model generation method of the present invention;
[0048] Figure 6 A schematic diagram of the outward offset of the hypotenuse of a 3D text model in a preferred embodiment of a 3D text / icon model generation method of the present invention;
[0049] Figure 7 A schematic diagram of the inward offset of the hypotenuse of a 3D text model in a preferred embodiment of a 3D text / icon model generation method of the present invention;
[0050] Figure 8 A schematic diagram of a preferred embodiment of a 3D text / icon model generation method of the present invention in which the hypotenuse of a 3D text model is a curved surface;
[0051] Fig. 9 A schematic diagram of functional modules of a preferred embodiment of a 3D text / icon model generating device of the present invention;
[0052] Fig.10 The figure is a schematic diagram of the hardware structure of a preferred embodiment of a 3D text / icon model generating device of the present invention. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. The embodiments of the present invention are described below in conjunction with the accompanying drawings.
[0054] The embodiment of the present invention provides a 3D text / icon model generation method, which is applied to a 3D printer. Figure 1 , Figure 1 FIG. 1 is a flow chart of a preferred embodiment of a method for generating a 3D text / icon model according to the present invention. Figure 1 As shown, it includes the steps of:
[0055] Step S100, obtaining a vector font of a 3D text / icon to be printed;
[0056] Step S200, obtaining corresponding svg file format data according to the vector glyph;
[0057] Step S300, parsing the svg file format data, and setting 3D model parameters for the parsed data;
[0058] Step S400: Perform 3D modeling processing according to the 3D model parameters to generate a 3D text / icon model.
[0059] In specific implementation, the embodiment of the present invention aims to provide a method for converting input text into a 3D model to solve the problems of redundancy and low efficiency in the prior art.
[0060] The present invention is based on the content of the svg file format. Since the content of the svg file format is a vector graphic, our basic design scheme is to convert ordinary text into vector glyphs, so that the text / icon to be printed can be input, and the required font style or icon style can be selected to generate the required vector glyphs, and 3D parameters such as the bevel offset can be set for the vector glyphs, and modeling can be performed according to the 3D parameters to finally generate the effect of a 3D model. The icons in the present invention include irregular trademark LOGOs, logos and other data.
[0061] like Figure 2 The figure shows a schematic diagram of a 3D text / icon model; the figure shows a schematic diagram of a font after glue filling. After the bottom of the text is detected to be full, the glue filling operation is completed; after the glue is cured, printing is completed.
[0062] Furthermore, after performing 3D modeling processing according to the 3D model parameters and generating a 3D text / icon model, the method further includes:
[0063] The 3D text model is reduced in a certain proportion to generate a 3D model of the character cover.
[0064] In specific implementation, the 3D text / icon model is reduced according to a certain ratio, and a 3D model of the character cover is generated according to the reduced ratio parameters, such as Figure 3 The figure shows a schematic diagram of a 3D model after adding a cap to the text.
[0065] Furthermore, the 3D text model is reduced according to a certain ratio to generate a 3D model of the character cover, including:
[0066] According to the 3D text / icon model, obtain the perimeter of the top layer in the 3D text model and the wall thickness of the text;
[0067] The 3D model of the character cover is generated by reducing the wall thickness and circumference of the character in a certain proportion.
[0068] In specific implementation, the 3D text model is reduced according to a certain perimeter ratio to form a cap of the 3D text model. The perimeter of the top layer in the 3D text model is further obtained, and the wall thickness is subtracted from the length to obtain the result to regenerate the 3D model of the cap.
[0069] Furthermore, the vector glyph of the 3D text / icon to be printed is obtained, including:
[0070] Detecting the 3D text / icon to be printed input by the user, obtaining the text / icon parameters set by the user, and generating the vector glyph of the 3D text / icon according to the text / icon parameters; or obtaining the vector glyph of the 3D text / icon to be printed generated by the user dragging from the drawing software.
[0071] In specific implementation, users can manually drag and drop vector glyphs generated by drawing software such as CoreDraw.
[0072] Alternatively, the user's text input command can be obtained on the 3D printing interface. The user enters the font of the text to be printed on the interface and sets the parameters of the text font. The vector glyph is generated according to the set parameters. At this time, the user can set the vector glyph he wants as needed, which improves the freedom of vector glyph setting. It can be realized that the required vector glyph can be generated by inputting the text to be printed and selecting the required font style, without having to spend time manually adjusting the vector glyph of each word, which greatly improves work efficiency.
[0073] Furthermore, taking printing text as an example, the 3D text to be printed is detected, the text parameters set by the user are obtained, and the vector glyph of the 3D text is generated according to the text parameters, including:
[0074] Detecting a text input instruction, obtaining the language type and font type set by the user, and generating a corresponding text font;
[0075] Extract the outline of the text according to the text font, and generate svg file format data based on the outline and parameters of the text.
[0076] When implementing it, Figure 4 As shown, it is a schematic diagram of the text font setting of an embodiment of the present invention; the text input instruction is that the user presses the input text button, and a pop-up window displays "Select Chinese or English", and enters the Chinese or English characters to be printed. For example: you or A. Select the required font (.ttf font), for example: Songti. TTF font is the only font standard for Windows operating system. Its biggest advantage is that it is very convenient to convert font outlines into curves, and the curves can be filled, deformed, and special effects can be produced. The outline of the text is extracted according to the text font, and the SVG file format data is generated according to the outline and parameters of the text.
[0077] Furthermore, the outline of the text is extracted according to the set text font, and the svg file format data is generated according to the outline and parameters of the text, including:
[0078] Extract the outline of the text according to the set text font, and export the corresponding file of the text outline as a json data package;
[0079] Store the json data packet in svg file format data.
[0080] When it is implemented, after pressing the OK button, extract the outline of the characters in the ttf file, export the bin file in the ttf file to a json data packet, and place the outline in the .glyf file, which is in the format of a quadratic Bezier curve. This curve is the vector outline path of the font, and the vector data is saved in the svg file format. Note: The font outline in the .ttf file can be extracted through the "Face" class in the third-party file "freetype" in the Python programming language. The "set_char_size" method in the "Face" class sets the size of the character outline in the svg file, obtains the return value of the "Outline" method, and obtains the parsed vector data. These vector data are saved in the .svg file format in the form of xml.
[0081] Furthermore, the svg file format data is parsed, including:
[0082] Read svg file format data and parse the vector data in the svg file format data through third-party functions.
[0083] In the specific implementation, the two-dimensional vector data of the svg file is read and the vector data is parsed. Note: through the "parse" method in the third-party file "svg" class of the Python programming language, the file name is passed into the "method" as a parameter, and then this class automatically parses and obtains the return value of the "flatten" method to obtain the parsed vector data.
[0084] Furthermore, the 3D text / image model includes a straight edge portion and a bevel edge portion, and the 3D model parameters are set for the parsed data, including:
[0085] Set the upper straight edge height, lower straight edge height, bevel offset, bevel height, surface arc type, surface arc curvature, bevel direction, and character splitting status of the 3D text / icon model in the parsed vector data.
[0086] In the specific implementation, the 3D text model is used as an example. Figure 5 As shown, an embodiment of setting 3D model parameters for parsed vector data,
[0087] Set the height of the upper straight edge (at the top of the model), the height of the lower straight edge (at the bottom of the model), and the height of the bevel edge (in the middle of the model). The sum of the three heights equals the total height of the model. If the height of the upper straight edge is 0 and the height of the lower straight edge is not 0, then the bevel edge arc is on the top and the straight edge is on the bottom. If the height of the upper straight edge is not 0 and the height of the lower straight edge is 0, then the bevel edge arc is on the bottom and the straight edge is on the top. The total height of the model: the height of the model on the Z axis of the stage, which is also the total height of the real model;
[0088] Set the model's bevel offset. Figure 5 The offset in the bevel. The bevel offset refers to the coordinate of the vertical distance from the highest point of the bevel to the stage, and the distance from this coordinate to the starting point of the slope. When the bevel offset is 0, there is no bevel height, only the straight edge height;
[0089] Set the height of the hypotenuse: the distance from the highest point of the hypotenuse to the vertical angle coordinate of the starting point of the hypotenuse; can be set in mm.
[0090] Set the surface arc: When the arc is greater than 0, the hypotenuse side is a curved surface. When the arc is equal to 0, the hypotenuse side is a straight surface.
[0091] Set the direction of the bevel: the bevel direction can be inward or outward.
[0092] Set character splitting: Set whether to split characters. If set to No, the characters will not be split. If set to Yes, the characters will be split.
[0093] Parse and calculate svg file format data, calculate the length, width, and direction of the svg vector outline, perform 3D modeling based on the calculation results, and generate a 3D text model.
[0094] Further, 3D modeling is performed according to the 3D model parameters to generate a 3D text / icon model, including:
[0095] Calculate the actual hypotenuse side area based on the upper straight edge height, lower straight edge height, and hypotenuse height;
[0096] Generate the current offset according to the actual hypotenuse side area and the hypotenuse offset;
[0097] Get the bevel direction and adjust the current offset according to the bevel direction;
[0098] The contour of the model is obtained by parsing the current offset, upper straight edge height, lower straight edge height, bevel edge height, surface arc type, surface arc curvature, bevel edge direction, and character splitting status, and the contour of the model is processed according to the ear cutting algorithm;
[0099] Generate 3D text / icon models through vector dimensionality increase.
[0100] The straight edge position includes the straight edge being above the hypotenuse or the straight edge being below the hypotenuse; and the hypotenuse direction is inward or outward.
[0101] In specific implementation, the embodiment of the present invention adds a bevel function and a bevel arc function. There are two specific implementations of this function: one is that the bevel is a straight line, and the other is that the bevel is a curve.
[0102] When the hypotenuse is a straight line, there are 4 states: 1 is the straight side on the top and the hypotenuse on the bottom, tilted outward; 2 is the straight side on the bottom and the hypotenuse on the top, tilted outward; 3 is the straight side on the top and the hypotenuse on the bottom, tilted inward; 4 is the straight side on the bottom and the hypotenuse on the top, tilted inward.
[0103] 3D text or icon models are composed of straight edges and hypotenuses, so there are two types of model combinations. One is that the hypotenuse is on top and the straight edge is on the bottom, and the other is that the straight edge is on top and the hypotenuse is on the bottom. If the hypotenuse is above the straight edge, start calculating from the top of the straight edge and add the height of the hypotenuse (the distance from the highest point of the hypotenuse to the vertical angle coordinate of the top of the straight edge). Therefore, a right triangle is generated. The calculation method of the "actual hypotenuse side area" part is: the height of the hypotenuse divided by the tangent value of the radian of the offset (the angle between the hypotenuse and the plane). The current offset: the offset divided by the "actual hypotenuse side area". If the hypotenuse is below the straight edge, start calculating from the stage, the height of the hypotenuse and the offset form a right triangle. The calculation method of the "actual hypotenuse side area" part is: the height of the hypotenuse divided by the tangent value of the radian of the offset. The current offset: the offset divided by the "actual hypotenuse side area". Whether the hypotenuse is on the top or the bottom, the calculation logic is the same. There are also two types of hypotenuse offset angles. One is outward offset, such as Figure 6 As shown in the figure, when the hypotenuse is facing inward, the part with the height of the hypotenuse is wide at the bottom and narrow at the top; one is offset inward, such as Figure 7 As shown, when the hypotenuse is facing outward, the part at the height of the hypotenuse is narrow at the bottom and wide at the top.
[0104] To determine whether the hypotenuse is facing inward or outward, if it is facing outward, the offset is a positive number. If it is facing inward, the offset is multiplied by -1.
[0105] By parsing the data, we can get the outline of the model, make the surface normal on the model outline, and then use the point sequence of the outline to create triangles. The ear cutting algorithm is used (in simple terms, a figure is cut into multiple triangles according to the edges of the figure. Each time a triangle is cut (stored in the form of a linked list), one piece is less until all triangles are cut. Then the triangles are taken from the linked list and reordered to obtain a figure composed of multiple triangles). The sorted model forms a 3D model through vector dimension.
[0106] The hypotenuse is curved, such as Figure 8 As shown, as the name implies, the hypotenuse is not a simple straight line, but a curved line with an arc. The implementation principle is the same as above, except that the "radian" parameter is added. This "radian" parameter is equivalent to the midpoint of the hypotenuse. The larger the value, the greater the outward expansion of the hypotenuse. The position of the coordinate axes x, y, and z is adjusted to achieve the purpose of changing the surface.
[0107] Furthermore, the contour of the model is obtained by parsing the current offset, the upper straight edge height, the lower straight edge height, the bevel edge height, the surface arc type, the surface arc curvature, the bevel edge direction, and the character splitting state, and also includes:
[0108] Get the type of the hypotenuse by the arc of the surface;
[0109] If the degree of the surface arc is 0, the hypotenuse is determined to be a straight line;
[0110] If the degree of the surface arc is not 0, the hypotenuse is determined to be a curve.
[0111] In specific implementation, when the radian is greater than 0, the hypotenuse side is a curved surface (such as Figure 8 When the arc is equal to 0, the hypotenuse side is a straight surface (as shown in Figure 7 shown).
[0112] Furthermore, the contour of the model is obtained by parsing the current offset, the upper straight edge height, the lower straight edge height, the bevel edge height, the surface arc type, the surface arc curvature, the bevel edge direction, and the character splitting state, and also includes:
[0113] The total height of the model is generated by superimposing the upper straight edge height, the lower straight edge height, and the bevel edge height.
[0114] In specific implementation, the height of the upper straight edge (at the top of the model), the height of the lower straight edge (at the bottom of the model), and the height of the bevel edge (in the middle of the model) are added together to equal the total height of the model. If the height of the upper straight edge is 0 and the height of the lower straight edge is not 0, then the bevel edge arc is at the top and the straight edge is at the bottom. If the height of the upper straight edge is not 0 and the height of the lower straight edge is 0, then the bevel edge arc is at the bottom and the straight edge is at the top.
[0115] In the embodiment of the present invention, by setting the bevel offset, the bottom of the 3D text or icon can be made to form an acute angle or an obtuse angle with the plane, which can increase the diversity of font printing and facilitate application in different 3D printing scenarios.
[0116] It should be noted that there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present invention, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.
[0117] Another embodiment of the present invention provides a 3D text / icon model generation device, such as Fig. 9 As shown, the device 1 comprises:
[0118] A vector font acquisition module 11, used to acquire the vector font of the 3D text / icon to be printed;
[0119] The format data acquisition module 12 is used to acquire the corresponding svg file format data according to the vector font;
[0120] The data analysis module 13 is used to analyze the svg file format data and set 3D model parameters for the analyzed data;
[0121] The 3D model generation module 14 is used to perform 3D modeling processing according to the 3D model parameters to generate a 3D text / icon model.
[0122] The specific implementation method is shown in the method embodiment, which will not be described here in detail.
[0123] Another embodiment of the present invention provides a 3D text / icon model generation device, such as Fig.10 As shown, the device 10 includes:
[0124] One or more processors 110 and memory 120, Fig.10 A processor 110 is used as an example for description. The processor 110 and the memory 120 may be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.
[0125] The processor 110 is used to complete various control logics of the device 10, which can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISCMachine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components. In addition, the processor 110 can also be any traditional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration.
[0126] The memory 120 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the 3D text / icon model generation method in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the device 10 by running the non-volatile software programs, instructions and units stored in the memory 120, that is, the 3D text / icon model generation method in the above method embodiment is implemented.
[0127] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store applications required for operating the device and at least one function; the data storage area may store data created according to the use of the device 10, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0128] One or more units are stored in the memory 120, and when executed by one or more processors 110, the 3D text / icon model generation method in any of the above method embodiments is executed, for example, the above described 3D text / icon model generation method is executed. Figure 1 The method comprises steps S100 to S400.
[0129] An embodiment of the present invention provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, for example, to execute the above-described Figure 1 The method comprises steps S100 to S400.
[0130] As an example, the non-volatile storage medium can include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable ROM (EEPROM), or a flash memory. Volatile memory can include a random access memory (RAM) as an external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.
[0131] Another embodiment of the present invention provides a computer program product, the computer program product includes a computer program stored in a non-volatile computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by a processor, the processor executes the 3D text / icon model generation method of the above method embodiment. For example, the above described Figure 1 The method comprises steps S100 to S400.
[0132] The embodiments described above are merely illustrative, in which the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0133] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can exist in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0134] Conditional language such as "can," "can," "might," or "may," among other things, unless specifically stated otherwise or otherwise understood within the context as used, is generally intended to convey that particular embodiments can include (while other embodiments do not) particular features, elements, and / or operations. Thus, such conditional language is also generally intended to imply that features, elements, and / or operations are anyway required for one or more embodiments or that one or more embodiments must include logic for determining, with or without input or prompting, whether such features, elements, and / or operations are included or will be performed in any particular embodiment.
[0135] What has been described herein in this specification and the accompanying drawings includes examples that can provide methods and devices for generating 3D text / icon models. Of course, it is not possible to describe every conceivable combination of elements and / or methods for the purpose of describing the various features of the present disclosure, but it is recognized that many other combinations and permutations of the disclosed features are possible. Therefore, it is apparent that various modifications can be made to the present disclosure without departing from the scope or spirit of the present disclosure. In addition, or in the alternative, other embodiments of the present disclosure may be apparent from consideration of the present specification and the accompanying drawings and from the practice of the present disclosure as presented herein. It is intended that the examples set forth in this specification and the accompanying drawings be considered to be illustrative and not restrictive in all respects. Although specific terms are employed herein, they are used in a general and descriptive sense and are not used for limiting purposes.
Claims
1. A 3D text / icon model generation method, characterized in that , applied to a 3D printer, the method comprises: Get the vector glyph of the 3D text / icon to be printed; Get the corresponding svg file format data according to the vector glyph; Parse the svg file format data and set the 3D model parameters for the parsed data; Perform 3D modeling processing according to 3D model parameters to generate 3D text / icon models; The 3D text model includes a straight edge part and a bevel edge part, and setting 3D model parameters for the parsed data includes: Set the upper straight edge height, lower straight edge height, bevel offset, bevel height, surface arc type, surface arc curvature, bevel direction, and character splitting status of the 3D text / icon model in the parsed vector data; The 3D modeling process is performed according to the 3D model parameters to generate a 3D text / icon model, including: Calculate the actual hypotenuse side area based on the upper straight edge height, lower straight edge height, and hypotenuse height; Generate the current offset according to the actual hypotenuse side area and the hypotenuse offset; Get the bevel direction and adjust the current offset according to the bevel direction; The contour of the model is obtained by parsing the current offset, upper straight edge height, lower straight edge height, bevel edge height, surface arc type, surface arc curvature, bevel edge direction, and character splitting status, and the contour of the model is processed according to the ear cutting algorithm; Generate 3D text / icon models through vector dimensionality increase.
2. The 3D text / icon model generation method according to claim 1, characterized in that: The step of obtaining the vector font of the 3D text / icon to be printed includes: Detecting the 3D text / icon to be printed input by the user, obtaining the text / icon parameters set by the user, and generating the vector glyph of the 3D text / icon according to the text / icon parameters; or obtaining the vector glyph of the 3D text / icon to be printed generated by the user dragging from the drawing software.
3. The 3D text / icon model generation method according to claim 2, characterized in that: The method of detecting that a user inputs a 3D text to be printed, obtaining text parameters set by the user, and generating a vector font of the 3D text according to the text parameters includes: Detecting a text input instruction, obtaining the language type and font type set by the user, and generating a corresponding text font; Extract the outline of the text according to the text font, and generate svg file format data based on the outline and parameters of the text.
4. The 3D text / icon model generation method according to claim 1, characterized in that: The method of obtaining the contour of the model by parsing the current offset, the upper straight edge height, the lower straight edge height, the bevel edge height, the surface arc type, the surface arc curvature, the bevel edge direction, and the character splitting state also includes: Get the type of the hypotenuse by the arc of the surface; If the degree of the surface arc is 0, the hypotenuse is determined to be a straight line; If the degree of the surface arc is not 0, the hypotenuse is determined to be a curve.
5. The 3D text / icon model generation method according to claim 4, characterized in that: The method of obtaining the contour of the model by parsing the current offset, the upper straight edge height, the lower straight edge height, the bevel edge height, the surface arc type, the surface arc curvature, the bevel edge direction, and the character splitting state also includes: The total height of the model is generated by superimposing the upper straight edge height, the lower straight edge height, and the bevel edge height.
6. A 3D text / icon model generation device, characterized in that: The device comprises: A vector font acquisition module, used to acquire the vector font of the 3D text / icon to be printed; A format data acquisition module is used to acquire corresponding svg file format data according to the vector glyph; The data parsing module is used to parse the svg file format data and set the 3D model parameters for the parsed data; A 3D model generation module is used to perform 3D modeling processing according to 3D model parameters and generate a 3D text / icon model; The 3D text model includes a straight edge part and a bevel edge part, and setting 3D model parameters for the parsed data includes: Set the upper straight edge height, lower straight edge height, bevel offset, bevel height, surface arc type, surface arc curvature, bevel direction, and character splitting status of the 3D text / icon model in the parsed vector data; The 3D modeling process is performed according to the 3D model parameters to generate a 3D text / icon model, including: Calculate the actual hypotenuse side area based on the upper straight edge height, lower straight edge height, and hypotenuse height; Generate the current offset according to the actual hypotenuse side area and the hypotenuse offset; Get the bevel direction and adjust the current offset according to the bevel direction; The contour of the model is obtained by parsing the current offset, upper straight edge height, lower straight edge height, bevel edge height, surface arc type, surface arc curvature, bevel edge direction, and character splitting status, and the contour of the model is processed according to the ear cutting algorithm; Generate 3D text / icon models through vector dimensionality increase.
7. A 3D text / icon model generation device, characterized in that: The device comprises at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the 3D text / icon model generation method described in any one of claims 1-5.
8. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute the 3D text / icon model generation method described in any one of claims 1-5.
Citation Information
Patent Citations
Method for manufacturing three-dimensional flexible oracle bone inscription calligraphy work based on 3D printing technology
CN110001052A