Cutting contour compensation method, device, cutting equipment and storage medium
By judging the enclosure of the cutting element, and using a closed or unclosed contour compensation algorithm, the dimensional deviation problem caused by cutting joint loss of the cutting machine is solved, and accurate compensation for complex graphics and large offsets is achieved, and the element characteristics are retained.
Patent Information
- Application Number
- CN202111208733.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-18
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2041-10-18
AI Technical Summary
During cutting, existing cutting machines have deviations from the actual size and theoretical size due to cutting joint losses, and existing compensation methods cannot effectively deal with the problems of complex graphics and large offsets.
A cutting profile compensation method is provided. By judging whether the element to be compensated is closed, a closed profile compensation algorithm or an unclosed profile compensation algorithm is used to compensate, adapt to different graphic features and retain the original element characteristics.
Accurate compensation for various cutting patterns is achieved, ensuring the accuracy of dimensions after cutting, adapting to complex graphics and large offsets, and retaining the original element characteristics.
Smart Images

Figure CN113936016B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of CNC cutting technology, and in particular to a cutting contour compensation method, device, cutting equipment and storage medium. Background Art
[0002] With the advancement of technology, a range of cutting products has emerged, including flame cutting machines, plasma cutting machines, laser cutting machines, water jet cutting machines, and wire cutting machines. These existing cutting machines, when cutting according to CNC instructions, follow a theoretical cutting path. The actual cut dimensions will deviate slightly due to the presence of a kerf, which is the loss during cutting. Consequently, the outer contour of the cut part will be smaller in length, while the inner contour will be larger. This means that the difference between the two sides is exactly the kerf width, while the difference between one side is half the kerf width. A common drawback of these products is that the cut workpiece dimensions are typically smaller than the actual drawing dimensions, typically 1-3 mm smaller. To address this issue, "contour compensation" plays a crucial role.
[0003] In order to compensate for the size difference caused by the kerf loss, geometric size compensation is required. Currently, kerf compensation is divided into software compensation and CNC system compensation. The ultimate goal is to offset the trajectory of the cutting machine so that the size formed after the kerf loss is exactly equal to the size of the programmed drawing. The existing nesting software compensation method is to input programming parameters such as the compensation radius during programming. When generating the CNC code, the geometric dimensions are automatically offset according to the inner and outer contours. It is only applicable to the compensation of closed contours. The existing CNC system compensation method is to generate offset instructions in the CNC code, such as left compensation, right compensation or close compensation. It can also continue to compensate according to the compensation offset direction. If the software compensation amount is set to 0, no compensation is generated. This solution only offsets simple graphics with small offsets and is not suitable for complex graphics processing.
[0004] In summary, there is an urgent need for a cutting contour compensation method that does not limit the cutting pattern and offset size. Summary of the Invention
[0005] Based on this, it is necessary to provide a cutting contour compensation method, device, cutting equipment and storage medium that does not limit the cutting pattern and offset size to address the above technical problems.
[0006] In a first aspect, a cutting contour compensation method is provided, the method comprising:
[0007] Get the graphics element to be compensated;
[0008] If the current offset compensation value is not zero and the primitive to be compensated exists, determining whether the primitive to be compensated is closed;
[0009] If the primitive to be compensated is closed, compensation is performed using a closed contour compensation algorithm according to the current offset compensation value, and data is filled;
[0010] If the to-be-compensated primitive is not closed, determining whether to enable open compensation;
[0011] If open compensation is enabled, the open contour compensation algorithm is used to perform compensation and fill in data based on the current offset compensation value.
[0012] In one embodiment, the method further comprises:
[0013] If the unclosed compensation is not enabled, it is determined whether the next primitive to be compensated is closed.
[0014] In one embodiment, if the primitive to be compensated is closed, performing compensation using a closed contour compensation algorithm according to the current offset compensation value includes:
[0015] If the to-be-compensated graphic element belongs to an outer contour, performing equidistant compensation outward on the to-be-compensated graphic element according to the current offset compensation value;
[0016] If the primitive to be compensated belongs to an inner contour, the primitive to be compensated is compensated inwardly at equal distances according to the current offset compensation value. If the compensated primitive to be compensated intersects or crosses the boundary, the compensation for the inner contour is canceled.
[0017] In one embodiment, if the non-closed contour compensation is enabled, performing compensation using the non-closed contour compensation algorithm according to the current offset compensation value includes:
[0018] If the primitive to be compensated is not closed, the self-intersection points of the primitive to be compensated are searched for by a plane scanning algorithm based on a monotone chain, and then invalid rings are eliminated, wherein the self-intersection points are concave vertices of valid rings or convex vertices of invalid rings;
[0019] If the graphics element to be compensated after the invalid ring is removed belongs to the outer contour, performing equidistant compensation on the graphics element to be compensated outward according to the current offset compensation value;
[0020] If the primitive to be compensated after removing the invalid ring belongs to the inner contour, the primitive to be compensated is compensated inwardly at equal distances according to the current offset compensation value. If the primitive to be compensated intersects or crosses the boundary after compensation, the compensation is canceled.
[0021] In one embodiment, the performing of outward equidistant compensation on the to-be-compensated graphic element or the performing of inward equidistant compensation on the to-be-compensated graphic element according to the current offset compensation value is specifically:
[0022] If the primitive to be compensated is a circle, the current radius is added to the current offset compensation value or the current radius is added to the current offset compensation value to obtain a compensation radius, and the compensated primitive is obtained by using the compensation radius. If the compensation radius is less than zero, compensation is canceled;
[0023] If the to-be-compensated primitive is not a circle, the to-be-compensated primitive is split into a set of straight lines or arcs, and equidistant compensation is performed outward or inward on each of the straight lines or arcs, and each intersection is connected to obtain a compensated primitive.
[0024] In one embodiment, when the arc is a multi-segment arc or an inner contour arc, specifically:
[0025] If polyline arcs intersect, recalculate the start / end angles of each arc; or / and
[0026] If the polyline arcs do not intersect, the arc ends and adjacent edges are extended; or / and
[0027] If the arc is an inner contour arc and the radius after compensation is a negative number, the arc will be cancelled and converted to a straight line.
[0028] In one embodiment, the method further comprises:
[0029] Initialize the current offset compensation value.
[0030] In a second aspect, a cutting profile compensation device is provided, the device comprising:
[0031] A graphics primitive acquisition unit, used for acquiring graphics primitives to be compensated;
[0032] a first judging unit, configured to judge whether the to-be-compensated primitive is closed if the current offset compensation value is not zero and the to-be-compensated primitive exists;
[0033] A first compensation unit is configured to, if the primitive to be compensated is closed, perform compensation using a closed contour compensation algorithm according to the current offset compensation value and fill in data;
[0034] A second judgment unit is configured to judge whether to enable non-closed compensation if the to-be-compensated primitive is non-closed;
[0035] The second compensation unit is used to perform compensation and fill data based on the unclosed contour compensation algorithm according to the current offset compensation value if the unclosed compensation is turned on.
[0036] In a third aspect, a cutting device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0037] Get the graphics element to be compensated;
[0038] If the current offset compensation value is not zero and the primitive to be compensated exists, determining whether the primitive to be compensated is closed;
[0039] If the primitive to be compensated is closed, compensation is performed using a closed contour compensation algorithm according to the current offset compensation value, and data is filled;
[0040] If the to-be-compensated primitive is not closed, determining whether to enable open compensation;
[0041] If open compensation is enabled, the open contour compensation algorithm is used to perform compensation and fill in data based on the current offset compensation value.
[0042] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0043] Get the graphics element to be compensated;
[0044] If the current offset compensation value is not zero and the primitive to be compensated exists, determining whether the primitive to be compensated is closed;
[0045] If the primitive to be compensated is closed, compensation is performed using a closed contour compensation algorithm according to the current offset compensation value, and data is filled;
[0046] If the to-be-compensated primitive is not closed, determining whether to enable open compensation;
[0047] If open compensation is enabled, the open contour compensation algorithm is used to perform compensation and fill in data based on the current offset compensation value.
[0048] The above-mentioned cutting contour compensation method, device, cutting equipment and storage medium obtain the graphics element to be compensated; if the current offset compensation value is not zero and the graphics element to be compensated exists, it is determined whether the graphics element to be compensated is closed; if the graphics element to be compensated is closed, it is compensated by a closed contour compensation algorithm according to the current offset compensation value, and the data is filled; if the graphics element to be compensated is not closed, it is determined whether to turn on the open contour compensation; if the open contour compensation is turned on, it is compensated by an open contour compensation algorithm according to the current offset compensation value, and the data is filled. This application does not limit the cutting graphics, and the characteristics of the original graphics element will be retained when the offset is too large. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 Schematic diagram of a process of a cutting contour compensation method in one embodiment;
[0050] Figure 2 is a schematic diagram of circular compensation in one embodiment;
[0051] Figure 3 Schematic diagram of polygonal self-intersecting ring compensation in one embodiment;
[0052] Figure 4 is a structural block diagram of a cutting profile compensation device in one embodiment;
[0053] Figure 5 FIG. 1 is a diagram showing the internal structure of a cutting device in one embodiment. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0055] The cutting contour compensation method provided in this application can be applied in the application environment of cutting equipment.
[0056] In one embodiment, Figure 1 As shown, a cutting contour compensation method is provided, which is described by taking the application of the method to a cutting device as an example, and includes the following steps:
[0057] Step S11: obtaining the graphics primitive to be compensated.
[0058] In an embodiment of the present invention, the primitive to be compensated is the cut contour or cut pattern of the workpiece's cross section. The image to be processed includes an outer contour and / or an inner contour. The primitive to be compensated can be set by the user in the interface, allowing the user to select a primitive for compensation or to exclude it. The primitive to be compensated can also be obtained by analyzing the image to be processed. The primitive to be compensated can be closed, such as a circle, rectangle, ellipse, triangle, polygon, etc., or it can be open. A cut pattern of a workpiece corresponds to one or more primitives to be compensated.
[0059] Step S12: If the current offset compensation value is not zero and the primitive to be compensated exists, it is determined whether the primitive to be compensated is closed.
[0060] In this embodiment of the present invention, before processing the primitive to be compensated, the current offset compensation value must be initialized. This value can be determined or set based on the cutting machine's previous cutting size errors or empirical errors. If the current offset compensation value is 0, no offset compensation is performed. If the current offset compensation value is not 0 and the primitive to be compensated exists, step S12 is executed. By determining whether the current primitive to be compensated is closed, different compensation methods are applied depending on whether the primitive is closed or open, and this is not limited to the cutting pattern. If the current primitive to be compensated is closed, step S13 is executed; if the current primitive to be compensated is open, step S14 is executed.
[0061] Step S13: If the primitive to be compensated is closed, compensation is performed using a closed contour compensation algorithm according to the current offset compensation value, and data is filled.
[0062] In an embodiment of the present invention, when the same cutting figure corresponds to multiple primitives to be compensated, if the current primitive to be compensated is a closed two-dimensional figure, it is relatively easy to process. The closed contour compensation algorithm is applicable to offset compensation of closed primitives to be compensated. Specifically, if the primitive to be compensated is closed, compensation is performed using the closed contour compensation algorithm using the current offset compensation value in two cases:
[0063] In the first case, if the primitive to be compensated belongs to an outer contour, equidistant compensation is performed outward on the primitive to be compensated according to the current offset compensation value;
[0064] The second case is that if the primitive to be compensated belongs to an inner contour, the primitive to be compensated is compensated inwardly at equal distances according to the current offset compensation value. If the compensated primitive to be compensated intersects or crosses the boundary, the compensation for the inner contour is cancelled.
[0065] Specifically, the performing of equidistant compensation outward on the to-be-compensated graphic element or the performing of equidistant compensation inward on the to-be-compensated graphic element according to the current offset compensation value is as follows:
[0066] If the primitive to be compensated is a circle, the current radius is added to the current offset compensation value or the current radius is added to the current offset compensation value to obtain a compensation radius, and the compensated primitive is obtained by using the compensation radius. If the compensation radius is less than zero, compensation is canceled;
[0067] If the primitive to be compensated is not a circle, the primitive to be compensated is split into a set of lines or arcs, and equidistant compensation is performed on each of the lines or arcs outward or inward, and the compensated primitive is obtained by connecting the intersection points. Lines only require equidistant offset compensation, while arcs have three different situations, especially when the arc is a multi-segment arc or an inner contour arc, the processing will be different, specifically:
[0068] If polyline arcs intersect, recalculate the start / end angles of each arc; or / and
[0069] If the polyline arcs do not intersect, the arc ends and adjacent edges are extended; or / and
[0070] If the arc is an inner contour arc and the radius after compensation is a negative number, the arc will be cancelled and converted to a straight line.
[0071] like Figure 2As shown in the figure, when the primitive to be compensated is circular and has an outer contour, the contour offset is completed by simply changing the radius. The specific offset amplitude is determined by the size of the current offset compensation value. Among them, 20 is the primitive before compensation, and 21 is the primitive after compensation.
[0072] Step S14: If the graphics element to be compensated is not closed, it is determined whether to enable open compensation.
[0073] In this embodiment of the present invention, not all non-closed primitives to be compensated require contour compensation. Users can pre-define whether non-closed compensation is enabled or disabled for certain primitives based on experience or requirements. Therefore, a step is added to determine whether non-closed compensation is enabled, and compensation is not performed on primitives that do not require compensation. If non-closed compensation is not enabled for the primitive to be compensated, compensation is not performed on the primitive to be compensated. Instead, a determination is made as to whether the next primitive to be compensated is closed, executing step S12.
[0074] Step S15: If the non-closed contour compensation is enabled for the primitive to be compensated, compensation is performed using the non-closed contour compensation algorithm according to the current offset compensation value, and data is filled.
[0075] In the embodiment of the present invention, when the current primitive to be compensated is an open polygon, the situation is complicated. The open contour compensation algorithm is applicable to offset compensation of the outer contour and inner contour of the open primitive to be compensated. Specifically, if open contour compensation is enabled, compensation is performed by the open contour compensation algorithm based on the current offset compensation value, including:
[0076] If the primitive to be compensated is not closed, the self-intersection points of the primitive to be compensated are searched for by a plane scanning algorithm based on a monotone chain, and then invalid rings are eliminated, wherein the self-intersection points are concave vertices of valid rings or convex vertices of invalid rings; Figure 3 As shown, the solid line is the uncompensated contour, and the dotted line is the compensated contour. It can be seen that there is a self-intersection point problem. By judging the valid ring and invalid ring through the self-intersection point, the complex self-intersection ring problem can be solved.
[0077] If the graphics element to be compensated after invalid rings are removed belongs to the outer contour, the graphics element to be compensated isometrically compensated outward according to the current offset compensation value; specifically, if the graphics element to be compensated belongs to the outer contour, the graphics element to be compensated is split into a set of straight lines or arcs, and the straight lines or arcs in the set of straight lines or arcs are compensated outward one by one, and the compensated outer contour is obtained by connecting the intersection points;
[0078] If the graphics element to be compensated belongs to the inner contour after the invalid ring is eliminated, the graphics element to be compensated is compensated inwardly at an equal distance according to the current offset compensation value. If the graphics element to be compensated intersects or crosses the boundary after compensation, the compensation is canceled. Specifically, if the graphics element to be compensated belongs to the inner contour, the graphics element to be compensated is split into a set of straight lines or arcs, and the straight lines or arcs in the set of straight lines or arcs are compensated inward one by one at an equal distance. The inner contour after compensation is obtained by connecting the intersection points. If the inner contour after compensation intersects or crosses the boundary, the compensation is canceled.
[0079] In the above-mentioned cutting contour compensation method, the primitive to be compensated is obtained; if the current offset compensation value is not zero and the primitive to be compensated exists, it is determined whether the primitive to be compensated is closed; if the primitive to be compensated is closed, compensation is performed through the closed contour compensation algorithm according to the current offset compensation value, and data is filled; if the primitive to be compensated is not closed, it is determined whether to turn on the open contour compensation; if the open contour compensation is turned on, compensation is performed through the open contour compensation algorithm according to the current offset compensation value, and data is filled. This application does not limit the cutting graphics, and the characteristic of the original primitive will be retained when the offset is too large.
[0080] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0081] In one embodiment, Figure 4 As shown, a cutting contour compensation device is provided, comprising: a graphic element acquisition unit 41, a first judgment unit 42, a first compensation unit 43, a second judgment unit 44 and a second compensation unit 45, wherein:
[0082] A graphics primitive acquisition unit 41, configured to acquire graphics primitives to be compensated;
[0083] A first judging unit 42 is configured to judge whether the to-be-compensated primitive is closed if the current offset compensation value is not zero and the to-be-compensated primitive exists;
[0084] A first compensation unit 43 is configured to, if the primitive to be compensated is closed, perform compensation using a closed contour compensation algorithm according to the current offset compensation value and fill in data;
[0085] A second judgment unit 44 is configured to judge whether to enable non-closed compensation if the to-be-compensated primitive is non-closed;
[0086] The second compensation unit 45 is configured to perform compensation and fill in data using an open contour compensation algorithm according to a current offset compensation value if the open contour compensation is enabled.
[0087] In one embodiment, the apparatus further comprises:
[0088] The compensation cancellation unit is used to determine whether the next primitive to be compensated is closed if the unclosed compensation is not enabled.
[0089] In one embodiment, the first compensation unit 43 includes:
[0090] A first compensation subunit is configured to perform equidistant compensation on the primitive to be compensated outward according to the current offset compensation value if the primitive to be compensated belongs to an outer contour;
[0091] The second compensation subunit is used to perform equidistant compensation on the primitive to be compensated inward according to the current offset compensation value if the primitive to be compensated belongs to the inner contour, and cancel the compensation of the inner contour if the primitive to be compensated after compensation intersects or crosses the boundary.
[0092] In one embodiment, the second compensation unit 45 includes:
[0093] A primitive culling subunit is configured to, if the primitive to be compensated is not closed, search for self-intersection points of the primitive to be compensated by a plane scanning algorithm based on a monotone chain, and then eliminate invalid rings, wherein the self-intersection points are concave vertices of valid rings or convex vertices of invalid rings;
[0094] a third compensation subunit, configured to perform equidistant compensation on the primitive to be compensated outward according to the current offset compensation value if the primitive to be compensated after invalid rings are removed belongs to an outer contour;
[0095] The fourth compensation subunit is used to perform equidistant compensation on the primitive to be compensated inward according to the current offset compensation value if the primitive to be compensated after the invalid ring is removed belongs to the inner contour, and cancel the compensation if the primitive to be compensated intersects or crosses the boundary after compensation.
[0096] In one embodiment, the performing of outward equidistant compensation on the to-be-compensated graphic element or the performing of inward equidistant compensation on the to-be-compensated graphic element according to the current offset compensation value is specifically:
[0097] If the primitive to be compensated is a circle, the current radius is added to the current offset compensation value or the current radius is added to the current offset compensation value to obtain a compensation radius, and the compensated primitive is obtained by using the compensation radius. If the compensation radius is less than zero, compensation is canceled;
[0098] If the to-be-compensated primitive is not a circle, the to-be-compensated primitive is split into a set of straight lines or arcs, and equidistant compensation is performed outward or inward on each of the straight lines or arcs, and each intersection is connected to obtain a compensated primitive.
[0099] In one embodiment, when the arc is a multi-segment arc or an inner contour arc, specifically:
[0100] If polyline arcs intersect, recalculate the start / end angles of each arc; or / and
[0101] If the polyline arcs do not intersect, the arc ends and adjacent edges are extended; or / and
[0102] If the arc is an inner contour arc and the radius after compensation is a negative number, the arc will be cancelled and converted to a straight line.
[0103] In one embodiment, the apparatus further comprises:
[0104] Initialize the current offset compensation value.
[0105] The specific definition of the cutting contour compensation device can be found in the definition of the cutting contour compensation method above and will not be repeated here. Each module in the aforementioned cutting contour compensation device can be implemented in whole or in part via software, hardware, or a combination thereof. Each of these modules can be embedded in or independent of the processor in the cutting device in hardware form, or stored in memory in the cutting device in software form, allowing the processor to call and execute the corresponding operations of each module.
[0106] In one embodiment, a cutting device is provided, the internal structure of which can be shown as follows: Figure 5 As shown. The cutting device includes a processor and memory connected via a system bus. The processor of the cutting device is used to provide computing and control capabilities. The memory of the cutting device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. When executed by the processor, the computer program implements a cutting contour compensation method.
[0107] Those skilled in the art will understand that Figure 5The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the cutting equipment to which the solution of the present application is applied. The specific cutting equipment may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0108] In one embodiment, a cutting device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0109] Get the graphics element to be compensated;
[0110] If the current offset compensation value is not zero and the primitive to be compensated exists, determining whether the primitive to be compensated is closed;
[0111] If the primitive to be compensated is closed, compensation is performed using a closed contour compensation algorithm according to the current offset compensation value, and data is filled;
[0112] If the to-be-compensated primitive is not closed, determining whether to enable open compensation;
[0113] If open compensation is enabled, the open contour compensation algorithm is used to perform compensation and fill in data based on the current offset compensation value.
[0114] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0115] Get the graphics element to be compensated;
[0116] If the current offset compensation value is not zero and the primitive to be compensated exists, determining whether the primitive to be compensated is closed;
[0117] If the primitive to be compensated is closed, compensation is performed using a closed contour compensation algorithm according to the current offset compensation value, and data is filled;
[0118] If the to-be-compensated primitive is not closed, determining whether to enable open compensation;
[0119] If open compensation is enabled, the open contour compensation algorithm is used to perform compensation and fill in data based on the current offset compensation value.
[0120] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0121] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0122] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A cutting contour compensation method, characterized in that: The method comprises: Get the graphics element to be compensated; If the current offset compensation value is not zero and the primitive to be compensated exists, determining whether the primitive to be compensated is closed; If the primitive to be compensated is closed, compensation is performed using a closed contour compensation algorithm according to the current offset compensation value, and data is filled. Specifically, if the primitive to be compensated belongs to an outer contour, equidistant compensation is performed outward on the primitive to be compensated according to the current offset compensation value; If the to-be-compensated graphic element belongs to an inner contour, performing equidistant compensation inward on the to-be-compensated graphic element according to the current offset compensation value, and canceling compensation for the inner contour if the compensated graphic element intersects or crosses the boundary; If the to-be-compensated primitive is not closed, determining whether to enable open compensation; If open compensation is enabled, compensation is performed using the open contour compensation algorithm based on the current offset compensation value, and data is filled. Specifically, if the primitive to be compensated is open, the self-intersection points of the primitive to be compensated are searched for using a plane scanning algorithm based on a monotone chain, and invalid loops are eliminated. The self-intersection points are concave vertices of valid loops or convex vertices of invalid loops. If the graphics element to be compensated after the invalid ring is removed belongs to the outer contour, performing equidistant compensation on the graphics element to be compensated outward according to the current offset compensation value; If the primitive to be compensated after removing the invalid ring belongs to the inner contour, the primitive to be compensated is compensated inwardly at equal distances according to the current offset compensation value. If the primitive to be compensated intersects or crosses the boundary after compensation, the compensation is canceled.
2. The cutting contour compensation method according to claim 1, characterized in that: The method further comprises: If the unclosed compensation is not enabled, it is determined whether the next primitive to be compensated is closed.
3. The cutting contour compensation method according to claim 1, characterized in that: The method of performing outward equidistant compensation on the to-be-compensated graphic element or inward equidistant compensation on the to-be-compensated graphic element according to the current offset compensation value is as follows: If the primitive to be compensated is a circle, the current radius is added to the current offset compensation value or the current radius is added to the current offset compensation value to obtain a compensation radius, and the compensated primitive is obtained by using the compensation radius. If the compensation radius is less than zero, compensation is canceled; If the to-be-compensated primitive is not a circle, the to-be-compensated primitive is split into a set of straight lines or arcs, and equidistant compensation is performed outward or inward on each of the straight lines or arcs, and each intersection is connected to obtain a compensated primitive.
4. The cutting contour compensation method according to claim 3, characterized in that: When the arc is a multi-segment arc or an inner contour arc, specifically: If polyline arcs intersect, recalculate the start / end angles of each arc; or / and If the polyline arcs do not intersect, the arc ends and adjacent edges are extended; or / and If the arc is an inner contour arc and the radius after compensation is a negative number, the arc will be cancelled and converted to a straight line.
5. The cutting contour compensation method according to claim 1, characterized in that: Before determining whether the to-be-compensated primitive is closed, the method further includes: Initialize the current offset compensation value.
6. A cutting contour compensation device, characterized in that: The device comprises: A graphics primitive acquisition unit, used for acquiring graphics primitives to be compensated; a first judging unit, configured to judge whether the to-be-compensated primitive is closed if the current offset compensation value is not zero and the to-be-compensated primitive exists; a first compensation unit, configured to, if the to-be-compensated primitive is closed, perform compensation using a closed contour compensation algorithm according to the current offset compensation value, and fill in data; specifically, if the to-be-compensated primitive belongs to an outer contour, perform equidistant compensation outward on the to-be-compensated primitive according to the current offset compensation value; If the to-be-compensated graphic element belongs to an inner contour, performing equidistant compensation inward on the to-be-compensated graphic element according to the current offset compensation value, and canceling compensation for the inner contour if the compensated graphic element intersects or crosses the boundary; A second judgment unit is configured to judge whether to enable non-closed compensation if the to-be-compensated primitive is non-closed; A second compensation unit is configured to, if open compensation is enabled, perform compensation using an open contour compensation algorithm based on a current offset compensation value and fill in data. Specifically, if the primitive to be compensated is open, search for self-intersection points of the primitive to be compensated using a plane scanning algorithm based on a monotone chain, and then eliminate invalid loops, wherein the self-intersection points are concave vertices of valid loops or convex vertices of invalid loops; If the graphics element to be compensated after the invalid ring is removed belongs to the outer contour, performing equidistant compensation on the graphics element to be compensated outward according to the current offset compensation value; If the primitive to be compensated after removing the invalid ring belongs to the inner contour, the primitive to be compensated is compensated inwardly at equal distances according to the current offset compensation value. If the primitive to be compensated intersects or crosses the boundary after compensation, the compensation is canceled.
7. A cutting device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Wire electric discharge machine method and apparatus
CN101791727A
Rectangular workpiece position and angle measurement method
CN106197262A