Design method, device and equipment of C-type common-edge graph and medium
By adopting a new C-type co-edge graphic design method in laser cutting technology, the problem of inaccurate shared boundary identification in traditional technology is solved, and a more efficient cutting and production process is achieved.
Patent Information
- Application Number
- CN202510243366.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-06-27
AI Technical Summary
The traditional C-type common edge is not accurate enough when identifying and obtaining shared boundaries, resulting in the shared boundaries between parts being cut multiple times, increasing cutting time and reducing production efficiency.
By obtaining the set of graphics to be shared and the preset common edge strategy, solve the nested relationship between the graphics, sort the outer frame and inner hole graphics, determine the target graphics, discrete graphics, process edges according to the preset strategy, and form a common edge graphics.
Improves cutting efficiency, reduces wear of cutting tools, reduces costs, and shortens the air displacement path between parts and improves production efficiency.
Smart Images

Figure CN120206034A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of laser cutting, and particularly to a design method, device, equipment and medium for C-shaped common-edge graphics. Background Art
[0002] In the current field of laser cutting technology, nesting software plays an important role. Conditions such as whether the arrangement order of the graphics on the sheet is reasonable and whether the idle travel distance is short have become important bases for judging the quality of nesting software. The common-edge algorithm can utilize the shared boundaries between multiple parts to closely arrange and combine the parts, thereby improving the utilization rate of materials.
[0003] When cutting parts with common edges, the shared boundary is only cut once, simplifying the cutting process, saving cutting time, while improving work efficiency and production efficiency. Also, the number of times the cutting tool is used is reduced, reducing the number of times the cutting tool wears, reducing the raw material procurement cost, reducing energy consumption, and reducing the additional expenses caused by frequent replacement of the cutting tool.
[0004] Traditional C-shaped common edges are not accurate enough when identifying and obtaining shared boundaries, resulting in some shared boundaries between parts being cut multiple times, and the idle travel path between parts is long, resulting in too long cutting time and unable to improve production efficiency. Summary of the Invention
[0005] To solve the above problems, this application proposes a design method, device, equipment and medium for C-shaped common-edge graphics, and the method includes:
[0006] Obtain a set of graphics to be common-edged and a preset common-edge strategy; solve the nesting relationship between the graphics to be common-edged to determine the outer frame graphics within the graphics to be common-edged and the inner hole graphics contained within the outer frame graphics; sort the outer frame graphics and the inner hole graphics respectively to obtain a first outer frame graphics order and a second set of inner hole graphics orders; the second set of inner hole graphics orders contains the inner hole graphics order corresponding to each outer frame graphics; based on the first outer frame graphics order and the second set of inner hole graphics orders, determine the target graphics that meet the common-edge standard; discretize the target graphics into multiple discrete edges; based on the preset common-edge strategy, determine the processing method corresponding to each discrete edge, and the processing method includes at least one of retention, deletion, and reconstruction; based on the processing method corresponding to each discrete edge, form the discrete edges into common-edge graphics.
[0007] In one example, solving the nesting relationship between the to-be-edge-sharing graphics to determine the outer frame graphics within the to-be-edge-sharing graphics and the inner hole graphics contained within the outer frame graphics specifically includes: determining the closed graphics and non-closed graphics among the to-be-edge-sharing graphics, and solving the bounding box corresponding to the non-closed graphics; sorting the areas of the bounding boxes of the non-closed graphics and the areas of the closed graphics to obtain a first intermediate graphics set, where the first intermediate graphics set includes the bounding boxes of the non-closed graphics and the closed graphics; cyclically traversing the first intermediate graphics set to determine the inclusion relationships among the graphics in the first intermediate graphics set; and based on the inclusion relationships, determining the outer frame graphics within the to-be-edge-sharing graphics and the inner hole graphics contained within the outer frame graphics.
[0008] In one example, based on the first outer frame graphics order and the second inner hole graphics order set, determining the target graphics that meet the edge-sharing standard specifically includes: obtaining the bounding boxes of each outer frame graphics; based on the first outer frame graphics order, cyclically traversing each outer frame graphics to obtain the bounding box distances and graphic distances among the outer frame graphics; and based on the bounding box distances and the graphic distances, determining the target graphics that meet the edge-sharing standard.
[0009] In one example, based on the preset edge-sharing strategy, determining the processing methods corresponding to each discrete edge specifically includes: determining the target graphics corresponding to the discrete edges including line segment types; obtaining the lengths, parallel relationships, direction relationships, and position relationships of each discrete edge in the target graphics; and based on the lengths, parallel relationships, direction relationships, and position relationships of each discrete edge, determining the processing methods corresponding to each discrete edge.
[0010] In one example, based on the processing methods corresponding to each discrete edge, forming the discrete edges into edge-sharing graphics specifically includes: determining the intermediate edges corresponding to the processed discrete edges; based on the merging algorithm strategy, merging adjacent intermediate edges to construct edge-sharing graphics; using the edge closest to the previous edge-sharing graphics as the first edge of the current edge-sharing graphics; and based on the distances between the starting point and the ending point of the first edge and the ending point of the previous edge-sharing graphics respectively, determining the order of each edge within the current edge-sharing graphics.
[0011] In one example, after forming the discrete edges into edge-sharing graphics based on the processing methods corresponding to each discrete edge, the method further includes: cyclically traversing all the graphics within the to-be-edge-sharing graphics to determine the to-be-edge-sharing graphics corresponding to the edge-sharing graphics; assigning the process information, layer information, and the internal graphics contained within the original graphics corresponding to the to-be-edge-sharing graphics to the edge-sharing graphics; merging all the edge-sharing graphics into an edge-sharing group graphics, and performing cutting based on the edge-sharing group graphics.
[0012] In one example, the merging of all the co-edge figures into a co-edge group figure and the cutting based on the co-edge group figure specifically include: based on the preset co-edge strategy, determining whether the co-edge figures of different layers can be co-edged; if the co-edge figures of different layers can be co-edged, merging all the co-edge figures into a co-edge group figure, and the layer of the co-edge group figure is the layer with the most figures in the co-edge figure set; if the co-edge figures of different layers cannot be co-edged, based on the layer information, implementing the co-edge strategy for the co-edge figures and different layers respectively, and the layer of the co-edge group figure is the layer where the corresponding co-edge figure is located.
[0013] The present application also provides a design device for C-shaped co-edge figures, including: a preparation module, which acquires a co-edge figure set to be co-edged and a preset co-edge strategy; a nesting module, which solves the nesting relationship between the co-edge figures to be co-edged to determine the outer frame figure inside the co-edge figures to be co-edged and the inner hole figure contained inside the outer frame figure; a sorting module, which sorts the outer frame figure and the inner hole figure respectively to obtain a first outer frame figure order and a second inner hole figure order set; the second inner hole figure order set contains the inner hole figure order corresponding to each outer frame figure; a judgment module, which determines the target figure meeting the co-edge standard based on the first outer frame figure order and the second inner hole figure order set; a discretization module, which discretizes the target figure into a plurality of discrete edges; a processing module, which determines the processing method corresponding to each discrete edge based on the preset co-edge strategy, and the processing method includes at least one of retention, deletion, and reconstruction; a co-edge module, which forms the discrete edges into co-edge figures based on the processing methods corresponding to the discrete edges.
[0014] The present application also provides a design device for a C-shaped common-edge graph, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to perform: obtaining a set of graphs to be common-edged and a preset common-edge strategy; solving the nesting relationship between the graphs to be common-edged to determine the outer-frame graph within the graphs to be common-edged and the inner-hole graph contained within the outer-frame graph; sorting the outer-frame graph and the inner-hole graph respectively to obtain a first outer-frame graph order and a second inner-hole graph order set; the second inner-hole graph order set contains the inner-hole graph order corresponding to each outer-frame graph; determining a target graph that meets the common-edge standard based on the first outer-frame graph order and the second inner-hole graph order set; discretizing the target graph into a plurality of discrete edges; determining the processing method corresponding to each discrete edge based on the preset common-edge strategy, the processing method including at least one of retention, deletion, and reconstruction; and assembling the discrete edges into a common-edge graph based on the processing methods corresponding to the respective discrete edges.
[0015] The present application also provides a non-volatile computer storage medium storing computer-executable instructions, characterized in that the computer-executable instructions are set to: obtain a set of graphs to be common-edged and a preset common-edge strategy; solve the nesting relationship between the graphs to be common-edged to determine the outer-frame graph within the graphs to be common-edged and the inner-hole graph contained within the outer-frame graph; sort the outer-frame graph and the inner-hole graph respectively to obtain a first outer-frame graph order and a second inner-hole graph order set; the second inner-hole graph order set contains the inner-hole graph order corresponding to each outer-frame graph; determine a target graph that meets the common-edge standard based on the first outer-frame graph order and the second inner-hole graph order set; discretize the target graph into a plurality of discrete edges; determine the processing method corresponding to each discrete edge based on the preset common-edge strategy, the processing method including at least one of retention, deletion, and reconstruction; and assemble the discrete edges into a common-edge graph based on the processing methods corresponding to the respective discrete edges.
[0016] The method proposed in this application can bring the following beneficial effects: The novel common-edge strategy proposed by the present invention is efficient and stable. It can distinguish in advance whether common-edge operation can be performed according to the characteristics of the graphics, only retain the graphics that can perform common-edge operation, accurately identify the shared edges between the graphics, reduce the operation of cutting the shared edges multiple times during the cutting process, improve the cutting efficiency while reducing the wear of the cutting tool during the cutting process, reduce the use of cutting materials, and save costs. At the same time, this strategy sets multiple sorting methods, selects different sorting methods according to different scenarios, reduces the empty movement process during the common-edge process, shortens the path length between parts, accelerates the entire production process, and improves the production efficiency during cutting. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application, and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application, and do not constitute an improper limitation of the present application. In the drawings:
[0018] Figure 1 It is a schematic flow chart of a design method for a C-shaped common-edge graphic in an embodiment of the present application;
[0019] Figure 2 It is a schematic flow chart of a process for determining a nesting relationship in an embodiment of the present application;
[0020] Figure 3 It is a schematic diagram of a sorting step in an embodiment of the present application;
[0021] Figure 4 It is a schematic diagram of a step for adding an extension line in an embodiment of the present application;
[0022] Figure 5 It is a schematic structural diagram of a design device for a C-shaped common-edge graphic in an embodiment of the present application;
[0023] Figure 6 It is a schematic structural diagram of a design device for a C-shaped common-edge graphic in an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0024] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0025] The following will describe in detail the technical solutions provided by each embodiment of the present application in conjunction with the drawings.
[0026] Figure 1 A flowchart of a design method for a C-shaped common-edge pattern provided for one or more embodiments of this specification. This method can be applied to the field of laser cutting. This process can be executed by a computing device in the corresponding field (such as a control module in a laser cutting device, etc.). Some input parameters or intermediate results in the process allow manual intervention and adjustment to help improve accuracy.
[0027] Both C-shaped common-edge and grid common-edge are common-edge strategies, but the application scenarios of the two strategies may be different. The grid common-edge strategy arranges patterns using a grid layout and is suitable for processing simple and relatively regular patterns, with low flexibility; C-shaped common-edge is similar to the existence of a C-shaped shared boundary between parts, pays more attention to the geometric relationship between patterns, is suitable for arranging complex patterns, has stronger adaptability, and the material utilization rate is also higher.
[0028] The implementation of the analysis method involved in the embodiments of this application can be a terminal device or a server, and this application does not make special restrictions on this. For the convenience of understanding and description, the following embodiments will be described in detail using a server as an example.
[0029] It should be noted that this server can be a single device or a system composed of multiple devices, that is, a distributed server, and this application does not make specific limitations on this.
[0030] As Figure 1 shown, the embodiments of this application provide a design method for a C-shaped common-edge pattern, including:
[0031] S101: Obtain a set of patterns to be common-edged and a preset common-edge strategy.
[0032] First, the server obtains a set of patterns to be common-edged uploaded by the staff and a preset common-edge strategy. It should be noted that the patterns obtained by importing the drawing patterns, the patterns imported from the part library, the manually drawn patterns, etc. can all be used as the patterns to be common-edged. When the user uploads a preset common-edge strategy, the user can select the C-shaped common-edge function to pop up a common-edge strategy setting interface to set strategies such as the processing order, the sorting of inner holes, and whether different layers are supported for common-edge.
[0033] S102: Solve the nesting relationship between the patterns to be common-edged to determine the outer frame pattern within the patterns to be common-edged and the inner hole patterns contained within the outer frame pattern.
[0034] The reason for solving the nesting relationship to obtain the outer frame and inner hole patterns here is that during cutting, a part contains an inner hole pattern and an outer frame pattern. All inner hole patterns need to be cut before cutting the outer frame pattern, which can prevent the part from falling off due to cutting the outer frame first and making it impossible to cut the inner hole pattern.
[0035] Specifically, asFigure 2 As shown, when solving the nested relationship, it is necessary to determine the closed figures and non-closed figures in the figures to be edge-sharing, solve the bounding boxes corresponding to the non-closed figures, and then sort the areas of the bounding boxes of the non-closed figures and the areas of the closed figures to obtain the first intermediate figure set. The first intermediate figure set here includes the bounding boxes of the non-closed figures and the closed figures. By cyclically traversing the first intermediate figure set, the inclusion relationships of the figures in the first intermediate figure set are determined, and based on the inclusion relationships, the outer frame figures within the figures to be edge-sharing and the inner hole figures contained within the outer frame figures are determined. Specifically, the sorted figures can be cyclically traversed to judge the overlapping relationship between the bounding box of the current figure and the bounding boxes of all figures smaller than the area of the current figure. If there is no overlap at all, the two figures are not in an inclusion relationship. For example, if the maximum coordinates of the bounding box of the current figure are Amax(aXmax, aYmax, 0) and the minimum coordinates are Amin(aXmin, bYmin, 0); the maximum coordinates of the bounding box of the smaller figure are Bmax(bXmax, bYmax, 0) and the minimum coordinates are Bmin(bXmin, bYmin, 0); if aXmin is greater than bXmax, it means there is no overlapping relationship between the two figures; if bXmin is greater than aXmax, it means there is no overlapping relationship between the two figures; if aYmin is greater than bYmax, then there is no overlapping relationship between the two figures; if bYmin is greater than aYmax, then there is no overlapping relationship between the two figures; except for the above situations, it can be judged that the two figures overlap. If there is an overlapping relationship, continue to use the OpenCascade library to solve whether there is an intersection figure between the figures. If there is an intersection, it can be judged that the two figures are in an inclusion relationship.
[0036] S103: Sort the outer frame figures and the inner hole figures respectively to obtain the first outer frame figure order and the second inner hole figure order set; the second inner hole figure order set contains the inner hole figure order corresponding to each outer frame figure.
[0037] Sorting, on the one hand, ensures that the obtained parts can be arranged in order, which can be more accurate when judging whether two parts can share an edge. After arranging, the inner hole arrangement is no longer chaotic, and the idle movement process of the cutting tool becomes standardized, reducing the idle movement path process. This is also the difference between the grid strategy and the C-type strategy. The grid does not require sorting, and the C-type must be sorted before subsequent edge-sharing processing can be carried out.
[0038] Among them, the sorting options for the outer frame graphics include from bottom to top, from top to bottom, from left to right, diagonal diffusion, and stepped diffusion; the sorting options for the inner hole graphics include from bottom to top, from top to bottom, from left to right, from right to left, and local shortest path. If only the outer frame graphics exist or the number of graphics included in the outer frame graphics is 1, then only the outer frame graphics are sorted. If the outer frame graphics exist and the number of graphics included in the outer frame is greater than 1, then the outer frame graphics and the inner hole graphics included in the outer frame need to be sorted.
[0039] As Figure 3 shown, taking the sorting from bottom to top as an example, the sorting steps include:
[0040] Obtain the lowest point coordinates L(Xmin, Ymin) of the bounding box of each graphic; sort the graphics from smallest to largest according to the size of Ymin; traverse all the Ymin values, set a tolerance value, and group the Ymin values whose current Ymin value is within the tolerance range of the previous Ymin value and the subsequent Y value. The grouped Ymin values will not participate in subsequent grouping, and so on for grouping; when the index of the Ymin grouping is odd, sort the graphics from smallest to largest according to the value of Xmin; when the index of the Ymin grouping is even, sort the graphics from largest to smallest according to the value of Xmin.
[0041] S104: Based on the order of the first outer frame graphics and the set of the order of the second inner hole graphics, determine the target graphics that meet the common edge standard.
[0042] In one embodiment, the common-edge criteria here include multiple criteria, and only when all are satisfied can it be used as the target graphic. Specifically, first, it is necessary to obtain the bounding boxes of the two graphics and determine whether the distance between the bounding boxes is less than or equal to the set minimum common-edge distance of 0.1. If it is less than or equal to the set minimum common-edge distance of 0.1, it means that the two graphics meet the distance requirement of the bounding boxes. Specifically, when determining the distance between the bounding boxes, it is necessary to obtain the information of the graphic bounding boxes that has been saved when solving the graphic nesting relationship. If the maximum coordinates of one graphic bounding box are Cmax(cXmax, cYmax, 0), the minimum coordinates are Cmin(cXmin, cYxmin, 0), the maximum coordinates of the other graphic bounding box are Dmax(dXmax, dYmax, 0), and the minimum coordinates are Dmin(dXmin, dYmin, 0); when cXmin - dXmax > 0.1, or cYmin - dYmax > 0.1, or dXmin - cXmax > 0.1, or dYmin - cYmax > 0.1, it means that the distance between the two graphic bounding boxes is greater than 0.1. Except for the above situations, the distance between the two graphic bounding boxes is less than or equal to 0.1. After determining the distance between the bounding boxes, if the distance between the bounding boxes is less than or equal to the minimum common-edge distance, continue to determine the distance between the two graphics. If the distance is greater than the minimum common-edge distance, then the two graphics cannot be co-edged. If the distance between the two graphics is less than or equal to the minimum common-edge distance, then the two graphics meet the common-edge criteria; if it is greater than the minimum common-edge distance, the two graphics cannot be co-edged.
[0043] S105: Discretize the target graphic into multiple discrete edges.
[0044] If the two graphics meet the common-edge criteria, discretize the graphics into edges, and determine the type and length of the edges, as well as the relationship between the edges of the two graphics, so as to determine whether the common-edge strategy is satisfied. Specifically, first, determine the types of the discrete edges of the two target graphics respectively. If there are no discrete edges of the line segment type, then the two target graphics cannot be co-edged. If there are discrete edges of the line segment type, then continue to determine the lengths of the edges of the two graphics. If the lengths of the discrete edges are all less than the minimum common-edge length, then the two target graphics cannot be co-edged. If both of the two target graphics have discrete edges of the line segment type and the lengths of the line segments are greater than or equal to the minimum common-edge length, then continue to determine the relationship between the discrete edges of the two target graphics.
[0045] S106: Based on the preset common-edge strategy, determine the processing methods corresponding to each discrete edge, and the processing methods include at least one of retaining, deleting, and reconstructing.
[0046] In one embodiment, when determining the processing method of discrete edges, it is necessary to determine the target graph corresponding to the discrete edges including line segment types; obtain the lengths, parallel relationships, direction relationships, and position relationships of the discrete edges in the target graph; and determine the processing methods corresponding to the discrete edges based on the lengths, parallel relationships, direction relationships, and position relationships of the discrete edges.
[0047] Specifically, the above-mentioned preset common-edge strategy may include: respectively traversing all the edges of the two graphs in a loop, taking one edge from each of the two graphs, and determining whether the two currently obtained edges are parallel; if all the edges between the two graphs are not parallel, then the two graphs cannot share a common edge; if two edges between the two graphs are not parallel, then these two edges are not processed; if two edges between the two graphs are parallel, determine whether the directions of the two edges are the same; and respectively determine the position relationships between the two edges according to whether the directions of the edges are consistent. According to the position relationships and directions, the parallel edges are processed such as being retained, deleted, reconstructed, etc. to construct new edges. Among them, a flag bit is set for the common-edge edges, and the default flag bit is 0. When it is determined that two edges can share a common edge, the first edge is set to 1 and the second edge is set to 2. If the flag bit has already been set to 2, the flag bit setting is no longer performed. If the second edge is split and reset, the flag bit setting is also no longer performed.
[0048] If the directions of the two edges are the same, first determine whether the starting points and ending points of the two edges coincide. If all the starting and ending points coincide, then set the flag bit of the first edge to 1 and the flag bit of the second edge to 2; if the starting points coincide and the ending points do not coincide, determine the length sizes of the two edges. If the length of the first edge is greater than the length of the second edge, set the flag bit of the first edge to 1 and the flag bit of the second edge to 2; if the length of the first edge is less than the length of the second edge, set the flag bit of the first edge to 1, reconstruct the second edge, use the ending point of the first edge as the starting point, and the ending point of the second edge as the ending point to construct a new line segment to generate a new edge.
[0049] If the ending points coincide and the starting points do not coincide, determine the length sizes of the two edges. If the length of the first edge is greater than the second edge, set the flag bit of the first edge to 1 and the flag bit of the second edge to 2; if the length of the first edge is less than the length of the second edge, set the flag bit of the first edge to 1, reconstruct the second edge, use the starting point of the first edge as the ending point, and the starting point of the second edge as the starting point to reconstruct a new line segment to generate a new edge.
[0050] If the starting and ending points of two edges do not coincide, set the flag bit of the first edge to 1, and determine whether the starting and ending points of the second edge are on the first edge. If both the starting and ending points of the second edge are on the first edge, set the flag bit of the second edge to 2; if the starting point of the second edge is on the first edge and does not coincide with the ending point of the first edge, and the ending point is not on the first edge, reconstruct the second edge, using the starting point of the first edge as the starting point and the ending point of the second edge as the ending point to construct a new line segment to generate a new edge; if the starting point of the second edge is not on the first edge and the ending point is on the first edge, reconstruct the second edge, using the starting point of the second edge as the starting point and the starting point of the first edge as the ending point to reconstruct a new line segment to generate a new edge; if neither the starting nor the ending point of the second edge is on the first edge but both the starting and ending points of the first edge are on the second edge, delete the second edge and reconstruct two new edges, using the starting point of the second edge as the starting point and the starting point of the first edge as the ending point to construct a new edge, and using the ending point of the first edge as the starting point and the ending point of the second edge as the ending point to construct a new edge.
[0051] If they are not the same, determine whether the starting point of the first edge coincides with the ending point of the second edge, and whether the ending point of the first edge coincides with the starting point of the second edge. If the starting point of the first edge coincides with the ending point of the second edge and the ending point of the first edge coincides with the starting point of the second edge, set the flag bit of the first edge to 1 and the flag bit of the second edge to 2.
[0052] If the starting point of the first edge coincides with the ending point of the second edge and the ending point of the first edge does not coincide with the starting point of the second edge, set the flag bit of the first edge to 1. Determine the lengths of the two edges. If the length of the first edge is greater than the length of the second edge, set the flag bit of the second edge to 2; if the length of the first edge is less than the length of the second edge, reconstruct the second edge, using the starting point of the second edge as the starting point and the ending point of the first edge as the ending point to construct a new line segment to generate a new edge.
[0053] If the ending point of the first edge coincides with the starting point of the second edge and the starting point of the first edge does not coincide with the ending point of the second edge, set the flag bit of the first edge to 1. Determine the lengths of the two edges. If the length of the first edge is greater than the length of the second edge, set the flag bit of the second edge to 2; if the length of the first edge is less than the length of the second edge, reconstruct the second edge, using the starting point of the first edge as the starting point and the ending point of the second edge as the ending point to construct a new line segment as a new edge.
[0054] If the starting point of the first edge does not coincide with the ending point of the second edge, and the ending point of the first edge does not coincide with the starting point of the second edge, set the flag bit of the first edge to 1. Determine whether both the starting point and the ending point of the second edge are on the first edge. If both are on the first edge, set the flag bit of the second edge to 2; if the ending point of the second edge is on the first edge and this ending point does not coincide with the ending point of the first edge, reconstruct the second edge, use the starting point of the second edge as the starting point of the new line segment, and the ending point of the first edge as the ending point of the new line segment to construct a new line segment as the new edge; if the starting point of the second edge is on the first edge, reconstruct the second edge, use the starting point of the first edge as the starting point of the new line segment, and the ending point of the second edge as the ending point of the new line segment to generate a new edge; if neither the starting point nor the ending point of the second edge is on the first edge, but the starting point and the ending point of the first edge are on the second edge, delete the second edge and reconstruct two new edges, respectively use the starting point of the second edge as the starting point and the ending point of the first edge as the ending point to construct a new edge, and use the starting point of the first edge as the starting point and the ending point of the second edge as the ending point to construct another new edge.
[0055] S107: Based on the processing methods corresponding to the discrete edges, form the discrete edges into a common-edge graph.
[0056] When processing each discrete edge, according to the flag bit situation, delete the edge with the flag bit of 2. Reorganize and construct all discrete edges. Among them, the discrete edges that have not undergone common-edge still belong to the original graph (the graph to be common-edged), the edges with the flag bit of 1 belong to the first graph, and the reconstructed edges belong to the second graph. According to the merging algorithm strategy, merge the adjacent edges and reconstruct them respectively to generate a new common-edge graph.
[0057] In one embodiment, after saving all the reconstructed graphs, it is necessary to loop through all the common-edge graphs to judge the distance between the starting point and the ending point of each edge of the current common-edge graph and the ending point of the previous common-edge graph. The nearest edge is used as the first edge of the graph. If the starting point is the nearest to the ending point of the previous common-edge graph, then this edge is not reversed. If the ending point is the nearest to the ending point of the previous common-edge graph, then this edge is reversed. Reverse and sort the other edges in the clockwise or counterclockwise order of the first edge. After the sorting is completed, the construction of the common-edge graph is completed.
[0058] In one embodiment, after obtaining the common-edge graph, it is necessary to loop through the graph before the common-edge strategy is performed, find the original graph with the same ID as the currently newly generated graph, and assign the process, layer, and internal graph contained in the original graph to the newly generated graph; the newly generated graphs are merged into a common-edge group graph, and the efficient C-type common-edge operation is completed. When performing laser cutting, the cutting can be carried out based on the process parameters of the common-edge group graph.
[0059] In addition, in the nesting software of the present invention, the user can set the graphics of different layers, and the obtained graphics may be on different layers. According to the nesting rules in the nesting software, the marking layer does not participate in the common-edge processing. Therefore, the graphics of the marking layer need to be excluded before the common-edge processing. When setting the common-edge strategy, the user can choose whether to perform the common-edge between different layers according to the needs. Before solving the graphic nesting relationship, it is judged whether the user has checked the option of whether the common-edge between different layers can be performed. If the option of the common-edge between different layers is not checked, then the common-edge strategy needs to be implemented layer by layer. When constructing a new common-edge group, the layer of the new graphic is the layer where the original graphic is located before the common-edge; if the option of the common-edge between different layers is checked, then all the graphics except the marking layer are subjected to the common-edge, and the layer of the new graphic is the layer with the largest number of original graphics included.
[0060] The common-edge strategy in the present invention also supports settings such as point common-edge, starting point extension, preventing plate collision, and border priority. The user can set these functions according to the needs. When the user checks the option of supporting point common-edge, it is judged whether there are intersections between the graphics. If there are intersections, then the common-edge can be performed to generate a combined graphic with common edges.
[0061] The specific steps for judging whether there are intersections between the graphics include:
[0062] After processing parallel edges such as retaining, deleting, and reconstructing them according to the positional relationship and direction, it is determined whether there are intersections between the edges. First, a rough judgment is made to determine the size relationship between the starting points and ending points of the two edges: Assume that the starting point of the first edge is S1(sX1, sY1, 0), the ending point is F1(fX1, fY1, 0), the starting point of the second edge is S2(sX2, sY2, 0), and the ending point is F2(fX2, fY2, 0). Obtain the maximum value X1max of sX1 and fX1 and the minimum value X2min of sX2 and fX2. If X1max is less than X2min, it means there is no intersection between the two edges; obtain the maximum value Y1max of sY1 and fY2 and the minimum value Y2min of sY2 and fY2. If Y1max is less than Y2min, it means there is no intersection between the two edges; obtain the minimum value X1min of sX1 and fX1 and the maximum value X2max of sX2 and fX2. If X1min is greater than X2max, it means there is no intersection between the two edges; obtain the minimum value Y1min of sY1 and fY1 and the maximum value Y2nax of sY2 and fY2. If Y1min is greater than Y2max, it means there is no intersection between the two edges; if none of the above conditions are met, it means there may be an intersection between the two edges, and the vector cross product algorithm is used for judgment: If the value of ((sX1 - sX2) * (fY2 - sY2) - (sY1 - sY2) * (fX2 - sX2)) * ((fX1 - sX2) * (fY2 - sY2) - (fY1 - sY2) * (fX2 - sX2)) is greater than 0, it means there is no intersection between the two edges; if the value of ((sX2 - sX1) * (fY1 - sY1) - (sY2 - sY1) * (fX1 - sX1)) * ((fX2 - sX1) * (fY1 - sY1) - (fY2 - sY1) * (fX1 - sX1)) is greater than 0, it means there is no intersection between the two edges; otherwise, there is an intersection between the two edges.
[0063] When the user checks the option of extending the starting point, the user can set the size of the extension length and add an extension line at the starting point of the first edge on the first co - edge figure. As Figure 4 shown, the specific steps for adding the extension line include: obtaining the starting point coordinates of the first edge on the first co - edge figure; obtaining the unit vector of the tangent direction at the starting point coordinates; multiplying the extension length by the unit vector to obtain the extension vector; subtracting the extension vector from the starting point coordinates to obtain the starting point of the extension line; constructing the extension line based on the starting point coordinates of the extension line and the starting point coordinates of the figure.
[0064] When the user checks the option to prevent the collision plate, during the process of reconstructing all the edges, the operation where the edges with a flag bit of 1 belong to the first figure and the reconstructed edges belong to the second figure is changed to the edges with a flag bit of 1 belonging to the second figure and the reconstructed edges belonging to the first figure, and this operation completes the setting of preventing the collision plate.
[0065] When the user checks the option of border priority, during the process of reconstructing all the edges, according to the merging algorithm strategy, adjacent edges are merged and new figures are respectively reconstructed. Among these new figures, the one with the largest number of edges is the outer frame figure. When sorting, the outer frame figure is sorted first, and then the other edge figures are sorted.
[0066] From the above technical solutions, it can be seen that the present invention has the following advantages: The novel common-edge strategy proposed by the present invention is efficient and stable. It can pre-distinguish and judge whether common-edge operations can be performed according to the characteristics of the figures, only retain the figures that can perform common-edge operations, accurately identify the shared edges between the figures, reduce the operation of repeatedly cutting the shared edges during the cutting process, improve the cutting efficiency while reducing the wear of the cutting tool during the cutting process and reducing the use of cutting materials, thus saving costs.
[0067] At the same time, this strategy sets multiple sorting methods, selects different sorting methods according to different scenarios, reduces the empty movement process during the common-edge process, shortens the path length between parts, accelerates the entire production process, and improves the production efficiency during cutting.
[0068] As Figure 5 shown, the embodiment of the present application also provides a design device for a C-shaped common-edge figure, including:
[0069] A preparation module 501, which obtains a set of figures to be common-edged and a preset common-edge strategy.
[0070] A nesting module 502, which solves the nesting relationship between the figures to be common-edged to determine the outer frame figure within the figures to be common-edged and the inner hole figures contained within the outer frame figure.
[0071] A sorting module 503, which sorts the outer frame figure and the inner hole figures respectively to obtain a first outer frame figure order and a second set of inner hole figure orders; the second set of inner hole figure orders contains the inner hole figure orders corresponding to each outer frame figure.
[0072] A judgment module 504, which determines the target figures that meet the common-edge standard based on the first outer frame figure order and the second set of inner hole figure orders.
[0073] A discretization module 505, which discretizes the target figures into multiple discrete edges.
[0074] The processing module 506 determines the processing methods corresponding to each discrete edge based on the preset common-edge strategy, and the processing methods include at least one of retention, deletion, and reconstruction.
[0075] The common-edge module 507 forms the discrete edges into common-edge graphics based on the processing methods corresponding to the discrete edges.
[0076] As Figure 6 shown, an embodiment of the present application further provides a design device for a C-shaped common-edge graphic, including:
[0077] At least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:
[0078] Obtain a set of graphics to be common-edged and a preset common-edge strategy; solve the nesting relationship between the graphics to be common-edged to determine the outer frame graphics within the graphics to be common-edged and the inner hole graphics contained within the outer frame graphics; sort the outer frame graphics and the inner hole graphics respectively to obtain a first outer frame graphic order and a second set of inner hole graphic orders; the second set of inner hole graphic orders contains the inner hole graphic orders corresponding to each outer frame graphic; determine target graphics that meet the common-edge standard based on the first outer frame graphic order and the second set of inner hole graphic orders; discretize the target graphics into multiple discrete edges; determine the processing methods corresponding to the discrete edges based on the preset common-edge strategy, and the processing methods include at least one of retention, deletion, and reconstruction; form the discrete edges into common-edge graphics based on the processing methods corresponding to the discrete edges.
[0079] An embodiment of the present application further provides a non-volatile computer storage medium storing computer-executable instructions, and the computer-executable instructions are set as:
[0080] Obtain a set of graphics to be common-edged and a preset common-edge strategy; solve the nesting relationship between the graphics to be common-edged to determine the outer frame graphics within the graphics to be common-edged and the inner hole graphics contained within the outer frame graphics; sort the outer frame graphics and the inner hole graphics respectively to obtain a first outer frame graphic order and a second set of inner hole graphic orders; the second set of inner hole graphic orders contains the inner hole graphic orders corresponding to each outer frame graphic; determine target graphics that meet the common-edge standard based on the first outer frame graphic order and the second set of inner hole graphic orders; discretize the target graphics into multiple discrete edges; determine the processing methods corresponding to the discrete edges based on the preset common-edge strategy, and the processing methods include at least one of retention, deletion, and reconstruction; form the discrete edges into common-edge graphics based on the processing methods corresponding to the discrete edges.
[0081] Each embodiment in this application is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for the relevant parts, reference can be made to the partial description of the method embodiments.
[0082] The devices and media provided in the embodiments of this application correspond one-to-one with the methods. Therefore, the devices and media also have beneficial technical effects similar to those of their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be elaborated here.
[0083] Those skilled in the art should understand that the embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0084] This application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of this application. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the specified functions in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0085] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implements the specified functions in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0086] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or steps for implementing the functions specified in multiple blocks.
[0087] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0088] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM) and / or non-volatile memory such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0089] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can store information by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.
[0090] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the presence of additional identical elements in the process, method, commodity or device comprising the element.
[0091] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. A design method for a C-shaped common edge pattern, characterized in that: include: Obtain the graphics set to be shared edge and preset the shared edge strategy; Solving the nesting relationship between the graphics to be shared edges, so as to determine the outer frame graphics within the graphics to be shared edges and the inner hole graphics contained in the outer frame graphics; The outer frame graphics and the inner hole graphics are sorted respectively to obtain a first outer frame graphics sequence and a second inner hole graphics sequence set; the second inner hole graphics sequence set contains an inner hole graphics sequence corresponding to each outer frame graphics; Determining a target graphic that meets a common edge standard based on the first outer frame graphic sequence and the second inner hole graphic sequence set; Discretize the target graph into a plurality of discrete edges; Based on the preset common edge strategy, determining a processing method corresponding to each discrete edge, the processing method including at least one of retaining, deleting and reconstructing; Based on the processing methods corresponding to the discrete edges, the discrete edges are organized into a common edge graph.
2. The method according to claim 1, characterized in that The step of solving the nesting relationship between the graphics to be edged together to determine the outer frame graphics within the graphics to be edged together and the inner hole graphics contained within the outer frame graphics specifically includes: Determine the closed figures and the non-closed figures in the figures to be shared edges, and solve the bounding box corresponding to the non-closed figures; sorting the bounding box areas of the non-closed figures and the closed figures to obtain a first intermediate figure set, wherein the first intermediate figure set includes the bounding boxes of the non-closed figures and the closed figures; The first intermediate graphic set is traversed in a loop to determine the inclusion relationship of each graphic in the first intermediate graphic set; Based on the inclusion relationship, an outer frame figure within the to-be-shared-edge figure and an inner hole figure included in the outer frame figure are determined.
3. The method according to claim 1, characterized in that The determining of the target graphics meeting the common edge standard based on the first outer frame graphics sequence and the second inner hole graphics sequence set specifically includes: Get the bounding box of each outer frame graphic; Based on the first outer frame graphic sequence, the outer frame graphics are traversed in a loop to obtain bounding box distances and graphic distances between the outer frame graphics; Based on the bounding box distance and the graphic distance, a target graphic that meets the common edge standard is determined.
4. The method according to claim 1, characterized in that Determining the processing method corresponding to each discrete edge based on the preset common edge strategy specifically includes: Determine the target graph corresponding to the discrete edge containing the line segment type; Obtaining the length, parallel relationship, direction relationship and position relationship of each discrete edge in the target graph; Based on the length, parallel relationship, direction relationship and position relationship of each discrete edge, a processing method corresponding to each discrete edge is determined.
5. The method according to claim 1, characterized in that The step of assembling the discrete edges into a common edge graph based on the processing method corresponding to each discrete edge specifically includes: Determine the intermediate edges corresponding to the processed discrete edges; Based on a merging algorithm strategy, the adjacent intermediate edges are merged to construct a common edge graph; The edge of the current co-edge graph closest to the previous co-edge graph is used as the first edge of the current co-edge graph; The order of the edges in the current co-edge graphic is determined based on the distances between the start point and the end point of the first edge and the end point of the previous co-edge graphic.
6. The method according to claim 1, characterized in that After the discrete edges are organized into a common edge graph based on the processing methods corresponding to the discrete edges, the method further includes: Loop through all the graphics in the graphics to be shared edge, and determine the graphics to be shared edge corresponding to the graphics to be shared edge; Assigning process information, layer information corresponding to the to-be-coplanarized graphics and internal graphics contained in the original graphics to the coplanarized graphics; All the common edge graphics are merged into a common edge group graphic, and cutting is performed according to the common edge group graphic.
7. The method according to claim 6, characterized in that The step of merging all the co-edge graphics into a co-edge group graphic and performing cutting according to the co-edge group graphic specifically includes: Based on the preset co-edge strategy, determining whether the graphics to be co-edged on different layers can be co-edged; If the graphics to be shared by edges of different layers can be shared by edges, then all the graphics to be shared by edges are merged into a group of graphics to be shared by edges, and the layer of the group of graphics to be shared by edges is the layer containing the most graphics in the set of graphics to be shared by edges; If the graphics to be shared by different layers cannot share edges, based on the layer information, the sharing strategies are respectively implemented for the graphics to be shared by different layers, and the layer of the sharing group graphics is the layer where the corresponding graphics to be shared by are located.
8. A design device for a C-shaped common edge pattern, characterized in that: include: Preparation module, obtaining the graphics set to be shared edge and presetting the shared edge strategy; A nesting module is used to solve the nesting relationship between the graphics to be shared edges, so as to determine the outer frame graphics within the graphics to be shared edges and the inner hole graphics contained in the outer frame graphics; A sorting module, sorting the outer frame graphics and the inner hole graphics respectively to obtain a first outer frame graphics sequence and a second inner hole graphics sequence set; the second inner hole graphics sequence set includes an inner hole graphics sequence corresponding to each outer frame graphics; A judgment module, based on the first outer frame graphic sequence and the second inner hole graphic sequence set, determines a target graphic that meets the common edge standard; A discretization module discretizes the target graph into a plurality of discrete edges; A processing module, based on the preset common edge strategy, determines a processing method corresponding to each discrete edge, wherein the processing method includes at least one of retaining, deleting and reconstructing; The common edge module organizes the discrete edges into a common edge graph based on the processing methods corresponding to the discrete edges.
9. A design device for a C-shaped common edge pattern, characterized in that: include: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute: Obtain the graphics set to be shared edge and preset the shared edge strategy; Solving the nesting relationship between the graphics to be shared edges, so as to determine the outer frame graphics within the graphics to be shared edges and the inner hole graphics contained in the outer frame graphics; The outer frame graphics and the inner hole graphics are sorted respectively to obtain a first outer frame graphics sequence and a second inner hole graphics sequence set; the second inner hole graphics sequence set contains an inner hole graphics sequence corresponding to each outer frame graphics; Determining a target graphic that meets a common edge standard based on the first outer frame graphic sequence and the second inner hole graphic sequence set; Discretize the target graph into a plurality of discrete edges; Based on the preset common edge strategy, determining a processing method corresponding to each discrete edge, the processing method including at least one of retaining, deleting and reconstructing; Based on the processing methods corresponding to the discrete edges, the discrete edges are organized into a common edge graph.
10. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions are configured to: Obtain the graphics set to be shared edge and preset the shared edge strategy; Solving the nesting relationship between the graphics to be shared edges, so as to determine the outer frame graphics within the graphics to be shared edges and the inner hole graphics contained in the outer frame graphics; The outer frame graphics and the inner hole graphics are sorted respectively to obtain a first outer frame graphics sequence and a second inner hole graphics sequence set; the second inner hole graphics sequence set contains an inner hole graphics sequence corresponding to each outer frame graphics; Determining a target graphic that meets a common edge standard based on the first outer frame graphic sequence and the second inner hole graphic sequence set; Discretize the target graph into a plurality of discrete edges; Based on the preset common edge strategy, determining a processing method corresponding to each discrete edge, the processing method including at least one of retaining, deleting and reconstructing; Based on the processing methods corresponding to the discrete edges, the discrete edges are organized into a common edge graph.