Method for automatically generating and optimizing crushed material line of cutting piece

By using an automatic generation and optimization method for cutting scrap lines, and employing heuristic generation rules and integer linear programming algorithms, the problem of excessive number and total length of scrap lines in existing technologies is solved. This method minimizes the scrap lines, improves cutting efficiency, and saves labor costs.

CN121745646APending Publication Date: 2026-03-27GUANGDONG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing methods for generating scrap lines can only provide feasible basic solutions that satisfy connectivity and scrap size constraints, resulting in an excessive number and total length of scrap lines. This necessitates a large amount of manual intervention, which is time-consuming and labor-intensive, and restricts overall cutting efficiency.

Method used

An automatic generation and optimization method for cutting scrap lines is adopted, including steps S1 to S6. An initial candidate set of scrap lines is generated by constructing heuristic generation rules, and redundancy removal and structuring are performed. The optimal combination of scrap lines is solved using an integer linear programming algorithm to meet the optimization objective of minimizing the number of scrap lines and the total length.

Benefits of technology

It achieves precise minimization of the number and total length of the scrap line, reduces the need for subsequent manual inspection and modification, improves cutting efficiency, and saves time and labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121745646A_ABST
    Figure CN121745646A_ABST
Patent Text Reader

Abstract

The invention discloses a method for automatically generating and optimizing a crushed material line of a cutting part. The method comprises the following steps: acquiring a two-dimensional CAD drawing containing a cutting part set material; the two-dimensional CAD drawing is converted into an undirected graph, and a waste area in the undirected graph is recognized; constructing a heuristic generation rule, and generating an initial crushed aggregate line candidate set by adopting the heuristic generation rule according to the waste material area; and performing redundancy elimination, structuring and cross relation analysis processing on the initial crushed aggregate line candidate set to obtain an effective crushed aggregate line candidate set, and solving an optimal crushed aggregate line combination meeting a preset optimization target by adopting a solution algorithm based on integer linear programming according to the effective crushed aggregate line candidate set, the preset optimization target being to minimize the number and the total length of the crushed aggregate lines. The problems that an existing crushed aggregate line generation method can only provide a feasible basic scheme meeting connectivity and crushed aggregate size constraints, no optimization is carried out, the number of generated crushed aggregate lines is too large, the total length is too long, manual intervention needs to be relied on in the later period, and time and labor are consumed are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of part cutting processing, and particularly relates to a cutting part scrap line automatic generation and optimization method. BACKGROUND

[0002] In the part cutting processing process, part is often completely surrounded by the waste area, forming an "embedded part". In order to take out this kind of part, the scrap line is usually planned before cutting, and the closed waste area is broken under the premise of not damaging the part, so as to realize the safe taking out of the embedded part. However, the existing scrap line generation method can only provide a feasible basic scheme that meets the connectivity and scrap size constraints, and has not been optimized, resulting in too many generated scrap lines and too long total length. The above problems make it necessary to rely on experienced workers for a large amount of manual intervention, including checking and modifying the scrap line one by one. This process not only consumes time and effort, but also seriously restricts the overall cutting efficiency. SUMMARY

[0003] In view of the above defects, the present application provides a cutting part scrap line automatic generation and optimization method, which aims to solve the problem that the existing scrap line generation method can only provide a feasible basic scheme that meets the connectivity and scrap size constraints, and has not been optimized, resulting in too many generated scrap lines and too long total length, so that a large amount of manual intervention is necessary in the later stage, which consumes time and effort and also restricts the overall cutting efficiency.

[0004] In order to achieve this goal, the present application adopts the following technical scheme: A cutting part scrap line automatic generation and optimization method, comprising the following steps: Step S1: obtaining a two-dimensional CAD drawing containing part cutting; Step S2: converting the two-dimensional CAD drawing containing part cutting into an undirected graph, and performing identification processing on the undirected graph to identify the waste area; Step S3: constructing a heuristic generation rule, and generating an initial scrap line candidate set according to the waste area by using the heuristic generation rule; Step S4: performing redundancy removal, structuring and cross relationship analysis processing on the initial scrap line candidate set to obtain an effective scrap line candidate set; Step S5: based on the effective scrap line candidate set, an integer linear programming-based solving algorithm is used to solve an optimal scrap line combination that meets a preset optimization target, wherein the preset optimization target is to minimize the number and total length of the scrap lines; Step S6: performing optimization processing on the optimal scrap line combination to obtain an optimized scrap line combination.

[0005] Preferably, in step S2, the identification processing is performed on the undirected graph to identify the waste area, and specifically includes the following substeps: Step S21: Select any unvisited vertex as a starting vertex from the undirected graph, and traverse all edges of the undirected graph one by one; in the process of traversal, it is judged whether the traversal path can eventually return to the starting vertex, if yes, the contour corresponding to the path is identified as a closed contour; if not, the contour corresponding to the path is identified as an open contour, until all vertices in the undirected graph are traversed, so as to obtain all closed contours in the undirected graph; Step S22: Traverse each closed contour in turn, for the current closed contour, select a point from its interior at random and emit a virtual ray outward, and detect the intersection of the virtual ray with other closed contours, the closed contour intersecting the virtual ray and being closest to the current closed contour is defined as the direct parent contour of the current closed contour; in this way, a tree-like data structure containing the nesting hierarchical relationship of all closed contours is constructed; Step S23: According to the tree-like data structure containing the nesting hierarchy of all closed contours, define each hierarchical contour and region: define the top-level contour as the raw material plate boundary; define the even-level contours below the top-level contour as the outer contours of the embedded parts; define the odd-level contours below the top-level contour as the inner contours of the embedded parts; define the region between the raw material plate boundary and the embedded part outer contour directly nested thereunder, and the region between any embedded part inner contour and the embedded part outer contour directly nested thereunder as a waste area.

[0006] Preferably, in step S2, the following steps are further included: establishing a process rule, wherein the process rule includes that the edges corresponding to the process edges, process holes and through holes of the cut parts are not allowed to be placed with scrap lines; according to the process rule, identifying and marking the specific edges where scrap lines are prohibited.

[0007] Preferably, in step S3, the heuristic generation rule includes a generation rule based on the midpoint of the embedded part edge, a generation rule based on the AABB bounding box, a generation rule based on the OBB bounding box, and a generation rule based on the grid; The generation rule based on the midpoint of the embedded part edge includes the following steps: Traverse all edges on the current embedded part contour to determine the midpoint of each edge; Take the midpoint of each edge as the emission starting point, and emit a virtual ray in the horizontal direction and the vertical direction, respectively, to the outside of the current embedded part; In the virtual ray emitting process, it is judged whether the virtual ray intersects with the boundary of the scrap area, the hole profile inside the scrap area or the outer profile of other embedded parts inside the scrap area. If yes, the virtual ray emitting is stopped, the intersection position is recorded as the ray end point, and the line between the emitting start point and the ray end point is taken as the candidate scrap line. If no, the virtual ray emitting is continued until the virtual ray intersects with the boundary of the scrap area, the hole profile inside the scrap area or the outer profile of other embedded parts inside the scrap area. The generation rule based on the AABB bounding box comprises the following steps: A minimum axis-aligned bounding box is generated based on the current embedded part profile, and the midpoints of the four edges in the minimum axis-aligned bounding box are determined. From the midpoints of the four edges in the minimum axis-aligned bounding box, rays are respectively emitted in the direction of “pointing to the inside of the current embedded part profile”, and the position of the first intersection of the rays with the current embedded part profile is taken as the emitting start point of the candidate scrap line. From the emitting start point of the candidate scrap line, virtual rays are respectively emitted in the horizontal direction and the vertical direction to the outside of the current embedded part. In the virtual ray emitting process, it is judged whether the virtual ray intersects with the boundary of the scrap area, the hole profile inside the scrap area or the outer profile of other embedded parts inside the scrap area. If yes, the virtual ray emitting is stopped, the intersection position is recorded as the ray end point, and the line between the emitting start point and the ray end point is taken as the candidate scrap line. If no, the virtual ray emitting is continued until the virtual ray intersects with the boundary of the scrap area, the hole profile inside the scrap area or the outer profile of other embedded parts inside the scrap area.

[0008] Preferably, the generation rule based on the OBB bounding box comprises the following steps: A directional bounding box is generated based on the current embedded part profile, and the midpoints of the four edges in the directional bounding box are determined. From the midpoints of the four edges in the directional bounding box, rays are respectively emitted in the direction of “pointing to the inside of the current embedded part profile”, and the position of the first intersection of the rays with the current embedded part profile is taken as the emitting start point of the candidate scrap line. From the emitting start point of the candidate scrap line, virtual rays are respectively emitted in the horizontal direction and the vertical direction to the outside of the current embedded part. In the virtual ray emitting process, it is judged whether the virtual ray intersects with the boundary of the scrap area, the hole profile inside the scrap area or the outer profile of other embedded parts inside the scrap area. If yes, the emitting of the virtual ray is stopped, and the intersection position is recorded as the ray end point, and the line connecting the emitting start point and the ray end point is taken as the candidate scrap line. If no, the emitting of the virtual ray is continued until the virtual ray intersects with the boundary of the scrap area, the hole profile inside the scrap area or the outer profile of other embedded parts inside the scrap area. The grid-based generation rule comprises the following steps: An scrap area containing the current embedded part is acquired, and an AABB bounding box is generated based on the profile of the scrap area; Inside the AABB bounding box, a virtual rectangular grid is constructed according to a preset grid density; A ray is emitted from a left grid point of the virtual rectangular grid along a horizontal right direction and from an upper grid point of the virtual rectangular grid along a vertical downward direction, respectively; In the ray emitting process, all intersection points of the ray with the hole profile inside the scrap area and the outer profile of the embedded part are detected and recorded; For each ray, all the recorded intersection points are sorted according to the “ray emitting direction” to obtain the sorted intersection points, and the line connecting any two adjacent intersection points in the sorted intersection points is taken as a candidate scrap line.

[0009] Preferably, in step S4, the following steps are specifically included: Step S41: acquiring the shortest distance between any two adjacent candidate scrap lines in the initial candidate scrap line set and the included angle formed by the extension of any two adjacent candidate scrap lines; Step S42: judging whether the shortest distance between any two adjacent candidate scrap lines is less than a preset distance threshold. If yes, the two candidate scrap lines are determined to be similar candidate scrap lines, and one of the two candidate scrap lines is deleted. If no, the two candidate scrap lines are retained. And judging whether the included angle formed by the extension of any two adjacent candidate scrap lines is less than a preset included angle threshold. If yes, the two candidate scrap lines are determined to be similar candidate scrap lines, and one of the two candidate scrap lines is deleted. If no, the two candidate scrap lines are retained, to form the scrap line candidate set after the redundancy removal processing; Step S43: assigning a unique index to each candidate scrap line in the scrap line candidate set after the redundancy removal processing, and recording the key attributes of each candidate scrap line one by one; wherein the key attributes of the candidate scrap line include the start point coordinates, the end point coordinates, the length, the connected profile, the belonging scrap area and the direction vector of the candidate scrap line; and traversing each candidate scrap line in the de-duplicated candidate scrap line set, performing geometric intersection calculation on any two different candidate scrap lines, and recording all intersecting candidate scrap line pairs to form a valid candidate scrap line set.

[0010] Preferably, in step S5, specifically comprising the following sub-steps: Step S51: establishing an initial integer linear programming model; Step S52: constructing the objective function and constraints of the initial integer linear programming model, wherein the objective function expression of the initial integer linear programming model is as follows: ; wherein, represents the weight of the number of candidate scrap lines in the objective function, represents the weight of the total length of candidate scrap lines in the objective function, represents the length of the candidate scrap line , represents the set of all candidate scrap lines, represents a binary variable, and Z represents the total cost of the set of all candidate scrap lines; The constraints of the initial integer linear programming model are as follows: The first constraint is that the candidate scrap line should be preferentially laid near the midpoint of the part edge; The second constraint is that the candidate scrap line should be horizontal or vertical; The third constraint is to prohibit the generation of candidate scrap lines on a specific process edge; The fourth constraint is that a single part must be connected to at least two candidate scrap lines; The fifth constraint is that the at least two candidate scrap lines connected by a single part cannot be located on the same edge; The sixth constraint is that the candidate scrap lines are not allowed to intersect; In the fourth and fifth constraints, for each part , represents the set of all parts corresponding to the waste area to be processed, which needs to satisfy the following four constraints: ; ; ; ; wherein, represents a binary auxiliary variable; represents a subset of candidate scrap lines generated from the upper edge set of the axis-aligned bounding box of the part , which allows the placement of candidate scrap lines; represents a subset of candidate scrap lines generated from the lower edge set of the axis-aligned bounding box of the part The lower set of candidate scrap lines generated on the axis-aligned bounding box allows placement of candidate scrap lines; Indicates from parts The left set of candidate scrap lines generated on the axis-aligned bounding box allows placement of the candidate scrap line subset; Indicates from parts The right set of candidate scrap lines generated on the axis-aligned bounding box allows placement of the candidate scrap line subset; That is when At that time, the first two constraints become This means that at least one candidate scrap line must be selected from both the upper and lower candidate scrap lines of the part; the latter two constraints become... It doesn't work; when At that time, the first two constraints become It has no effect; the last two constraints become... This means that at least one candidate scrap line must be selected from both the left and right candidate scrap lines of the part. In the sixth constraint, for each pair of pre-calculated intersecting candidate line fragments... , The set of all pairwise intersecting candidate scrap lines must satisfy the following constraints: ; in, A binary variable representing the candidate scrap line k; That is, if candidate scrap line j is selected, then it forces The value must be 0, and no candidate scrap line k is allowed, to ensure that at most one of any pair of intersecting candidate scrap lines can be selected; Step S53: Perform iterative operations on the initial integer linear programming model to obtain the integer linear programming model of the current iteration; Step S54: Use a solver to solve the integer linear programming model of the current iteration to obtain the optimal solution that simultaneously satisfies the first, second, third, fourth, fifth, and sixth constraints. ; Step S55: Extraction All The corresponding scrap lines are used to virtually cut the original waste area, resulting in several waste sub-regions. The directional bounding box size of all waste sub-regions is then calculated. Step S56: Determine whether the oriented bounding box size of all waste sub-regions is smaller than a preset size threshold. If so, then determine... To find the globally optimal solution that satisfies all constraints, output The optimal combination of material handling lines is selected; otherwise, the following criteria are determined: If not feasible, add a new constraint to the integer linear programming model of the current iteration, and repeat steps S54-S56 using the integer linear programming model with the new constraint until the optimal solution obtained by the integer linear programming model with the new constraint satisfies all constraints. The new constraints are as follows: ; in, This represents the set of all candidate scrap lines that can pass through scrap sub-regions exceeding a preset size threshold.

[0011] The technical solution provided by this invention may include the following beneficial effects: This solution generates diverse initial candidate sets of scrap lines using a constructed heuristic generation rule. These candidate sets are then processed for redundancy removal, structuring, and cross-relationship analysis to obtain an effective candidate set. Based on this, an integer linear programming-based algorithm is used to find the optimal combination of scrap lines that satisfies the optimization objective of minimizing the number and total length of scrap lines. Compared to existing scrap line generation methods that only provide feasible basic solutions satisfying connectivity and scrap size constraints, this solution uses an integer linear programming-based algorithm to precisely minimize the number and total length of scrap lines. This optimization eliminates the need for extensive manual checking and modification in the later stages, effectively saving time and labor costs, thereby improving overall cutting efficiency. Attached Figure Description

[0012] Figure 1 This is a flowchart illustrating the steps of an automatic generation and optimization method for a cutting material scrap line. Detailed Implementation

[0013] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0014] A method for automatically generating and optimizing scrap lines for cutting parts includes the following steps: Step S1: Obtain a 2D CAD drawing containing the cutting kit; Step S2: Convert the 2D CAD drawing containing the cutting parts into an undirected graph, and perform recognition processing on the undirected graph to identify the waste area; Step S3: Construct heuristic generation rules and generate an initial set of candidate scrap lines based on the waste area using the heuristic generation rules; Step S4: Perform redundancy removal, structuring, and cross-relationship analysis on the initial candidate set of scrap lines to obtain an effective candidate set of scrap lines; Step S5: Based on the effective candidate set of scrap lines, use an integer linear programming-based algorithm to solve for the optimal combination of scrap lines that satisfies the preset optimization objective, where the preset optimization objective is to minimize the number and total length of scrap lines. Step S6: Optimize the optimal material breaking line combination to obtain the optimized material breaking line combination.

[0015] This solution includes a method for automatically generating and optimizing the scrap line of a cutting part, such as... Figure 1As shown, the first step is to obtain a 2D CAD drawing containing the cutting parts. In this embodiment, obtaining this 2D CAD drawing provides a solid data foundation for the subsequent conversion of the undirected graph. The second step is to convert the 2D CAD drawing containing the cutting parts into an undirected graph and perform identification processing on the undirected graph to identify the waste areas. In this embodiment, an undirected graph is a structure composed of vertices and edges, characterized by edges having no direction. Each edge connects two vertices, indicating a bidirectional relationship between them. By converting the 2D CAD drawing into an undirected graph, a standardized data foundation can be laid for the subsequent identification of waste areas. Through identification processing of the undirected graph, the waste areas of the cutting parts and non-cutting parts can be clearly distinguished, especially the closed waste areas surrounding the "embedded parts," providing accurate target areas for the subsequent generation of scrap lines. The third step is to construct heuristic generation rules and generate an initial set of candidate scrap lines based on the waste area. In this embodiment, using heuristic generation rules to generate the initial set of candidate scrap lines provides a broad search space for the subsequent integer linear programming-based solution algorithm. The fourth step is to perform redundancy removal, structuring, and cross-relationship analysis on the initial set of candidate scrap lines to obtain an effective set of candidate scrap lines. In this embodiment, redundancy removal effectively eliminates redundant solutions, effectively reducing the search space of the integer linear programming-based solution algorithm while fully preserving the core connectivity characteristics. Structuring the initial set of candidate scrap lines provides standardized input for the cost function calculation of the subsequent integer linear programming-based solution algorithm. Cross-relationship analysis of the initial set of candidate scrap lines provides a basis for establishing key constraints for the subsequent integer linear programming-based solution algorithm, ensuring the rationality and efficiency of the final cutting path. The fifth step is to use an integer linear programming algorithm based on the effective candidate set of scrap lines to find the optimal combination of scrap lines that satisfies the preset optimization objective. The preset optimization objective is to minimize the number and length of scrap lines. In this embodiment, the integer linear programming algorithm, through mathematical modeling and iterative solution logic, ensures that the optimal solution is found within a finite time. Simultaneously, this algorithm can accurately minimize the number and total length of scrap lines while fully meeting process requirements, balancing processing efficiency and material utilization. The sixth step is to optimize the optimal combination of scrap lines to obtain the optimized combination. In this embodiment, although obtaining the optimal combination ensures the minimum number of scrap lines and the shortest total cutting length, this is not equivalent to the optimal processing trajectory. Therefore, the core of optimizing the optimal combination of scrap lines lies in finely adjusting it according to the actual cutting process. For example, aligning multiple parallel and closely spaced scrap lines within a local area collinearly can reduce path switching during the cutting process and improve processing smoothness.

[0016] This solution generates diverse initial candidate sets of scrap lines using a constructed heuristic generation rule. These candidate sets are then processed for redundancy removal, structuring, and cross-relationship analysis to obtain an effective candidate set. Based on this, an integer linear programming-based algorithm is used to find the optimal combination of scrap lines that satisfies the optimization objective of minimizing the number and total length of scrap lines. Compared to existing scrap line generation methods that only provide feasible basic solutions satisfying connectivity and scrap size constraints, this solution uses an integer linear programming-based algorithm to precisely minimize the number and total length of scrap lines. This optimization eliminates the need for extensive manual checking and modification in the later stages, effectively saving time and labor costs, thereby improving overall cutting efficiency.

[0017] Preferably, in step S2, the undirected graph is processed to identify waste regions, specifically including the following sub-steps: Step S21: Select any unvisited vertex from the undirected graph as the starting vertex, and traverse along all edges of the undirected graph one by one; during the traversal, determine whether the traversal path can eventually return to the starting vertex. If so, identify the contour corresponding to the path as a closed contour; if not, identify the contour corresponding to the path as an open contour, until all vertices in the undirected graph have been traversed to obtain all closed contours in the undirected graph. Step S22: Iterate through each closed contour in sequence. For the current closed contour, select any point inside it and emit a virtual ray outward. Detect the intersection of the virtual ray with other closed contours. Define the closed contour that intersects with the virtual ray and is closest to the current closed contour as the direct parent contour of the current closed contour. And so on, to build a tree-like data structure containing the nested hierarchical relationship of all closed contours. Step S23: Based on the tree-like data structure containing all nested levels of closed contours, define the contours and regions at each level: define the top-level contour as the boundary of the raw material plate; define the even-numbered contours below the top level as the outer contours of the embedded parts; define the odd-numbered contours below the top level as the inner contours of the embedded parts; define the region between the boundary of the raw material plate and the outer contour of the embedded parts directly nested below it, and the region between the inner contour of any embedded part and the outer contour of the embedded parts directly nested below it as the waste region.

[0018] In this embodiment, in step S21, by employing a depth-first search (DFS) algorithm combined with backtracking, the vertices and edges of the undirected graph can be traversed, accurately identifying all closed contours and providing a reliable data foundation for the subsequent construction of a nested hierarchical tree of closed contours. In step S22, by constructing a tree-like data structure containing the nested hierarchical relationships of all closed contours, the spatial inclusion logic between each closed contour is clarified, laying a structural foundation for the accurate definition of the waste area. In step S23, by identifying the waste area based on the tree-like data structure containing the nested hierarchical relationships of all closed contours, it is ensured that there is no overlap or omission of waste areas, providing a clear target area for the subsequent planning of the scrap line.

[0019] Preferably, step S2 further includes the following steps: establishing process rules, wherein the process rules prohibit the placement of scrap lines on the edges corresponding to the process edges, process holes, and through holes of the cut part; and identifying and marking specific edges where scrap lines are prohibited from being generated according to the process rules. In this embodiment, by identifying and marking specific edges where scrap lines are prohibited from being generated according to the process rules, damage to the cut part caused by misplanning of scrap lines can be effectively prevented, thereby ensuring the quality and process stability of the cut part.

[0020] Preferably, in step S3, the heuristic generation rules include generation rules based on the midpoint of the embedded part edge, generation rules based on AABB bounding boxes, generation rules based on OBB bounding boxes, and generation rules based on meshes. The generation rule based on the midpoint of the embedded part edge includes the following steps: Traverse all edges on the outline of the current embedded part and determine the midpoint of each edge; Using the midpoint of each edge as the emission starting point, virtual rays are emitted towards the outside of the currently embedded part along both the horizontal and vertical directions; During the virtual ray emission process, it is determined whether the virtual ray intersects with the boundary of the waste area, the outline of the hole inside the waste area, or the outer outline of other embedded parts inside the waste area. If so, the emission of the virtual ray is stopped, and the intersection position is recorded as the ray endpoint. The line connecting the emission start point and the ray endpoint is used as the candidate scrap line. If not, the virtual ray continues to be emitted until it intersects with the boundary of the waste area, the outline of the hole inside the waste area, or the outer outline of other embedded parts inside the waste area. The generation rules based on AABB bounding boxes include the following steps: Generate a minimum axis-aligned bounding box based on the current embedded part outline, and determine the midpoints of the four sides in the minimum axis-aligned bounding box; Starting from the midpoint of the four sides in the minimum axis-aligned bounding box, emit rays in the direction "pointing to the inside of the current embedded part contour", and take the position where the ray first intersects with the current embedded part contour as the starting point of the candidate scrap line. Starting from the emission point of the candidate fragment line, virtual rays are emitted towards the outside of the current embedded part in both the horizontal and vertical directions; During the virtual ray emission process, it is determined whether the virtual ray intersects with the boundary of the waste area, the outline of the hole inside the waste area, or the outer outline of other embedded parts inside the waste area. If so, the emission of the virtual ray is stopped, and the intersection position is recorded as the ray endpoint. The line connecting the emission start point and the ray endpoint is used as the candidate scrap line. If not, the virtual ray continues to be emitted until it intersects with the boundary of the waste area, the outline of the hole inside the waste area, or the outer outline of other embedded parts inside the waste area.

[0021] In this embodiment, when generating the initial candidate set of scrap lines using the generation rule based on the midpoint of the embedded part's edge, it is only necessary to locate the midpoint of the embedded part's edge through geometric calculation and emit rays along a fixed direction. The overall calculation logic is simple and there is no complex iterative process, which not only has high execution efficiency but also makes the generation logic intuitive and easy to understand, facilitating engineering implementation. When generating the initial candidate set of scrap lines using the generation rule based on AABB bounding boxes, since the ray starting point is planned based on the edge of the bounding box rather than relying on the edge structure of the embedded part itself, it is not limited by the number and length differences of the embedded part's edges. Even for complex embedded parts with irregular shapes, it can generate candidate scrap lines with regular positions and uniform distribution. Furthermore, in other embodiments, to improve the diversity of the initial candidate set of scrap lines, the generation rule based on AABB bounding boxes can select characteristic positions such as 1 / 3 and 2 / 3 of the bounding box edge in addition to selecting the midpoint of the bounding box edge to emit rays.

[0022] Preferably, the generation rule based on OBB bounding boxes includes the following steps: Generate an oriented bounding box based on the current embedded part outline, and determine the midpoints of the four sides in the oriented bounding box; Starting from the midpoint of the four sides in the directional bounding box, emit rays in the direction "pointing to the inside of the current embedded part outline", and take the position where the ray first intersects with the current embedded part outline as the starting point of the candidate scrap line. Starting from the emission point of the candidate fragment line, virtual rays are emitted towards the outside of the current embedded part in both the horizontal and vertical directions; During the virtual ray emission process, it is determined whether the virtual ray intersects with the boundary of the waste area, the outline of the hole inside the waste area, or the outer outline of other embedded parts inside the waste area. If so, the emission of the virtual ray is stopped, and the intersection position is recorded as the ray endpoint. The line connecting the emission start point and the ray endpoint is used as the candidate scrap line. If not, the virtual ray continues to be emitted until it intersects with the boundary of the waste area, the outline of the hole inside the waste area, or the outer outline of other embedded parts inside the waste area. The grid-based generation rules include the following steps: Obtain the scrap area containing the currently embedded part, and generate an AABB bounding box based on the contour of the scrap area; Inside the AABB bounding box, a virtual rectangular mesh is constructed according to a preset mesh density; Rays are emitted from the left grid point of the virtual rectangular grid in a horizontal direction to the right and from the top grid point of the virtual rectangular grid in a vertical direction downward, respectively. During the radiation emission process, all intersection points between the radiation and the contours of holes inside the waste area and the outer contours of embedded parts are detected and recorded. For each ray, all its recorded intersection points are sorted according to the "ray emission direction" to obtain the sorted intersection points, and the line connecting two adjacent intersection points in the sorted intersection points is used as the candidate fragmentation line.

[0023] In this embodiment, when generating the initial scrap line candidate set using OBB bounding box-based generation rules, compared to AABB bounding boxes, OBB bounding boxes can adjust their orientation according to the actual contour direction of the embedded parts, thus more closely conforming to the shape of the embedded parts. Based on this characteristic, the ray emission points determined by the OBB bounding box can more accurately match the contour features of the parts and have stronger representativeness. The candidate scrap lines generated based on OBB bounding boxes are not only shorter but also more reasonable. The OBB bounding box generation rules are particularly suitable for embedded parts with irregular shapes such as long and narrow shapes, effectively avoiding the problems of "excessively long candidate scrap lines" and "too many invalid candidate lines" caused by excessive redundant space in AABB bounding boxes. By using mesh-based generation rules to generate the initial scrap line candidate set, candidate lines can be systematically generated throughout the entire scrap area, without being limited by the geometric features of specific embedded parts.

[0024] Preferably, step S4 specifically includes the following steps: Step S41: Obtain the shortest distance between any two adjacent candidate fragmentation lines in the initial fragmentation line candidate set and the included angle formed by extending any two adjacent candidate fragmentation lines; Step S42: Determine whether the shortest distance between any two adjacent candidate fragment lines is less than a preset distance threshold. If yes, determine that the two candidate fragment lines are similar candidate fragment lines and delete one of them. If no, retain the two candidate fragment lines. Also, determine whether the included angle formed by extending any two adjacent candidate fragment lines is less than a preset included angle threshold. If yes, determine that the two candidate fragment lines are similar candidate fragment lines and delete one of them. If no, retain the two candidate fragment lines to form a fragment line candidate set after redundancy removal. Step S43: Assign a unique index to each candidate scrap line in the candidate scrap line set after redundancy removal, and record the key attributes of each candidate scrap line one by one; wherein, the key attributes of the candidate scrap line include the starting point coordinates, ending point coordinates, length, connected contours, the scrap area to which it belongs, and direction vector; It also iterates through each candidate fragment line in the candidate fragment line set after redundancy removal, performs geometric intersection calculations on any two different candidate fragment lines, and records all intersecting candidate fragment line pairs to form a valid candidate fragment line set.

[0025] In this embodiment, in step S41, the shortest distance between any two adjacent candidate scrap lines in the initial scrap line candidate set and the angle formed after extension are obtained, providing a data basis for subsequent judgment on whether candidate scrap lines are redundant. In step S42, the distance threshold is set to 10mm and the angle threshold is set to 5°. By deleting similar candidate scrap lines that are too close or have too small an angle, the amount of data in the scrap line candidate set can be effectively reduced, avoiding repeated processing of similar information in subsequent calculations. In step S43, by assigning a unique index to each candidate scrap line and recording key attributes, the scattered geometric data is transformed into structured information, facilitating subsequent querying and management. Intersecting scrap line pairs are filtered out through geometric intersection calculations to ensure the practicality of the final scrap line candidate set.

[0026] Preferably, step S5 specifically includes the following sub-steps: Step S51: Establish the initial integer linear programming model; Step S52: Construct the objective function and constraints of the initial integer linear programming model, wherein the objective function expression of the initial integer linear programming model is as follows: ; in, This indicates the weight of the number of candidate scrap lines in the objective function. This represents the weight of the total length of the candidate scrap lines in the objective function. Indicates candidate scrap line Length, This represents the set of all candidate scrap lines. Let Z represent a binary variable, and Z represent the total cost of all candidate scrap line sets. The constraints of the initial integer linear programming model are as follows: The first constraint is that candidate scrap lines should be preferentially placed near the midpoint of the part's edge; The second constraint is that the candidate fragmentation line should be horizontal or vertical. The third constraint is to prohibit the generation of candidate scrap lines on specific process edges; The fourth constraint is that a single part must be connected to at least two candidate scrap lines; The fifth constraint is that at least two candidate scrap lines connected to a single part cannot be located on the same edge; The sixth constraint is that candidate scrap lines are not allowed to intersect; In the fourth and fifth constraints, for each part , This represents the set of all parts corresponding to the waste area to be processed, which must satisfy the following four constraints: ; ; ; ; in, Represents a binary auxiliary variable; Indicates from parts The subset of candidate scrap lines generated by the upper edge set of the axis-aligned bounding box allows the placement of candidate scrap lines; Indicates from parts The lower set of candidate scrap lines generated on the axis-aligned bounding box allows placement of candidate scrap lines; Indicates from parts The left set of candidate scrap lines generated on the axis-aligned bounding box allows placement of the candidate scrap line subset; Indicates from parts The right set of candidate scrap lines generated on the axis-aligned bounding box allows placement of the candidate scrap line subset; That is when At that time, the first two constraints become This means that at least one candidate scrap line must be selected from both the upper and lower candidate scrap lines of the part; the latter two constraints become... It doesn't work; when At that time, the first two constraints become It has no effect; the last two constraints become... This means that at least one candidate scrap line must be selected from both the left and right candidate scrap lines of the part. In the sixth constraint, for each pair of pre-calculated intersecting candidate line fragments... , The set of all pairwise intersecting candidate scrap lines must satisfy the following constraints: ; in, A binary variable representing the candidate scrap line k; That is, if candidate scrap line j is selected, then it forces The value must be 0, and no candidate scrap line k is allowed, to ensure that at most one of any pair of intersecting candidate scrap lines can be selected; Step S53: Perform iterative operations on the initial integer linear programming model to obtain the integer linear programming model of the current iteration; Step S54: Use a solver to solve the integer linear programming model of the current iteration to obtain the optimal solution that simultaneously satisfies the first, second, third, fourth, fifth, and sixth constraints. ; Step S55: Extraction All The corresponding scrap lines are used to virtually cut the original waste area, resulting in several waste sub-regions. The directional bounding box size of all waste sub-regions is then calculated. Step S56: Determine whether the oriented bounding box size of all waste sub-regions is smaller than a preset size threshold. If so, then determine... To find the globally optimal solution that satisfies all constraints, output The optimal combination of material handling lines is selected; otherwise, the following criteria are determined: If not feasible, add a new constraint to the integer linear programming model of the current iteration, and repeat steps S54-S56 using the integer linear programming model with the new constraint until the optimal solution obtained by the integer linear programming model with the new constraint satisfies all constraints. The new constraints are as follows: ; in, This represents the set of all candidate scrap lines that can pass through scrap sub-regions exceeding a preset size threshold.

[0027] In this embodiment, the optimal combination of scrap lines is obtained by solving an integer linear programming algorithm, which can simultaneously satisfy the first constraint, the second constraint, the third constraint, the fourth constraint, the fifth constraint, the sixth constraint, and the newly added constraint, thereby minimizing the number of scrap lines and the total length.

[0028] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0029] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for automatically generating and optimizing a cutting waste line, characterized in that: Includes the following steps: Step S1: Obtain a 2D CAD drawing containing the cutting kit; Step S2: Convert the 2D CAD drawing containing the cutting parts into an undirected graph, and perform recognition processing on the undirected graph to identify the waste area; Step S3: Construct heuristic generation rules and generate an initial set of candidate scrap lines based on the waste area using the heuristic generation rules; Step S4: Perform redundancy removal, structuring, and cross-relationship analysis on the initial candidate set of scrap lines to obtain an effective candidate set of scrap lines; Step S5: Based on the effective candidate set of scrap lines, use an integer linear programming-based algorithm to solve for the optimal combination of scrap lines that satisfies the preset optimization objective, where the preset optimization objective is to minimize the number and total length of scrap lines. Step S6: Optimize the optimal material breaking line combination to obtain the optimized material breaking line combination.

2. The method for automatic generation and optimization of a cutting waste line according to claim 1, characterized in that: In step S2, the undirected graph is processed to identify waste regions, which specifically includes the following sub-steps: Step S21: Select any unvisited vertex from the undirected graph as the starting vertex, and traverse along all edges of the undirected graph one by one; during the traversal, determine whether the traversal path can eventually return to the starting vertex. If so, identify the contour corresponding to the path as a closed contour; if not, identify the contour corresponding to the path as an open contour, until all vertices in the undirected graph have been traversed to obtain all closed contours in the undirected graph. Step S22: Iterate through each closed contour in sequence. For the current closed contour, select any point inside it and emit a virtual ray outward. Detect the intersection of the virtual ray with other closed contours. Define the closed contour that intersects with the virtual ray and is closest to the current closed contour as the direct parent contour of the current closed contour. And so on, to build a tree-like data structure containing the nested hierarchical relationship of all closed contours. Step S23: Based on the tree-like data structure containing all nested levels of closed contours, define the contours and regions at each level: define the top-level contour as the boundary of the raw material plate; define the even-numbered contours below the top level as the outer contours of the embedded parts; define the odd-numbered contours below the top level as the inner contours of the embedded parts; define the region between the boundary of the raw material plate and the outer contour of the embedded parts directly nested below it, and the region between the inner contour of any embedded part and the outer contour of the embedded parts directly nested below it as the waste region.

3. The method for automatic generation and optimization of cutting material scrap lines according to claim 1, characterized in that: Step S2 also includes the following steps: Establish process rules, which include prohibiting the placement of scrap lines on the process edges, process holes, and the edges corresponding to through holes of the cut parts; According to the process rules, identify and mark the specific edges where the generation of scrap lines is prohibited.

4. The method for automatic generation and optimization of a cutting waste line according to claim 1, characterized in that: In step S3, the heuristic generation rules include generation rules based on the midpoint of the embedded part edge, generation rules based on AABB bounding boxes, generation rules based on OBB bounding boxes, and generation rules based on meshes. The generation rule based on the midpoint of the embedded part edge includes the following steps: Traverse all edges on the outline of the current embedded part and determine the midpoint of each edge; Using the midpoint of each edge as the emission starting point, virtual rays are emitted towards the outside of the currently embedded part along both the horizontal and vertical directions; During the virtual ray emission process, it is determined whether the virtual ray intersects with the boundary of the waste area, the outline of the hole inside the waste area, or the outer outline of other embedded parts inside the waste area. If so, the emission of the virtual ray is stopped, and the intersection position is recorded as the ray endpoint. The line connecting the emission start point and the ray endpoint is used as the candidate scrap line. If not, the virtual ray continues to be emitted until it intersects with the boundary of the waste area, the outline of the hole inside the waste area, or the outer outline of other embedded parts inside the waste area. The generation rules based on AABB bounding boxes include the following steps: Generate a minimum axis-aligned bounding box based on the current embedded part outline, and determine the midpoints of the four sides in the minimum axis-aligned bounding box; Starting from the midpoint of the four sides in the minimum axis-aligned bounding box, emit rays in the direction "pointing to the inside of the current embedded part contour", and take the position where the ray first intersects with the current embedded part contour as the starting point of the candidate scrap line. Starting from the emission point of the candidate fragment line, virtual rays are emitted towards the outside of the current embedded part in both the horizontal and vertical directions; During the virtual ray emission process, it is determined whether the virtual ray intersects with the boundary of the waste area, the outline of the hole inside the waste area, or the outer outline of other embedded parts inside the waste area. If so, the emission of the virtual ray is stopped, and the intersection position is recorded as the ray endpoint. The line connecting the emission start point and the ray endpoint is used as the candidate scrap line. If not, the virtual ray continues to be emitted until it intersects with the boundary of the waste area, the outline of the hole inside the waste area, or the outer outline of other embedded parts inside the waste area.

5. The method for automatic generation and optimization of a cutting waste line according to claim 4, characterized in that: The generation rules based on OBB bounding boxes include the following steps: Generate an oriented bounding box based on the current embedded part outline, and determine the midpoints of the four sides in the oriented bounding box; Starting from the midpoint of the four sides in the directional bounding box, emit rays in the direction "pointing to the inside of the current embedded part outline", and take the position where the ray first intersects with the current embedded part outline as the starting point of the candidate scrap line. Starting from the emission point of the candidate fragment line, virtual rays are emitted towards the outside of the current embedded part in both the horizontal and vertical directions; During the virtual ray emission process, it is determined whether the virtual ray intersects with the boundary of the waste area, the outline of the hole inside the waste area, or the outer outline of other embedded parts inside the waste area. If so, the emission of the virtual ray is stopped, and the intersection position is recorded as the ray endpoint. The line connecting the emission start point and the ray endpoint is used as the candidate scrap line. If not, the virtual ray continues to be emitted until it intersects with the boundary of the waste area, the outline of the hole inside the waste area, or the outer outline of other embedded parts inside the waste area. The grid-based generation rules include the following steps: Obtain the scrap area containing the currently embedded part, and generate an AABB bounding box based on the contour of the scrap area; Inside the AABB bounding box, a virtual rectangular mesh is constructed according to a preset mesh density; Rays are emitted from the left grid point of the virtual rectangular grid in a horizontal direction to the right and from the top grid point of the virtual rectangular grid in a vertical direction downward, respectively. During the radiation emission process, all intersection points between the radiation and the contours of holes inside the waste area and the outer contours of embedded parts are detected and recorded. For each ray, all its recorded intersection points are sorted according to the "ray emission direction" to obtain the sorted intersection points, and the line connecting two adjacent intersection points in the sorted intersection points is used as the candidate fragmentation line.

6. The method for automatic generation and optimization of cutting material scrap lines according to claim 1, characterized in that: Step S4 specifically includes the following steps: Step S41: Obtain the shortest distance between any two adjacent candidate fragmentation lines in the initial fragmentation line candidate set and the included angle formed by extending any two adjacent candidate fragmentation lines; Step S42: Determine whether the shortest distance between any two adjacent candidate fragment lines is less than a preset distance threshold. If yes, determine that the two candidate fragment lines are similar candidate fragment lines and delete one of them. If no, retain the two candidate fragment lines. Also, determine whether the included angle formed by extending any two adjacent candidate fragment lines is less than a preset included angle threshold. If yes, determine that the two candidate fragment lines are similar candidate fragment lines and delete one of them. If no, retain the two candidate fragment lines to form a fragment line candidate set after redundancy removal. Step S43: Assign a unique index to each candidate scrap line in the candidate scrap line set after redundancy removal, and record the key attributes of each candidate scrap line one by one; wherein, the key attributes of the candidate scrap line include the starting point coordinates, ending point coordinates, length, connected contours, the scrap area to which it belongs, and direction vector; It also iterates through each candidate fragment line in the candidate fragment line set after redundancy removal, performs geometric intersection calculations on any two different candidate fragment lines, and records all intersecting candidate fragment line pairs to form a valid candidate fragment line set.

7. The method for automatic generation and optimization of a cutting material scrap line according to claim 1, characterized in that: Step S5 specifically includes the following sub-steps: Step S51: Establish the initial integer linear programming model; Step S52: Construct the objective function and constraints of the initial integer linear programming model, wherein the objective function expression of the initial integer linear programming model is as follows: ; in, This indicates the weight of the number of candidate scrap lines in the objective function. This represents the weight of the total length of the candidate scrap lines in the objective function. Indicates candidate scrap line Length, This represents the set of all candidate scrap lines. Let Z represent a binary variable, and Z represent the total cost of all candidate scrap line sets. The constraints of the initial integer linear programming model are as follows: The first constraint is that candidate scrap lines should be preferentially placed near the midpoint of the part's edge; The second constraint is that the candidate fragmentation line should be horizontal or vertical. The third constraint is to prohibit the generation of candidate scrap lines on specific process edges; The fourth constraint is that a single part must be connected to at least two candidate scrap lines; The fifth constraint is that at least two candidate scrap lines connected to a single part cannot be located on the same edge; The sixth constraint is that candidate scrap lines are not allowed to intersect; In the fourth and fifth constraints, for each part , This represents the set of all parts corresponding to the waste area to be processed, which must satisfy the following four constraints: ; ; ; ; in, Represents a binary auxiliary variable; Indicates from parts The subset of candidate scrap lines generated by the upper edge set of the axis-aligned bounding box allows the placement of candidate scrap lines; Indicates from parts The lower set of candidate scrap lines generated on the axis-aligned bounding box allows placement of candidate scrap lines; Indicates from parts The left set of candidate scrap lines generated on the axis-aligned bounding box allows placement of the candidate scrap line subset; Indicates from parts The right set of candidate scrap lines generated on the axis-aligned bounding box allows placement of the candidate scrap line subset; That is when At that time, the first two constraints become This means that at least one candidate scrap line must be selected from both the upper and lower candidate scrap lines of the part; the latter two constraints become... It doesn't work; when At that time, the first two constraints become It has no effect; the last two constraints become... This means that at least one candidate scrap line must be selected from both the left and right candidate scrap lines of the part. In the sixth constraint, for each pair of pre-calculated intersecting candidate line fragments... , The set of all pairwise intersecting candidate scrap lines must satisfy the following constraints: ; in, A binary variable representing the candidate scrap line k; That is, if candidate scrap line j is selected, then it forces The value must be 0, and no candidate scrap line k is allowed, to ensure that at most one of any pair of intersecting candidate scrap lines can be selected; Step S53: Perform iterative operations on the initial integer linear programming model to obtain the integer linear programming model of the current iteration; Step S54: Use a solver to solve the integer linear programming model of the current iteration to obtain the optimal solution that simultaneously satisfies the first, second, third, fourth, fifth, and sixth constraints. ; Step S55: Extraction All The corresponding scrap lines are used to virtually cut the original waste area, resulting in several waste sub-regions. The directional bounding box size of all waste sub-regions is then calculated. Step S56: Determine whether the oriented bounding box size of all waste sub-regions is smaller than a preset size threshold. If so, then determine... To find the globally optimal solution that satisfies all constraints, output The optimal combination of material handling lines is selected; otherwise, the following criteria are determined: If not feasible, add a new constraint to the integer linear programming model of the current iteration, and repeat steps S54-S56 using the integer linear programming model with the new constraint until the optimal solution obtained by the integer linear programming model with the new constraint satisfies all constraints. The new constraints are as follows: ; in, This represents the set of all candidate scrap lines that can pass through scrap sub-regions exceeding a preset size threshold.