A kind of cut method for optimizing route
Technical field
The present invention relates to the numerical control laser cutter technical field, specifically a kind of cut method for optimizing route.
Background technology
Generally all adopt the CAM software programming in laser cutting system, this CAM software is to generate the NC code that machine tool can read by computer programming, thereby makes the machine tool operation, and is more accurate, more efficient, for enterprise saves a large amount of costs.Adopt a key issue will considering when CAM software is programmed is how to improve cutting efficiency.If cutting efficiency is excessively low, will inevitably increase processing cost, cause enterprise competitiveness to descend.In cutting process, the length that the sky that comprises on the laser head path moves is the bottleneck of restriction cutting efficiency.For the figure that a plurality of profiles are arranged, different cutting sequences can produce different skies and move length.The purpose of path optimization finds a cutting path exactly, makes sky move length short as far as possible, must satisfy again some specific (special) requirements of laser cutting parameter.
The method for optimizing route that general laser cutting software adopts can be divided into two large classes: the one, and interactive optimization, it is the manual or automanual generation cutting path of experience of User, the advantage of these class methods is generally can both obtain optimal path, but fairly large figure is needed a large amount of manual operationss, reduced equally efficient; The 2nd, Automatic Optimal, these class methods can be divided into two classes again: the one, according to certain predetermined rule, as from left to right to the figure auto-sequencing, the cutting path that produces like this is more regular, also can shorten sky and move length, but apart from larger, there is not a kind of rule can adapt to all situations to different graphics-optimized weak effects; The 2nd, intelligent optimization method, in conjunction with artificial intelligence and bionics algorithm, improve the effect of path optimization such as ant group algorithm, the cutting path that these class methods produce relatively approaches the human mode of thinking, it is shorter that sky moves length, but it is very large that the common shortcoming of intelligent optimization method is calculated amount, and travelling speed is very slow, can't process large-scale figure.Present automated path optimization method all moves apart from sky than being easier to produce unnecessary single hop length, and this is breakneck in laser cutting process.In addition, present automatic optimization method to the singularity of cut consider not, can't satisfy in practice the requirement of laser cutting parameter, even have larger potential safety hazard.
Summary of the invention
The objective of the invention is to overcome the deficiencies in the prior art, optimize the order of pattern cut, at utmost shorten sky and move.
For achieving the above object, design a kind of cut method for optimizing route, comprise that the process software by the laser cutting machine of computer control work carries out path optimization, it is characterized in that this optimization method comprises the steps: the figure of (1) the required cutting of input in the control system of laser cutting machine, described figure has at least an independent pattern to form, and each pattern is comprised of a contour patterns at least; (2) all contour patterns in the figure being carried out the ectonexine minor sort, is that the moon is cut or sun is cut with the filling type of distinguishing each contour patterns; The described treatment step that all contour patterns in the figure is carried out the ectonexine minor sort: (a), take out in the figure and be positioned at outermost all contour patterns, be mounted under the root node of one tree, and arrange that to fill type be that sun is cut; Each outermost contour patterns taken out the contour patterns of its most contiguous internal layer, be mounted under the present node, and arrange that to fill type be that the moon is cut (b), respectively; (c), the contour patterns that is in interior one deck is repeated above step, be arranged alternately successively from outside to inside the filling type of every one deck contour patterns, until reach innermost layer; (3) in the figure that sequences level inside and outside each contour patterns of output, successively the contour patterns of each level is carried out the individual layer block sorting from inside to outside; The treatment step that described individual layer block sorting adopts: (a), each contour patterns in the same level is calculated and set up grid; (b), positioning pattern, determine that namely each contour patterns is distributed in the position in each grid, output contour patterns grid array; (c), the traversal figure, namely according to the route traversal grid of planning, export successively the contour patterns in each contour patterns grid; (d), the figure after the output ordering; (4) output path optimizing.
Each contour patterns in the same level is calculated and set up grid adopt following treatment step: (a), calculate the minimum rectangle surround these all contour patterns of level; (b), rectangle is divided into 10 * 10 little rectangle by warp and weft; (c), the coordinate figure tabulation of every warp and weft of record; (d), warp and parallel sort from small to large by coordinate figure respectively.
Described positioning pattern adopts following treatment step: (a), according to parallel and warp list initialization grid, this grid is a two-dimensional array, and each element can both the some contour patterns of carry; (b), get a contour patterns, calculate this contour patterns centre coordinate (X, Y); (c), in parallel tabulation this Y coordinate figure of binary search, find the 1st parallel of this Y coordinate figure below, that is to say the 1st parallel of this contour patterns below, establishing this parallel sequence number is L; (d), in warp tabulation binary search X, find the 1st warp in this contour patterns left side, establish this warp sequence number M; (e), this contour patterns is navigated in the grid [L, M], this grid [L, M] is registered as 1 contour patterns grid; (f), judge whether contour patterns takes, when contour patterns does not take, return step (b); When all contour patterns take, then export contour patterns grid array, finish the location.
The treatment step that described traversal figure carries out: (a), 4 corners of procuratorial work grid, choose a wherein nearest contour patterns grid of distance reference point; (b), take reference point as benchmark, each contour patterns in the current contour patterns grid is done nearest ordering; (c), successively the contour patterns of exporting in the current contour patterns grid is tabulated to optimizing, and upgrading reference point is the terminal point of last contour patterns; (d), judge whether the whole contour patterns grids in the grid are covered; (e), all cover when the contour patterns grid, then export complete optimization tabulation; All do not cover when the contour patterns grid, get next contour patterns grid and return step (b); The rule of getting next contour patterns grid is to judge that first whether warp quantity is greater than parallel quantity, when warp quantity>parallel quantity, then get the next contour patterns grid in these row, when warp number≤parallel quantity is got next contour patterns grid in this row, whenever cover row, the counter-rotating working direction is walked next column, whenever covers delegation, and the counter-rotating working direction is walked next line.
Described process software adopts CAM software.
The present invention compared with prior art has the following advantages:
1. can automatically accurately detect the relation of inclusion of any multilayer contour patterns, only the contour patterns of same level shortened the optimization that sky moves,, and between different ectonexines time, also can optimize sky during transition and move length then according to from inside to outside order cutting the contour patterns of different levels;
2. greatly reduce empty existing probability, the minimizing potential safety hazard of shifting out of the long distance of single hop;
3. be to advance by snakelike to the optimum results of the regular array contour patterns of same level, at utmost shorten sky and move; To contour patterns positional alignment rule, but the contour patterns of variform similar array, optimum results is equal to the regular array contour patterns, obviously is better than traditional optimization; To the contour patterns of irregular alignment, the test result of a large amount of master drawings shown adopt the present invention that the optimum results of most of figure still is better than existing method for optimizing route;
4. implement simply, speed is fast, processes extensive figure efficient higher.
Description of drawings
Fig. 1 is main-process stream block diagram of the present invention.
Fig. 2 is ectonexine minor sort schematic diagram among the present invention.
Fig. 3 is the individual layer block sorting FB(flow block) among Fig. 1.
Fig. 4 is the calculating among Fig. 3 and sets up the grid FB(flow block).
Fig. 5 is the positioning pattern FB(flow block) among Fig. 3.
Fig. 6 is the traversal figure FB(flow block) among Fig. 3.
Fig. 7 is the figure to be cut in the embodiment of the invention.
Fig. 8 is the cutting sequence schematic diagram after a pattern amplifies in the lower right corner among Fig. 7, and stain wherein represents the cutting starting point of contour patterns.
Fig. 9 is outermost layer cutting sequence schematic diagram among Fig. 7.
Embodiment
The invention will be further described below in conjunction with accompanying drawing.
As shown in Figure 1, cut method for optimizing route among the present invention is to adopt the process software by the laser cutting machine of computer control work to carry out path optimization, this process software adopts CAM software among the present invention, mainly comprises two large processing modules in this disposal route:
1, to the ectonexine minor sort of all contour patterns in the figure, it also is the relation of inclusion of the inside and outside level of contour patterns, that the moon is cut or sun is cut with the filling type of distinguishing each contour patterns, this is the important parameter that leads in/out with cut functions such as cutting gap compensations, generally needs to cut first internal layer to cut skin in cut again;
2, individual layer block sorting namely in the figure that sequences the contour patterns level, carries out the individual layer block sorting to the contour patterns of each level from inside to outside successively.
Embodiment 1
As shown in Figure 7, be a typical planar laser cutting drawing, some patterns are arranged in the figure on this drawing, the quantity of these patterns is medium, and interactive optimization is adopted in inconvenience; And each pattern comparatively rule that distributes, but not alignment, the cutting starting point of pattern is also different, and each pattern also is comprised of the contour patterns of some moulding, and these contour patterns may be comprised of closed lines, also may adopt inc lines.Behind this drawing input laser cutting machine, the CAM software in the laser cutting machine control system is handled as follows step:
One, by treatment step shown in Figure 1 each contour patterns is carried out the ectonexine minor sort first: (a), take out in the figure and be positioned at outermost all contour patterns, be mounted under the root node of one tree, and arrange that to fill type be that sun is cut; Each outermost contour patterns taken out the contour patterns of its most contiguous internal layer, be mounted under the present node, and arrange that to fill type be that the moon is cut (b), respectively; (c), the contour patterns that is in interior one deck is repeated above step, be arranged alternately successively from outside to inside the filling type of every one deck contour patterns, until reach innermost layer.
Separately in Fig. 7 a pattern in the lower right corner as example, by treatment step shown in Figure 2 this pattern is carried out result behind the ectonexine minor sort, referring to Fig. 8, each contour patterns in this pattern is distinguished expression with numeral, wherein, there is the multilayer relation of inclusion between contour patterns 5~contour patterns 10, its relation of inclusion from inside to outside is contour patterns 6-contour patterns 7-contour patterns 10, the present invention has guaranteed to cut first internal layer all the time, cut again outer field order, and between different inside and outside levels during transition, such as contour patterns 5, contour patterns 6 is in different inside and outside levels, also can optimize sky and move length, although it is contour patterns 5-contour patterns 9-contour patterns 8-contour patterns 7 that the shortest sky of the contour patterns in this pattern in same level moves order, but after considering the contour patterns 6 in the internal layer of contour patterns 7, it is contour patterns 5-contour patterns 6-contour patterns 7-contour patterns 8-contour patterns 9 that the shortest sky of each contour patterns moves order.
Two, referring to Fig. 3, the individual layer block sorting adopts following treatment step: (a), each contour patterns in the same level is calculated and set up grid; (b), positioning pattern, determine that namely each contour patterns is distributed in the position in each grid, output contour patterns grid array; (c), the traversal figure, namely according to the route traversal grid of planning, export successively the contour patterns in each contour patterns grid; (d), the figure after the output ordering.
Referring to Fig. 4, each contour patterns in the same level is calculated and sets up the treatment step that grid adopts: (a), calculate the minimum rectangle that surrounds these all contour patterns of level; (b), rectangle is divided into 10 * 10 little rectangle by warp and weft; (c), the coordinate figure tabulation of every warp and weft of record; (d), warp and parallel sort from small to large by coordinate figure respectively; To all levels finish calculate and set up grid after, the step that enters again positioning pattern.
Referring to Fig. 5, the treatment step that positioning pattern adopts: the treatment step that described positioning pattern adopts: (a), according to parallel and warp list initialization grid, this grid is a two-dimensional array, and each element can both the some contour patterns of carry; (b), get a contour patterns, calculate this contour patterns centre coordinate (X, Y); (c), in parallel tabulation this Y coordinate figure of binary search, find the 1st parallel of this Y coordinate figure below, that is to say the 1st parallel of this contour patterns below, establishing this parallel sequence number is L; (d), in warp tabulation binary search X, find the 1st warp in this contour patterns left side, establish this warp sequence number M; (e), this contour patterns is navigated in the grid [L, M], this grid [L, M] is registered as 1 contour patterns grid; (f), judge whether contour patterns takes, if contour patterns does not take, return step (b); If all contour patterns take, then export contour patterns grid array, finish the location.
Referring to Fig. 6, the treatment step that carries out of traversal figure: (a), 4 corners of procuratorial work grid, choose a wherein nearest contour patterns grid of distance reference point; (b), take reference point as benchmark, each contour patterns in the current contour patterns grid is done nearest ordering; (c), successively the contour patterns of exporting in the current contour patterns grid is tabulated to optimizing, and upgrading reference point is the terminal point of last contour patterns; (d), judge whether the whole contour patterns grids in the grid are covered; (e) if the contour patterns grid is all covered, then export complete optimization tabulation, otherwise, get next contour patterns grid and return step (b); The rule of getting next contour patterns grid is to judge that first whether warp quantity is greater than parallel quantity, if warp quantity is greater than parallel quantity, then get the next contour patterns grid in these row, otherwise get the next contour patterns grid in this row, whenever cover row, the counter-rotating working direction is walked next column, whenever covers delegation, and the counter-rotating working direction is walked next line.
They are positioned at same level to the outermost layer contour patterns of each pattern in the figure shown in Figure 7, after individual layer block sorting processing shown in Figure 3, roughly cutting sequence after the optimization of its output is referring to Fig. 9, the initial stop position of laser head is in the lower right corner, can see that the path after the optimization advances by snakelike, namely shorten to the full extent sky and moved.