Graphics merging method, device, equipment and storage medium

By calculating the intersection points of contour lines and chamfering the inflection points during the graphics merging process, the problem of low graphics merging accuracy is solved, and more efficient and smooth graphics processing is achieved.

CN114119809BActive Publication Date: 2025-09-19SUZHOU INOVANCE CONTROL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111291498.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-02
Publication Date
2025-09-19
Estimated Expiration
2041-11-02

AI Technical Summary

Technical Problem

In the prior art, the merging accuracy of graphics is not high, resulting in poor processing efficiency and effect.

Method used

By obtaining the graphics to be processed, traversing each target contour line, calculating the intersection point, and chamfering the contour line based on the intersection point and the preset corner accuracy, the graphics are finally merged.

Benefits of technology

The accuracy of graphics merging is improved, and the smoothness and efficiency of processing trajectory are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114119809B_ABST
    Figure CN114119809B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of graphics processing technology, and discloses a graphics merging method, device, equipment and storage medium. The method includes: obtaining a graphics to be processed; traversing each target contour line in the graphics to be processed; calculating the intersection of each target contour line to obtain a corresponding intersection point; chamfering the inflection point of each target contour line based on the intersection point and a preset corner accuracy to obtain a target contour line after chamfering; and completing the merging of the graphics to be processed based on the chamfered target contour line. Through the above method, the intersection of each target contour line in the graphics to be processed is calculated, and the inflection point of each target contour line is chamfered based on the obtained intersection point and the preset corner accuracy. The chamfering of each target contour line completes the merging of the graphics to be processed, making the contour of the merged graphics more concise and smooth, improving the accuracy of the graphics merging, and being able to improve the processing efficiency and smoothness of the generated trajectory during graphics processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of graphics processing technology, and in particular to a graphics merging method, device, equipment and storage medium. Background Art

[0002] Market demand for computer-aided manufacturing (CAM) is rapidly growing, and CAM technology has been widely adopted in industries such as machinery, electronics, aerospace, chemicals, and construction. The CAM industry encompasses a wide range of sectors. Due to the close integration of CAM technology with robotics, most robot manufacturers develop their own offline programming software for robots. This offline programming software incorporates certain CAM functions, along with other features such as robot configuration and debugging, forming a comprehensive robotics PC platform software. CAM is a crucial and essential component of production line automation. 2D-CAM software assists in processing the surface machining data required for product manufacturing, integrating process information to generate post-processing files required by production equipment. Simultaneously, software enhancements are made to enhance user-friendliness, including CAD drawing, file processing, graphic editing, trajectory editing, tool setup, collision detection, and simulation. As CAM software for surface machining, 2D-CAM also has applications across multiple industries. For example, laser machining requires both offline 2D-CAM software for generating machining files and online 2D-CAM software for editing machining trajectories. Woodworking and textile processing also require CAM software for surface machining. Before generating processing data, 2D-CAM software needs to optimize the graphics. Graphic optimization directly affects the final processing effect. Graphic merging is an important operation in graphic optimization. Simple merging will not only increase duplicate lines, but also increase the number of jumps in the processing process, and cause jitter, seriously affecting processing efficiency and processing results.

[0003] The above content is only used to assist in understanding the technical solution of the present invention and does not constitute an admission that the above content is prior art. Summary of the Invention

[0004] The main purpose of the present invention is to provide a graphics merging method, device, equipment and storage medium, aiming to solve the technical problem of low merging accuracy when merging graphics in the prior art.

[0005] To achieve the above object, the present invention provides a method for merging graphics, the method comprising the following steps:

[0006] Get the graphics to be processed;

[0007] Traversing each target contour line in the graphics to be processed;

[0008] Calculating the intersection points of the target contour lines to obtain corresponding intersection points;

[0009] chamfering the inflection points of each target contour line based on the intersection point and a preset corner accuracy to obtain a chamfered target contour line;

[0010] The graphics to be processed are merged according to the target contour line after chamfering.

[0011] Optionally, obtaining the graphics to be processed includes:

[0012] Obtaining a target processing instruction, and extracting a graphic selection instruction and a graphic combination instruction from the target processing instruction;

[0013] Determine an initial graphic according to the graphic selection instruction;

[0014] Determine a target combination mode according to the graphic combination instruction;

[0015] The initial graphics are combined based on the target combination method to obtain corresponding graphics to be processed.

[0016] Optionally, after combining the initial graphics based on the target combination mode to obtain corresponding graphics to be processed, the method further includes:

[0017] Get user adding instruction;

[0018] Determine the corresponding adding position and target adding line according to the user adding instruction;

[0019] completing the addition of auxiliary lines to the to-be-processed graphic based on the adding position and the target adding line, thereby obtaining the to-be-processed graphic after the auxiliary lines are added;

[0020] The traversing each target contour line in the to-be-processed graphic includes:

[0021] Traverse each target contour line in the graphics to be processed after the auxiliary lines are added.

[0022] Optionally, combining the initial graphics based on the target combination mode to obtain corresponding graphics to be processed includes:

[0023] Determine the corresponding target processing method according to the target combination method;

[0024] The initial graphics are combined and processed by the target processing method to obtain the corresponding graphics to be processed.

[0025] Optionally, the merging of the graphics to be processed according to the chamfered target contour line includes:

[0026] Get the current distance between each target contour line;

[0027] Based on the intersection point, the target contour lines corresponding to the current distance less than the preset distance threshold are merged and connected to obtain a connected target contour line;

[0028] The graphics to be processed are merged according to the chamfered target contour line and the connected target contour line.

[0029] Optionally, the merging of the graphics to be processed according to the chamfered target contour line and the connected target contour line includes:

[0030] Check whether the user deletion instruction is obtained;

[0031] If the user deletion instruction is obtained, obtaining the position information of each target contour line;

[0032] Determine whether there is a target contour line with the same position information;

[0033] If there are target contour lines with the same position information, obtaining the repeated position information corresponding to the target contour lines with the same position information;

[0034] Deleting the target contour lines with the same position information until the number of target contour lines corresponding to the repeated position information reaches a preset number, thereby obtaining the deleted target contour lines;

[0035] The graphics to be processed are merged according to the chamfered target contour line, the connected target contour line, and the deleted target contour line.

[0036] Optionally, the merging of the graphics to be processed according to the chamfered target contour line, the connected target contour line, and the deleted target contour line includes:

[0037] Check whether the user discrete instruction is obtained;

[0038] If the user discrete instruction is obtained, determining discrete contour lines among the target contour lines according to the user discrete instruction;

[0039] Performing discretization processing on the discrete contour line based on a preset chopping process and a preset discretization distance to obtain a discretized target contour line;

[0040] The graphics to be processed are merged according to the chamfered target contour lines, the connected target contour lines, the deleted target contour lines and the discretized target contour lines.

[0041] In addition, to achieve the above-mentioned purpose, the present invention further provides a graphics merging device, the graphics merging device comprising:

[0042] An acquisition module, used to acquire graphics to be processed;

[0043] A traversal module, used for traversing each target contour line in the graphics to be processed;

[0044] A calculation module, configured to calculate the intersection points of the target contour lines to obtain corresponding intersection points;

[0045] a chamfering module, configured to chamfer the inflection points of each target contour line based on the intersection point and a preset corner accuracy to obtain a chamfered target contour line;

[0046] A merging module is used to complete the merging of the graphics to be processed according to the target contour line after chamfering.

[0047] In addition, to achieve the above-mentioned purpose, the present invention also proposes a graphics merging device, which includes: a memory, a processor, and a graphics merging program stored in the memory and executable on the processor, wherein the graphics merging program is configured to implement the graphics merging method described above.

[0048] In addition, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which a graphics merging program is stored. When the graphics merging program is executed by a processor, the graphics merging method described above is implemented.

[0049] The present invention obtains a graphics to be processed; traverses each target contour line in the graphics to be processed; calculates the intersection of each target contour line to obtain a corresponding intersection point; performs inflection chamfering on each target contour line based on the intersection point and a preset corner precision to obtain a target contour line after chamfering; and completes the merging of the graphics to be processed based on the chamfered target contour line. In the above manner, the intersection of each target contour line in the graphics to be processed is calculated, and the inflection chamfering of each target contour line is performed based on the obtained intersection point and the preset corner precision. The chamfering of each target contour line completes the merging of the graphics to be processed, making the contour of the merged graphics more concise and smooth, improving the accuracy of the graphics merging, and being able to improve the processing efficiency and smoothness of the generated trajectory during graphics processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 It is a structural diagram of a graphics merging device in a hardware operating environment involved in an embodiment of the present invention;

[0051] Figure 2 This is a flow chart of a first embodiment of a method for merging graphics according to the present invention;

[0052] Figure 3 A schematic diagram of a graphic combination according to an embodiment of a graphic merging method of the present invention;

[0053] Figure 41. It is a flowchart of a second embodiment of the graphics merging method of the present invention;

[0054] Figure 5 This is a schematic diagram of the overall process of an embodiment of a graphics merging method of the present invention;

[0055] Figure 6 FIG. 1 is a structural block diagram of the first embodiment of the graphics merging device of the present invention.

[0056] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0057] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0058] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of a graphics merging device in a hardware operating environment according to an embodiment of the present invention.

[0059] like Figure 1 As shown, the graphic merging device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard). Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (RAM) memory or a stable non-volatile memory (NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0060] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the graphic merging device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0061] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a graphics merging program.

[0062] exist Figure 1 In the graphic merging device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the graphic merging device of the present invention can be set in the graphic merging device, and the graphic merging device calls the graphic merging program stored in the memory 1005 through the processor 1001 and executes the graphic merging method provided by the embodiment of the present invention.

[0063] The embodiment of the present invention provides a method for merging graphics. Figure 2 , Figure 2 FIG. 4 is a flow chart of a first embodiment of a method for merging graphics according to the present invention.

[0064] In this embodiment, the graphics merging method includes the following steps:

[0065] Step S10: Obtain the graphics to be processed.

[0066] It should be noted that the execution subject of this embodiment is the terminal device, and the 2D-CAM software on the terminal device executes the action. The terminal device can be a computer, tablet or other smart terminal device. This embodiment does not limit this. This embodiment takes a computer as an example. When the terminal device obtains the target processing instruction for merging graphics issued by the user, the target processing instruction is processed and executed by the 2D-CAM software, thereby obtaining the graphics to be processed, traversing the target contour line of the graphics to be processed, calculating the intersection of the target contour line, and chamfering the inflection point of the target contour line according to the intersection of the target contour line, and finally completing the merging of the graphics.

[0067] It can be understood that the graphics to be processed are initial graphics after simple combination, for example Figure 3 As shown, the current graphic A needs to be merged with the graphic B. The initial graphic C that is not optimized after the graphic A and the graphic B are combined is the graphic to be processed.

[0068] In a specific implementation, it is necessary to obtain the corresponding graphics to be processed according to user needs. Furthermore, obtaining the graphics to be processed includes: obtaining a target processing instruction, extracting a graphic selection instruction and a graphic combination instruction in the target processing instruction; determining an initial graphic according to the graphic selection instruction; determining a target combination method according to the graphic combination instruction; and combining the initial graphics based on the target combination method to obtain the corresponding graphics to be processed.

[0069] It should be noted that the user sends a target processing instruction for merging graphics to the terminal device, and the target processing instruction includes a graphic selection instruction for determining the merging of the (initial) graphics to be merged and a graphic combination instruction for determining the combination method during merging.

[0070] It is understood that after the terminal device receives the target processing instruction sent by the user, the 2D-CAM software parses the target processing instruction and extracts the graphic selection instruction and graphic combination instruction contained in the target processing instruction. Since a preset database may contain a variety of graphics, including but not limited to points, lines, arcs, circles, elliptical arcs, ellipses, polylines, splines, connected lines, etc., after extracting the graphic selection instruction, it is necessary to determine the corresponding to-be-merged (initial) graphic in the preset database based on the image identification code contained in the graphic selection instruction.

[0071] It is understandable that after obtaining the initial graphics, since there are multiple combination methods, such as grouping, docking, alignment, nesting, etc., the initial graphics are combined according to the corresponding target combination method determined by the method identification code in the graphic combination instruction. For example, the image identification codes in the current graphic selection instruction are xx1 and xx2, and the identification codes of all graphics in the preset database are traversed to determine that the corresponding initial graphics are graphics A and graphics B. The method identification code in the current graphic combination instruction is xx101, and the identification codes of all combination methods are traversed to determine that the corresponding target combination method is alignment. Then, after aligning graphics A and B, the graphics C obtained is the graphics to be processed.

[0072] In a specific implementation, in order to optimize the process of graphic merging and improve the accuracy of the graphic merging process, further, after the initial graphics are combined based on the target combination method to obtain the corresponding graphics to be processed, it also includes: obtaining user addition instructions; determining the corresponding addition position and target addition line according to the user addition instructions; completing the addition of auxiliary lines to the graphics to be processed based on the addition position and target addition line to obtain the graphics to be processed after the auxiliary lines are added; traversing each target contour line in the graphics to be processed includes: traversing each target contour line in the graphics to be processed after the auxiliary lines are added.

[0073] It should be noted that the terminal device obtains the user-added instruction for adding auxiliary lines sent by the user, and the 2D-CAM software parses the user-added instruction and extracts the auxiliary line addition position and target addition line in the user-added instruction. Since there are many types of auxiliary lines, such as bridge lines, leads, overcuts, seals and gaps, the 2D-AM software needs to extract the target addition line in the user-added instruction to determine the type of auxiliary line that needs to be added.

[0074] It is understood that after the addition position is extracted, at least one of the starting coordinates, end coordinates, and transfer point coordinates of the target addition line is determined based on the coordinate information in the addition position, and the target addition line is added based on the starting coordinates and end coordinates to obtain the graphics to be processed after the auxiliary lines are added. For example, if the coordinate information in the current addition position is the starting coordinates (0, 0) and the end coordinates (1, 1), and the target addition line is a leader line, then a leader line is added from (0, 0) and extended to (1, 1).

[0075] In a specific implementation, the subsequent graphics merging process is to traverse each target contour line in the graphics to be processed, that is, to traverse each target contour line in the graphics to be processed after adding auxiliary lines, and at the same time, calculate the intersection of each target contour line based on the graphics to be processed after adding auxiliary lines.

[0076] It should be noted that, since different combination methods correspond to different processing techniques, in order to accurately merge the initial graphics, further, the initial graphics are combined based on the target combination method to obtain the corresponding graphics to be processed, including: determining the corresponding target processing method according to the target combination method; and combining the initial graphics through the target processing method to obtain the corresponding graphics to be processed.

[0077] It is understood that there are multiple processing techniques involved in the merging of graphics. After obtaining the initial graphics, the processing techniques need to be imported into the 2D-CAM software. Processing technique types include but are not limited to bridging, wire routing, common edge cutting, fly cutting, nesting, overcutting, multi-turn, notch / seal cutting, and shredding. Different combination methods are mapped to various process types. For example, the process types available for grouping include bridging, wire routing, fly cutting, and multi-turn; the process type available for docking and aligning is common edge processing; and the process type available for nesting is nesting processing.

[0078] It can be understood that after determining the corresponding target combination method, the mapping relationship between the target combination method and the processing technology is searched in the preset storage database. If there is a mapping relationship between the target combination method and a single processing technology, the corresponding target processing technology can be determined according to the target combination method. For example, the current docking combination method only has a mapping relationship with the common edge process, and the corresponding target processing technology method can be determined as the common edge process method according to the docking combination method. The current nested combination method only has a mapping relationship with the nested process, and the corresponding target processing technology method can be determined as the nested process method according to the nested combination method.

[0079] In the specific implementation, if there is a mapping relationship between the target combination method and multiple processing technologies, it is necessary to determine the target processing technology corresponding to the target combination method based on the method identification code in the graphic combination instruction. For example, the method identification code is xx201, and the target combination method is a group combination method. In the mapping relationship table between the group combination method and the processing technology, the processing technology method coded 01 is found to be bridging, and the target processing technology method is determined to be the bridging processing technology method.

[0080] Step S20: traverse each target contour line in the graphics to be processed.

[0081] It should be noted that after obtaining the graphics to be processed with auxiliary lines added, contour traversal is performed on the graphics to be processed with auxiliary lines added to obtain target contour lines in the graphics to be processed with auxiliary lines added.

[0082] Step S30: Calculating the intersection points of the target contour lines to obtain corresponding intersection points.

[0083] It should be noted that contour calculation is performed on each target contour line to obtain a contour line equation corresponding to each target contour line, and equations are solved based on each contour line equation to obtain the intersection points between each target contour line.

[0084] Step S40: performing chamfering on the inflection points of each target contour line based on the intersection point and a preset corner accuracy to obtain a chamfered target contour line.

[0085] It should be noted that to achieve smoother machining paths and higher machining accuracy after merging graphics, a preset error range between the actual chamfer trajectory and the theoretical chamfer trajectory is set during inflection point chamfering, known as the preset corner accuracy. For example, if the preset corner accuracy is 0.05mm, the distance between the actual chamfer trajectory and the theoretical chamfer trajectory must be controlled within 0.05mm.

[0086] It is understandable that after the intersection points are obtained, the intersection points of the target contour lines are chamfered based on the preset corner accuracy, and the chamfering uses a tangent arc to process the corresponding intersection points.

[0087] Step S50: completing the merging of the graphics to be processed according to the target contour line after chamfering.

[0088] It should be noted that, after the target contour lines existing in the graphics to be processed after the auxiliary lines are added are chamfered, the merging of the graphics to be processed is completed.

[0089] This embodiment obtains a graphics to be processed; traverses each target contour line in the graphics to be processed; calculates the intersection of each target contour line to obtain a corresponding intersection point; performs inflection chamfering on each target contour line based on the intersection point and a preset corner precision to obtain a target contour line after chamfering; and completes the merging of the graphics to be processed based on the chamfered target contour line. In the above manner, the intersection of each target contour line in the graphics to be processed is calculated, and the inflection chamfering of each target contour line is performed based on the obtained intersection point and a preset corner precision. The chamfering of each target contour line completes the merging of the graphics to be processed, making the contour of the merged graphics more concise and smooth, improving the accuracy of the graphics merging, and being able to improve the processing efficiency and smoothness of the generated trajectory during graphics processing.

[0090] refer to Figure 4 , Figure 4 FIG. 4 is a flow chart of a second embodiment of a method for merging graphics according to the present invention.

[0091] Based on the first embodiment, step S50 in the graphics merging method of this embodiment includes:

[0092] Step S51: Obtain the current distance between each target contour line.

[0093] It should be noted that in order to improve the smoothness of the processing trajectory after the graphics are merged, after obtaining the intersection between the target contour lines, it is necessary to obtain the unconnected disconnected contour lines in each target contour line and obtain the current distance between the disconnected contour lines in each target contour line.

[0094] Step S52: Based on the intersection point, the target contour lines corresponding to the current distances less than the preset distance threshold are merged and connected to obtain a connected target contour line.

[0095] It should be noted that the current distance between each disconnected contour line is determined to be less than a preset distance threshold. If the current distance between the disconnected contour lines is less than the preset distance threshold, the disconnected contour lines are connected to the intersection point between the two disconnected contour lines. For example, if target contour lines A and target contour lines B are not connected, that is, disconnected contour lines A and B are not connected, and the current distance between disconnected contour lines A and B is 0.05mm, the preset distance threshold is 0.1mm, and the intersection point between disconnected contour lines A and B is a, then the disconnected connecting line A and disconnected contour line B are extended and merged to point a to connect them, resulting in the connected target contour line C.

[0096] Step S53: completing the merging of the graphics to be processed according to the chamfered target contour line and the connected target contour line.

[0097] It should be noted that after the target contour lines existing in the graphics to be processed after the auxiliary lines are added are chamfered and merged, the merging of the graphics to be processed is completed.

[0098] It can be understood that in order to reduce the total processing length after the graphics are merged and reduce the number of processing jumps, it is necessary to delete the overlapping parts in the target contour lines. Furthermore, the merging of the graphics to be processed is completed according to the chamfered target contour lines and the connected target contour lines, including: detecting whether a user deletion instruction is obtained; if the user deletion instruction is obtained, obtaining the position information of each target contour line; judging whether there are target contour lines with the same position information; if there are target contour lines with the same position information, obtaining the repeated position information corresponding to the target contour lines with the same position information; deleting the target contour lines with the same position information until the number of target contour lines corresponding to the repeated position information is a preset number, and obtaining the deleted target contour lines; completing the merging of the graphics to be processed according to the chamfered target contour lines, the connected target contour lines and the deleted target contour lines.

[0099] It should be noted that after adding auxiliary lines, there will be overlapping parts in the contour lines of the graphics to be processed. It is necessary to determine whether to delete the overlapping parts in the target contour lines based on user needs. After the terminal device detects the user's deletion instruction to delete the overlapping parts in the target contour lines, the 2D-CAM software obtains the position information of each target contour line, that is, the coordinate information of each point in each target contour line. The coordinate information of each point is compared to determine whether there are points with the same coordinate information. If there are more than or equal to two points with the same coordinate information in two or more target contour lines, and the equations of the connecting lines between the points with the same coordinate information are the same, it means that the two or more target contour lines overlap. The points with the same coordinate information in the overlapping target contour lines are obtained, which are the places where the overlapping target contour lines overlap. The points with the same coordinate information in the overlapping target contour lines are repeated position information. For example, there is a curve section of y=2x+1 in contour lines A, contour lines B and contour lines C. At this time, the starting point (1, 3) to the end point (2, 5) on contour lines A, contour lines B and contour lines C are all located on y=2x+1. This means that the y=2x+1 curve from the starting point (1, 3) to the end point (2, 5) is repeated position information. At this time, the overlapping contour lines are A, B and C.

[0100] It is understandable that after obtaining the repeated position information, the target contour lines (overlapping contour lines) with the same position information at the repeated position information are deleted to a preset number of contour lines (preset number), and the overlapping contour lines in the graphics to be processed after the auxiliary lines are added are deleted to obtain the deleted target contour lines. For example, the current preset number is 1. At this time, there are three overlapping target contour lines A, B, and C on the y=2x+1 curve from the starting point (1, 3) to the end point (2, 5). The three target contour lines have the same position information. At this time, any two of the target contour lines A, B, and C on the y=2x+1 curve from the starting point (1, 3) to the end point (2, 5) are deleted, and the remaining target contour line is located on the y=2x+1 curve from the starting point (1, 3) to the end point (2, 5).

[0101] It should be understood that after chamfering, merging and connecting the target contour lines in the graphics to be processed after the auxiliary lines are added, and duplicate contour lines are deleted, the merging of the graphics to be processed is completed.

[0102] In a specific implementation, in order to ensure the accuracy of the processing after the graphics are merged, it is necessary to discretize the target contour lines in the graphics to be processed after adding auxiliary lines according to user needs. Furthermore, the merging of the graphics to be processed is completed according to the target contour lines after chamfering, the target contour lines after connection, and the target contour lines after deletion, including: detecting whether the user discrete instruction is obtained; if the user discrete instruction is obtained, determining the discrete contour lines in the target contour lines according to the user discrete instruction; discretizing the discrete contour lines based on a preset shredding process and a preset discrete distance to obtain the discrete target contour lines; completing the merging of the graphics to be processed according to the target contour lines after chamfering, the target contour lines after connection, the target contour lines after deletion, and the discretized target contour lines.

[0103] It should be noted that after adding auxiliary lines, the contour line of the graphics to be processed needs to be discretized based on user needs. After the terminal device detects the user's discretization instruction for discretizing the target contour line, the 2D-CAM software obtains the discrete contour line in the user discretization instruction and discretizes the discrete contour line using the preset shredding process corresponding to the discretization and the preset discretization distance for achieving equal distance discretization of the contour line, thereby obtaining the discretized target contour line. For example, if the discrete contour line in the user's discretization instruction is A and the preset discretization distance is 2mm, the discretization process will be used to shred the discrete contour line A at intervals of 2mm, thereby obtaining the discretized target contour line A.

[0104] It is understandable that after chamfering, merging, deleting duplicate contours, and discretizing target contours required by the user in the graphics to be processed after adding auxiliary lines, the graphics to be processed are merged.

[0105] In a specific implementation, as an optional embodiment of the present invention, Figure 5 As shown, after the terminal device receives the target processing instruction sent by the user, the 2D-CAM software determines the merged graphics (initial graphics) and imports the processing technology. The initial graphics are combined by the target combination method to obtain the graphics to be processed, and auxiliary lines are added to the graphics to be processed according to the user addition instruction. The contour line intersection is calculated based on the graphics to be processed after the auxiliary lines are added, and when the user deletion instruction is obtained, the repeated contour lines in the graphics to be processed after the auxiliary lines are added are deleted by the user deletion instruction. When the user deletion instruction is not received, the duplicate line deletion processing is not performed. The contour lines are inflected and chamfered according to the preset inflection point accuracy and contour line intersection. At the same time, the contour lines that meet the connection conditions in the graphics to be processed after the auxiliary lines are added are merged and connected based on the contour line intersection. When the user discrete instruction is obtained, the contour lines in the graphics to be processed after the auxiliary lines are added are discretized by the user discrete instruction. When the user discrete instruction is not received, no discrete processing is performed. The graphics to be processed after the auxiliary lines are added are deleted, the inflection points are taught, the connection is merged and the discrete processing is completed to complete the merging of the graphics to be processed.

[0106] This embodiment obtains the current distance between target contour lines; based on the intersection point, merges and connects target contour lines whose current distance is less than a preset distance threshold to obtain a connected target contour line; and then merges the graphics to be processed based on the chamfered target contour line and the connected target contour line. By merging and connecting contour lines that meet the connection criteria based on the current distance between target contour lines and the preset distance threshold, the accuracy of the graphics merging and the smoothness of the trajectory during the processing of the merged graphics are improved.

[0107] In addition, refer to Figure 6 , an embodiment of the present invention further provides a graphics merging device, the graphics merging device comprising:

[0108] The acquisition module 10 is used to acquire the graphics to be processed.

[0109] The traversal module 20 is used to traverse each target contour line in the graphics to be processed.

[0110] The calculation module 30 is used to calculate the intersection points of the target contour lines to obtain corresponding intersection points.

[0111] The chamfering module 40 is configured to chamfer the inflection points of each target contour line based on the intersection point and a preset corner accuracy to obtain the chamfered target contour line.

[0112] The merging module 50 is configured to merge the graphics to be processed according to the target contour line after chamfering.

[0113] This embodiment obtains a graphics to be processed; traverses each target contour line in the graphics to be processed; calculates the intersection of each target contour line to obtain a corresponding intersection point; performs inflection chamfering on each target contour line based on the intersection point and a preset corner precision to obtain a target contour line after chamfering; and completes the merging of the graphics to be processed based on the chamfered target contour line. In the above manner, the intersection of each target contour line in the graphics to be processed is calculated, and the inflection chamfering of each target contour line is performed based on the obtained intersection point and a preset corner precision. The chamfering of each target contour line completes the merging of the graphics to be processed, making the contour of the merged graphics more concise and smooth, improving the accuracy of the graphics merging, and being able to improve the processing efficiency and smoothness of the generated trajectory during graphics processing.

[0114] In one embodiment, the acquisition module 10 is further configured to acquire target processing instructions and extract graphic selection instructions and graphic combination instructions from the target processing instructions;

[0115] Determine an initial graphic according to the graphic selection instruction;

[0116] Determine a target combination mode according to the graphic combination instruction;

[0117] The initial graphics are combined based on the target combination method to obtain corresponding graphics to be processed.

[0118] In one embodiment, the acquisition module 10 is further configured to acquire a user adding instruction;

[0119] Determine the corresponding adding position and target adding line according to the user adding instruction;

[0120] completing the addition of auxiliary lines to the to-be-processed graphic based on the adding position and the target adding line, thereby obtaining the to-be-processed graphic after the auxiliary lines are added;

[0121] The traversing each target contour line in the to-be-processed graphic includes:

[0122] Traverse each target contour line in the graphics to be processed after the auxiliary lines are added.

[0123] In one embodiment, the acquisition module 10 is further configured to determine a corresponding target processing method according to the target combination method;

[0124] The initial graphics are combined and processed by the target processing method to obtain the corresponding graphics to be processed.

[0125] In one embodiment, the merging module 50 is further configured to obtain the current distance between each target contour line;

[0126] Based on the intersection point, the target contour lines corresponding to the current distance less than the preset distance threshold are merged and connected to obtain a connected target contour line;

[0127] The graphics to be processed are merged according to the chamfered target contour line and the connected target contour line.

[0128] In one embodiment, the merging module 50 is further configured to detect whether a user deletion instruction is obtained;

[0129] If the user deletion instruction is obtained, obtaining the position information of each target contour line;

[0130] Determine whether there is a target contour line with the same position information;

[0131] If there are target contour lines with the same position information, obtaining the repeated position information corresponding to the target contour lines with the same position information;

[0132] Deleting the target contour lines with the same position information until the number of target contour lines corresponding to the repeated position information reaches a preset number, thereby obtaining the deleted target contour lines;

[0133] The graphics to be processed are merged according to the chamfered target contour line, the connected target contour line, and the deleted target contour line.

[0134] In one embodiment, the merging module 50 is further configured to detect whether a discrete instruction from the user is obtained;

[0135] If the user discrete instruction is obtained, determining discrete contour lines among the target contour lines according to the user discrete instruction;

[0136] Performing discretization processing on the discrete contour line based on a preset chopping process and a preset discretization distance to obtain a discretized target contour line;

[0137] The graphics to be processed are merged according to the chamfered target contour lines, the connected target contour lines, the deleted target contour lines and the discretized target contour lines.

[0138] Since the present device adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, which will not be described one by one here.

[0139] In addition, an embodiment of the present invention further provides a storage medium, on which a graphics merging program is stored. When the graphics merging program is executed by a processor, the steps of the graphics merging method described above are implemented.

[0140] Since the storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought by the technical solutions of the above embodiments, which will not be described one by one here.

[0141] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of it according to actual needs to achieve the purpose of the embodiment scheme, and no limitation is made here.

[0142] In addition, for technical details not fully described in this embodiment, reference can be made to the graphics merging method provided in any embodiment of the present invention, and will not be repeated here.

[0143] In addition, it should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0144] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0145] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, or of course by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0146] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A graphics merging method, characterized in that: The graphics merging method comprises: Get the graphics to be processed; Traversing each target contour line in the graphics to be processed; Calculating the intersection points of the target contour lines to obtain corresponding intersection points; chamfering the inflection points of each target contour line based on the intersection point and a preset corner accuracy to obtain a chamfered target contour line; completing merging of the graphics to be processed according to the target contour line after chamfering; The step of merging the graphics to be processed according to the target contour line after chamfering includes: Get the current distance between each target contour line; Based on the intersection point, the target contour lines corresponding to the current distance less than the preset distance threshold are merged and connected to obtain a connected target contour line; The graphics to be processed are merged according to the chamfered target contour line and the connected target contour line.

2. The graphics merging method according to claim 1, wherein: The step of obtaining the graphics to be processed includes: Obtaining a target processing instruction, and extracting a graphic selection instruction and a graphic combination instruction from the target processing instruction; Determine an initial graphic according to the graphic selection instruction; Determine a target combination mode according to the graphic combination instruction; The initial graphics are combined based on the target combination method to obtain corresponding graphics to be processed.

3. The graphics merging method according to claim 2, wherein: After combining the initial graphics based on the target combination method to obtain corresponding graphics to be processed, the method further includes: Get user adding instruction; Determine the corresponding adding position and target adding line according to the user adding instruction; completing the addition of auxiliary lines to the to-be-processed graphic based on the adding position and the target adding line, thereby obtaining the to-be-processed graphic after the auxiliary lines are added; The traversing each target contour line in the to-be-processed graphic includes: Traverse each target contour line in the graphics to be processed after the auxiliary lines are added.

4. The graphics merging method according to claim 2, wherein: The combining of the initial graphics based on the target combination mode to obtain corresponding graphics to be processed includes: Determine the corresponding target processing method according to the target combination method; The initial graphics are combined and processed by the target processing method to obtain the corresponding graphics to be processed.

5. The graphics merging method according to claim 1, wherein: The merging of the graphics to be processed according to the chamfered target contour line and the connected target contour line includes: Check whether the user deletion instruction is obtained; If the user deletion instruction is obtained, obtaining the position information of each target contour line; Determine whether there is a target contour line with the same position information; If there are target contour lines with the same position information, obtaining the repeated position information corresponding to the target contour lines with the same position information; Deleting the target contour lines with the same position information until the number of target contour lines corresponding to the repeated position information reaches a preset number, thereby obtaining the deleted target contour lines; The graphics to be processed are merged according to the chamfered target contour line, the connected target contour line, and the deleted target contour line.

6. The graphics merging method according to claim 5, wherein: The merging of the graphics to be processed according to the chamfered target contour line, the connected target contour line, and the deleted target contour line comprises: Check whether the user's discrete instructions are obtained; If the user discrete instruction is obtained, determining discrete contour lines among the target contour lines according to the user discrete instruction; Performing discretization processing on the discrete contour line based on a preset chopping process and a preset discretization distance to obtain a discretized target contour line; The graphics to be processed are merged according to the chamfered target contour lines, the connected target contour lines, the deleted target contour lines and the discretized target contour lines.

7. A graphics merging device, characterized in that: The graphics merging device comprises: An acquisition module, used to acquire graphics to be processed; A traversal module, used for traversing each target contour line in the graphics to be processed; A calculation module, configured to calculate the intersection points of the target contour lines to obtain corresponding intersection points; a chamfering module, configured to chamfer the inflection points of each target contour line based on the intersection point and a preset corner accuracy to obtain a chamfered target contour line; A merging module, configured to complete merging of the graphics to be processed according to the target contour line after chamfering; The merging module is further used to obtain the current distance between each target contour line; merge and connect the target contour lines corresponding to the current distance less than a preset distance threshold based on the intersection point to obtain a connected target contour line; and complete the merging of the to-be-processed graphics based on the chamfered target contour line and the connected target contour line.

8. A graphics merging device, characterized in that: The device includes: a memory, a processor, and a graphics merging program stored in the memory and executable on the processor, wherein the graphics merging program is configured to implement the graphics merging method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium stores a graphics merging program, which, when executed by a processor, implements the graphics merging method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Laser marking system, closed pattern filling algorithm thereof, and storage medium

    CN108961359A

  • Image edge smoothing method and device

    CN110689492A