Array determination method and electronic device for laser cutting
By constructing a cutting array based on minimum distance in the laser cutting system, the problems of material waste and low efficiency in irregularly shaped parts are solved, achieving more efficient material utilization and cutting accuracy.
Patent Information
- Application Number
- CN202411247868.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2044-09-06
AI Technical Summary
Existing laser cutting systems suffer from material waste and low cutting efficiency when processing irregularly shaped, tilted, or assembled parts by using circumscribed rectangular arrays to calculate the position.
By determining the bounding rectangle of the target primitive, copying the primitive and calculating the minimum distance, a cutting array is constructed to optimize the primitive spacing, reduce material waste, and improve cutting accuracy.
It achieves higher material utilization and cutting precision, reduces material waste, and improves cutting efficiency.
Smart Images

Figure CN119131046B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of laser cutting, in particular to an array determination method for laser cutting and an electronic device. BACKGROUND
[0002] In the existing laser cutting system, multiple parts need to be cut on a material, and generally an array is used to arrange the graphics for cutting multiple parts. The array function is to calculate the circumscribed rectangle of the graphics and then calculate the placement position of the graphics in the array according to the width and height of the circumscribed rectangle. This technology is accurate in terms of array position according to the spacing of the graphics similar to the outer frame of the rectangle. However, when the parts are shaped parts, inclined parts, combined parts, etc., the calculation of the placement position of the array according to the circumscribed rectangle may cause unreasonable distance between two part graphics, resulting in material waste. SUMMARY
[0003] The present application aims to provide an array determination method for laser cutting and an electronic device, which can improve the material utilization rate in laser cutting and the efficiency of manually making cutting graphics.
[0004] In a first aspect, the present application provides an array determination method for laser cutting, comprising: determining a circumscribed rectangle of a target graphic, wherein the target graphic is a cutting shape required by laser cutting; copying the target graphic to obtain a first graphic in a first direction, wherein the distance between the circumscribed rectangle of the target graphic and the circumscribed rectangle of the first graphic is a set value; calculating a target minimum distance between the first graphic and the target graphic in the first direction; and constructing a cutting array based on the target minimum distance and the target graphic.
[0005] In the above embodiment, the placement position of the graphic can be calculated based on the circumscribed rectangle to form an initial array, and the minimum distance between two adjacent graphics is used as the offset between the two graphics, so that the cutting array is constructed based on the minimum distance, so that the distance between the graphics in the cutting array is closer, and the cutting based on the cutting array can save the material used for cutting the parts. In addition, the array obtained based on the above minimum distance can prevent the graphics in each cutting array from overlapping, and can better achieve the accuracy of the parts obtained by cutting.
[0006] In an optional implementation, the calculating the target minimum distance of the first graphic element and the target graphic element in the first direction comprises: determining a first minimum distance of a key point in the first graphic element and the target graphic element in the first direction; determining a second minimum distance of a key point in the target graphic element and the first graphic element in the first direction, wherein the smaller value of the first minimum distance and the second minimum distance is determined as the target minimum distance.
[0007] In the above implementation, the minimum distance can be calculated from two dimensions, and the reliability of the target minimum distance obtained is improved.
[0008] In an optional implementation, the determining the first minimum distance of the key point in the first graphic element and the target graphic element comprises: determining distances of key points in a first sub-graphic element in the first graphic element and the target graphic element, to filter out a minimum distance of the first sub-graphic element and the target graphic element from the distances, the first sub-graphic element being any one of all sub-graphic elements included in the first graphic element; and determining the first minimum distance of the key point in the first graphic element and the target graphic element based on minimum distances of all sub-graphic elements of the first graphic element and the target graphic element.
[0009] In an optional implementation, the determining the second minimum distance of the key point in the first graphic element and the target graphic element comprises: determining distances of key points in a second sub-graphic element in the target graphic element and the first graphic element, to filter out a minimum distance of the second sub-graphic element and the first graphic element from the distances, the second sub-graphic element being any one of all sub-graphic elements included in the target graphic element; and determining the first minimum distance of the key point in the target graphic element and the first graphic element based on minimum distances of all sub-graphic elements of the target graphic element and the first graphic element.
[0010] In the above implementation, the minimum distance of the key point in each sub-graphic element to the other graphic element can be calculated in units of sub-graphic elements, and the calculation amount can be relatively smaller, and the calculation efficiency is improved.
[0011] In an optional implementation, the determining the circumscribed rectangle of the target graphic element comprises: decomposing the target graphic element into a plurality of sub-graphic elements, wherein the sub-graphic elements comprise one or more of a line segment, a circular arc, and the like; and determining a target minimum horizontal coordinate, a target maximum horizontal coordinate, a target minimum vertical coordinate, and a target maximum vertical coordinate based on key points of the plurality of sub-graphic elements, wherein the target minimum horizontal coordinate, the target maximum horizontal coordinate, the target minimum vertical coordinate, and the target maximum vertical coordinate are used to determine vertex coordinates of the circumscribed rectangle.
[0012] In the above embodiment, the target graph element can be decomposed into a plurality of small sub-graph elements, and the circumscribed rectangle can be determined based on the small sub-graph elements. Since it is not necessary to screen each point in the target graph element one by one to determine the vertex coordinates of the circumscribed rectangle, the relative calculation amount can be relatively small, and the cutting array determination efficiency can be improved.
[0013] In an optional embodiment, the key points of the line segment include end points of the line segment; and the target minimum horizontal coordinate, the target maximum horizontal coordinate, the target minimum vertical coordinate, and the target maximum vertical coordinate are determined based on the key points of the plurality of sub-graph elements, including: comparing the coordinates of the end points of each line segment in the plurality of sub-graph elements to determine a first minimum horizontal coordinate, a first maximum horizontal coordinate, a first minimum vertical coordinate, and a first maximum vertical coordinate; comparing the key points of each circular arc in the plurality of sub-graph elements to determine a second minimum horizontal coordinate, a second maximum horizontal coordinate, a second minimum vertical coordinate, and a second maximum vertical coordinate; taking a smaller value between the first minimum horizontal coordinate and the second minimum horizontal coordinate as the target minimum horizontal coordinate; taking a larger value between the first maximum horizontal coordinate and the second maximum horizontal coordinate as the target maximum horizontal coordinate; taking a smaller value between the first minimum vertical coordinate and the second minimum vertical coordinate as the target minimum vertical coordinate; and taking a larger value between the first maximum vertical coordinate and the second maximum vertical coordinate as the target maximum vertical coordinate.
[0014] In the above embodiment, the maximum value and the minimum value of the target graph element on each coordinate axis can be determined based on the key points of each sub-graph element, so as to determine each end point of the circumscribed rectangle.
[0015] In an optional embodiment, the comparing the key points of each circular arc in the plurality of sub-graph elements to determine the second minimum horizontal coordinate, the second maximum horizontal coordinate, the second minimum vertical coordinate, and the second maximum vertical coordinate includes: constructing a circular arc coordinate system based on a center of a target circular arc for each circular arc in the plurality of sub-graph elements, and determining an intersection point of the target circular arc and a coordinate axis of the circular arc coordinate system; comparing the start point, the end point, and the intersection point of each circular arc and the coordinate axis of the circular arc coordinate system to determine the second minimum horizontal coordinate, the second maximum horizontal coordinate, the second minimum vertical coordinate, and the second maximum vertical coordinate.
[0016] In an optional implementation, the cutting array includes a plurality of array elements; and the constructing the cutting array based on the target minimum distance and the target element includes: copying the i-th array element in the first direction to obtain an i+1-th spare element, where a distance between a circumscribed rectangle of the i-th array element and a circumscribed rectangle of the i+1-th spare element is the set value, i is a positive integer, and the i-th array element represents the target element when i is 1; and moving the i+1-th spare element in the first direction to be close to the i-th array element by the target minimum distance to obtain an i+1-th array element.
[0017] In the above implementation, the deviation between two adjacent elements in the cutting array can be eliminated in a manner of translation.
[0018] In a second aspect, the present application provides an electronic device, comprising: a processor, a memory, the memory storing machine readable instructions executable by the processor, when the electronic device is running, the machine readable instructions are executed by the processor to perform the steps of the method according to any one of the preceding embodiments.
[0019] In a third aspect, the present application provides a laser cutting device, comprising: a processor, a memory, a laser cutting head, the memory storing machine readable instructions executable by the processor, when the laser cutting device is running, the machine readable instructions are executed by the processor to perform the steps of the method according to any one of the preceding embodiments.
[0020] In a fourth aspect, the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, the computer program being executed by a processor to perform the steps of the method according to any one of the preceding embodiments.
[0021] In a fifth aspect, the present application provides a computer program product, the computer program product comprising a computer program, the computer program being executed by a processor to implement the method according to any one of the preceding embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope, and for those skilled in the art, other related drawings can also be obtained without creative labor.
[0023] Figure 1 The block diagram of the electronic device provided by the embodiments of the present application is shown;
[0024] Figure 2A flowchart of an array determination method for laser cutting provided in an embodiment of this application;
[0025] Figure 3 This is a schematic diagram of a component array provided in an embodiment of this application;
[0026] Figure 4 This is another schematic diagram of a cutting array provided for an embodiment of this application. Detailed Implementation
[0027] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0028] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0029] Laser cutting technology is a manufacturing technique that uses a high-energy-density laser beam to process materials. It has advantages such as high precision, high efficiency, and non-contact operation. In laser cutting, the laser beam cuts the material along a predetermined trajectory, enabling precise processing of various materials and rapid manufacturing of parts.
[0030] Before laser cutting, it is necessary to determine the primitives based on the shape of the required parts, and then determine the array required for cutting based on the primitives. The array function of parts in laser cutting refers to the ability to cut multiple identical or different parts simultaneously in a single laser processing step through reasonable arrangement and design, thereby improving production efficiency and reducing costs. However, current methods of part arraying have shortcomings. They may result in significant material waste, or require a large amount of manual calculation to lay out the cutting array. This method significantly reduces the efficiency of obtaining the cutting array and the overall cutting efficiency, and wastes human resources.
[0031] Based on the above research, the embodiments of this application can provide an array determination method, electronic device, computer-readable storage medium, and computer program product for laser cutting, which can improve the utilization rate of materials used in laser-cut parts and reduce material waste.
[0032] To facilitate understanding of this embodiment, the electronic device that performs the array determination method for laser cutting disclosed in this application embodiment will first be described in detail.
[0033] like Figure 1 The diagram shown is a block illustration of an electronic device. The electronic device 100 may include a memory 111 and a processor 113. Those skilled in the art will understand that...Figure 1 The structure shown is only schematic, and does not limit the structure of the electronic device 100. For example, the electronic device 100 can also include more or fewer components than those shown, or have a different configuration of components than those shown. Figure 1 For example, the electronic device 100 can also include more or fewer components than those shown, or have a different configuration of components than those shown. Figure 1 For example, the electronic device 100 can also include more or fewer components than those shown, or have a different configuration of components than those shown.
[0034] The memory 111 and the processor 113 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, the memory 111 and the processor 113 can be electrically connected to each other through one or more communication buses or signal lines. The processor 113 is configured to execute an executable module stored in the memory.
[0035] The memory 111 can 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 111 is configured to store a program. After receiving an execution instruction, the processor 113 executes the program. The method performed by the electronic device 100 defined in the process disclosed in any of the embodiments of the present application can be applied to the processor 113 or implemented by the processor 113.
[0036] The processor 113 can be an integrated circuit chip having a signal processing capability. The processor 113 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc. The processor 113 can also be a digital signal processor (DSP), a special-purpose integrated circuit (ASIC), a field programmable gate array (FPGA), or the like.
[0037] (Application Specific Integrated Circuit, ASIC), Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can be any conventional processor.
[0038] The electronic device 100 in the embodiments can be used to execute each step in each method provided by the embodiments.
[0039] The embodiments of the present application also provide a laser cutting device, which can include a processor, a memory and a laser cutting head.
[0040] The memory stores machine readable instructions executable by the processor, and when the laser cutting device is running, the machine readable instructions are executed by the processor to execute the steps in the array determination method for laser cutting provided by the embodiments of the present application.
[0041] The processor and the memory included in the laser cutting device can be similar to the memory and the processor of the electronic device 100 provided by the foregoing embodiments, and specific reference can be made to the related description in the foregoing electronic device 100, which will not be repeated here.
[0042] The laser cutting device in the embodiments can be used to execute each step in each method provided by the embodiments of the present application. The implementation process of the array determination method for laser cutting will be described in detail through several embodiments.
[0043] Please refer to Figure 2 , which is a flowchart of the array determination method for laser cutting provided by the embodiments of the present application. The array determination method for laser cutting provided by the embodiments of the present application can be applied to an electronic device or a laser cutting device, and the steps in the array determination method for laser cutting are executed through the device. The specific process shown in FIG. 10 will be described in detail below. Figure 2
[0044] Step 210, determining the circumscribed rectangle of the target graph element.
[0045] The target graph element is a cutting shape required for laser cutting.
[0046] The circumscribed rectangle of the target graph element is the smallest rectangle that can frame all the points of the target graph element.
[0047] Exemplarily, the most edge points can be determined in the horizontal and vertical directions of the two coordinate axes, and the two most edge points of the target graphic element in the horizontal direction can be taken as the positions of the two widths of the circumscribed rectangle, and the two most edge points of the target graphic element in the vertical direction can be taken as the positions of the two lengths of the circumscribed rectangle. In an example, the horizontal coordinates of the two most edge points of the target graphic element in the horizontal direction can be Xmin and Xmax respectively, and the vertical coordinates of the two most edge points of the target graphic element in the vertical direction can be Ymin and Ymax respectively, and then the four vertices of the circumscribed rectangle can be determined as (Xmin, Ymin), (Xmin, Ymax), (Xmax, Ymin), and (Xmax, Ymax).
[0048] In step 220, a first graphic element is obtained by copying the target graphic element in a first direction.
[0049] The distance between the circumscribed rectangle of the target graphic element and the circumscribed rectangle of the first graphic element is a set value. Exemplarily, the set value can be zero.
[0050] The distance between the circumscribed rectangle of the target graphic element and the circumscribed rectangle of the first graphic element can be represented by the distance between the two edges closest to each other.
[0051] Figure 3 A part array diagram is shown in FIG. 1, in which a target graphic element Gt and a first graphic element G1 are shown, and the distance between the circumscribed rectangles of the target graphic element Gt and the first graphic element G1 is zero.
[0052] The first direction described above can be the direction of the horizontal coordinate in a pre-set coordinate system, or the direction of the vertical coordinate in the coordinate system. The pre-set coordinate system can be a coordinate system determined based on the target graphic element. For example, the coordinate system can be a coordinate system constructed with an arbitrary position on the target graphic element as the origin, or a coordinate system constructed with one of the vertices of the circumscribed rectangle of the target graphic element as the origin. It can be understood that the embodiments of the present application are not limited to the position of constructing the coordinate system. In the examples shown in FIGS. 1-3, the coordinate system is constructed with a point outside the target graphic element as the origin, and the width of the circumscribed rectangle of each graphic element is parallel to the horizontal coordinate of the coordinate system, and the length of the circumscribed rectangle of the graphic element is parallel to the vertical coordinate of the coordinate system. Figure 3 In the example shown in FIG. 1, the coordinate system is constructed with a point outside the target graphic element as the origin, and the width of the circumscribed rectangle of each graphic element is parallel to the horizontal coordinate of the coordinate system, and the length of the circumscribed rectangle of the graphic element is parallel to the vertical coordinate of the coordinate system.
[0053] In step 230, a target minimum distance of the first graphic element and the target graphic element in the first direction is calculated.
[0054] Exemplarily, for a first point on the first graph element, the first point can be represented as the nearest distance to the target graph element in the first direction, representing the distance between the first point on the first graph element and the target graph element. For example, a line can be drawn parallel to the first direction and passing through the first point, and the distance between the point on the line closest to the first point and the first point can be understood as the distance between the first point on the first graph element and the target graph element.
[0055] For a second point on the target graph element, the second point can be represented as the nearest distance to the first graph element in the first direction, representing the distance between the second point on the target graph element and the first graph element.
[0056] In Figure 3 In the example shown, the first direction is a direction parallel to the horizontal coordinate. Among them, the distance between the first graph element and the target graph element can be represented as the distance between the points in the direction parallel to the horizontal coordinate.
[0057] The above-mentioned target minimum distance can be the minimum distance between all points on the first graph element and the target graph element, and all points on the target graph element and the first graph element.
[0058] Step 240, constructing a cutting array based on the target minimum distance and the target graph element.
[0059] Exemplarily, an initial array can be obtained in the manner of step 220, and then the copied graph element can be translated according to the calculated target minimum distance to eliminate the gap between the two graph elements.
[0060] The target minimum distance can be used as a graph element offset.
[0061] In the first direction, the i+1 standby graph element is obtained by copying the i-th array graph element, i is a positive integer, and i is 1. The i-th array graph element represents the target graph element; the i+1 standby graph element is moved towards the i-th array graph element in the first direction by the target minimum distance to obtain the i+1 array graph element.
[0062] Among them, the distance between the circumscribed rectangle of the i-th array graph element and the circumscribed rectangle of the i+1 standby graph element is a set value.
[0063] Figure 4 A cutting array schematic diagram is shown. In Figure 4 In the example shown, the arrangement of the array graph elements in the obtained cutting array can be more compact. The same size of material can carve more parts.
[0064] In actual use, the size of the material is larger, and when the required cutting array is not only one-dimensional, the minimum distance between the first graph element and the target graph element can be calculated from multiple directions.
[0065] For example, the cutting array can be a two-dimensional matrix. The minimum distance between the first primitive and the target primitive can be determined from the directions of the horizontal and vertical coordinates, and this distance can be used as the offset in the corresponding directions to construct the cutting matrix.
[0066] The above method allows for a denser arrangement of graphic elements, enabling more efficient use of the cutting material and reducing material waste.
[0067] Considering that a primitive is typically a shape constructed from continuous lines, determining the circumscribed rectangle by identifying each point in the continuous lines is relatively inefficient. Therefore, step 210 above may include steps 211 and 212.
[0068] Step 211: Decompose the target primitive into multiple sub-primitives.
[0069] The sub-primitives include one or more of line segments and arcs.
[0070] If the primitive is formed by connecting line segments, it can be decomposed into multiple line segments. If the target primitive is an irregular shape, it can be decomposed into a set of line segments and arcs.
[0071] exist Figure 3 In the example shown, the outer contour of the target primitive Gt can be decomposed to determine multiple line segments and multiple arcs.
[0072] Step 212: Based on the key points of multiple sub-elements, determine the minimum x-coordinate, maximum x-coordinate, minimum y-coordinate, and maximum y-coordinate of the target.
[0073] The key points mentioned above can be the endpoints of the decomposed line segments, the starting and ending points of the arc, and the intersection points of the arc with the diameters parallel to the horizontal and vertical coordinates.
[0074] For example, the coordinates of key points of multiple sub-primitives can be compared to filter out the minimum x-coordinate, maximum x-coordinate, minimum y-coordinate, and maximum y-coordinate of the target.
[0075] The minimum x-coordinate, maximum x-coordinate, minimum y-coordinate, and maximum y-coordinate of the target are used to determine the vertex coordinates of the circumscribed rectangle.
[0076] The minimum x-coordinate, maximum x-coordinate, minimum y-coordinate, and maximum y-coordinate of the target can be represented as Xmin, Xmax, Ymin, and Ymax, respectively. Then, the four vertices of the circumscribed rectangle can be determined as (Xmin, Ymin), (Xmin, Ymax), (Xmax, Ymin), and (Xmax, Ymax).
[0077] The step 212 can include steps 2121-2126.
[0078] The step 2121 compares the coordinates of the endpoints of the line segments in the plurality of sub-graph elements to determine a first minimum horizontal coordinate, a first maximum horizontal coordinate, a first minimum vertical coordinate, and a first maximum vertical coordinate.
[0079] For example, the minimum horizontal coordinate can be selected from the coordinates of the endpoints of the line segments as the first minimum horizontal coordinate, the maximum horizontal coordinate can be selected from the coordinates of the endpoints of the line segments as the first maximum horizontal coordinate, the minimum vertical coordinate can be selected from the coordinates of the endpoints of the line segments as the first minimum vertical coordinate, and the maximum vertical coordinate can be selected from the coordinates of the endpoints of the line segments as the first maximum vertical coordinate.
[0080] The step 2122 compares the coordinates of the key points of the circular arcs in the plurality of sub-graph elements to determine a second minimum horizontal coordinate, a second maximum horizontal coordinate, a second minimum vertical coordinate, and a second maximum vertical coordinate.
[0081] For example, the minimum horizontal coordinate can be selected from the coordinates of the key points of the circular arcs as the first minimum horizontal coordinate, the maximum horizontal coordinate can be selected from the coordinates of the key points of the circular arcs as the first maximum horizontal coordinate, the minimum vertical coordinate can be selected from the coordinates of the key points of the circular arcs as the first minimum vertical coordinate, and the maximum vertical coordinate can be selected from the coordinates of the key points of the circular arcs as the first maximum vertical coordinate.
[0082] The step 2123 determines a target minimum horizontal coordinate as the smaller of the first minimum horizontal coordinate and the second minimum horizontal coordinate.
[0083] The step 2124 determines a target maximum horizontal coordinate as the larger of the first maximum horizontal coordinate and the second maximum horizontal coordinate.
[0084] The step 2125 determines a target minimum vertical coordinate as the smaller of the first minimum vertical coordinate and the second minimum vertical coordinate.
[0085] The step 2126 determines a target maximum vertical coordinate as the larger of the first maximum vertical coordinate and the second maximum vertical coordinate.
[0086] In an embodiment, the step 2122 can include constructing a circular arc coordinate system based on the center of the target circular arc and determining an intersection of the target circular arc and a coordinate axis of the circular arc coordinate system for the target circular arc.
[0087] The target arc is any one of the plurality of arcs. The intersection of the arcs can be determined in the same way as the target arc.
[0088] The starting point, the ending point, and the intersection of the arcs with the coordinate axes of the arc coordinate system of each arc can be compared to determine the second minimum horizontal coordinate, the second maximum horizontal coordinate, the second minimum vertical coordinate, and the second maximum vertical coordinate.
[0089] Considering that a primitive can contain many points, calculating the minimum distance between two primitives for each point can result in a relatively large amount of calculation. To reduce the amount of calculation and the burden on computing resources, the calculation of the minimum distance can be implemented based on key points by screening out the key points. Based on this, the step 230 can include steps 231 and 232.
[0090] Step 231: In the first direction, determine the first minimum distance between the key points in the first primitive and the target primitive.
[0091] The first minimum distance between the key points in the first primitive and the target primitive can represent the minimum value of the distances between all key points in the first primitive and the target primitive.
[0092] Step 232: In the first direction, determine the second minimum distance between the key points in the target primitive and the first primitive.
[0093] The smaller value of the first minimum distance and the second minimum distance is determined as the target minimum distance.
[0094] The second minimum distance between the key points in the target primitive and the first primitive can represent the minimum value of the distances between all key points in the target primitive and the first primitive.
[0095] For example, the first primitive can be divided into a plurality of sub-primitives.
[0096] Optionally, for a first sub-primitive in the first primitive, the distances between the key points in the first sub-primitive and the target primitive are determined to screen out the minimum distance between the first sub-primitive and the target primitive; based on the minimum distances between all sub-primitives of the first primitive and the target primitive, the first minimum distance between the key points in the first primitive and the target primitive is determined.
[0097] The first sub-primitive described above can be any one of all sub-primitives contained in the first primitive. The first sub-primitive can be a line segment. For some heterogeneous figures, for example, figures with curves, the curves can be decomposed into a plurality of shorter line segments.
[0098] Among all the minimum distances between the sub-primitives of the first primitive and the target primitive, the minimum one is determined as the first minimum distance between the key point in the first primitive and the target primitive.
[0099] For example, for the first sub-primitive, the value range of the second direction of the first sub-primitive can be determined. The second direction is perpendicular to the first direction. For example, the first direction is the direction parallel to the horizontal coordinate, and the second direction is the direction parallel to the vertical coordinate.
[0100] For example, for the first sub-primitive, the value range of the second direction of the first sub-primitive can be determined. The second direction is perpendicular to the first direction. For example, the first direction is the direction parallel to the horizontal coordinate, and the second direction is the direction parallel to the vertical coordinate.
[0101] Then, the distances between the two end points of the first sub-primitive and the graphics whose vertical coordinate value ranges are within [y1, y2] are calculated to determine the minimum distance.
[0102] For example, a straight line passing through the first end point of the first sub-primitive and parallel to the first direction can be drawn, and the distance between the intersection point of the straight line and the graphics whose vertical coordinate value ranges are within [y1, y2] is determined as the minimum distance between the first end point of the first sub-primitive and the target primitive. A straight line passing through the second end point of the first sub-primitive and parallel to the first direction can be drawn, and the distance between the intersection point of the straight line and the graphics whose vertical coordinate value ranges are within [y1, y2] is determined as the minimum distance between the second end point of the first sub-primitive and the target primitive. If the minimum distance between the first end point and the target primitive is smaller, it is taken as the minimum distance between the first sub-primitive and the target primitive. If the minimum distance between the second end point and the target primitive is smaller, it is taken as the minimum distance between the first sub-primitive and the target primitive.
[0103] For all the other sub-primitives in the first primitive, the minimum distances between the sub-primitives and the target primitive can be determined in a similar manner as the first sub-primitive.
[0104] Alternatively, for the second sub-primitive in the target primitive, the distances between the key points in the second sub-primitive and the first primitive are determined to screen the minimum distance between the second sub-primitive and the first primitive. The second sub-primitive is any one of all the sub-primitives in the target primitive. Based on the minimum distances between all the sub-primitives of the target primitive and the first primitive, the first minimum distance between the key point in the target primitive and the first primitive is determined.
[0105] Taking a specific coordinate as an example, the second sub-graph element is a line segment, and the end point coordinates of the line segment are (x1, y1) and (x2, y2), respectively. The value range of the second direction of the line segment is [y1, y2]. Then, the graph whose vertical coordinate value range is in the range of [y1, y2] is determined.
[0106] Then, the distance between the two end points of the second sub-graph element and the graph whose vertical coordinate value range is in the range of [y1, y2] is calculated to determine the minimum distance.
[0107] For example, a straight line passing through the first end point of the second sub-graph element and parallel to the first direction is drawn, the distance between the intersection point of the straight line and the graph whose vertical coordinate value range is in the range of [y1, y2] is determined, the minimum distance is screened out as the minimum distance between the first end point of the second sub-graph element and the first graph element. A straight line passing through the second end point of the second sub-graph element and parallel to the first direction is drawn, the distance between the intersection point of the straight line and the graph whose vertical coordinate value range is in the range of [y1, y2] is determined, the minimum distance is screened out as the minimum distance between the second end point of the second sub-graph element and the first graph element. If the minimum distance between the first end point and the first graph element is smaller, it is taken as the minimum distance between the second sub-graph element and the first graph element. If the minimum distance between the second end point and the first graph element is smaller, it is taken as the minimum distance between the second sub-graph element and the first graph element.
[0108] For all other sub-graph elements in the target graph element, the minimum distance between each sub-graph element and the first graph element can be determined in a similar manner as the second sub-graph element.
[0109] In the embodiments of the present application, even if the parts to be engraved are special-shaped parts, inclined parts, combined parts, and other non-rectangular shapes, more sufficient use of materials can be achieved, and a more efficient calculation method is used to determine the cutting array. Further, the actual distance between the parts can be better guaranteed while improving the utilization rate of the material, and the precision is not affected by the shape of the parts.
[0110] In addition, the present application also provides a computer readable storage medium, which stores a computer program. When the computer program is run by a processor, the steps of the array determination method for laser cutting described in the above method embodiments are executed.
[0111] The computer program product for the array determination method for laser cutting provided by the embodiments of the present application includes a computer readable storage medium storing program codes. The instructions included in the program codes can be used to execute the steps of the array determination method for laser cutting described in the above method embodiments. For details, refer to the above method embodiments, which will not be described here.
[0112] It should be understood that all the functional units in the embodiments of the present application can be integrated into one processing unit, or each can exist alone, or two or more can be integrated into one function unit.
[0113] In addition, each functional unit in the various embodiments of the present application can be integrated together to form an independent part, or each unit can exist alone, or two or more units can be integrated to form an independent part.
[0114] 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 solutions of the present application can be embodied in the form of a software product in essence or in the part that contributes to the prior art, or part of the technical solutions. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes. It should be noted that in this paper, relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to the process, method, article or device. Without more limitations, the elements defined by the statement "include" do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0115] The above is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. It should be noted that similar reference numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0116] The above is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. It should be noted that similar reference numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0116] The above is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. It should be noted that similar reference numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
Claims
1. An array determination method for laser cutting, characterized by, The method comprises the following steps: determining an outer rectangle of a target graphic element, wherein the target graphic element is a cutting shape required by laser cutting; copying the target graphic element to obtain a first graphic element in a first direction, wherein a distance between the outer rectangle of the target graphic element and an outer rectangle of the first graphic element is a set value; calculating a target minimum distance between the first graphic element and the target graphic element in the first direction, comprising: determining a first minimum distance between a key point in the first graphic element and the target graphic element in the first direction; determining a second minimum distance between a key point in the target graphic element and the first graphic element in the first direction, wherein a smaller value between the first minimum distance and the second minimum distance is determined as the target minimum distance; constructing a cutting array based on the target minimum distance and the target graphic element; the determining of the first minimum distance between the key point in the first graphic element and the target graphic element comprises: determining distances between key points in a first sub-graphic element in the first graphic element and the target graphic element, to screen out a minimum distance between the first sub-graphic element and the target graphic element, wherein the first sub-graphic element is any one of all sub-graphic elements contained in the first graphic element; determining the first minimum distance between the key point in the first graphic element and the target graphic element based on minimum distances between all sub-graphic elements of the first graphic element and the target graphic element; wherein the first sub-graphic element comprises one or more of a line segment and an arc; the determining of the second minimum distance between the key point in the target graphic element and the first graphic element comprises: determining distances between key points in a second sub-graphic element in the target graphic element and the first graphic element, to screen out a minimum distance between the second sub-graphic element and the first graphic element, wherein the second sub-graphic element is any one of all sub-graphic elements contained in the target graphic element; determining the second minimum distance between the key point in the target graphic element and the first graphic element based on minimum distances between all sub-graphic elements of the target graphic element and the first graphic element; wherein the second sub-graphic element comprises one or more of a line segment and an arc.
2. The method of claim 1, wherein, The method comprises the following steps: decomposing the target graphic element into a plurality of sub-graphic elements, wherein the sub-graphic elements comprise one or more of a line segment and an arc; determining a target minimum horizontal coordinate, a target maximum horizontal coordinate, a target minimum vertical coordinate and a target maximum vertical coordinate based on key points of the plurality of sub-graphic elements, wherein the target minimum horizontal coordinate, the target maximum horizontal coordinate, the target minimum vertical coordinate and the target maximum vertical coordinate are used to determine coordinates of vertices of an outer rectangle.
3. The method of claim 2, wherein, The key point of the line segment comprises an end point of the line segment; the determining of the target minimum horizontal coordinate, the target maximum horizontal coordinate, the target minimum vertical coordinate and the target maximum vertical coordinate based on the key points of the plurality of sub-graphic elements comprises: comparing coordinates of end points of each line segment in the plurality of sub-graphic elements to determine a first minimum horizontal coordinate, a first maximum horizontal coordinate, a first minimum vertical coordinate and a first maximum vertical coordinate; Comparing the key points of each arc of the plurality of sub-graph elements, and determining a second minimum horizontal coordinate, a second maximum horizontal coordinate, a second minimum vertical coordinate, and a second maximum vertical coordinate; Taking the smaller value of the first minimum horizontal coordinate and the second minimum horizontal coordinate as a target minimum horizontal coordinate; Taking the larger value of the first maximum horizontal coordinate and the second maximum horizontal coordinate as a target maximum horizontal coordinate; Taking the smaller value of the first minimum vertical coordinate and the second minimum vertical coordinate as a target minimum vertical coordinate; Taking the larger value of the first maximum vertical coordinate and the second maximum vertical coordinate as a target maximum vertical coordinate.
4. The method of claim 3, wherein, The comparing the key points of each arc of the plurality of sub-graph elements, and determining a second minimum horizontal coordinate, a second maximum horizontal coordinate, a second minimum vertical coordinate, and a second maximum vertical coordinate, comprises: For a target arc, constructing an arc coordinate system based on the center of the target arc, and determining the intersection of the target arc and the coordinate axis of the arc coordinate system, the target arc being any one of the decomposed arcs; Comparing the start point, end point, and intersection of each arc and the coordinate axis of the arc coordinate system to determine the second minimum horizontal coordinate, the second maximum horizontal coordinate, the second minimum vertical coordinate, and the second maximum vertical coordinate.
5. The method of claim 1, wherein, The cutting array comprises a plurality of array elements; The constructing a cutting array based on the target minimum distance and the target element comprises: In the first direction, copying the i-th array element to obtain an i+1-th standby element, wherein the distance between the circumscribed rectangle of the i-th array element and the circumscribed rectangle of the i+1-th standby element is the set value, i is a positive integer, and when i is 1, the i-th array element represents the target element; Moving the i+1-th standby element in the first direction to be close to the i-th array element by the target minimum distance to obtain an i+1-th array element.
6. An electronic device, comprising: Comprise: A processor, a memory, the memory stores machine readable instructions executable by the processor, when the electronic device runs, the machine readable instructions are executed by the processor to execute the steps of the method of any one of claims 1 to 5.
7. A laser cutting apparatus, characterized by, Comprise: A processor, a memory, a laser cutting head, the memory stores machine readable instructions executable by the processor, when the laser cutting device runs, the machine readable instructions are executed by the processor to execute the steps of the method of any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, the computer program is executed by the processor to execute the steps of the method of any one of claims 1 to 5.
9. A computer program product, characterised in that, The computer program product comprises a computer program, the computer program is executed by the processor to realize the method of any one of claims 1 to 5.