An S-shaped sorting cutting path optimization method based on region segmentation
By using an S-shaped sorting cutting path optimization method based on region segmentation, the continuous cutting problem of the sponge ring cutter was solved, improving processing efficiency and shortening the cutting path.
Patent Information
- Application Number
- CN202310420116.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-19
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2043-04-19
AI Technical Summary
Existing cutting methods cannot meet the continuous cutting requirements of sponge ring cutter cutting machines, resulting in low processing efficiency and excessively long cutting paths.
An S-shaped sorting cutting path optimization method based on region segmentation is adopted. Through region segmentation, overall and local sorting, processing path planning and collision handling, the shortest and continuous cutting path is generated.
This technology enables continuous cutting of sponge ring cutters, improving processing efficiency and shortening the cutting path.
Smart Images

Figure CN116394327B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent manufacturing, specifically relating to an S-shaped sorting and cutting path optimization method based on region segmentation. Background Technology
[0002] A sponge ring cutter is a machine specifically designed for cutting sponges. With the increasing demand for sponge products, traditional manual cutting methods can no longer meet production needs. The emergence of the sponge ring cutter solves this problem, allowing for the rapid and accurate cutting of large quantities of sponge material into the required shapes and sizes. Compared to traditional cutting machines, the advantage of the sponge ring cutter lies in its high-speed ring cut, which significantly improves production efficiency. The ring cutter does not detach from the raw material during the cutting process, eliminating the need for lifting and lowering the blade, and employs a continuous cutting method, requiring a highly regular processing path.
[0003] Currently, most research on cutting methods is based on discontinuous cutting, using the generalized traveling salesman algorithm (TSA) to optimize for minimizing idle travel. However, this approach can damage already processed samples along the machining path, making it unsuitable for continuous cutting in sponge ring cutter machines. Reducing the transition path between samples, adding a small number of repetitive paths around already processed samples, and balancing idle travel with machining quality, along with rationally planning the cutting path, are key to achieving continuous cutting, improving machining efficiency, and shortening the machining path. Summary of the Invention
[0004] Purpose of the invention: This paper addresses the continuous cutting problem of sponge ring cutter cutting machines by proposing an S-shaped sorting cutting path optimization method based on region segmentation. This method can achieve continuous cutting, improve processing efficiency, and shorten the processing path.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] An S-shaped sorting and cutting path optimization method based on region segmentation includes the following steps:
[0007] Step 1: Region Segmentation: Divide the layout diagram into multiple regions step by step;
[0008] Step 2: Region Sorting: Sort the segmented region samples by overall and local sorting to establish the sample search order for each region;
[0009] Step 3: Processing Path Planning: After sorting, the region samples generate processing paths during the search, and the entry and exit points are reasonably selected to generate the shortest processing path;
[0010] Step 4: Collision Handling: The processing paths formed between samples may collide with other samples. Establish the collision area and perform collision handling on the collision points.
[0011] Furthermore, the step of dividing the layout diagram into multiple regions in step one is as follows:
[0012] Step (1): Find the inflection point sample LA in the unsearched sample set;
[0013] Step (2): Cut upwards, and extend the sample above it that conforms to extension principle 1 into the same area through the inflection point sample; cut downwards, and extend the sample below it that conforms to the extension principle into the same area through the inflection point sample;
[0014] Step (3): There are some small samples in the region obtained from step (2) that have not been placed in the region. These samples need to be extended into the region according to extension principle 2 to obtain region REG.
[0015] Furthermore, the steps for finding the inflection point sample LA in step (1) are as follows:
[0016] Step A: Place the unsearched samples in the sample image into an empty set P;
[0017] Step B: Find sample A with the smallest X-coordinate value of the centroid of the set;
[0018] Step C: According to rule f ls Add the samples that meet the criteria from the sample set to an empty set.
[0019] Step D: Let S be the set obtained from step C, and let t be the number of samples in set S. If t = 0, select A as the inflection point sample; if t = 1, select the sample in S as the inflection point sample; if t > 1, perform step B on S.
[0020] Furthermore, the cutting direction in step (2) is divided into two types: upward and downward. The REG region searches from the bottom sample, which is called upward cutting; the REG region searches from the top sample, which is called downward cutting. After searching a sample region, the cutting direction is reversed.
[0021] The expansion principle 1 is: satisfying one of the following two conditions: a. The left boundary of the envelope rectangle of the candidate sample C is to the left of the inflection point sample LA; b. The centroid of the candidate sample C is to the right of the right boundary of the envelope rectangle of LA.
[0022] The second expansion principle is: find the rightmost sample of the right boundary of the envelope rectangle in the current region, and add the sample whose centroid is located to the left of the right boundary of the envelope rectangle of that sample to the current region.
[0023] Among them, rule f lsThe left boundary of the envelope rectangle to be added to sample B should be located to the left of the centroid of A. When cutting upwards, the centroid of B should be located below the centroid of A; when cutting downwards, the centroid of B should be located above the centroid of A.
[0024] Furthermore, the specific implementation process of the overall sorting in step two is as follows:
[0025] Step 1) Divide the segmented region into multiple parallel regions. Search the REG regions in the same order as the cutting direction. When cutting upwards, search from low to high according to the plane height of each region; when cutting downwards, search from high to low according to the plane height of each region.
[0026] Step 2) Divide the row area into multiple column areas. The search rule for row areas is to search each area from left to right. The search order of the column area samples is consistent with the cutting direction: if the cut is upward, search from the bottom sample; if the cut is downward, search from the top sample.
[0027] Step 3) Change the search order of the same area according to the reverse reasoning method.
[0028] In step 1), the "same-line region" refers to the region composed of same-line samples. A same-line sample is defined as a sample whose centroid lies between the upper and lower boundaries of the leftmost sample's enclosing rectangle; the former is the right-hand same-line sample of the latter, and the latter is the left-hand same-line sample of the former. When a sample has no same-line samples, that sample forms a separate same-line region.
[0029] In step 2), the "co-column region" refers to a region composed of samples in the same column. A co-column sample is defined as a known sample where the centroids of other samples lie between the left and right boundaries of the rectangle encompassing the known sample. When a sample does not have co-column samples, that sample forms a separate co-column region.
[0030] The backward induction method in step 3) refers to dividing the segmented region REG into n parallel regions, and numbering each parallel region as r1, ..., r along the cutting direction. i , ..., r n , in r n If the sample search order remains unchanged according to the peer region search rules, r n-1 Based on its next peer region r n The relative position changes order, and so on, until the first parallel region r1. The change order of a parallel region according to its relative position to the next parallel region refers to... i Given that the search order for (i≥2) is known, r i The first sample image searched i1The centroid of LB is denoted as LB. The x-coordinate of LB is denoted as x1. i-1 The first sample S searched (i-1)1 The centroid is denoted as LA1, and the last sample s was searched. (i-1)-1 The centroid is notated as LA -1 LA -1 and LA -1 The midpoint is denoted as mid. The x-coordinate of mid is denoted as x2. If x1 < x2, then S (i-1)1 With s i1 The distance is relatively close, s (i-1)-1 With s i1 The distance is relatively far. According to the search rules for the same region, search for r. i-1 At that time, it will first search for s (i-1)1 Search s again (i-1)-1 It is prone to collisions, so r i-1 The sample search order needs to be reversed. Due to the special position of r1, when the sample search order needs to be reversed according to the backward reasoning method, rule f1 also needs to be satisfied.
[0031] The rule f1 is as follows: When cutting upwards, the upper boundary of the envelope rectangle of the inflection point sample is located below the lower boundary of the envelope rectangle of the leftmost sample in the same row area; when cutting downwards, the lower boundary of the envelope rectangle of the inflection point sample is located above the upper boundary of the envelope rectangle of the leftmost sample in the same row area.
[0032] Furthermore, the specific implementation process of the local sorting in step two is as follows:
[0033] Step S1: The first and last column regions in the same row, M1 and M2, are located within the same row region. -1 The search order remains unchanged;
[0034] Step S2: When the number of regions t in the same row is less than or equal to 2, there is no need to change the sample search order within the same row.
[0035] Step S3: When the number of regions t in the same row is greater than 2, reverse the search order of the even-numbered columns.
[0036] Furthermore, the machining path in step three consists of a machining contour and a transition line. The machining contour is the contour of the sample between the infeed point and the exit point of the currently searched sample, which is the path on which the tool repeatedly cuts during machining. The sample contour can be clockwise or counterclockwise. The transition line is the line segment formed by the exit point of the currently searched pattern and the infeed point of the next pattern to be searched.
[0037] Furthermore, the specific implementation process of rationally selecting the processing path in step three is as follows:
[0038] Step 1: Currently searching for sample C i For the first sample piece searched in the layout diagram, select the first point in the set of contour points of that sample piece as its reference point; when C i When the sample is not the first sample searched in the nesting diagram, due to the entry point C ie Searching for C i Since the previous sample has already been determined, we need to select the cut-out point C of the currently searched sample. ik And the next sample image to be searched, C i+1 Entry point C (i+1)e .
[0039] Step 2: Select C from the contour points of the current search sample and the next sample to be searched. ik and C (i+1)e If the resulting transition line does not collide with other samples, select C. ik and C (i+1)e This ensures the shortest processing path and prevents the transition line from colliding with other samples.
[0040] Furthermore, the collision region in step four refers to the area detected when searching for a sample in the REG region, including the previous search region, the current REG region, and the next region to be searched. When REG is the first region segmented from the sample image, the collision region does not include the previous search region; when REG is the last region, the collision region does not include the next region to be searched.
[0041] Furthermore, the specific implementation process of the collision handling in step four is as follows:
[0042] Step 1: Solve the processing path between the current search sample and the next sample to be searched;
[0043] Step II: When the transition line collides with a single sample, if the sample is not yet searched, the currently searched sample forms a machining path with it, and then the sample forms a machining path with the next sample to be searched. If the sample is already searched: a) If the sample is in the current region REG, the previous and next searched samples form a machining path. b) If the sample is not in the current region REG, but in the previous search region, the currently searched sample forms a machining path with it, and then the sample forms a machining path with the next sample to be searched. Since the sample has already formed a cutting path, the tool has already cut the complete contour of the sample during machining. At this point, it is no longer necessary to cut the complete contour of the sample. The entry and exit points are searched on the sample, a transition line is generated, and the section of the sample contour between the entry and exit points is repeatedly cut.
[0044] Step III: When the transition line collides with multiple samples, according to rule f cs Process the collision samples one by one.
[0045] Rule f cs Cut upwards, selecting the bottom leftmost sample among the collided samples for processing each time; cut downwards, selecting the top leftmost sample among the collided samples for processing each time. The currently searched sample forms a processing path with the first collided sample processed, and then the first collided sample processed forms a processing path with the collided samples processed next, and so on, until the last processed sample forms a processing path with the next sample to be searched.
[0046] Compared with existing technologies, the present invention has the following advantages: 1. The present invention can achieve continuous cutting requirements. 2. The present invention can obtain the shortest cutting path in the shortest time. Attached Figure Description
[0047] Figure 1 This is a schematic diagram of the overall process of the S-shaped sorting and cutting path optimization method based on region segmentation adopted in this invention.
[0048] Figure 2 This is a schematic diagram illustrating how a region REG is divided into multiple parallel regions and parallel regions are divided into columns in this invention.
[0049] Figure 3 This is a schematic diagram of the backward reasoning method in this invention;
[0050] Figure 4 This is a schematic diagram illustrating the cases where no local sorting occurs and the cases where local sorting occurs in this invention;
[0051] Figure 5 This is a schematic diagram of the collision area in this invention;
[0052] Figure 6 This is a schematic diagram illustrating the processing procedure for collision samples that are already searched samples in this invention;
[0053] Figure 7 This is a schematic diagram of the collision handling process when multiple samples collide in this invention;
[0054] Figure 8 This is a schematic diagram of steps (a) to (f) in an S-shaped sorting and cutting path planning method based on region segmentation, as described in another embodiment of the present invention. Detailed Implementation
[0055] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0056] A method for optimizing S-shaped sorting and cutting paths based on region segmentation, referenced Figure 1 The specific steps are as follows:
[0057] Step 1: Region Segmentation: Divide the layout diagram into multiple regions step by step;
[0058] Step 2: Region Sorting: Sort the segmented region samples by overall and local sorting to establish the sample search order for each region;
[0059] Step 3: Processing path planning: After sorting the sample areas, a processing path is generated during the search. The entry and exit points are selected appropriately to generate the shortest cutting path.
[0060] Step 4: Collision handling: When forming processing paths between samples, collision detection is required to identify the collision area and handle the collision.
[0061] The S-shaped sorting and cutting path optimization method for region segmentation first expands a region by inflection point samples, then sorts the region as a whole and locally to establish the sample search order for a region. During the sample search, processing path planning and collision handling are performed to finally generate a cutting path for a region. The operation of generating a cutting path for a region is repeated until all samples have been searched.
[0062] Finding a continuous cutting path in a complex layout diagram is time-consuming and results in a relatively long cutting path. Dividing the layout diagram into multiple regions allows for much faster searching of the shortest continuous sub-cutting path within each region, and the final cutting path of the layout diagram composed of multiple sub-cutting paths is the shortest. The steps for dividing the layout diagram into regions are as follows:
[0063] Step (1): Find the inflection point sample AL in the unsearched sample set;
[0064] Step (2): Cut upwards, and extend the sample above it that conforms to extension principle 1 into the same area through the inflection point sample; cut downwards, and extend the sample below it that conforms to the extension principle into the same area through the inflection point sample;
[0065] Step (3): There are some small samples in the region obtained from step (2) that have not been placed in the region. These samples need to be extended into the region according to extension principle 2 to obtain region REG.
[0066] The inflection point sample (LA) is an unsearched sample, and it comes in two types: top left and bottom left. Finding the inflection point sample is crucial for expanding into a region. The steps to find the inflection point sample are as follows:
[0067] Step A: Place the unsearched samples in the sample image into an empty set P;
[0068] Step B: Find sample A with the smallest X-coordinate value of the centroid of the set;
[0069] Step C: According to rule f ls Add the samples that meet the criteria from the sample set to an empty set.
[0070] Step D: Let S be the set obtained from step C, and let t be the number of samples in set S. If t = 0, select A as the inflection point sample; if t = 1, select the sample in S as the inflection point sample; if t > 1, perform step B on S.
[0071] There are two cutting directions: upward and downward. When a region REG starts searching from the bottom sample, it's called upward cutting; when it starts searching from the top sample, it's called downward cutting. After searching a region's sample, the cutting direction is reversed, resulting in an S-shaped cutting path.
[0072] Extension Principle 1: One of the following two conditions must be met: a. The left boundary of the envelope rectangle of the candidate sample C is to the left of the inflection point sample LA; b. The centroid of the candidate sample C is to the right of the right boundary of the envelope rectangle of LA.
[0073] Extension Principle 2: Find the rightmost sample of the right boundary of the envelope rectangle in the current region, and add the sample whose centroid is located to the left of the right boundary of the envelope rectangle of that sample to the current region.
[0074] Rule f ls The left boundary of the envelope rectangle to be added to sample B should be located to the left of the centroid of A. When cutting upwards, the centroid of B should be below the centroid of A; when cutting downwards, the centroid of B should be above the centroid of A.
[0075] The specific implementation process of overall sorting of the region REG is as follows:
[0076] Step 1) Divide the segmented region into multiple parallel regions. The search order of each region is consistent with the cutting direction. When cutting upwards, search from low to high according to the plane height of each region; when cutting downwards, search from high to low according to the plane height of each region.
[0077] Step 2) Divide the row area into multiple column areas. The search rule for the row area is to search each area from left to right. The search order of the column area samples is consistent with the cutting direction.
[0078] Step 3) Change the search order of the same area according to the reverse reasoning method.
[0079] A parallel region refers to a region composed of parallel samples. A parallel sample is defined as one whose centroid lies between the upper and lower boundaries of the rectangle encompassing the leftmost sample; in this case, the former is the right parallel sample of the latter, and the latter is the left parallel sample of the former. When a sample has no parallel samples, that sample forms a parallel region on its own.
[0080] A co-column region refers to a region composed of samples in the same column. A co-column sample is defined as another sample whose centroid lies between the left and right boundaries of the rectangle enclosing the given sample. When a sample has no co-column samples, that sample forms its own co-column region.
[0081] like Figure 2 As shown, the region REG is divided into n parallel regions, and each parallel region is further divided into multiple column regions. Cut upwards, and the parallel region at the bottom of the plane where the region is located is the first region of REG, which is the first region to be searched in REG.
[0082] The backward induction method refers to dividing the segmented region REG into n parallel regions, and numbering each parallel region as r1, ..., r along the cutting direction. i , ..., r n , in r n If the sample search order remains unchanged according to the peer region search rules, r n-1 Based on its next peer region r n The relative position changes order, and so on, until the first parallel region r1. The change order of a parallel region according to its relative position to the next parallel region refers to... i Given that the sample search order for (i≥2) is known, such as Figure 3 As shown, r i The first sample image searched i1 The centroid of LB is denoted as LB. The x-coordinate of LB is denoted as x1. i-1 The first sample image searched in the middle (i-1)1 The centroid is denoted as LA1, and the last sample s was searched. (i-1)-1 The centroid is notated as LA -1 LA -1 and LA -1 The midpoint is denoted as mid. The x-coordinate of mid is denoted as x2. If x1 < x2, then s(i-1)1 With s i1 The distance is relatively close, s (i-1)-1 With s i1 The distance is relatively far. According to the search rules for the same region, search for r. i-1 At that time, it will first search for s (i-1)1 Search s again (i-1)-1 It is prone to collisions, so r i-1 The sample search order needs to be reversed. Due to the special position of r1, when the sample search order needs to be reversed according to the backward reasoning method, rule f1 also needs to be satisfied.
[0083] Rule f1: When cutting upwards, the upper boundary of the envelope rectangle of the inflection point sample is below the lower boundary of the envelope rectangle of the leftmost sample in the same row area; when cutting downwards, the lower boundary of the envelope rectangle of the inflection point sample is above the upper boundary of the envelope rectangle of the leftmost sample in the same row area.
[0084] like Figure 4 As shown in ab, searching for samples according to the order of samples in the same row and column region can easily result in an N-shaped cutting path, increasing idle travel distance and even causing collisions. To avoid these situations, it is necessary to adjust the search order of samples in the same row and column region through local sorting to make the cutting path S-shaped. For example... Figure 4 As shown in cd, local sorting makes the sample cutting path S-shaped and eliminates... Figure 4 The collision situation is shown in b. The steps for local sorting are as follows:
[0085] Step S1: The first and last column regions in the same row, M1 and M2, are located within the same row region. -1 The search order remains unchanged;
[0086] Step S2: When the number of regions t in the same row is less than or equal to 2, there is no need to change the sample search order within the same row.
[0087] Step S3: When the number of regions t in the same row is greater than 2, reverse the search order of the even-numbered columns.
[0088] The specific implementation process of selecting a reasonable processing path in step three is as follows:
[0089] Step 1: Currently searching for sample C i For the first sample piece searched in the layout diagram, select the first point in the set of contour points of that sample piece as its reference point; when C i When the sample is not the first sample searched in the nesting diagram, due to the entry point C ie Searching for C i Since the previous sample has already been determined, we need to select the cut-out point C of the currently searched sample. ikAnd the next sample image to be searched, C i+1 Entry point C (i+1)e .
[0090] Step 2: Select C from the contour points of the current search sample and the next sample to be searched. ik and C (i+1)e If the resulting transition line does not collide with other samples, select C. ik and C (i+1)e This ensures the shortest processing path and prevents the transition line from colliding with other samples.
[0091] In this embodiment, the machining path consists of a machining contour and a transition line. The machining contour is the graphic contour between the infeed point and the exit point of the currently searched graphic, and the graphic contour can be clockwise or counterclockwise. The transition line is the line segment formed by the exit point of the currently searched graphic and the infeed point of the next graphic to be searched.
[0092] like Figure 5 As shown, the collision region refers to the area detected when searching for a sample in the REG region, including the previously searched region, the current REG region, and the next region to be searched. When REG is the first region segmented from the sample image, the collision region does not include the previous searched region; when REG is the last region, the collision region does not include the next region to be searched. This shortens the collision detection range and reduces the computational load of collision detection.
[0093] The collision handling process described in this embodiment is as follows:
[0094] Step 1: Solve the processing path between the current search sample and the next sample to be searched;
[0095] Step II: When the transition line collides with a single sample, if the sample is an unsearched sample, the currently searched sample forms a processing path with it, and the sample then forms a processing path with the next sample to be searched; if the sample is a searched sample, a) if the sample is in the current region REG, the previous and next searched samples form a processing path. The currently searched sample forms a processing path with it, and the sample then forms a processing path with the next sample to be searched. Figure 6As shown, when sample 3 and sample 4 form a machining path, the transition line collides with sample 2, which has already been searched. Collision handling is then performed to allow sample 1 and sample 3 to form a machining path, eliminating the machining path formed by sample 1 and sample 3 with sample 2. b) The sample is not in the current region REG, but in the previous search region. The currently searched sample forms a machining path with this sample, and this sample then forms a machining path with the next sample to be searched. Since this sample has already formed a machining path, the tool has already cut the complete contour of the sample during machining. At this point, it is no longer necessary to cut the complete contour of the sample again. The entry and exit points are searched on the sample, a transition line is generated, and the section of the sample contour between the entry and exit points is repeatedly cut.
[0096] Step III: When the transition line collides with multiple samples, according to rule f cs Process the collision samples one by one.
[0097] Rule f cs Cut upwards, selecting the bottom-leftmost sample from the collided samples for processing each time; cut downwards, selecting the top-leftmost sample for processing each time. The currently searched sample forms a processing path with the first collided sample processed, then the first collided sample forms a processing path with the next collided sample processed, and so on, until the last processed sample forms a processing path with the next sample to be searched. Figure 7 As shown, the current search sample A first generates a processing path with the bottom left sample col, then col generates a processing path with co2, then co2 generates a processing path, and finally co2 generates a processing path with the next sample B to be searched.
[0098] One embodiment of this application. For example... Figure 8 As shown, an S-shaped sorting and cutting path planning method based on region segmentation is presented. The steps are as follows:
[0099] (a) Obtain the layout diagram based on the sample to be cut.
[0100] (b) Since the region was initially cut from left to top, it is necessary to find the bottom left inflection point sample. First, find sample 1 with the smallest centroid X-coordinate value, and then follow rule f. ls Since there are no other samples below sample 1, sample 1 is the bottom left inflection point sample. According to extension principle 1, sample 2 is placed in a region S1. Then, according to extension principle 2, samples 3 and 4 are extended into S1.
[0101] (c) Based on the overall sorting, divide region S1 into parallel regions S. 11 S 12 S 13 S 11 Divide the same column into regions S 111 S12 Divide the same column into S 121 S 13 Divide the same column into regions S 131 Sort the entire region S1 to obtain the search order S. 11 S 12 S 13 , sequentially for S 11 S 12 S 13 Perform local sorting to obtain the search sequence {2, 3, 4}.
[0102] (d) The inflection point sample 1 and sample 2 form a processing path, sample 2 and sample 3 form a processing path, and finally sample 3 and sample 4 form a processing path. Change the cutting direction upward, find sample 5 with the smallest centroid X coordinate value, and process it according to rule f. ls Since there are no other samples below sample 5, sample 5 is the top left inflection point sample. Sample 4 and sample 5 form a processing path. Region S2 is extended using extension principle 1 and extension principle 2.
[0103] (e) Based on the overall sorting, divide region S2 into parallel regions S. 21 S 22 S 21 Divide the same column into regions S 211 S 22 Divide the same column into regions S 221 S 222 The search order for region S2 is S. 22 S 21 S 22 The midpoint of the line connecting the centroids of the first searched sample 6 and the last searched sample 7 is mid1, and mid1 is located at S. 21 The first search sample 8 is located to the right of its centroid. Based on the backward reasoning method, it can be deduced that S needs to be inverted at this point. 22 The order of searching regions in the same column is: first search S. 222 Search S again 221 Then, based on the local sorting, adjust the same column area S. 221 S 222 and S 211 The sample search order yields the search sequence {7, 6, 8}.
[0104] (f) The inflection point sample 5 and sample 6 form a processing path, sample 6 and sample 7 form a processing path, and finally sample 7 and sample 8 form a processing path.
[0105] The above are preferred embodiments of the present invention. Any changes made to the technical solution of the present invention that do not exceed the scope of the technical solution of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for optimizing S-shaped sorting and cutting paths based on region segmentation, characterized in that: Includes the following steps: Step 1: Region Segmentation: Divide the layout diagram into multiple regions step by step; Step 2: Region Sorting: Sort the segmented region samples through overall sorting and local sorting to establish the sample search order for each region; Step 3: Processing Path Planning: After sorting, the region samples generate processing paths during the search, and the entry and exit points are reasonably selected to generate the shortest processing path; Step 4: Collision Handling: The processing paths formed between samples may collide with other samples. Establish the collision area and perform collision handling on the collision points. in: The steps in step one of dividing the layout diagram into multiple regions are as follows: Step (1): Find the inflection point sample LA in the unsearched sample set; the specific steps are as follows: Step A: Place the unsearched samples in the sample image into an empty set P; Step B: Find sample A with the smallest X-coordinate value of the centroid of the set; Step C: According to rule f ls Add the samples that meet the conditions from the sample set to an empty set; rule f ls The left boundary of the envelope rectangle to be added to sample B should be located to the left of the centroid of A. When cutting upwards, the centroid of B should be located below the centroid of A; when cutting downwards, the centroid of B should be located above the centroid of A. Step D: Let S be the set obtained from step C, and let t be the number of samples in set S. If t = 0, select A as the inflection point sample; if t = 1, select a sample in S as the inflection point sample; if t > 1, perform step B on S. Step (2): Cut upwards, and extend the sample above it that conforms to extension principle 1 into the same area through the inflection point sample; cut downwards, and extend the sample below it that conforms to extension principle 1 into the same area through the inflection point sample; There are two cutting directions: upward and downward. Region REG starts searching from the bottom sample, which is called upward cutting; region REG starts searching from the top sample, which is called downward cutting; after searching a region sample, the cutting direction is reversed. The aforementioned extension principle 1 is: satisfying one of the following two conditions: a. the left boundary of the envelope rectangle of the candidate sample C is to the left of the inflection point sample LA, b. the centroid of the candidate sample C is to the right of the right boundary of the envelope rectangle of LA; Step (3): There are some small samples in the region obtained from step (2) that have not been placed in the region. These samples need to be expanded into the region according to expansion principle 2 to obtain region REG; The second expansion principle is: find the rightmost sample of the right boundary of the envelope rectangle in the current region, and add the sample whose centroid is located to the left of the right boundary of the envelope rectangle of that sample to the current region.
2. The S-shaped sorting and cutting path optimization method based on region segmentation according to claim 1, characterized in that: The specific implementation process of the overall sorting in step two is as follows: Step 1) Divide the segmented region into multiple parallel regions. Search the REG regions obtained in Step 1 in the same order as the cutting direction. Cut upwards and search from low to high according to the height of the plane where each region is located; cut downwards and search from high to low according to the height of the plane where each region is located. Among them, the same-line area refers to the area composed of same-line samples; a same-line sample means that the centroid of the right sample is located between the upper and lower boundaries of the leftmost sample's enclosing rectangle, then the former is the right-side same-line sample of the latter, and the latter is the left-side same-line sample of the former; when a sample does not have any same-line samples, the sample forms a separate same-line area. Step 2) Divide the row area into multiple column areas. The search rule for the row area is to search each area from left to right. The search order of the column area samples is consistent with the cutting direction. Cut upwards and search from the bottom sample; cut downwards and search from the top sample. Among them, the same column region refers to the region composed of same column samples; the same column sample means that if a sample is known, there are other samples whose centroids are located between the left and right boundaries of the envelope rectangle of the known sample, then the other samples are the same column samples of the known sample; when a sample does not have any same column samples, the sample forms a same column region on its own. Step 3) Change the search order of the same-line regions using a reverse reasoning method; The backward induction method refers to dividing the segmented region REG into n parallel regions, and numbering each parallel region as r1, ..., r along the cutting direction. i , ..., r n , in r n If the sample search order remains unchanged according to the peer region search rules, r n-1 Based on its next peer region r n The relative position change order of a region in a row is followed by another region in the same row, and so on, until the first region in the same row, r1; where the change order of a region in the same row according to the relative position of its next region in the same row means that in r i Given that the search order for (i≥2) is known, r i The first sample image searched i1 The centroid is denoted as LB; the x-coordinate of LB is denoted as x1; r i-1 The first sample image searched in the middle (i-1)1 The centroid is denoted as LA1, and the last sample s was searched. (i-1)1 The centroid is notated as LA -1 ;LA1 and LA -1 The midpoint is denoted as mid; the x-coordinate of mid is denoted as x2; if x1 < x2, then s (i-1)1 With s i1 The distance is relatively close, s (i-1)-1 With s i1 The distance is relatively far, so according to the search rules for the same area, the search term is r. i-1 At that time, it will first search for s (i-1)1 Search s again (i-1)-1 It is prone to collisions, so r i-1 The sample search order needs to be reversed. Due to the special position of r1, when the sample search order needs to be reversed according to the backward reasoning method, rule f1 also needs to be satisfied. The rule f1 is as follows: When cutting upwards, the upper boundary of the envelope rectangle of the inflection point sample is located below the lower boundary of the envelope rectangle of the leftmost sample in the same row area; when cutting downwards, the lower boundary of the envelope rectangle of the inflection point sample is located above the upper boundary of the envelope rectangle of the leftmost sample in the same row area. The specific implementation process of the local sorting in step two is as follows: Step S1: The first column region M1 and the last column region M in the same row region. -1 The search order remains unchanged; Step S2: When the number of regions t in the same row is less than or equal to 2, there is no need to change the sample search order within the same row. Step S3: When the number of regions t in the same row is greater than 2, reverse the search order of the even-numbered columns.
3. The S-shaped sorting and cutting path optimization method based on region segmentation according to claim 1, characterized in that: The machining path in step three consists of a machining contour and a transition line. The machining contour is the sample contour between the entry point and the exit point of the current search pattern, which is the path on which the tool repeatedly cuts during machining. The sample contour can be clockwise or counterclockwise. The transition line is the line segment formed by the exit point of the current search pattern and the entry point of the next search pattern.
4. The S-shaped sorting and cutting path optimization method based on region segmentation according to claim 1, characterized in that: The specific implementation process of selecting a reasonable processing path in step three is as follows: Step 1: Currently searching for sample C i For the first sample piece searched in the layout diagram, select the first point in the set of contour points of that sample piece as its reference point; when C i When the sample is not the first sample searched in the nesting diagram, due to the entry point C ie Searching for C i Since the previous sample has already been determined, we need to select the cut-out point C of the currently searched sample. ik And the next sample image to be searched, C i+1 Entry point C (i+1)e ; Step 2: Select C from the contour points of the current search sample and the next sample to be searched. ik and C (i+1)e If the resulting transition line does not collide with other samples, select C. ik and C (i+1)e This ensures the shortest processing path and prevents the transition line from colliding with other samples.
5. The S-shaped sorting and cutting path optimization method based on region segmentation according to claim 1, characterized in that: The collision region in step four refers to the area of collision detection when the sample in the search region REG is segmented in step one, including the previous search region, the current region REG, and the next region to be searched. When REG is the first region segmented in the layout diagram, the collision region does not include the previous search region; when REG is the last region, the collision region does not include the next region to be searched.
6. The S-shaped sorting and cutting path optimization method based on region segmentation according to claim 1, characterized in that: The specific implementation process of the collision handling in step four is as follows: Step 1: Solve the processing path between the current search sample and the next sample to be searched; Step II: When the transition line collides with a single sample, if the sample is an unsearched sample, the currently searched sample forms a machining path with the sample, and the sample then forms a machining path with the next sample to be searched; if the sample is a searched sample, a) if the sample is in the current region REG, the previous and next searched samples form a machining path; the currently searched sample forms a machining path with the sample, and the sample then forms a machining path with the next sample to be searched; b) if the sample is not in the current region REG, but in the previous search region, the currently searched sample forms a machining path with the sample, and the sample then forms a machining path with the next sample to be searched; since the sample has already formed a cutting path, the tool has already cut the complete outline of the sample during machining, so it is no longer necessary to cut the complete outline of the sample. The entry point and exit point are searched on the sample, a transition line is generated, and the section of the sample outline between the entry point and the exit point is repeatedly cut; Step III: When the transition line collides with multiple samples, according to rule f cs Process the collision samples sequentially; The aforementioned rule f cs The process is as follows: Cut upwards, selecting the bottom leftmost sample among the collided samples for processing each time; cut downwards, selecting the top leftmost sample among the collided samples for processing each time; the currently searched sample forms a processing path with the first collided sample processed, and then the first collided sample processed forms a processing path with the collided sample processed next, and so on, until the last processed sample forms a processing path with the next sample to be searched.
Citation Information
Patent Citations
Laser cutting system based on image recognition
CN110153567A
Snakelike sequencing continuous cutting path optimization method
CN114660990A