Cutting path generation method, device and program product
By obtaining the workpiece drawings and tool surface areas, controlling the tool surface areas to move within the cutting area, and determining the cutting position based on area changes, solving the problem of the inability to generate a special-shaped tool cutting path, realizing path generation and processing of different types of tools.
Patent Information
- Application Number
- CN202210927208.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-03
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2042-08-03
AI Technical Summary
The prior art cannot generate the cutting path of the special-shaped tool, resulting in the inability to process.
By obtaining the workpiece drawings and tool surface areas, the tool surface areas are controlled to move within the cutting area, and the cutting position is determined based on the area changes of the tool surface areas during the movement, and finally a cutting path is generated.
The cutting paths for different types of tools are realized, which solves the problem of not being able to generate cutting paths for special-shaped tools, and improves the efficiency and accuracy of path generation.
Smart Images

Figure CN115167285B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of numerical control programming, and in particular to a cutting path generation method, device and program product. Background Art
[0002] CNC programming refers to the process of generating a data processing program based on a workpiece drawing by a computer, which mainly includes steps such as analyzing the workpiece drawing, selecting the process and generating the cutting path. Among them, the cutting path refers to the path that the tool moves during the workpiece processing.
[0003] In the related art, when generating a cutting path, first, the user needs to select the type of standard tool used, such as: R-corner tool, pointed angle tool, angle tool, groove tool, etc.; then, the cutting path is generated based on the path generation algorithm corresponding to the standard tool selected by the user.
[0004] However, for user-made special-shaped tools other than standard tools, there is no path generation algorithm corresponding to the special-shaped tools in the relevant technology, which will lead to the problem that the cutting path of the special-shaped tools cannot be generated. Summary of the invention
[0005] In order to help improve the problem of being unable to generate a cutting path for a special-shaped tool, the present application provides a cutting path generation method, device and program product.
[0006] In a first aspect, the present application provides a cutting path generation method, which adopts the following technical solution:
[0007] A cutting path generation method, used in a path generation system, the method comprising:
[0008] In response to a path generation request, a workpiece drawing and a tool face region are acquired, wherein the workpiece drawing is obtained by projecting a workpiece model, and the tool face region is obtained by projecting the tool model;
[0009] Controlling the tool face to move within a cutting area, determining a cutting position based on a change in the area of the tool face during the movement, wherein the processing portion of the workpiece drawing is located within the cutting area;
[0010] When the position of the tool face region satisfies the end condition, a cutting path is generated based on each of the cutting positions.
[0011] By adopting the above technical solution, the path generation system responds to the path generation request sent by the user, obtains the workpiece drawing and the tool surface area, and controls the tool surface area to move in the cutting area, determines the cutting position based on the area change of the tool surface area during the movement, and finally generates a cutting path. It is possible to generate cutting paths for different types of tools, thereby solving the problem of being unable to generate cutting paths for special-shaped tools; since the type of tool does not need to be input during the path generation process, cutting paths for different types of tools can be generated, and it is also convenient for users to use.
[0012] Optionally, controlling the tool surface to move within the cutting area and determining the cutting position based on a change in area of the tool surface during the movement includes:
[0013] Acquire a moving starting point of the tool surface area, and determine the moving starting point as a first initial position;
[0014] Controlling the tool surface area to move a first distance from the first initial position to the first direction to determine whether the area of the tool surface area changes;
[0015] In the case where the area of the tool surface area changes, the cutting position is determined based on the current position of the tool surface area; the tool surface area is controlled to move to the first initial position; the tool surface area is controlled to move a second distance in a second direction to obtain a second initial position, and the second direction is perpendicular to the first direction;
[0016] The second initial position is determined as the first initial position, and the step of controlling the tool surface area to move a first distance from the first initial position in a first direction is performed to determine whether the area of the tool surface area changes.
[0017] By adopting the above technical solution, when the area of the tool surface domain changes, the cutting position is determined based on the current position of the tool surface domain, and the initial position of the tool surface domain is updated, and the movement of the tool surface domain is continuously controlled to continuously determine the cutting position. The cutting position can be accurately determined, and at the same time, the efficiency of cutting path generation can be improved.
[0018] Optionally, determining the second initial position as the first initial position includes:
[0019] determining whether the second initial position satisfies an end condition;
[0020] When the second initial position does not satisfy the end condition, the second initial position is determined as the first initial position.
[0021] By adopting the above technical solution, after determining the cutting position, it is first determined whether the second initial position meets the end condition. If the second initial position does not meet the end condition, the cutting position is determined. When the end condition is met, the search can be terminated in time, thereby improving the efficiency of generating the cutting path.
[0022] Optionally, controlling the tool surface to move a first distance from the first initial position to the first direction includes:
[0023] Determining whether the first initial position satisfies an end condition;
[0024] When the first initial position does not satisfy the end condition, the tool surface is controlled to move a first distance from the first initial position to the first direction.
[0025] By adopting the above technical solution, before determining the cutting position based on the first initial position, it is first determined whether the first initial position meets the end condition. When the first initial position does not meet the end condition, the step of continuing to determine the cutting position is executed. This can solve the problem that when the first initial position meets the end condition, the cutting position cannot be generated based on the first initial position or an erroneous cutting position is generated, and the accuracy of the generated cutting path can be improved.
[0026] Optionally, the controlling the tool surface area to move within the cutting area and determining the cutting position based on the area change of the tool surface area during the movement further includes:
[0027] When the area of the tool face region does not change, the tool face region is controlled to move the first distance in the first direction, and a step of determining whether the area of the tool face region changes is performed.
[0028] By adopting the above technical solution, when the area of the tool face does not change, the tool face is controlled to move in the first direction until the area of the tool face changes, thereby avoiding the problem of wasting time caused by blindly moving the tool face, thereby shortening the time for path generation.
[0029] Optionally, the obtaining of the moving starting point of the tool surface region and determining the moving starting point as the first one includes:
[0030] A moving starting point of the tool surface area is determined based on the position information of the processing portion.
[0031] By adopting the above technical solution, the initial position of the tool surface area is determined based on the position information of the processing part, which can reduce the moving range of the tool surface area, shorten the time to determine the cutting position, and thus shorten the time to generate the path.
[0032] Optionally, determining the moving starting point of the tool surface area based on the position information of the processing portion includes:
[0033] The processing portion is located in the first direction of the moving starting point, and the minimum distance between the moving starting point and the processing portion in the first direction is greater than the length of the tool surface area in the first direction;
[0034] The processing portion is located in the second direction of the moving starting point, and a minimum distance between the moving starting point and the processing portion in the second direction is smaller than a preset offset distance.
[0035] By adopting the above technical solution, the processing part is located in the first direction of the moving starting point, and the processing part is located in the second direction of the moving starting point. The tool surface only needs to move in the first direction and the second direction to determine all cutting positions, which can reduce the difficulty of implementing the method and also shorten the time for path generation.
[0036] Optionally, the workpiece drawing includes at least two component lines, and the method further includes:
[0037] determining a cutting line from each of the constituent lines;
[0038] A processing portion of the workpiece drawing is determined based on the cutting line.
[0039] By adopting the above technical solution, the influence of non-cutting lines in the workpiece drawing on the path generation process can be removed, thereby improving the accuracy of the determined cutting position and also shortening the path generation time.
[0040] In a second aspect, the present application provides a computer device, which adopts the following technical solution:
[0041] A computer device comprises a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute any one of the methods provided in the first aspect.
[0042] In a third aspect, the present application provides a computer program product, which adopts the following technical solution:
[0043] A computer program product comprises computer instructions. When the computer program product is run on a computer device, the computer device is caused to execute any one of the methods provided in the first aspect.
[0044] In summary, the present application includes at least one of the following beneficial technical effects:
[0045] 1. The path generation system generates a cutting path in response to a path generation request sent by a user. It is capable of generating cutting paths for different types of tools, thereby solving the problem of being unable to generate cutting paths for special-shaped tools. Since the type of tool does not need to be input during the path generation process, cutting paths for different types of tools can be generated, which is also convenient for users to use.
[0046] 2. When the area of the tool face domain changes, the cutting position is determined based on the current position of the tool face domain, and the first initial position of the tool face domain is updated, and the movement of the tool face domain is continued to be controlled to continuously determine the cutting position. The cutting position can be accurately determined, and the efficiency of generating the cutting position can also be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is a schematic diagram of the flow of the cutting path generation method provided in the embodiment of the present application;
[0048] Figure 2 It is a schematic diagram of a workpiece drawing and a tool surface area provided in an embodiment of the present application;
[0049] Figure 3 It is a drawing of an annular seal and a workpiece of the annular seal provided in an embodiment of the present application;
[0050] Figure 4 It is a schematic diagram of the cutter surface area provided in the embodiment of the present application;
[0051] Figure 5 It is a schematic diagram of the tool surface movement path provided in an embodiment of the present application;
[0052] Figure 6 is a schematic diagram of a tool movement trajectory provided in an embodiment of the present application;
[0053] Figure 7 It is a flowchart of an example of a path generation method provided in an embodiment of the present application;
[0054] Figure 8 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solutions and advantages of this application more clear, the following Figure 1-8 It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] First, several terms involved in the embodiments of the present application are introduced.
[0057] A region is a two-dimensional closed area with a certain boundary, which is a surface object. The boundary of a region can be formed by objects such as straight lines, polylines, circles, arcs or ellipses. Software programs can be used to fill patterns, color, analyze the geometric and physical characteristics of a region, and perform Boolean operations on the region.
[0058] A lathe refers to a machine tool that uses a tool to perform turning processing on a rotating workpiece.
[0059] An embodiment of the present application discloses a cutting path generation method, which is used in a path generation system. The path generation system can respond to a path generation request sent by a user, obtain a workpiece drawing and a tool surface area, and control the movement of the tool surface area in the cutting area, determine the cutting position based on the area change of the tool surface area during the movement, and finally generate a cutting path.
[0060] Among them, the path generation system can be integrated into other software as a plug-in, for example: integrated into computer-aided design (CAD) software as a plug-in, or it can also be an independently run system. As long as the cutting path generation method can be implemented, this embodiment does not limit the implementation method of the path generation system.
[0061] The embodiment of the present application is described by taking the path generation system running in an electronic device as an example. The electronic device is a terminal, a server or a lathe. The terminal can be a computer, a mobile phone, a tablet computer, etc. The embodiment of the present application does not limit the type of electronic device.
[0062] The present application embodiment discloses a cutting path generation method. Figure 1 , the method includes the following steps:
[0063] Step 101, in response to a path generation request, obtain a workpiece drawing and a tool surface area.
[0064] In one example, a path generation system may provide a user operation interface for receiving a path generation request issued by a user. The path generation request may include a path generation request and a tool surface area and other user-defined requirements. In one embodiment, the information may be data directly input by the user, and the data may be in the form of specific parameters or workpiece images, tool images, etc.; in another embodiment, the information may also be directly collected through an external device, such as through an external image acquisition and analysis device, etc. In this way, relevant operation data can be obtained directly based on the workpiece and the tool without relying on manual recognition. The operation is simple and output errors caused by errors in manual recognition can be avoided.
[0065] In an example, the workpiece drawing is a cross section of the workpiece model, and the tool face region is obtained by projecting the tool model.
[0066] In one example, if Figure 2 As shown, Figure 2 The tool part in the figure is the tool surface area 21, and the shaded part is the workpiece drawing 22.
[0067] Optionally, obtaining a workpiece drawing includes: obtaining a workpiece image; and intercepting a machined surface in the workpiece image to obtain a workpiece drawing.
[0068] The machining surface refers to the surface where the machining part is located, and the machining part refers to the part where the tool of the lathe contacts the workpiece during the machining of the workpiece.
[0069] Optionally, the workpiece image may be a design drawing of the workpiece, or may be an image obtained by capturing an image of the workpiece. This embodiment does not limit the type of the workpiece image.
[0070] In one example, intercepting a machined surface in a workpiece image to obtain a workpiece drawing includes: displaying the workpiece image on an operation interface of a path generation system; receiving a user's interception operation on the workpiece image; and intercepting the machined surface in the workpiece image based on the user's interception operation on the workpiece image to obtain a workpiece drawing.
[0071] In another example, intercepting a machining surface in a workpiece image to obtain a workpiece drawing includes: determining a rotation axis of the workpiece image, and intercepting the machining surface in the workpiece image based on the rotation axis to obtain a workpiece drawing.
[0072] For example: Figure 3 As shown, in one example, Figure 3 The workpiece in the figure is an annular seal 3a, and the annular seal 3a is cut along the AA line to obtain a workpiece drawing 3b of the annular seal.
[0073] In actual implementation, the workpiece drawing may also be obtained in other ways, such as receiving the workpiece drawing input by the user. This embodiment does not limit the way of obtaining the workpiece drawing.
[0074] Optionally, the tool surface area is pre-stored in the electronic device. In this case, the method of obtaining the tool surface area includes: determining the tool surface area based on the tool specifying operation of the user.
[0075] In one example, the tool designation operation is a tool identification input by a user, and different tool domains correspond to different tool identifications; accordingly, determining the tool domain based on the tool designation operation of the user includes: determining the tool domain based on the tool identification input by the user.
[0076] Optionally, the tool identification may be numbers, or letters, or a combination of numbers and letters. This embodiment does not limit the representation method of the tool identification.
[0077] In another example, the tool designation operation is a user's selection operation of a tool image, and different tool images correspond to different tool domains; accordingly, the domain is determined based on the user's tool designation operation, including: displaying tool images of each tool on an operation interface of a path generation system; receiving a user's selection operation of a tool image; and determining the tool domain based on the user's selection operation of the tool image.
[0078] In actual implementation, the tool surface area may also be obtained by other methods, such as: obtaining a tool image; determining the tool surface area based on the tool image. This embodiment does not limit the method of obtaining the tool surface area.
[0079] Since the workpiece drawing may include non-machined parts in addition to the machined parts, that is, there may be parts in the workpiece drawing that are not formed by the lathe machining process, this will lead to the problem that the cutting path cannot be accurately determined directly based on the workpiece drawing.
[0080] Based on the above technical problem, optionally, the workpiece drawing includes at least two constituent lines, and the path generation method further includes: determining a cutting line from each constituent line; and determining a processing portion of the workpiece drawing based on the cutting line.
[0081] Among them, the constituent lines refer to: the lines in the workpiece drawing.
[0082] In one example, determining a cutting line from each constituent line includes: displaying each constituent line on an operation interface of a path generation system; receiving a user's selection operation on the constituent line; and determining the cutting line based on the received user's selection operation on the constituent line.
[0083] Step 102, controlling the tool face to move within the cutting area, determining the cutting position based on the area change of the tool face during the movement, and the processing portion of the workpiece drawing is located within the cutting area.
[0084] The cutting area refers to the moving range of the tool surface.
[0085] The cutting position refers to the position of the tool surface when the tool surface cuts the processing part.
[0086] The area of the tool domain refers to the area of the two-dimensional closed area corresponding to the tool domain. When the tool domain does not intersect with other objects, the area of the tool domain is the initial area of the tool domain; when it intersects with other objects, the area of the tool domain is the difference between the initial area of the tool domain and the area of the intersection of the tool domain and other objects.
[0087] The area change of the tool face region refers to the change of the current area of the tool face region relative to the initial area of the tool face region.
[0088] Optionally, in order to make the determined cutting position match the actual cutting position of the tool during the lathe cutting process, the shape of the cutting area is the same as the shape of the moving range of the turning tool installed on the lathe.
[0089] When the tool face region is cut to the processing part, the tool face region partially overlaps with the processing part, which will cause the area of the tool face region to decrease. Therefore, the cutting position can be determined based on the area change of the tool face region.
[0090] In one example, if Figure 4 As shown, the initial area of the tool surface domain 21 is A; when cutting to the processing portion 22, the area of the intersection of the tool surface domain 21 and the processing portion 22 is B. At this time, the area of the tool surface domain 21 is AB, that is, the area of the tool surface domain 21 is reduced.
[0091] Optionally, in order to make the processing part of the workpiece drawing located within the cutting area, the cutting area can be determined based on the position of the processing part, or the position of the processing part can be determined first and then the processing part can be dragged into the cutting area. This embodiment does not limit the method of making the processing part located within the cutting area.
[0092] Optionally, the moving direction of the tool surface area includes: a first direction, a second direction, a direction opposite to the first direction and a direction opposite to the second direction, and the first direction is perpendicular to the second direction.
[0093] In order to facilitate the description of the position and cutting position of the tool surface area, in this embodiment, a moving coordinate system is established, the first direction is the positive direction of the X-axis in the moving coordinate system, and the second direction is the negative direction of the Z-axis in the moving coordinate system. At this time, the position and cutting position of the tool surface area are expressed using coordinates on the moving coordinate system.
[0094] In actual implementation, the first direction may also be the negative direction of the X-axis in the moving coordinate system, and the second direction may also be the positive direction of the Z-axis in the moving coordinate system. This embodiment does not limit the first direction and the second direction.
[0095] Further, such as Figure 5 As shown, in this embodiment, the positive direction of the X-axis of the moving coordinate system is taken as the top, and the positive direction of the Z-axis is taken as the right. Correspondingly, the direction opposite to the positive direction of the X-axis is taken as the bottom, and the direction opposite to the positive direction of the Z-axis is taken as the left.
[0096] In one example, the moving coordinate system is the same as the coordinate system used by the lathe, that is, in the moving coordinate system and the coordinate system used by the lathe, the position of the origin in the tool moving range, the positive direction of the X axis, the positive direction of the Z axis, and the scale ratio of the scale in the coordinate system to the actual distance are all the same. At this time, the coordinates of the tool face in the moving coordinates are the coordinates of the corresponding position of the tool in the coordinate system used by the lathe.
[0097] In another example, the mobile coordinate system is different from the coordinate system used by the lathe. In actual use, it is necessary to convert the coordinates of the moving surface area in the mobile coordinate system based on the mapping relationship between the mobile coordinate system and the coordinate system used by the lathe to obtain the coordinates of the tool position corresponding to the coordinate coefficient used by the lathe.
[0098] Optionally, controlling the tool face domain to move within the cutting range includes: obtaining a moving starting point of the tool face domain, and determining the moving starting point as a first initial position; controlling the tool face domain to move a first distance from the first initial position in a first direction, and determining whether the area of the tool face domain changes.
[0099] In the case where the area of the tool face domain changes, the cutting position is determined based on the current position of the tool face domain; the tool face domain is controlled to move to a first initial position; the tool face domain is controlled to move a second distance in a second direction to obtain a second initial position; the second initial position is determined as the first initial position, and the steps of controlling the tool face domain to move a first distance in a first direction from the first initial position to determine whether the area of the tool face domain has changed.
[0100] When the area of the tool face region does not change, the tool face region is controlled to move a first distance in a first direction, and a step of determining whether the area of the tool face region changes is performed.
[0101] By determining the cutting position based on the current position of the tool face domain when the area of the tool face domain changes, updating the initial position of the tool face domain, and continuing to control the movement of the tool face domain, the cutting position is continuously determined. The cutting position can be accurately determined, and at the same time, the efficiency of cutting path generation can be improved.
[0102] In one example, obtaining the moving starting point of the tool surface region includes: determining the moving starting point of the tool surface region based on position information of the processing portion.
[0103] Optionally, the moving starting point of the tool surface area is determined based on the position information of the processing part, including: the processing part is located in a first direction of the moving starting point, and the minimum distance between the moving starting point and the processing part in the first direction is greater than the length of the tool surface area in the first direction; the processing part is located in a second direction of the moving starting point, and the minimum distance between the moving starting point and the processing part in the second direction is less than a preset offset distance.
[0104] Among them, the offset distance is pre-stored in the electronic device and can be set according to the movement accuracy of the tool surface in the second direction. Therefore, in a specific implementation, the user can set the offset distance corresponding to each movement accuracy according to the requirements of the offset distance for each movement accuracy in advance. When the tool surface moves to the second direction with a certain movement accuracy, the system can obtain the corresponding offset distance according to the movement accuracy. In this way, the requirements of different movement accuracies can be met.
[0105] In another example, obtaining the moving starting point of the tool surface region includes: determining the moving starting point based on the cutting area.
[0106] Optionally, the moving starting point is located at the lower right corner of the uncut area.
[0107] In actual implementation, the moving starting point of the tool surface area may also be determined in other ways, such as: determining the moving starting point of the tool surface area based on the user's input operation. This embodiment does not limit the method for determining the starting position of the tool surface area.
[0108] In one example, the movement starting point is located on the Z axis.
[0109] Optionally, the first distance is determined based on the movement accuracy of the tool surface in the first direction, and the second distance is determined based on the movement accuracy of the tool surface in the second direction. The first distance and the second distance may be the same or different. This embodiment does not limit the size of the first distance and the second distance.
[0110] In one example, the first distance and the second distance are the same, both being 0.01 mm.
[0111] Optionally, the movement accuracy in the first direction and the movement accuracy in the second direction may be directly input by the user, or may be determined according to a lathe model input by the user. This embodiment does not limit the method for obtaining the movement accuracy.
[0112] In one example, the first distance is pre-stored in an electronic device. In a specific implementation, the user can pre-set the first distances corresponding to the various movement accuracies according to the requirements for the first distance. When the tool surface moves in the first direction with a certain movement accuracy, the system can obtain the corresponding first distance according to the movement accuracy. In this way, the requirements for different movement accuracies can be met.
[0113] In actual implementation, the first distance may also be directly input by the user, and this embodiment does not limit the method for determining the first distance.
[0114] In this embodiment, the method for determining the second distance is the same as the method for determining the first distance described above, and this embodiment will not be repeated herein.
[0115] In order to more clearly illustrate the movement process of the tool surface, an example is provided below. Figure 5 As shown, this example takes the first three cutting positions of the processing portion 22 as an example. In this example, the first distance and the second distance are the same, both K; the first direction is upward, and the second direction is left.
[0116] The tool surface domain 21 moves upward from the first initial position 1 in steps of K. When it moves to position 2, the area of the tool surface domain 21 changes. At this time, the first cutting position is determined based on position 2, and the tool surface domain 21 is controlled to move to position 3 (position 3 coincides with the first initial position 1). The tool surface domain 21 is controlled to move left by K to reach the second initial position 4, and the second initial position 4 is determined as the first initial position 4.
[0117] The tool surface domain 21 moves upward from the first initial position 4 in steps of K. When it moves to position 5, the area of the tool surface domain 21 changes. At this time, the second cutting position is determined based on position 5, and the tool surface domain 21 is controlled to move to position 6 (position 6 coincides with the first initial position 4). The tool surface domain 21 is controlled to move left by K to reach the second initial position 7, and the second initial position 7 is determined as the first initial position 7.
[0118] The tool surface area 21 moves upward from the first initial position 7 with a step size of K. When it moves to position 8, the area of the tool surface area 21 changes. At this time, the third cutting position is determined based on position 9, and the tool surface area 21 is controlled to move to position 9 (position 9 coincides with the first initial position 7).
[0119] Since the tool face domain has intersected with the workpiece when the area of the tool face domain changes, directly determining the current position of the tool face domain as the cutting position will cause overcutting of the workpiece. Therefore, in this embodiment, when the area of the tool face domain changes, the cutting position is determined based on the current position of the tool face domain, including: obtaining the reference coordinates of the current position of the tool face domain; moving the reference coordinates in a direction opposite to the first direction by a reference distance to obtain the coordinates of the cutting position.
[0120] Optionally, the reference distance is pre-stored in the electronic device and can be set according to the first distance. Therefore, in a specific embodiment, the user can pre-set the reference distance corresponding to each first distance according to the requirements of the reference distance for each first distance. When the tool surface moves in the first direction at a certain first distance, the system can obtain the corresponding reference distance based on the first distance. In this way, the requirements of different first distances can be met.
[0121] Optionally, the reference distance is less than or equal to the first distance.
[0122] In one example, the reference distance is equal to the first distance.
[0123] When the initial area is not determined based on the position of the processing part, the first initial position may be far away from the processing part. At this time, if the tool surface is controlled to move from the first initial position to the first direction, the area of the tool surface may not change during the movement, thereby making it impossible to determine the cutting position.
[0124] Based on the above technical problem, optionally, when the area of the tool surface region does not change, the tool surface region is controlled to move a first distance in a first direction, and the step of determining whether the area of the tool surface region changes is performed, including: when the area of the tool surface region does not change, determining whether the current position of the tool surface region meets the condition for continuing the search;
[0125] When the current position of the tool face region satisfies the continuing search condition, controlling the tool face region to move a first distance in a first direction, and executing the step of determining whether the area of the tool face region changes;
[0126] When the current position of the tool face domain does not meet the conditions for continuing the search, the tool face domain is controlled to move to the first initial position; the tool face domain is controlled to move a second distance in a second direction; the current position of the tool face domain is determined as the first initial position, and the tool face domain is controlled to move from the first initial position to the first direction by the first distance to determine whether the area of the tool face domain changes.
[0127] In one example, the continued search condition is determined based on the position of the processing part. At this time, the continued search condition can be determined based on the maximum value of the coordinates of the processing part in the first direction. For example, the continued search condition is that the coordinates of the tool surface area in the first direction are less than the maximum value of the coordinates of the processing part in the first direction.
[0128] In another example, the continued search condition is determined based on the cutting area. In this case, the continued search condition can be determined based on the boundary of the cutting area in the first direction, for example, the continued search condition is that the tool face is within the boundary of the cutting area in the first direction.
[0129] In actual implementation, the continued search condition may also be determined based on other methods, for example, the continued search condition is determined based on the number of times the tool surface area moves continuously in the first direction. This embodiment does not limit the method for determining the continued search condition.
[0130] Optionally, during the movement of the tool face region, it is necessary to determine whether the position of the tool face region meets the end condition. If the position of the tool face region meets the end condition, execute step 103; if the position of the tool face region does not meet the end condition, continue to determine the cutting position.
[0131] In one example, the end condition is determined based on a preset end position. In this case, the end condition may be: the position of the tool face region coincides with the end position or the position of the tool face region is located in a second direction of the end position.
[0132] In another example, the end condition is determined based on the cutting area. In this case, the end condition can be determined based on the boundary of the cutting area in the second direction. For example, the end condition is that the tool face is outside the boundary of the cutting area in the second direction.
[0133] In actual implementation, the end condition may also be determined based on other methods. For example, the end condition may be determined based on the maximum value of the coordinates of the processing part in the second direction. This embodiment does not limit the method for determining the end condition.
[0134] Optionally, determining whether the position of the tool face region meets the end condition includes the following situations:
[0135] The first one is, when the second initial position is determined as the first initial position, whether the position of the tool surface domain meets the end condition, at this time, the second initial position is determined as the first initial position, including: determining whether the second initial position meets the end condition; if the second initial position does not meet the end condition, determining the second initial position as the first initial position; if the position of the tool surface domain meets the end condition, executing step 103.
[0136] The second method is to determine whether the position of the tool face domain satisfies the end condition when controlling the tool face domain to move from the first initial position to the first direction. At this time, the tool face domain is controlled to move a first distance from the first initial position to the first direction, including: determining whether the first initial position satisfies the end condition; if the first initial position does not satisfy the end condition, controlling the tool face domain to move a first distance from the first initial position to the first direction; if the position of the tool face domain satisfies the end condition, executing step 103.
[0137] Step 103: When the position of the tool face region meets the end condition, a cutting path is generated based on each cutting position.
[0138] Optionally, generating a cutting path based on each cutting position includes: arranging each cutting position in a generation order to obtain the cutting path.
[0139] In actual implementation, when the actual moving direction of the tool is opposite to the second direction during the machining process, a cutting path is generated based on each cutting position, including: arranging each cutting position in an order opposite to the generation order to obtain a cutting path.
[0140] In one example, the cutting path is stored in a path array, and the elements in the path array are used to store the coordinates of the cutting positions. At this time, the cutting positions are arranged in a generated order to obtain the cutting path, including: inserting the coordinates of each cutting position into the path array in a generated order to obtain the cutting path.
[0141] In CNC machining, the format of the control program is modal code + cutting position coordinates. For example: the modal code is G01, the cutting position coordinates are (X=10, Z=10), (X=10.1, Z=10.1) and (X=10.2, Z=10.2), then the corresponding control program is as follows:
[0142] G01 X10,Z10
[0143] X10.1 Z10.1
[0144] X10.2 Z10.2
[0145] In one embodiment, the tool moves according to the cutting path as shown in FIG. Figure 6 shown.
[0146] The implementation principle of the embodiment of the present application is as follows: the path generation system responds to the path generation request sent by the user, obtains the workpiece drawing and the tool surface area, and controls the tool surface area to move in the cutting area, determines the cutting position based on the area change of the tool surface area during the movement, and finally generates a cutting path. It can generate cutting paths for different types of tools, thereby solving the problem of being unable to generate cutting paths for special-shaped tools; since the type of tool does not need to be input during the path generation process, cutting paths for different types of tools can be generated, and it can also be convenient for users to use.
[0147] In addition, when the area of the tool surface changes, the cutting position is determined based on the current position of the tool surface, and the initial position of the tool surface is updated. The movement of the tool surface is continuously controlled to continuously determine the cutting position. The cutting position can be accurately determined, and at the same time, the efficiency of cutting path generation can be improved.
[0148] In addition, before determining the cutting position based on the first initial position, it is first determined whether the first initial position meets the end condition. When the first initial position does not meet the end condition, the step of continuing to determine the cutting position is executed. This can solve the problem that when the first initial position meets the end condition, the cutting position cannot be generated based on the first initial position or an incorrect cutting position is generated, and the accuracy of the generated cutting path can be improved.
[0149] In order to more clearly understand the cutting path generation method provided by the present application, the present application embodiment also gives an example to illustrate the method. In this example, the first direction is upward along the X-axis, the second direction is left along the Z-axis, the first distance and the second distance are both K, and the initial area of the tool surface is A. Figure 7 As shown, the method includes the following steps:
[0150] Step 701, in response to a path generation request, obtain a workpiece drawing and a tool face region.
[0151] Step 702, control the tool surface to move K to the left along the Z axis.
[0152] Step 703, controlling the tool surface to move upward along the X-axis by K.
[0153] Step 704, obtain the area of the tool surface domain and determine whether the area of the tool surface domain is less than A; if the area of the tool surface domain is equal to A, execute step 703; if the area of the tool surface domain is less than A, execute step 705.
[0154] Step 705: Subtract K from the X coordinate of the current position of the tool face and insert it into the path array together with the Z coordinate of the current position.
[0155] Step 706, control the tool surface to move downward along the X axis to the position X=0.
[0156] Step 707, determine whether the Z coordinate of the current position of the tool surface area meets the end condition; if the Z coordinate of the current position of the tool surface area does not meet the end condition, execute step 702; if the Z coordinate of the current position of the tool surface area meets the end condition, execute step 708.
[0157] Step 708: output the path array and the process ends.
[0158] For details, refer to the above cutting path generation method.
[0159] The implementation principle of the embodiment of the present application is: when the area of the tool surface does not change, the tool surface is controlled to move upward until the area of the tool surface changes, which can avoid the problem of wasting time caused by blindly moving the tool surface, thereby shortening the time for path generation.
[0160] The embodiment of the present application also discloses a computer device.
[0161] Specifically, the computer device includes a memory and a processor.
[0162] like Figure 8As shown, a server disclosed in the present application is shown, the computer device includes a memory 810 and a processor 820. The number of the processor 820 in the computer device can be one or more. Figure 8 A processor 820 is taken as an example; the memory 810 and the processor 820 in the device may be connected via a bus or other means. Figure 8 The example of connecting through bus is taken in the following.
[0163] The memory 810, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the cutting path generation method in the embodiment of the present invention; the processor 820 executes various functional applications and data processing of the device / terminal / device by running the software programs, instructions and modules stored in the memory 810, thereby realizing the above-mentioned cutting path generation method.
[0164] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0165] The embodiment of the present application also discloses a computer program product.
[0166] Specifically, the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a training device or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device or data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integration. Available media can be magnetic media, (e.g., floppy disk, hard disk, tape), optical media (e.g., DVD), or semiconductor media (e.g., solid-state drive (SSD)), etc.
[0167] The above are all preferred embodiments of the present application, and are not intended to limit the protection scope of the present application. Any feature disclosed in this specification (including the abstract and drawings), unless otherwise stated, can be replaced by other equivalent or alternative features with similar purposes. That is, unless otherwise stated, each feature is only an example of a series of equivalent or similar features.
Claims
1. A cutting path generation method, characterized in that: Used in a path generation system, the method comprises: In response to a path generation request, a workpiece drawing and a tool surface area are acquired, wherein the processing portion of the workpiece drawing is located in the cutting area; and the tool surface area is obtained by projecting the tool model; Controlling the tool surface area to move within the cutting area, and determining the cutting position based on the area change of the tool surface area during the movement; the area of the tool surface area refers to the area of the closed area corresponding to the tool surface area; When the position of the tool face region satisfies the end condition, a cutting path is generated based on each of the cutting positions.
2. The method according to claim 1, characterized in that The controlling the tool surface area to move within the cutting area and determining the cutting position based on the area change of the tool surface area during the movement process includes: Acquire a moving starting point of the tool surface area, and determine the moving starting point as a first initial position; Controlling the tool surface area to move a first distance from the first initial position to a first direction to determine whether the area of the tool surface area changes; In the case where the area of the tool surface area changes, the cutting position is determined based on the current position of the tool surface area; the tool surface area is controlled to move to the first initial position; the tool surface area is controlled to move a second distance in a second direction to obtain a second initial position, and the second direction is perpendicular to the first direction; The second initial position is determined as the first initial position, and the step of controlling the tool surface area to move a first distance from the first initial position in a first direction is performed to determine whether the area of the tool surface area changes.
3. The method according to claim 2, characterized in that The step of determining the second initial position as the first initial position comprises: determining whether the second initial position satisfies an end condition; When the second initial position does not satisfy the end condition, the second initial position is determined as the first initial position.
4. The method according to claim 2, characterized in that: The controlling the tool surface to move from the first initial position to the first direction by a first distance comprises: Determining whether the first initial position satisfies an end condition; When the first initial position does not satisfy the end condition, the tool surface is controlled to move a first distance from the first initial position to the first direction.
5. The method according to claim 2, characterized in that: The controlling the tool surface area to move within the cutting area and determining the cutting position based on the area change of the tool surface area during the movement process further includes: When the area of the tool face region does not change, the tool face region is controlled to move the first distance in the first direction, and a step of determining whether the area of the tool face region changes is performed.
6. The method according to claim 2, characterized in that The step of obtaining the moving starting point of the tool surface region includes: A moving starting point of the tool surface area is determined based on the position information of the processing portion.
7. The method according to claim 6, characterized in that The step of determining the moving starting point of the tool surface region based on the position information of the processing portion includes: The processing portion is located in the first direction of the moving starting point, and the minimum distance between the moving starting point and the processing portion in the first direction is greater than the length of the tool surface area in the first direction; The processing portion is located in the second direction of the moving starting point, and a minimum distance between the moving starting point and the processing portion in the second direction is smaller than a preset offset distance.
8. The method according to claim 1, characterized in that The workpiece drawing includes at least two component lines, and the method further includes: determining a cutting line from each of the constituent lines; A processing portion of the workpiece drawing is determined based on the cutting line.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute the method according to any one of claims 1 to 8.
10. A computer program product comprising computer instructions, characterized in that: When the computer program product is run on a computer device, the computer device is caused to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Tool bit effective machining area calculation based on three scan line and cutter path creation method
CN101216706A
Method and system for determining path of tool machining pocket shape
CN106133628A