Method, device, equipment and storage medium for generating machining trajectory
By generating a seamless processing trajectory, the problem of poor connection between the starting point and the end point in laser cutting is solved, the yield and processing efficiency are improved, and the processing effect of the target graphics without connection marks is ensured.
Patent Information
- Application Number
- CN202111269481.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-28
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2041-10-28
AI Technical Summary
In the prior art, during laser cutting, process problems such as poor connection between the starting point and the end point, and focus or blackening at the intersection lead to low yield and reduced processing efficiency.
By obtaining the graphics information to be processed and auxiliary processing parameters, determining the target area, selecting the original starting and end points, and using auxiliary line types and line lengths to generate seamless processing trajectories, it avoids the starting and ending points being on the target graphics, ensuring processing accuracy and efficiency.
It realizes seamless processing without connection marks, improves the yield and processing efficiency, and reduces processing defects caused by poor connection between the starting and ending points.
Smart Images

Figure CN114091187B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of laser cutting technology, and in particular to a method, device, equipment and storage medium for generating a processing trajectory. Background Art
[0002] In the field of PCB laser cutting, the laser CNC cutting machine cuts according to the graphic files processed by the graphic processing software to obtain products that meet the shape requirements.
[0003] But currently only laser cut products will have some problems such as Figure 1 or Figure 2 The process problems shown are, for example, when cutting a circle or a closed polygon, the laser cutting starting point and the end point are not connected well, the intersection is highlighted or blackened, and other process problems. Figure 1 or Figure 2 , Figure 1 Box 101 and Figure 2 The process problems located in block 102 are all caused by the poor connection between the original starting point and the original end point. The occurrence of the above process problems will cause losses such as scrapping of the obtained products, low yield rate, and further reduce processing efficiency.
[0004] Therefore, there is a need to provide a method for reducing the scrap rate of products and improving processing efficiency. Summary of the Invention
[0005] The main purpose of the present invention is to provide a method, device, equipment and storage medium for generating a processing trajectory, which can solve the process problems in the prior art such as poor connection between the starting point and the end point of laser cutting, and the focus or blackening of the intersection, which cause low yield and low processing efficiency.
[0006] To achieve the above-mentioned object, the present invention provides a first aspect of a method for generating a machining trajectory, the method comprising:
[0007] Acquiring information of a graphic to be processed and auxiliary processing parameters, wherein the information of the graphic to be processed includes shape parameters of a target graphic to be processed, an inner area and an outer area of the target graphic, and the auxiliary processing parameters include processing parameters for assisting in processing the target graphic, and the auxiliary processing parameters include at least an auxiliary processing type, an auxiliary line type, and an auxiliary line type length;
[0008] determining a target area according to the inner area, the outer area, and the auxiliary processing type;
[0009] Determine the original starting point and the original end point on the target shape according to the shape parameters and the preset start and end point selection rules;
[0010] Determining a target processing start point and a target processing end point that are not on the target graphic and are located in the target area based on the original starting point, the original end point, the shape parameter, the target area, the auxiliary line type, and the length of the auxiliary line type;
[0011] A processing trajectory of the target graphic is generated based on the target processing starting point, the target processing end point, the target graphic, the auxiliary line type, and the length of the auxiliary line type.
[0012] In a feasible implementation, the step of obtaining the graphics information to be processed includes:
[0013] Acquire a drawing file of the target graphic, wherein the drawing file includes shape parameters of the target graphic;
[0014] According to the shape parameters and preset inner and outer area recognition rules, the inner area and the outer area of the target graphic are determined to obtain the graphic information to be processed.
[0015] In one feasible implementation, the shape parameters include a shape type, and determining an original starting point and an original end point on the target shape based on the shape parameters and a preset start and end point selection rule includes:
[0016] When the shape type is a polygon, the midpoint of the longest straight line among the straight lines of the polygon is determined as the original starting point and the original end point of the polygon;
[0017] When the shape type is a circle, any point on the circle is selected as the original starting point and the original end point of the circle.
[0018] In one feasible implementation, the shape parameter includes a shape type. When the shape type is a polygon, determining the inner area and the outer area of the target graphic based on the shape parameter and a preset inner and outer area identification rule to obtain the graphic information to be processed includes:
[0019] Obtaining the vector direction of each straight line in the polygon drawing file;
[0020] When the vector directions are connected end to end to form the same rotation direction, and the rotation direction is counterclockwise, the intersection of the left areas of the vector directions of the straight lines is determined as the inner area of the polygon; and the union of the right areas of the vector directions of the straight lines is determined as the outer area of the polygon;
[0021] When the vector directions are connected end to end to form the same rotation direction, and the rotation direction is clockwise, the intersection of the right side areas of the vector directions of the straight lines is determined as the inner area of the polygon; the union of the left side areas of the vector directions of the straight lines is determined as the outer area of the polygon.
[0022] In a feasible implementation, the auxiliary line type includes an auxiliary line segment; the auxiliary line type length includes the auxiliary line segment length;
[0023] Then, determining a target processing start point and a target processing end point that are not on the target graphic and are located in the target area based on the original starting point, the original end point, the shape parameter, the target area, the auxiliary line type, and the auxiliary line type length includes:
[0024] Taking the original starting point as the starting point of the first ray, the first ray is emitted within the target area within a first preset angle range, where the first preset angle range is a first angle between the first ray and the longest straight line;
[0025] Determine an end point of a first auxiliary line segment on the first ray using the starting point of the first ray and the length of the auxiliary line segment, and determine the end point of the first auxiliary line segment as the target processing starting point;
[0026] Taking the original end point as the starting point of a second ray, emitting a second ray within the target area within a second preset angle range, where the second preset angle range is a second angle between the second ray and the longest straight line;
[0027] An end point of a second auxiliary line segment is determined on the second ray using the starting point of the second ray and the length of the auxiliary line segment, and the end point of the second auxiliary line segment is determined as the target processing end point.
[0028] In a feasible implementation, when the shape type is a circle, the auxiliary line type includes an auxiliary arc; the auxiliary line type length includes the auxiliary arc length;
[0029] Then, determining a target processing start point and a target processing end point that are not on the target graphic and are located in the target area based on the original starting point, the original end point, the shape parameter, the target area, the auxiliary line type, and the auxiliary line type length includes:
[0030] Obtaining a first radius of the circle;
[0031] Scaling the first radius according to a preset scaling ratio to obtain a second radius, wherein the preset scaling ratio is related to the length of the auxiliary arc and a preset interval range, and the preset interval range is the interval between the auxiliary arc and the circle;
[0032] determining the auxiliary arc according to the second radius and the length of the auxiliary arc;
[0033] A target processing start point and a target processing end point of the circle are determined according to the auxiliary arc, the original starting point, the preset interval range, the original end point and the target area.
[0034] In a feasible implementation, determining the target processing starting point and target processing end point of the circle according to the auxiliary arc, the original starting point, the preset interval range, the original end point, and the target area includes:
[0035] Taking the original starting point as the end point of the first auxiliary arc, setting the first auxiliary arc within the target area according to the preset interval range, and obtaining the target processing starting point, which is the starting point of the first auxiliary arc;
[0036] Using the original end point as the starting point of a second auxiliary arc, setting the second auxiliary arc within the target area according to the preset interval range, and obtaining the target processing end point, which is the end point of the second auxiliary arc;
[0037] The first auxiliary arc and the second auxiliary arc have opposite curvature directions and both point into the target area.
[0038] To achieve the above-mentioned object, the second aspect of the present invention provides a device for generating a machining trajectory, the device comprising:
[0039] Processing data acquisition module: used to acquire information of graphics to be processed and auxiliary processing parameters, wherein the information of graphics to be processed includes shape parameters of the target graphics to be processed, inner area and outer area of the target graphics, and the auxiliary processing parameters include processing parameters for assisting in processing the target graphics, and the auxiliary processing parameters include at least auxiliary processing type, auxiliary line type and auxiliary line type length;
[0040] A target area determination module is configured to determine a target area according to the inner area, the outer area and the auxiliary processing type;
[0041] Original start and end point determination module: used to determine the original start point and the original end point on the target shape according to the shape parameters and the preset start and end point selection rules;
[0042] A target starting and ending point determination module is configured to determine a target processing starting point and a target processing end point that are not on the target graphic and are located in the target area based on the original starting point, the original end point, the shape parameters, the target area, the auxiliary line type, and the length of the auxiliary line type;
[0043] A seamless trajectory generation module is used to generate a processing trajectory of the target graphic based on the target processing starting point, the target processing end point, the target graphic, the auxiliary line type and the length of the auxiliary line type.
[0044] To achieve the above-mentioned objectives, the third aspect of the present invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps shown in the first aspect or any feasible implementation method.
[0045] To achieve the above-mentioned objectives, the fourth aspect of the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps shown in the first aspect or any feasible implementation method.
[0046] The embodiments of the present invention have the following beneficial effects:
[0047] The present application determines the target area according to the inner area, outer area and auxiliary processing type of the target graphic, and the target area is the inner area or outer area of the target graphic, and is combined with the preset start and end point selection rules according to the shape parameters of the target graphic, so that the original starting point and the original end point can be selected on the target graphic first, and finally the target area, the original starting point and the original end point, the auxiliary line type, the auxiliary line type length and the shape parameters are used to determine the target processing start point and the target processing end point that are not on the target graphic and are located in the target area. In this way, processing is performed according to the final generated processing trajectory, which can reduce the problem of poor connection between the start and end points on the target graphic and the generation of connection marks, thereby improving the processing accuracy of the target graphic, achieving a seamless processing effect without connection marks on the target graphic, and further improving the processing yield and processing efficiency of the finished product. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0049] in:
[0050] Figure 1 This is a process effect diagram of poor connection between the starting and ending points when laser cutting a polygon in an embodiment of the present invention;
[0051] Figure 2Another process effect diagram of poor connection between the starting and ending points when laser cutting a circle in an embodiment of the present invention;
[0052] Figure 3 Flowchart of a method for generating a machining trajectory according to an embodiment of the present invention;
[0053] Figure 4 is another flow chart of a method for generating a machining trajectory according to an embodiment of the present invention;
[0054] FIG5(a) and FIG5(b) are diagrams showing the effect of a seamless process when the target pattern is a polygon in an embodiment of the present invention;
[0055] FIG6(a) and FIG6(b) are diagrams showing the effect of a seamless process when the target pattern is a circle in an embodiment of the present invention;
[0056] Figure 7 1 is a structural block diagram of a device for generating a machining trajectory according to an embodiment of the present invention;
[0057] Figure 8 4 is a structural block diagram of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0059] See also Figure 3 A flowchart of a method for generating a machining trajectory in an embodiment of the present invention. The method can be applied to both a terminal and a server. This embodiment is described by taking application to a terminal as an example, wherein: Figure 3 The method shown includes the following steps:
[0060] 301. Acquire information of a graphic to be processed and auxiliary processing parameters, wherein the information of the graphic to be processed includes shape parameters of a target graphic to be processed, an inner region and an outer region of the target graphic, and the auxiliary processing parameters include processing parameters for assisting in seamless processing of the target graphic;
[0061] In an embodiment of the present invention, first, the graphics information to be processed and the auxiliary processing parameters are obtained, wherein the graphics information to be processed can be obtained by reading the mapping information of the target image, or by the user actively inputting it in a preset input interface, which is not limited to this example; the auxiliary processing parameters can be actively input by the user in a preset input interface, wherein the preset input interface is used to input processing parameters or select processing parameters. It can be understood that the method for generating the processing trajectory introduced in this application can form a software module, and provide graphics processing software containing the software module to realize the generation of the processing trajectory on the user side. Therefore, the preset input interface can be any terminal interface containing the graphics processing software, and the setting or selection of the processing parameters is realized through the terminal interface to realize the generation of the subsequent processing trajectory to produce a seamless effect. Furthermore, the graphics information to be processed is used to indicate the size, shape, inner area and outer area of the target graphic, and other properties and characteristics of the target graphic. The properties and characteristics can be used to guide the processing of the target graphic. The auxiliary processing parameters include processing parameters that assist in seamless processing of the target graphics, including but not limited to the auxiliary processing type, auxiliary line type, and the positional relationship between the auxiliary line type length and the target graphics, etc., wherein the auxiliary processing type is used to indicate the target area of the auxiliary processing, that is, whether the auxiliary processing is performed in the external area of the target graphics or in the internal area of the target graphics; the auxiliary line type is used to indicate the type of auxiliary line for auxiliary processing, such as a line segment or an arc, etc.; the auxiliary line type length refers to the length of the auxiliary line, such as the length of a line segment, or the length of an arc; the positional relationship with the target graphics refers to the positional relationship between the auxiliary line and the target graphics.
[0062] 302. Determine a target area according to the inner area, the outer area, and the auxiliary processing type;
[0063] 303. Determine an original starting point and an original end point on the target shape according to the shape parameters and a preset start and end point selection rule;
[0064] It is understandable that after obtaining the information of the graphics to be processed and the auxiliary processing parameters, the target area of the target graphics and the original starting point and original end point are further determined, wherein the target area of the target graphics can be determined by the inner area, outer area and auxiliary processing parameters of the target graphics; the original starting point and original end point located on the target graphics are determined by the shape parameters and the preset start and end point selection rules. Among them, the preset start and end point selection rules are used to select the original starting point and original end point on the target graphics, including but not limited to randomly selecting a point so that the point is used as the original starting point and original end point, or selecting a point as the original starting point and original end point in combination with the shape parameters, which is not limited to this example. In this embodiment, the latter is preferred to improve the generation accuracy of the traceless trajectory.
[0065] In the embodiment of the present invention, it should be noted that the target area is the outer area or inner area of the target graphic, and the target area can be determined by the auxiliary processing type included in the auxiliary processing parameters and the inner area and outer area of the target graphic. The auxiliary processing type indicates on which side (inside or outside) of the target graphic the seamless trajectory of the target graphic is generated. The auxiliary processing type includes inner traceless and outer traceless. Inner traceless indicates that the seamless trajectory is generated inside the target graphic, while outer traceless indicates that the seamless trajectory is generated outside the target graphic. Furthermore, continuing with the above-mentioned preset input interface as an example, the user can select the auxiliary processing type in the interface, and generate a seamless trajectory of the target graphic by determining whether to perform seamless processing inside or outside the target graphic product. For example, if the outside of the target graphic is a product area that needs to be retained, then the inside of the target graphic is a waste area that does not need to be retained. Therefore, the user can input or select the auxiliary processing type as "inner seamless" through the prompt of the terminal interface, so that the target area is the outside of the target graphic; conversely, if the inside of the target graphic is a product area that needs to be retained, then the outside of the target graphic is a waste area that does not need to be retained. Therefore, the user can input or select the auxiliary processing type as "outer seamless" through the prompt of the terminal interface, so that the target area is the outside of the target graphic.
[0066] It is understandable that there is no precedence relationship between the execution order of steps 302 and 303. In other words, the determination of the original starting point and the original end point, and the determination of the target area can be performed simultaneously.
[0067] 304. Determine a target processing start point and a target processing end point that are not on the target graphic and are located in the target area based on the original starting point, the original end point, the shape parameter, the target area, the auxiliary line type, and the length of the auxiliary line type.
[0068] Furthermore, after determining the original starting point, original endpoint, and target area, the shape parameters and auxiliary processing parameters can be combined to determine the target processing starting point and target processing endpoint that are not on the target figure but are located within the target area. It should be noted that different target figures have different shape types, such as polygons or circles, polygons are divided into regular or irregular, and circles are divided into large circles and small circles. Therefore, the auxiliary processing parameters also vary. Therefore, after determining the original starting point, original endpoint, and target area, the shape parameters and auxiliary processing parameters can be combined to achieve the target processing starting point and target processing endpoint of figures of different sizes and shapes that are not on the target figure but are located within the target area.
[0069] 305. Generate a processing trajectory of the target graphic based on the target processing starting point, the target processing end point, the target graphic, the auxiliary line type, and the length of the auxiliary line type.
[0070] It is understandable that after determining the target processing starting point and the target processing end point, the target processing starting point, the target processing end point, the target graphics and the auxiliary processing parameters can be used to generate a seamless trajectory of the target graphics. Furthermore, since the target processing starting point and the target processing end point are located in the target area and are not on the target graphics, the processing trajectory of the target graphics finally obtained by combining the target graphics and the auxiliary processing parameters makes it possible for the product to have no connection marks when laser cutting is performed based on the processing trajectory, and there will be no connection marks in the target graphics obtained by processing, as is generally the case in the prior art, because the processing starting point and the processing end point of the graphics processing trajectory are located on the target graphics. The target graphics can be seamlessly processed by moving the target processing starting point and the target processing end point that are not on the target graphics and are located in the target area, thereby improving processing accuracy and efficiency.
[0071] It should be noted that the so-called "traceless" in this application means that the processing starting point and processing end point of the existing graphic processing trajectory are generally located on the graphic, and the performance differences of different processing devices at the beginning and end of processing often lead to poor connection between the end point and the starting point. For example, the overlap of the end point and the starting point makes the connection heavier, resulting in a distorted graphic with the connection point thickened and blackened; or insufficient connection makes the graphic unable to close and the graphic is incomplete. The above problems cause the target graphic obtained by processing to produce connection traces. Often, this problem is compensated by adjusting the performance parameters of the processing equipment to reduce such differences. However, the performance of different processing equipment is different, and each processing requires debugging, which is time-consuming and labor-intensive. Therefore, the present application proposes a simple and convenient generation of a traceless processing trajectory, which can effectively reduce the impact of starting and ending processing on the target graphic on the processing of the target graphic.
[0072] An embodiment of the present invention discloses a method for generating a processing trajectory, which includes: the present application determines a target area according to an inner area, an outer area and an auxiliary processing type of a target graphic, where the target area is an inner area or an outer area of the target graphic, and combines a preset start and end point selection rule based on the shape parameters of the target graphic, so that the original starting point and the original end point can be selected on the target graphic first, and finally the target area, the original starting point and the original end point, the auxiliary line type, the auxiliary line type length and the shape parameters are used to determine the target processing start point and the target processing end point that are not on the target graphic and are located in the target area. In this way, processing is performed according to the finally generated processing trajectory, which can reduce the problem of poor connection between the start and end points on the target graphic and the generation of connection marks, thereby improving the processing accuracy of the target graphic, achieving a seamless processing effect without connection marks on the target graphic, and further improving the processing yield and processing efficiency of the finished product.
[0073] See also Figure 4 Another flow chart of a method for generating a machining trajectory according to an embodiment of the present invention is shown in FIG. Figure 4 The method shown includes the following steps:
[0074] 401. Obtain a drawing file of the target graphic, where the drawing file includes shape parameters of the target graphic;
[0075] It should be noted that in the embodiment of the present invention, the shape parameters of the target graphic are obtained through drawing files, which include but are not limited to DXF files and Gbr-RS-274-X files (Gerber X2 and RS-274RS-274X) and other drawing files.
[0076] DXF is an AutoCAD (Drawing Interchange Format or Drawing Exchange Format) drawing exchange file, which is an open vector data format and can be divided into two categories: ASCII format and binary format. It is used for data exchange between AutoCAD and other CAD (Computer Aided Design) software.
[0077] The Gerber format is a collection of document formats used by the circuit board industry's software to describe circuit board images (circuit layers, solder mask layers, character layers, etc.) as well as drilling and milling data. Gerber is available in three formats: Gerber X2, the latest Gerber format, RS-274X (extended Gerber format), and the older RS-274-D. The Gerber format is the standard format for image conversion in the circuit board industry. Furthermore, users can set or select auxiliary processing parameters based on the target graphic specifications and processing requirements. Step 401 is similar to step 301, and the description of step 301 can also be referenced and will not be repeated here.
[0078] Furthermore, after obtaining the drawing file, the auxiliary processing parameters may be further obtained, or the auxiliary processing parameters may be obtained at the same time, which is not limited to the example here;
[0079] 402. Determine the inner region and outer region of the target graphic according to the shape parameters and preset inner and outer region identification rules to obtain the graphic information to be processed;
[0080] Specifically, the preset inner and outer region identification rules are related to shape parameters. Different inner and outer region identification rules may be adopted for target graphics of different shapes. The shape parameters include shape types, such as closed graphics such as polygons, circles, or ellipses. For example, when the shape type of the target graphic is a polygon, step 402 may include steps i, ii, and iii to determine the inner and outer regions of the polygon. Steps i, ii, and iii are as follows:
[0081] i. Obtaining the vector direction of each straight line in the polygonal drawing file;
[0082] Exemplarily, when the target figure is a polygon, the vector directions of the straight lines constituting the polygon are obtained. The vector directions can be obtained from the drawing file. Taking a rectangle as an example, the vector directions include the vector directions of the four sides of the rectangle.
[0083] ii. When the vector directions are connected end to end to form the same rotation direction, and the rotation direction is counterclockwise, the intersection of the left regions of the vector directions of the straight lines is determined as the inner region of the polygon; and the union of the right regions of the vector directions of the straight lines is determined as the outer region of the polygon;
[0084] iii. When the vector directions are connected end to end to form the same rotation direction, and the rotation direction is clockwise, the intersection of the right side areas of the vector directions of the straight lines is determined as the inner area of the polygon; and the union of the left side areas of the vector directions of the straight lines is determined as the outer area of the polygon.
[0085] Furthermore, after determining the vector direction, the first digits of each vector direction are connected in sequence according to the shape of the polygon. When the first digits of the vector directions connected can form a consistent rotation direction, the inner area and outer area of the polygon are determined by the vector direction corresponding to each straight line. When the rotation direction is counterclockwise, the intersection of the left area of the vector direction of each straight line is determined as the inner area of the target figure; the union of the right area of the vector direction of each straight line is determined as the outer area of the target figure.
[0086] Among them, when the rotation direction is clockwise, the intersection of the right side area of the vector direction of each straight line is determined as the inner area of the target figure; the union of the left side areas of the vector directions of each straight line is determined as the outer area of the target figure.
[0087] It can be understood that when the vector directions of each straight line are connected end to end or head to head, it means that the vector directions cannot form a consistent rotation direction. It is necessary to correct the vector directions of the straight lines that do not satisfy the end-to-end connection so that the end-to-end connection of the vector directions of each straight line can form a consistent rotation direction, and then distinguish the inner and outer areas of the polygon by rotating clockwise or counterclockwise.
[0088] Exemplarily, when the shape type of the target figure is a circle, and the shape parameters also include the center and radius of the circle, step 402 may also include the following method to determine the inner and outer areas of the circle: taking the center of the circle as the starting point, when the line connecting a point on the plane and the center of the circle is greater than the radius, the position of the point is a point outside the circle, and then the area formed by the set of all points whose connection with the original line is greater than the radius is determined as the outer area of the circle, and the area formed by the set of all points whose connection with the center of the circle is less than the radius is determined as the inner area of the circle.
[0089] 403. Determine a target area based on the inner area, the outer area, and the auxiliary processing parameters;
[0090] 404. Determine an original starting point and an original end point on the target shape according to the shape parameters and a preset start and end point selection rule;
[0091] Among them, step 403 and step 404 are Figure 3 Steps 302 and 303 are similar and will not be described here in detail to avoid repetition. For details, please refer to the description of the aforementioned steps.
[0092] In a feasible implementation, a start and end point selection rule can be set in advance for the shape type of each graphic. For example, when the shape parameter is a polygon, the start and end point selection rule can be to use the midpoint of the longest straight line as the original starting point and the original end point; when the polygon has multiple equal longest straight lines, a longest straight line is randomly selected, and the midpoint of the straight line is used as the original starting point and the original end point; when the shape parameter is a circle, a point on the circle is randomly selected as the original starting point and the original end point. This example is not limited here. For example, please refer to Figure 5(a) and Figure 5(b). Figure 5(a) and Figure 5(b) are effect diagrams of a processing trajectory when the target graphic is a polygon, wherein the original starting point 511 and the original end point 511 in Figure 5(a) are located on the polygon and are the midpoints of the longest straight line of the polygon; the original starting point 512 and the original end point 512 in Figure 5(b) are located on the polygon and are the midpoints of the longest straight line of the polygon.
[0093] 405. Determine a target processing start point and a target processing end point that are not on the target graphic and are located in the target area based on the original starting point, the original end point, the shape parameter, the target area, the auxiliary line type, and the length of the auxiliary line type.
[0094] It can be understood that the auxiliary processing parameters are related to the shape types in the shape parameters, and different shape types correspond to different auxiliary processing parameters.
[0095] In a feasible implementation, when the shape type is a polygon, the auxiliary line type in the auxiliary processing parameters includes an auxiliary line segment; the auxiliary line type length in the auxiliary processing parameters includes an auxiliary line segment length; then step 405 may include:
[0096] S1. Using the original starting point as the starting point of a first ray, emit the first ray within the target area within a first preset angle range, where the first preset angle range is a first angle between the first ray and the longest straight line;
[0097] S2. Determine the end point of a first auxiliary line segment on the first ray using the starting point of the first ray and the length of the auxiliary line segment, and determine the end point of the first auxiliary line segment as the target processing starting point;
[0098] It should be noted that in order to prevent the appearance of corners on the edges of the target graphics finally formed when the processing of the target graphics is started from the target processing starting point in the target area, the present application also pre-sets a first preset angle range when determining the target processing starting point. By taking the original starting point as the starting point of the first ray, the first angle range is used as the first angle between the first ray and the longest straight line, and the first ray is emitted within the target area within the first preset angle range, wherein the first angle range can be a range of angle variation, which is used to represent the critical range of the positional relationship between the first ray and the longest straight line. The first angle is within the variation range to prevent the first ray from coinciding with the longest straight line or the first ray from being too far away from the longest straight line due to exceeding the angle range, resulting in a corner on the target graphics.
[0099] Among them, the first auxiliary line segment is obtained by the first ray and the length of the auxiliary line segment, and the end point of the first auxiliary line segment is used as the starting point of the target processing. The line segment length can be set by itself, but should not exceed the maximum length that the target area can accommodate to ensure the seamless processing effect of the target graphic.
[0100] S3, using the original endpoint as the starting point of a second ray, emitting a second ray within the target area within a second preset angle range, where the second preset angle range is a second angle between the second ray and the longest straight line;
[0101] S4. Determine an end point of a second auxiliary line segment on the second ray using the starting point of the second ray and the length of the auxiliary line segment, and determine the end point of the second auxiliary line segment as the target processing end point.
[0102] It should be noted that in order to prevent the appearance of corners on the edges of the target graphics finally formed when the processing of the target graphics is ended at the target processing end point in the target area, the present application also pre-sets a second preset angle range when determining the target processing end point. By taking the original end point as the starting point of the second ray, the second angle range is used as the second angle between the second ray and the longest straight line, and the second ray is emitted within the target area within the second preset angle range. The second angle range can be a range of angle variation, which is used to represent the critical range of the positional relationship between the second ray and the longest straight line. The second angle is within the variation range to prevent the second ray from coinciding with the longest straight line or the distance between the second ray and the longest straight line from being too large due to exceeding the angle range, resulting in a corner on the target graphics.
[0103] Among them, the second auxiliary line segment is obtained through the second ray and the length of the auxiliary line segment, and the end point of the second auxiliary line segment is used as the target processing end point. The length of the auxiliary line segment can be set by itself, but should not exceed the maximum length that the target area can accommodate, to ensure the seamless processing effect of the target graphic.
[0104] It can be understood that the first auxiliary line segment and the second auxiliary line segment are both located in the target processing area. For example, please refer to Figures 5(a) and 5(b). Figures 5(a) and 5(b) are effect diagrams of a processing trajectory when the target figure is a polygon. The figures show the processing trajectory after the first auxiliary line segment and the second auxiliary line segment are added to the longest straight line. The box 501 in Figure 5(a) is located at the junction of the original starting point 511 and the original end point 511. The endpoint 521 in the target area (waste area) of the polygon is the target processing starting point, and the endpoint 531 is the target processing starting point. As shown in Figure 5(a), after the first auxiliary line segment (521-511) and the second auxiliary line segment (511-531) are added to the target area, the edge line of the target figure in the product area is smooth, there is no connection mark, and the seamless effect is obvious. Furthermore, the location of the box 502 in FIG5(b) is the junction of the original starting point 512 and the original end point 512, wherein the target processing starting point 522 and the target processing starting point 532 are located in the target area (waste area) of the polygon. As shown in FIG5(b), after the first auxiliary line segment (522-512) and the second auxiliary line segment (512-532) are added to the target area, the edge line of the target graphic in the product area is smooth, there is no connection mark, and the traceless effect is obvious. Furthermore, by comparing FIG5(a) and FIG5(b), it can be seen that the target processing areas in FIG5(a) and FIG5(b) are opposite, which further reflects that in this application, by identifying the inside and outside, it can be ensured that the traceless processing effect can be guaranteed regardless of whether the target area is inside or outside. Furthermore, this application can be applied to the field of laser cutting, such as the processing of PCB boards, by etching on the PCB template to achieve opening or forming. The product area shown in FIG5 is the product area that needs to be retained, and the waste area is the target area that does not need to be retained.
[0105] In one feasible implementation, when the shape type is a circle, the auxiliary line type in the auxiliary processing parameters includes an auxiliary arc; and the auxiliary line type length in the auxiliary processing parameters includes an auxiliary arc length. Then, step 405 may include steps P1-P4 to determine a target processing start point and a target processing end point of the circle. Specifically, steps P1-P4 are as follows:
[0106] P1. Obtain a first radius of the circle;
[0107] P2. Scaling the first radius according to a preset scaling ratio to obtain a second radius, where the preset scaling ratio is related to the length of the auxiliary arc and a preset interval range, where the preset interval range is the interval between the auxiliary arc and the circle;
[0108] In one feasible implementation, the first radius of the circle can be obtained through a drawing file, and the second radius used to determine the auxiliary arc can be determined by the first radius. Specifically, the first radius is scaled according to a preset scaling ratio to obtain the above-mentioned second radius. The scaling ratio is related to a preset interval range between the arc of the pre-set circle and the auxiliary arc. The preset interval range is used to ensure that when the auxiliary arc is added to the target area, the auxiliary arc does not overlap with the arc and does not cause corners to appear on the edge of the circle.
[0109] P3. Determine the auxiliary arc according to the second radius and the length of the auxiliary arc;
[0110] P4. Determine a target processing start point and a target processing end point of the circle according to the auxiliary arc, the original starting point, the preset interval range, the original end point, and the target area.
[0111] It can be understood that after the second radius and arc length are known, an auxiliary arc can be determined. Further, the target processing start point and target processing end point of the circle can be determined through the auxiliary arc, the original starting point, the preset interval range, the original end point and the target area.
[0112] P4 may include steps P4a and P4b. The specific steps P4a and P4b are as follows:
[0113] P4a, using the original starting point as the end point of the first auxiliary arc, and setting the first auxiliary arc within the target area according to the preset interval range to obtain the target processing starting point, which is the starting point of the first auxiliary arc;
[0114] Exemplarily, the original starting point is used as the end point of the first auxiliary arc, and the distance between the other end (starting point) of the first auxiliary arc and the arc is further used as the interval between the first auxiliary arc and the arc. The first auxiliary arc is set within the target area according to the preset interval range, and the starting point of the first auxiliary arc within the target area and with the preset interval range is used as the target processing starting point.
[0115] P4b, using the original end point as the starting point of a second auxiliary arc, setting the second auxiliary arc within the target area according to the preset interval range, and obtaining the target processing end point, which is the end point of the second auxiliary arc;
[0116] Exemplarily, the original end point is used as the starting point of the second auxiliary arc, and the distance between the other end (end point) of the second auxiliary arc and the arc is further used as the interval between the second auxiliary arc and the arc. The second auxiliary arc is set within the target area according to the preset interval range, and the starting point of the second auxiliary arc within the target area and with the preset interval range is used as the target processing starting point.
[0117] It should be noted that the bending directions of the first auxiliary arc and the second auxiliary arc are opposite, and both point into the target area.
[0118] It can be understood that the first auxiliary arc and the second auxiliary arc are both located in the target processing area. For example, please refer to Figures 6(a) and 6(b). Figures 6(a) and 6(b) are effect diagrams of a processing trajectory when the target figure is a circle, wherein the box 601 in Figure 6(a) is located at the connection point of the original original starting point 611 and the original end point 611, wherein the original starting point 611 and the original end point 611 are located at a point on the circle, and the target processing starting point 621 and the target processing end point 631 are located in the target area (waste area) of the circle. As shown in Figure 6(a), after the first auxiliary arc (621-611) and the second auxiliary arc (611-631) are added to the target area, the edge line of the target figure in the product area is smooth, there is no connection mark, and the seamless effect is obvious. Furthermore, the location of the box 602 in FIG6 (b) is the junction of the original starting point 612 and the original end point 612, wherein the original starting point 612 and the original end point 612 are located at a point on the circle, and the target processing starting point 622 and the target processing end point 632 are located in the target area (waste area) of the circle. As shown in FIG6 (b), after the first auxiliary arc (622-612) and the second auxiliary arc (612-632) are added to the target area, the edge line of the target graphic in the product area is smooth, there is no connection mark, and the traceless effect is obvious. Further, by comparing FIG6 (a) and FIG6 (b), it can be seen that the target processing areas in FIG6 (a) and FIG6 (b) are opposite, one is located inside the circle and the other is located outside the circle. This further reflects that in this application, by distinguishing and identifying the inner and outer areas of the target graphic and selecting the auxiliary processing type, it can be ensured that no matter whether the target area is in the inner or outer area of the target graphic, the traceless processing effect can be guaranteed, and the molding quality of the target graphic in the product area can be guaranteed.
[0119] 406. Generate a processing trajectory of the target graphic based on the target processing starting point, the target processing end point, the target graphic, the auxiliary line type, and the length of the auxiliary line type.
[0120] Furthermore, after obtaining the target processing starting point and the target processing end point through the above steps, the processing trajectory of the target graphic and the auxiliary processing parameters can be combined to generate the target graphic, which can also be called a seamless processing trajectory, and the seamless processing trajectory can also be sent to the processing equipment for processing to obtain the final molded product, wherein the processing equipment can be a laser cutting machine, and the molded product can be a product having the shape of the target graphic, or a product obtained by etching the target graphic, which is not limited to this example. Taking Figure 6 (a) as an example, the processing path of the seamless processing trajectory can be that the laser moves from the target processing starting point 621 along the first auxiliary arc (621-611) to the original starting point 611, from the original starting point 611 through the target graphic (circle) to the original end point 611, and continues to move along the second auxiliary arc (611-631) to the target processing end point 631, and finally obtains the cut product, wherein the product obtained by taking Figure 6 (a) as an example is the outer area of the shape, so there is no connection mark in the outer area of the circle.
[0121] An embodiment of the present invention discloses a method for generating a seamless processing trajectory. The application determines the target area according to the inner area, outer area and auxiliary processing type of the target graphic, where the target area is the inner area or the outer area of the target graphic, and combines the preset start and end point selection rules according to the shape parameters of the target graphic, so that the original starting point and the original end point can be selected on the target graphic first, and finally the target area, the original starting point and the original end point, the auxiliary line type, the auxiliary line type length and the shape parameters are used to determine the target processing start point and the target processing end point that are not on the target graphic and are located in the target area. In this way, when processing is performed according to the finally generated processing trajectory, the problem of poor connection between the start and end points on the target graphic and the generation of connection marks can be reduced, thereby improving the processing accuracy of the target graphic, achieving a seamless processing effect without connection marks on the target graphic, and further improving the processing yield and processing efficiency of the finished product. Furthermore, the auxiliary processing parameters are set according to the shape type, so that the method for generating the seamless processing trajectory is applicable to the seamless processing of products of various shape types, and, according to different shape parameters, the auxiliary processing parameters also include the auxiliary line segment length and the preset angle range, or the auxiliary arc length and the preset interval range, further ensuring that the seamless processing trajectory obtained by the method for generating the seamless processing trajectory of the present application eliminates the connection marks while not causing additional corner problems on the target graphics, further ensuring the processing quality, improving the processing efficiency, and allowing cutting equipment such as laser cutting machines to meet better process requirements when cutting graphics, avoiding product scrapping and reducing costs.
[0122] See also Figure 7 , Figure 7 A device for generating a machining trajectory according to an embodiment of the present invention is provided. Figure 7 The apparatus shown comprises:
[0123] Processing data acquisition module 701: used to acquire information of graphics to be processed and auxiliary processing parameters, wherein the information of graphics to be processed includes shape parameters of the target graphics to be processed, inner and outer areas of the target graphics, and the auxiliary processing parameters include processing parameters for assisting in processing the target graphics, and the auxiliary processing parameters include at least auxiliary processing type, auxiliary line type, and auxiliary line type length;
[0124] Target area determination module 702: used to determine the target area according to the inner area, the outer area and the auxiliary processing type;
[0125] The original starting and ending point determination module 703 is used to determine the original starting point and the original ending point on the target shape according to the shape parameters and the preset starting and ending point selection rules;
[0126] Target start and end point determination module 704: used to determine a target processing start point and a target processing end point that are not on the target shape and are located in the target area based on the original start point, the original end point, the shape parameters, the target area, the auxiliary line type, and the auxiliary line type length;
[0127] The seamless trajectory generation module 705 is used to generate a processing trajectory of the target graphic based on the target processing starting point, the target processing end point, the target graphic, the auxiliary line type and the length of the auxiliary line type.
[0128] It should be noted that Figure 7 The functions of each module are shown in Figure 3 The steps in the method shown are similar, so to avoid repetition, they will not be described here. For details, please refer to the aforementioned Figure 3 Instructions for each step in.
[0129] An embodiment of the present invention discloses a device for generating a processing trajectory, which determines a target area according to an inner area, an outer area and an auxiliary processing type of a target graphic, where the target area is the inner area or the outer area of the target graphic, and combines a preset start and end point selection rule based on the shape parameters of the target graphic, so that an original starting point and an original end point can be selected on the target graphic first, and finally a target processing start point and a target processing end point that are not on the target graphic and are located in the target area are determined using the target area, the original starting point and the original end point, the auxiliary line type, the auxiliary line type length and the shape parameters. In this way, processing is performed according to the finally generated processing trajectory, which can reduce the problem of poor connection between the start and end points on the target graphic and the generation of connection marks, thereby improving the processing accuracy of the target graphic, achieving a seamless processing effect without connection marks on the target graphic, and further improving the processing yield and processing efficiency of the finished product.
[0130] Figure 8 FIG1 shows an internal structure diagram of a computer device in an embodiment. The computer device can be a terminal or a server. Figure 8 As shown, the computer device includes a processor, a memory, and a network interface connected via a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the above method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can implement the above method. It will be understood by those skilled in the art that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0131] In one embodiment, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes Figure 3 Or follow the steps shown in 4.
[0132] In one embodiment, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the processor executes Figure 3 Or follow the steps shown in 4.
[0133] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0134] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0135] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A method for generating a machining trajectory, characterized in that: The method comprises: Acquiring information of a graphic to be processed and auxiliary processing parameters, wherein the information of the graphic to be processed includes shape parameters of a target graphic to be processed, an inner area and an outer area of the target graphic, and the auxiliary processing parameters include processing parameters for assisting in processing the target graphic, and the auxiliary processing parameters include at least an auxiliary processing type, an auxiliary line type, and an auxiliary line type length; Determining a target area according to the inner area, the outer area, and the auxiliary processing type; wherein the auxiliary processing type includes generating a seamless track inside the target graphic or generating a seamless track outside the target graphic; Determine the original starting point and the original end point on the target shape according to the shape parameters and the preset start and end point selection rules; Determining a target processing start point and a target processing end point that are not on the target graphic and are located in the target area based on the original starting point, the original end point, the shape parameter, the target area, the auxiliary line type, and the length of the auxiliary line type; A processing trajectory of the target graphic is generated based on the target processing starting point, the target processing end point, the target graphic, the auxiliary line type, and the length of the auxiliary line type.
2. The method according to claim 1, characterized in that The step of obtaining the graphics information to be processed includes: Acquire a drawing file of the target graphic, wherein the drawing file includes shape parameters of the target graphic; According to the shape parameters and preset inner and outer area recognition rules, the inner area and the outer area of the target graphic are determined to obtain the graphic information to be processed.
3. The method according to claim 1, characterized in that The shape parameters include a shape type, and determining an original starting point and an original end point on the target graphic based on the shape parameters and a preset start and end point selection rule includes: When the shape type is a polygon, the midpoint of the longest straight line among the straight lines of the polygon is determined as the original starting point and the original end point of the polygon; When the shape type is a circle, any point on the circle is selected as the original starting point and the original end point of the circle.
4. The method according to claim 3, characterized in that When the shape type is a polygon, determining the inner area and the outer area of the target graphic according to the shape parameters and the preset inner and outer area identification rules to obtain the graphic information to be processed includes: Obtaining the vector direction of each straight line in the polygon drawing file; When the vector directions are connected end to end to form the same rotation direction, and the rotation direction is counterclockwise, the intersection of the left areas of the vector directions of the straight lines is determined as the inner area of the polygon; and the union of the right areas of the vector directions of the straight lines is determined as the outer area of the polygon; When the vector directions are connected end to end to form the same rotation direction, and the rotation direction is clockwise, the intersection of the right side areas of the vector directions of the straight lines is determined as the inner area of the polygon; the union of the left side areas of the vector directions of the straight lines is determined as the outer area of the polygon.
5. The method according to claim 4, characterized in that: The auxiliary line type includes auxiliary line segments; the auxiliary line type length includes the auxiliary line segment length; Then, determining a target processing start point and a target processing end point that are not on the target graphic and are located in the target area based on the original starting point, the original end point, the shape parameter, the target area, the auxiliary line type, and the auxiliary line type length includes: Taking the original starting point as the starting point of the first ray, the first ray is emitted within the target area within a first preset angle range, where the first preset angle range is a first angle between the first ray and the longest straight line; Determine an end point of a first auxiliary line segment on the first ray using the starting point of the first ray and the length of the auxiliary line segment, and determine the end point of the first auxiliary line segment as the target processing starting point; Taking the original end point as the starting point of a second ray, emitting a second ray within the target area within a second preset angle range, where the second preset angle range is a second angle between the second ray and the longest straight line; An end point of a second auxiliary line segment is determined on the second ray using the starting point of the second ray and the length of the auxiliary line segment, and the end point of the second auxiliary line segment is determined as the target processing end point.
6. The method according to claim 3, characterized in that: When the shape type is a circle, the auxiliary line type includes an auxiliary arc; the auxiliary line type length includes the auxiliary arc length; Then, determining a target processing start point and a target processing end point that are not on the target graphic and are located in the target area based on the original starting point, the original end point, the shape parameter, the target area, the auxiliary line type, and the auxiliary line type length includes: Obtaining a first radius of the circle; Scaling the first radius according to a preset scaling ratio to obtain a second radius, wherein the preset scaling ratio is related to the length of the auxiliary arc and a preset interval range, and the preset interval range is the interval between the auxiliary arc and the circle; determining the auxiliary arc according to the second radius and the length of the auxiliary arc; A target processing start point and a target processing end point of the circle are determined according to the auxiliary arc, the original starting point, the preset interval range, the original end point and the target area.
7. The method according to claim 6, characterized in that The step of determining a target processing starting point and a target processing end point of the circle according to the auxiliary arc, the original starting point, the preset interval range, the original end point, and the target area includes: Taking the original starting point as the end point of the first auxiliary arc, setting the first auxiliary arc within the target area according to the preset interval range, and obtaining the target processing starting point, which is the starting point of the first auxiliary arc; Using the original end point as the starting point of a second auxiliary arc, setting the second auxiliary arc within the target area according to the preset interval range, and obtaining the target processing end point, which is the end point of the second auxiliary arc; The first auxiliary arc and the second auxiliary arc have opposite curvature directions and both point into the target area.
8. A device for generating a machining trajectory, characterized in that: The device comprises: Processing data acquisition module: used to acquire information of graphics to be processed and auxiliary processing parameters, wherein the information of graphics to be processed includes shape parameters of the target graphics to be processed, inner area and outer area of the target graphics, and the auxiliary processing parameters include processing parameters for assisting in processing the target graphics, and the auxiliary processing parameters include at least auxiliary processing type, auxiliary line type and auxiliary line type length; a target area determination module, configured to determine the target area according to the inner area, the outer area, and the auxiliary processing type, wherein the auxiliary processing type includes generating a seamless track inside the target graphic or generating a seamless track outside the target graphic; Original start and end point determination module: used to determine the original start point and the original end point on the target shape according to the shape parameters and the preset start and end point selection rules; A target starting and ending point determination module is configured to determine a target processing starting point and a target processing end point that are not on the target graphic and are located in the target area based on the original starting point, the original end point, the shape parameters, the target area, the auxiliary line type, and the length of the auxiliary line type; A seamless trajectory generation module is used to generate a processing trajectory of the target graphic based on the target processing starting point, the target processing end point, the target graphic, the auxiliary line type and the length of the auxiliary line type.
9. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.
10. A computer device comprising a memory and a processor, characterized in that: The memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.