Graph cutting method and system, terminal equipment and storage medium
By analyzing, optimizing and coordinating the original processing data, and combining preset cutting properties and methods, laser cutting of the graphic data under the equipment coordinate system, the problem of poor laser cutting accuracy in the existing technology is solved, and higher accuracy and wider application scenarios are achieved.
Patent Information
- Application Number
- CN202510221566.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-04-22
AI Technical Summary
In the prior art, the cutting accuracy of laser cutting is poor, and cutting parameters cannot be set directly.
By analyzing, optimizing and coordinating the obtained original processing data, the graphic data under the equipment coordinate system is obtained, and laser cutting is performed according to preset cutting properties and preset cutting methods.
It realizes the free setting of multiple cutting attributes, improves processing accuracy and yield, and expands usage scenarios.
Smart Images

Figure CN119863472A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of laser processing, and in particular to a graphic cutting method, system, terminal equipment and storage medium. Background Art
[0002] In the existing laser cutting process, a plurality of continuous cutting points are generally divided on the laser cutting track, and cutting is performed according to the laser cutting track according to the cutting process parameters. However, the cutting parameters cannot be directly set in the existing technology, resulting in poor cutting accuracy.
[0003] Therefore the prior art still needs to be improved and enhanced. Summary of the invention
[0004] The main purpose of the present application is to provide a graphic cutting method, system, terminal device and storage medium, aiming to solve the problem of poor cutting accuracy of laser cutting in the prior art.
[0005] In order to achieve the above objectives, this application adopts the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a graph cutting method, comprising:
[0007] Analyze the acquired raw processing data to obtain analyzed data;
[0008] Optimizing the parsed data to obtain optimized graphic data;
[0009] Performing coordinate transformation on the optimized graphic data to obtain graphic data in a device coordinate system;
[0010] The graphic data in the device coordinate system is laser cut according to the preset cutting attributes and the preset cutting method to obtain the target cutting graphic.
[0011] In some embodiments, the parsed data includes: vector data and image data; and the optimizing the parsed data includes:
[0012] At least one of path optimization, curve smoothing, closure check, duplicate line deletion and connected line merging operations is performed on the vector data, and bitmap processing is performed on the image data.
[0013] In some embodiments, the bitmap processing of the image data includes:
[0014] The image data is subjected to at least one of grayscale conversion, contrast adjustment, color inversion, sharpening, binarization and contour extraction.
[0015] In some embodiments, the coordinate conversion of the optimized graphic data includes:
[0016] Using the graphic coordinate data of the vector data as the device coordinate data of the vector data in the device coordinate system;
[0017] After the pixel coordinate system is established for the image data, the pixel coordinate data of the image data is used as the device coordinate data of the image data in the device coordinate system.
[0018] In some embodiments, the step of performing coordinate transformation on the optimized graphic data further includes:
[0019] According to the color value of each pixel of the image data, the grayscale value of each pixel is calculated.
[0020] In some embodiments, when laser cutting is performed on vector data in a coordinate system, laser cutting is performed on the graphic data in the device coordinate system according to a preset cutting attribute and a preset cutting method, including:
[0021] According to the preset display path, manual sorting, setting of cutting points and cutting directions, and laser cutting in the preset motion mode according to the preset processing sequence;
[0022] Among them, the preset cutting properties include: displaying the path, manual sorting, and setting the cutting point and cutting direction; the preset cutting method includes: the preset processing sequence and the preset movement method; the preset processing sequence includes: the overall execution direction, the principle of first inside and then outside, the principle of cutting from the sharp corners, and the principle of cutting from the nearest corner; the overall execution direction includes: from top to bottom, from bottom to top, from left to right, and from right to left; the preset movement methods include: point movement, trajectory movement, and scanning movement.
[0023] In some embodiments, when laser cutting is performed on the image data in the coordinate system, the laser cutting is performed on the graphic data in the device coordinate system according to the preset cutting attribute and the preset cutting method, and then further includes:
[0024] The energy of laser cutting at the corresponding coordinates is controlled according to the grayscale value.
[0025] In a second aspect, an embodiment of the present application provides a graphic cutting system, comprising:
[0026] The parsing module is used to parse the acquired raw processing data to obtain parsed data;
[0027] An optimization module, used for optimizing the parsed data to obtain optimized graphic data;
[0028] A conversion module, used for performing coordinate conversion on the optimized graphic data to obtain graphic data in a device coordinate system;
[0029] The cutting module is used to perform laser cutting on the graphic data in the device coordinate system according to preset cutting properties and preset cutting methods to obtain a target cutting graphic.
[0030] In a third aspect, an embodiment of the present application provides a terminal device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the graphic cutting method as described above when executed by the processor.
[0031] In a fourth aspect, an embodiment of the present application provides a computer storage medium storing a computer program, which implements the steps of the graphic cutting method described above when executed by a processor.
[0032] The present application provides a graphic cutting method, system, terminal device and storage medium. The method parses the original processing data to obtain the parsed data, optimizes the parsed data, and performs coordinate conversion on the optimized graphic data to obtain the graphic data in the device coordinate system. Then, the graphic data in the device coordinate system is laser cut according to the preset cutting attributes and the preset cutting method. Compared with the prior art, the method can freely set a variety of cutting attributes and cut according to the preset cutting method, which effectively improves the processing accuracy and yield rate and greatly expands the usage scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 A flowchart of an embodiment of the graph cutting method provided by the present application;
[0035] Figure 2 A comparison diagram of curve smoothing effects in an embodiment of the graph cutting method provided in the present application;
[0036] Figure 3 A flowchart of coordinate conversion operation in one embodiment of the graphic cutting method provided by the present application;
[0037] Figure 4 A schematic diagram of a horizontal line method in an embodiment of the graphic cutting method provided by the present application;
[0038] Figure 5A schematic diagram of a vertical line method in an embodiment of the graphic cutting method provided by the present application;
[0039] Figure 6 A schematic diagram of an ellipse mode in an embodiment of the graphic cutting method provided in the present application;
[0040] Figure 7 A schematic diagram of a rectangular method in an embodiment of the graphic cutting method provided in the present application;
[0041] Figure 8 A schematic diagram of a cross method in an embodiment of the graphic cutting method provided by the present application;
[0042] Fig. 9 A schematic diagram of a grid mode in an embodiment of the graphic cutting method provided in the present application;
[0043] Fig.10 An architectural relationship diagram of an embodiment of the graphic cutting system provided in this application. DETAILED DESCRIPTION
[0044] The technical solutions in the embodiments of the present application will be described clearly and completely below 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, rather than all of the embodiments.
[0045] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0046] Hereinafter, the terms "including", "having" and their cognates used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or a combination of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or a combination of the foregoing items or increasing the possibility of one or more features, numbers, steps, operations, elements, components or a combination of the foregoing items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.
[0047] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.
[0048] The present application provides a graphic cutting method, system, terminal device and storage medium. In the present application, the original processing data is parsed, and after the parsed data is obtained, the parsed data is optimized, and the obtained optimized graphic data is coordinate-converted to obtain the graphic data in the device coordinate system, and then the graphic data in the device coordinate system is laser-cut according to the preset cutting attributes and the preset cutting method, so that a variety of cutting attributes can be freely set and cutting is performed according to the preset cutting method, which effectively improves the processing accuracy and yield rate, and greatly expands the use scenarios.
[0049] The following is a description of the design of the graphic cutting method through specific exemplary embodiments. It should be noted that the following embodiments are only used to explain the technical solution of the invention and are not specifically limited:
[0050] See also Figure 1 , the embodiment of the present application provides a graph cutting method, comprising steps S100-S400:
[0051] S100, parsing the acquired original processing data to obtain parsed data.
[0052] The parsed data include: vector data file formats (such as PLT (PLT is a drawing file format) \DXF (DXF is an open vector data format) etc.) and picture data file formats (such as BMP (standard image file format) \JPG (the full name of English is Joint Photographic Experts Group, a standard for continuous tone static image compression) etc.).
[0053] Exemplarily, based on the graphic cutting method in this application, a corresponding laser cutting system software is designed. The software uses a file in rld format (rad format is a file format commonly used in 3D printing and computer-aided design (CAD)). The rld file saves the graphic information, the layer processing parameters of each layer, and the processing order of each graphic element. Therefore, saving the imported graphic data as an rld file can facilitate the output and processing of this graphic later. Among them, the imported file formats support: dxf, ai (vector graphics file format), PLT, dst (mainly used for embroidery and sewing design) and sb, etc.; the exported file formats support: PLT, etc.
[0054] When importing files, the software defaults to millimeters as the import unit for DXF files. If the size of the imported DXF data is inconsistent with the original drawing, it may be caused by unit mismatch. Therefore, it is necessary to select the appropriate import unit according to the accuracy of the original PLT file. Among them, the optional data units are millimeters, centimeters, inches, and custom. When custom is selected, the user can arbitrarily set the data of a unit in the DXF file to correspond to the number of millimeters in the software.
[0055] Then, after obtaining the original processing data in ld format by drawing with CAD software, the original processing data is parsed to obtain parsed data, including: vector data and image data.
[0056] In addition, after obtaining the parsed data, it needs to be further stored. For vector data format files, the internal points of the file itself are given in order, and can be stored in sequence in a linked list. Since the order of the points is stored in sequence, when parsing, it can be read in sequence. A curve starts from the pen-lifting point and passes through a series of pen-dropping points in sequence, so the conversion constitutes the corresponding curve on the software. Among them, the data point information given by the vector data mainly includes: the coordinates of the points, the order of the points, and whether the pen is dropped or lifted at the point.
[0057] The image data is composed of rows and columns of pixels and is also stored row by row. The color values of the pixels are stored in the same row from left to right. The pixels are stored in two-bit arrays, corresponding to the rows and columns of the image.
[0058] S200, optimizing the parsed data to obtain optimized graphic data.
[0059] Exemplarily, after parsing to obtain the parsed data, the parsed data is optimized, including: path optimization, curve smoothing, closure check, deletion of duplicate lines, merging of connected lines and bitmap processing, to obtain optimized graphic data. The graphic data is composed of a number of independent curves.
[0060] Among them, path optimization is mainly used to reorder the paths of vector graphics (such as curves); for some graphics with poor curve accuracy, curve smoothing can make the graphics smoother and the processing smoother; closure check is to automatically check and close the curve according to the closure tolerance; deleting duplicate lines refers to the situation where two straight line segments inside a curve, or there are straight line segments between two curves that completely overlap, repeated processing will lead to a waste of time or affect the effect of the cutting; its essence is to compare the relative spatial relationship of any two straight lines, including complete overlap, partial overlap, and mutual inclusion; merging connected lines is to connect the curves in the selected curves with a connection error less than the merge tolerance (the merge tolerance is a function used to automatically merge vertices when chamfering edges, which specifies how close the vertices must be to be merged) into one curve; bitmap processing is mainly for processing image-type data.
[0061] It can be understood that in the present application, the analytical data is optimized, thereby improving the forming quality of the graphic data, which helps to improve the cutting effect.
[0062] For example, in one implementation method, optimizing parsed data includes:
[0063] Perform at least one of path optimization, curve smoothing, closure check, duplicate line deletion and connected line merging operations on the vector data, and perform bitmap processing on the image data.
[0064] Among them, bitmap processing includes: grayscale conversion, contrast adjustment, inversion, sharpening, binarization and contour extraction. Grayscale conversion and binarization can convert color images into different levels of gray or black and white; contrast adjustment can weaken the contrast between black and white parts in the image; inversion is to highlight the transparent subject in the image; sharpening is to highlight the edge of the object in the image; and contour extraction can extract the edge of the subject in the image.
[0065] Optionally, at least one of the following operations is performed on the vector data: path optimization, curve smoothing, closure check, deletion of duplicate lines and merging of connected lines, etc., and bitmap processing operations are performed on the image data.
[0066] Among them, path optimization: the original order of graphic data is generally the drawing order of CAD software, and it needs to be adjusted in order according to the processing technology, that is, the path of the vector graphics needs to be reordered. Reordering mainly considers the needs of processing. For example, if the graphics are required to be processed from bottom to top, because they are processed from bottom to top, the operator can collect the parts that have been cut in advance before they are processed, without having to wait until all the graphics are processed, thus saving the time for collecting materials (most of the time for collecting materials is included in the processing time).
[0067] Curve smoothing: It is mainly aimed at curves composed of multiple straight lines. On the one hand, some points are deformed and deviate greatly from the standard curve. On the other hand, there may be too few corresponding line segments at locations with large curvature. The curve smoothing process mainly includes two parts: segmentation and fitting. Segmentation is to find the locations with clear segmentation on the curve, such as sharp corners, and divide the curve into several smooth segments. Fitting is to use parametric curves to approximate and replace the original line segments.
[0068] When using the laser cutting system software, you can click the menu command [Process] / [Curve Smoothing] on the laser cutting system software, or click the corresponding icon on the system toolbar to display a dialog window. Drag the smoothness and click the [Apply] button. The interface will display the curves before and after smoothing for easy comparison. The schematic diagram of the curves before and after smoothing is as follows: Figure 2 As shown in the figure, the black curve is the original curve, and the gray curve is the smoothed curve. In addition, you can use the mouse to drag or zoom the graph. Click the [Full Screen] button, and the graph will be displayed as large as possible in the dialog box. If you are satisfied with the smoothing effect, you can click the [Apply] button, and the curve will be smoothed accordingly according to the smoothness setting. You can even select the [Direct Smoothing] button to use another smoothing method. The choice of smoothing method should be changed according to the needs of the actual graph.
[0069] Closure check is to check whether the starting point and the end point of the curve form a complete closed curve (within a certain error range). If so, the curve is forced to be closed.
[0070] However, the drawings generated by CAD software may undergo some graphic processing after entering the software. For example, adjacent lines will be connected together to facilitate drawing in one stroke; for example, two adjacent boxes have an overlapping edge, which will be processed twice during processing and the duplicate lines need to be deleted; these will affect the order of the graphics.
[0071] Merging connected lines means comparing any two curves in turn to see if they are connected head-to-head, head-to-tail, tail-to-head, and tail-to-tail. If so, the two curves are merged into one curve to become a contour line that can be drawn in one stroke, thereby reducing empty tracks. When merging connected lines, the selected curves with connection errors less than the merge tolerance will be automatically connected into one curve according to the merge tolerance setting.
[0072] For example, in one implementation method, bitmap processing is performed on the image data, including:
[0073] Perform at least one of grayscale conversion, contrast adjustment, color inversion, sharpening, binarization and contour extraction on the image data.
[0074] Exemplarily, the specific process of bitmap processing mainly includes:
[0075] Perform at least one of the following operations on the image data:
[0076] Grayscale conversion, contrast adjustment, color inversion, sharpening, binarization and contour extraction, etc.
[0077] Among them, since the image input is an ordinary photo or a rendering generated by design software, it is generally rich in color. However, laser processing cannot express these colors. Laser leaves traces by burning materials. For example, when using laser on paper or wood, the so-called "black" and "white" colors can be achieved by controlling whether the light is emitted or not, or by controlling the power change, more different degrees of "black", that is, grayscale. Therefore, the color image can be converted into different levels of grayscale or black and white by grayscale conversion and binarization of the image data, so that it can be processed by laser. In addition, in general, other graphic processing is performed on the basis of the grayscale image. Before processing, you can select grayscale processing first, and then click the [Apply to Source Image] button on the laser cutting system software. Furthermore, because the grayscale image occupies less memory than the color image, the step-by-step processing of larger bitmaps can avoid insufficient memory to a certain extent, and can also save the computing time of subsequent operations.
[0078] In addition, due to the light and the reflective surface of the object, the photo will have too bright and too dark parts, and the contrast needs to be weakened, that is, the contrast needs to be adjusted. Otherwise, when processing with laser, it will be burned or information will be lost, such as the hair of the portrait will be too dark, the apple muscle area of the face will be too bright, etc. For color images, the contrast and brightness can be adjusted, which has a certain auxiliary effect on the subsequent binarization processing effect.
[0079] Inverting can achieve a negative effect similar to a photo. If the material being processed is transparent, the photo needs to be inverted to see the normal image, such as processing on transparent glass or acrylic materials.
[0080] Sharpening can emphasize the edges of objects in the image. For example, if you emphasize the edges of text in the image, the text will be clearer; if you emphasize the edges of characters, they will be more vivid.
[0081] Binarization processing includes: dot map, scatter map and black and white map.
[0082] Among them, the dot map needs to set the dot size (mm), which is more suitable for occasions where the resolution of the processed material is not high or the laser response is relatively slow. The parameters that need to be adjusted for hanging screens are the resolution of the picture and the frequency of hanging screens. The higher the resolution, the finer the graphics. The higher the hanging screen frequency, the smaller the dots. The lower the hanging screen frequency, the larger the dots. The resolution is generally selected to be 500-1000, and the hanging screen frequency is 30-50 lines.
[0083] The grayscale performance of the scatter plot is better, which is suitable for the case where the resolution of the processed material is high and the laser response is fast. In most cases, the effect of directly converting the color image to black and white is poor, but it is also convenient for some applications with clear color contours.
[0084] Contour extraction can extract the edge of the main body in the image. After engraving, some images need to be cut along the edge. Therefore, after the edge of the main body of the image is extracted, it is converted into a vector graphic and then enlarged based on the outer contour. It can be used for applications that cut along the edge of the image.
[0085] Furthermore, in another embodiment of the present application, before cutting, processing preview and data check can be performed; the laser cutting system software supports processing preview of the file to be processed, and some basic processing information can be obtained through processing preview. Such as the actual output processing path, approximate processing time, and processing distance. And the processing process can be simulated. In addition, in addition to previewing the currently edited file, you can also preview the saved rd file.
[0086] The data check function integrates functions such as closure check, self-intersection check, intersection check and data overlap check. When checking data, users can select check items as needed to detect problematic data. Users can select check items as needed. After problematic data is detected, the found problems will be prompted on the right side of the dialog box, and the problematic graphics will be selected.
[0087] S300 , performing coordinate conversion on the optimized graphic data to obtain graphic data in a device coordinate system.
[0088] Among them, the equipment coordinate system refers to the coordinate system directly related to the physical structure of the cutting machine, which is used to define the position and movement of the cutting head, workbench and other mechanical parts.
[0089] Exemplarily, after obtaining the optimized graphic data, it is necessary to perform coordinate conversion on the optimized graphic data to a device coordinate system to obtain the graphic data in the device coordinate system so that processing can be performed directly to improve processing efficiency.
[0090] For example, in one implementation, see Figure 3 , the optimized graphic data is transformed into coordinates, including:
[0091] S301, using the graphic coordinate data of the vector data as the device coordinate data of the vector data in the device coordinate system;
[0092] S302: After establishing a pixel coordinate system for the image data, the pixel coordinate data of the image data is used as the device coordinate data of the image data in the device coordinate system.
[0093] For example, when performing coordinate conversion, for vector data, since the coordinates and directions are already given, it is only necessary to simply translate the graphic coordinate system to the device coordinate system to achieve the coordinate conversion of the vector data. After that, it can be directly sent to the device to move along the trajectory in sequence, and through the pen-lifting and pen-dropping information corresponding to each point of the original data point, the laser light can be controlled to switch on and off at the corresponding point, or the pen-lifting and pen-dropping of other tools (such as brushes and knives) can be controlled;
[0094] For example, in one implementation method, the optimized graphic data is subjected to coordinate transformation, and then the following steps are further included:
[0095] According to the color value of each pixel in the image data, the grayscale value of each pixel is calculated.
[0096] Exemplarily, when performing coordinate conversion, for image data, two issues need to be considered first: one is how to express the color of each pixel using laser energy, and the other is the coordinate definition of the point on the image.
[0097] Since the color of pixel points is generally represented by RGB, which is a ratio of red, green and blue to display the color, but for laser processing, the color cannot be reflected. Since RGB neutralizes the color and brightness, the universal standard formula for converting RGB to grayscale can be used to extract its brightness information from RGB, which is the so-called grayscale value; the grayscale after conversion is expressed as 0-255, among which 0 is the darkest and 255 is the brightest; then, corresponding to the laser power control, 0 corresponds to the maximum power and 255 corresponds to no light, and the linear correspondence between grayscale and power can be completed.
[0098] The image coordinate definition can use any corner of the image to establish the coordinate system zero point and direction, the pixel width W and pixel height H of the image, then the corresponding coordinates of each pixel are from (0, 0) to (W, H); the image determines its physical size through the resolution description, such as 1000DPI, which means that one inch corresponds to 1000 pixels, then the spacing of each pixel is 25.4 / 1000=0.0254mm, then the physical coordinates of each pixel are from (0, 0) to (0.0254*W, 0.0254*H); similar to vector processing, the data points in the image coordinate system are then translated to the device coordinate system, thereby realizing the coordinate conversion of the image data, and similarly it can be sent to the motherboard for processing.
[0099] Since the pixels of the image are arranged in rows and columns, the most direct way is to use row and column scanning, which passes through a row of pixels in turn, controls the light output of the pixel according to the energy value converted from the color value at the corresponding pixel, and then moves on to the next row until the entire image scan is completed.
[0100] Furthermore, in this application, the original processed data consists of vector data and image data, and these two types of data can also be converted to each other. Filling the surface formed by the vector data will turn it into an image; extracting the contours of the image pixels can also form new vector contours. Through the mutual conversion of vector data and image data, more data expressions and processing methods that the original image does not have can be created.
[0101] S400, laser cutting is performed on the graphic data in the coordinate system according to the preset cutting attributes and the preset cutting method to obtain a target cutting graphic.
[0102] Among them, the preset cutting properties include: display path, manual sorting, and setting cutting points and cutting directions; the preset cutting methods include: preset processing sequence and preset movement methods; the preset processing sequence includes: overall execution direction, the principle of first inside and then outside, the principle of cutting from sharp corners, and the principle of cutting from the nearest corner; the overall execution direction includes: from top to bottom, from bottom to top, from left to right, and from right to left; the preset movement methods include: point movement, trajectory movement, and scanning movement.
[0103] Demonstratively, after obtaining the graphic data in the device coordinate system, when performing laser cutting, laser cutting is performed along the cutting route on the optimized graphic data according to the preset cutting properties (including display path, manual sorting, and setting cutting points and cutting directions) and the preset cutting method (including preset processing sequence and preset movement method).
[0104] Among them, the vector from the node to the next node in the cutting curve (cutting path) is the cutting line; the vector from the end node of the previous curve to the first node of the next curve is the empty path. Among them, the processing trajectory is divided into two parts: empty path and cutting, that is, the difference between the trajectory of the pen being put down and the trajectory of the pen not being put down. Take writing as an example, it will not be written in one stroke, and there will always be a pen in the middle. But because the pen is not put down, the so-called empty path from the end of the previous stroke to the start of the next stroke has no motion trajectory requirements, only requires moving from one point to another, regardless of what trajectory it moves in, generally speaking, it moves in a straight line to the next starting point.
[0105] During the laser process, the laser processing sequence needs to be adjusted in real time, including:
[0106] The overall execution direction (such as from top to bottom, from bottom to top, from left to right, from right to left); the two curves before and after are not required to strictly follow this direction, but within a certain range (there are parameters for setting the corresponding block height during path optimization. Taking bottom to top as the main direction, if the block height is set to 50mm, the total graphic is arranged for 1000mm. Assuming that the bottom is the reference, its height is 0, and the top edge height is 1000, then simply put, 0-50, 50-100, 100-150...950-1000 is the divided The processing order of the blocks is always to finish the lower block first and then move on to the higher block. This is the so-called overall execution direction from bottom to top, and 50 is the so-called range. Of course, it may contain some cross-block graphics. For example, a curve range is from 30 to 80, which will span 0-50 and 50-100 blocks. For this kind of graph, it will be counted as the graph of the lower block, so as to ensure that the progress will not be reversed after entering the higher block). It is required to advance according to the execution direction (track remote control process).
[0107] The principle of inside first and outside second is that for curves with a containment relationship, the inside is processed first, and then the outside curve is processed.
[0108] The principle of starting cutting from a sharp corner is that the first node should be at a sharp corner as much as possible, rather than cutting on a smooth segment; and concave sharp corners take precedence over convex sharp corners.
[0109] The principle of cutting from the nearest point is that for two adjacent curves, the distance from the end node of the previous curve to the first node of the next curve is locally the shortest; the total length of the empty routing of all curves is required to be the minimum.
[0110] Furthermore, the laser processing scheme in this application belongs to two-dimensional plane processing, and the main movement forms of the equipment include three types: point movement (moving from one point to another on the plane regardless of the intermediate movement trajectory), XY trajectory movement (moving from one point to another on the plane, but strictly following the prescribed trajectory) and scanning movement (moving in the execution direction and scanning repeatedly); existing general equipment adopts one of these movement modes, and this application integrates three different working modes, which can be mixed and combined to adapt to more application scenarios.
[0111] For example, in one implementation method, when laser cutting is performed on vector data in a coordinate system, laser cutting is performed on graphic data in the coordinate system according to a preset cutting attribute and a preset cutting method, including:
[0112] According to the preset display path, manual sorting, setting of cutting points and cutting directions, laser cutting is performed in a preset motion mode in a preset processing sequence.
[0113] Exemplarily, after obtaining the vector data in the device coordinate system, laser cutting begins:
[0114] The laser is controlled to cut according to the preset display path, manual sorting, and set cutting points and cutting directions. At the same time, during the cutting process, the laser is controlled to cut according to the overall execution direction (one of top to bottom, bottom to top, left to right, and right to left), and one of the preset processing sequences such as the principle of first inside and then outside, the principle of cutting from the sharp corner, and the principle of cutting from the nearest point. In addition, the laser moves along the cutting path of the vector data according to one of the preset motion modes of point motion, trajectory motion, and scanning motion.
[0115] For example, in one implementation method, when laser cutting is performed on the image data in the coordinate system, the image data in the coordinate system is laser cut according to a preset cutting attribute and a preset cutting method, and then the method further includes:
[0116] The energy of laser cutting at the corresponding coordinates is controlled according to the grayscale value.
[0117] For example, after obtaining the image data in the device coordinate system, laser cutting begins:
[0118] Similarly, the laser is controlled to perform laser cutting along the cutting path of the image data according to the preset display path, manual sorting, setting of cutting points and cutting directions, and the preset processing order and the preset movement mode. In addition, in order to express the color of each pixel point of the image data with laser energy, the energy of the laser cutting at the corresponding coordinates is controlled according to the grayscale value, so as to cut out the target cutting pattern corresponding to the grayscale value of the image data at the established coordinates.
[0119] It can be understood that in this application, the integrated vector data and image data are processed separately and applied in a mixed manner in two-dimensional plane processing, which can adapt to almost all two-dimensional plane application processing scenarios; and, through the process analysis of vector data and image data in laser processing, and corresponding solutions, the processing accuracy and effect are improved.
[0120] For example, in another implementation method, a light shield needs to be designed to assist cutting during the cutting process. Then, the process of designing the light shield in the laser cutting system software is as follows:
[0121] First, click the menu command [Edit] / [Light Barrier Design], or click the drawing toolbar to start the light barrier design tool.
[0122] Then, you first need to design a light guide plate outer contour. When you start the light barrier design tool, a 200X200mm rectangular light guide plate contour will be generated by default. Users can manually create a standard shape of light guide plate contour in the "System" page of the tool. Among them, you can create a rectangular or elliptical standard light guide plate contour.
[0123] Even users can import a designed graphic as the outline of the light guide plate. Click the "Import Light Guide Plate Outline" button to select the desired file as the light guide plate outline. It should be pointed out that the outline file must be a closed graphic, otherwise, the system will automatically delete it.
[0124] Furthermore, if the imported outline size does not meet the requirements, the user can also modify the outline size and set whether to leave a white margin.
[0125] Secondly, after the outline graphic is ready, you can start adding dots to the light guide plate.
[0126] Among them, Figure 4-Figure 9 As shown in the figure, there are six types of dot patterns: horizontal line, vertical line, ellipse, rectangle, cross line and grid. There are four factors that affect the effect of the light guide plate: dot shape, dot size, dot spacing and baseline.
[0127] Among them, horizontal, vertical, cross, ellipse and rectangular dots have size and spacing parameters, while grid only has spacing parameters.
[0128] The baseline is related to the light source, and the user can adjust the baseline according to the actual light source position. Figure 4 - Fig. 9 The middle cross line shown is the baseline. The user can move the mouse to the baseline, press the mouse, and then drag the baseline to the desired position.
[0129] The baseline divides the entire light guide plate into four areas: the area above the horizontal baseline is defined as the upper row area, the area below the horizontal baseline is defined as the lower row area, the area to the left of the vertical baseline is defined as the left column area, and the area to the right of the vertical baseline is defined as the right column area. Then, by setting the initial value and the gradient of the dot size and spacing in the upper row, lower row, left column and right column, the light guide plate effect that the user wants can be formed.
[0130] For the grid mode, the row enable / column enable must be set for the grid to appear.
[0131] For the convenience of application, the system provides light source settings. If it is a standard light source, you can select the light source and then set the dot parameters without adjusting the baseline. At this time, the display of the baseline is also hidden.
[0132] Among them, dots in the form of horizontal lines, vertical lines, cross lines, ellipses, and rectangles are output in a scanning manner.
[0133] In scanning mode, the minimum energy and maximum energy are generally the same, and the light-on delay is 0. The system adjusts the density of the scan lines by adjusting the scan accuracy. The higher the scan accuracy, the denser the scan lines, and the lower the scan accuracy, the sparser the scan lines.
[0134] The grid is processed by cutting, which has nothing to do with the scanning accuracy. The minimum energy, maximum energy and switching light delay can be adjusted according to the actual effect. Generally speaking, the minimum energy is slightly lower than the maximum energy.
[0135] If you need to cut the outer contour of the light guide plate, enable contour cutting. If you need to process multiple light guide plates in an array, you can set the array parameters; the array direction is always in the opposite direction of the machine origin.
[0136] See also Fig.10 , the embodiment of the present application provides a graphic cutting system, comprising:
[0137] The analysis module 10 is used to analyze the acquired original processing data to obtain the analysis data; the optimization module 20 is used to optimize the analysis data to obtain the optimized graphic data; the conversion module 30 is used to perform coordinate conversion on the optimized graphic data to obtain the graphic data in the device coordinate system; the cutting module 40 is used to perform laser cutting on the graphic data in the coordinate system according to the preset cutting properties and the preset cutting method to obtain the target cutting graphic.
[0138] It can be understood that the graphic cutting system of this embodiment corresponds to the graphic cutting method of the above embodiment, and the options in the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.
[0139] The present application also provides a terminal device. Exemplarily, the terminal device includes a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to enable the terminal device to execute the functions of the various modules in the above-mentioned graphic cutting method or the above-mentioned graphic cutting system.
[0140] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
[0141] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.
[0142] The present application also provides a computer storage medium for storing the computer program used in the above terminal device. For example, the computer storage medium may include but is not limited to: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0143] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0144] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0145] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.
[0146] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A graph cutting method, characterized in that: include: Analyze the acquired raw processing data to obtain analyzed data; Optimizing the parsed data to obtain optimized graphic data; Performing coordinate transformation on the optimized graphic data to obtain graphic data in a device coordinate system; The graphic data in the device coordinate system is laser cut according to the preset cutting attributes and the preset cutting method to obtain the target cutting graphic.
2. The graph cutting method according to claim 1, characterized in that: The parsed data includes: vector data and picture data; the optimizing the parsed data includes: At least one of path optimization, curve smoothing, closure check, duplicate line deletion and connected line merging operations is performed on the vector data, and bitmap processing is performed on the image data.
3. The graph cutting method according to claim 2, characterized in that: The bitmap processing of the image data comprises: The image data is subjected to at least one of grayscale conversion, contrast adjustment, color inversion, sharpening, binarization and contour extraction.
4. The graph cutting method according to claim 2, characterized in that: The step of performing coordinate transformation on the optimized graphic data comprises: Using the graphic coordinate data of the vector data as the device coordinate data of the vector data in the device coordinate system; After the pixel coordinate system is established for the image data, the pixel coordinate data of the image data is used as the device coordinate data of the image data in the device coordinate system.
5. The graph cutting method according to claim 2, characterized in that: The step of performing coordinate transformation on the optimized graphic data further includes: According to the color value of each pixel of the image data, the grayscale value of each pixel is calculated.
6. The graph cutting method according to claim 2, characterized in that: When laser cutting is performed on the vector data in the coordinate system, the laser cutting of the graphic data in the device coordinate system according to the preset cutting attribute and the preset cutting method includes: According to the preset display path, manual sorting, setting of cutting points and cutting directions, and laser cutting in the preset motion mode according to the preset processing sequence; Among them, the preset cutting properties include: displaying the path, manual sorting, and setting the cutting point and cutting direction; the preset cutting method includes: the preset processing sequence and the preset movement method; the preset processing sequence includes: the overall execution direction, the principle of first inside and then outside, the principle of cutting from the sharp corners, and the principle of cutting from the nearest corner; the overall execution direction includes: from top to bottom, from bottom to top, from left to right, and from right to left; the preset movement methods include: point movement, trajectory movement, and scanning movement.
7. The graph cutting method according to claim 5, characterized in that: When laser cutting is performed on the image data in the coordinate system, the laser cutting is performed on the graphic data in the device coordinate system according to the preset cutting attribute and the preset cutting method, and then the following is further included: The energy of laser cutting at the corresponding coordinates is controlled according to the grayscale value.
8. A graphic cutting system, characterized in that: include: The parsing module is used to parse the acquired raw processing data to obtain parsed data; An optimization module, used for optimizing the parsed data to obtain optimized graphic data; A conversion module, used for performing coordinate conversion on the optimized graphic data to obtain graphic data in a device coordinate system; The cutting module is used to perform laser cutting on the graphic data in the device coordinate system according to preset cutting properties and preset cutting methods to obtain a target cutting graphic.
9. A terminal device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the graphic cutting method according to any one of claims 1 to 7 are implemented.
10. A computer storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the steps of the graph cutting method according to any one of claims 1 to 7 are implemented.