Workpiece surface treatment method and device based on full-coverage random path and medium
Through the workpiece surface treatment method based on the full coverage random path, the problems of high labor intensity, low efficiency and uneven coverage in the traditional old-fashioned treatment method are solved, and a more efficient and uniform workpiece surface treatment effect is achieved.
Patent Information
- Application Number
- CN202411469686.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-11
AI Technical Summary
Traditional old-fashioning treatment methods have high labor intensity and low efficiency, and uneven coverage of processing paths, resulting in excessive or under-processing of some areas and low uniformity.
The workpiece surface treatment method based on a full coverage random path is adopted. By calculating the full coverage random path, the workpiece surface is processed to ensure that the path is completely covered and uniform.
Improve the efficiency, coverage and uniformity of workpiece surface treatment, reduce labor intensity and improve processing effect.
Smart Images

Figure CN119414777A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of aging treatment, and in particular to a workpiece surface treatment method, device and medium based on a full coverage random path. Background Art
[0002] The natural oxidation of metal workpieces is a complex surface effect that is usually random and uncertain. During the natural oxidation process, a thin oxide film is formed on the surface of the workpiece, which can change the properties and appearance of the material. The aging treatment of metal workpieces refers to processing the surface of the metal workpiece into a form that simulates natural aging. Traditional methods use manual processing, but the labor intensity is high and the efficiency is low. At the same time, the processing path is easy to deviate, making it difficult to completely cover the processing surface, and the coverage rate is low. In addition, the coverage density of the processing path is uneven, resulting in over-processing or under-processing in some areas and low uniformity.
[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention
[0004] The embodiments of the present invention provide a workpiece surface treatment method, device and medium based on a full coverage random path, which effectively improves efficiency, coverage and uniformity.
[0005] On the one hand, an embodiment of the present invention provides a workpiece surface treatment method based on a full coverage random path, comprising the following steps:
[0006] Acquiring edge contour information of a workpiece, wherein the edge contour of the workpiece is a polygon;
[0007] Generate a vertex set and an edge set according to the edge contour information;
[0008] Calculate the center point of the polygon according to the vertex set and the edge set;
[0009] Calculate a full coverage path according to the vertex set and the polygon center point;
[0010] According to the full coverage path, calculating a full coverage random path;
[0011] Calculating a path processing speed according to the polygon center point and the edge set;
[0012] The workpiece surface is processed according to the full coverage random path and the path processing speed.
[0013] In some embodiments, the step of calculating the center point of a polygon according to the vertex set and the edge set includes:
[0014] Extract two adjacent vertices from the vertex set;
[0015] Extracting edges corresponding to the two adjacent vertices from the edge set;
[0016] Calculate the edge center point of the edge according to the two adjacent vertices;
[0017] The polygon center point is calculated based on the multiple edge center points.
[0018] In some embodiments, the calculating the full coverage path according to the vertex set and the polygon center point includes:
[0019] Calculate the distance from each vertex in the vertex set to the center point of the polygon;
[0020] Select a minimum value from the distances from the plurality of vertices to the center point as the first distance;
[0021] Calculating the number of paths covered according to the working radius of the machining tool and the first distance;
[0022] According to the number of circles covered by the path, segment the line segment from each vertex in the vertex set to the center point of the polygon to obtain the corresponding path point;
[0023] Combining a plurality of the path points to obtain a path point set;
[0024] Every two adjacent path points in the path point set are connected to obtain the full coverage path.
[0025] In some embodiments, the calculating the full coverage random path according to the full coverage path includes:
[0026] Selecting a section of the path from the fully covered path as a path to be processed, wherein the path to be processed is located between two adjacent path points;
[0027] Calculating the path length of the path to be processed;
[0028] Calculating a normalized path direction according to the path length;
[0029] Calculating the number of interpolation segments according to the working radius of the machining tool and the path length;
[0030] Calculating an interpolation point according to the path length, the normalized path direction and the number of interpolation segments;
[0031] Generate a random disturbance value according to the preset working radius range;
[0032] Calculating a random disturbance point according to the interpolation point and the disturbance random value;
[0033] Connecting multiple random disturbance points to obtain the full coverage random path.
[0034] In some embodiments, the calculating the path processing speed according to the polygon center point and the edge set includes:
[0035] Calculate the edge-to-center distance from each edge in the edge set to the center point of the polygon;
[0036] Select a maximum value from the distances from the edges to the center point as the second distance;
[0037] The path processing speed is calculated according to the preset maximum processing speed, the second distance and the distance from the edge to the center point.
[0038] In some embodiments, calculating the number of path coverage circles according to the working radius of the processing tool and the first distance includes:
[0039] According to the working radius of the machining tool and the first distance, the path coverage number is calculated by a path coverage number calculation formula, and the path coverage number calculation formula is:
[0040]
[0041] Where n cirl is the number of circles covered by the path, floor(*) is the rounding function, R min is the first distance, and w is the working radius of the processing tool.
[0042] In some embodiments, the calculating the interpolation point according to the path length, the normalized path direction and the number of interpolation segments includes:
[0043] According to the path length, the normalized path direction and the number of interpolation segments, the interpolation point is calculated by using an interpolation point calculation formula, and the interpolation point calculation formula is:
[0044]
[0045] Where, PS k is the kth interpolation point, P i is the i-th path point, L i is the path length, n sec is the number of interpolation segments, dp i is the normalized path direction, k=1, 2, ..., n sec .
[0046] On the other hand, an embodiment of the present invention provides a workpiece surface treatment device based on a full coverage random path, comprising:
[0047] The first module is used to obtain edge contour information of a workpiece, where the edge contour of the workpiece is a polygon;
[0048] A second module is used to generate a vertex set and an edge set according to the edge contour information;
[0049] A third module is used to calculate the center point of the polygon according to the vertex set and the edge set;
[0050] A fourth module is used to calculate a full coverage path according to the vertex set and the polygon center point;
[0051] A fifth module is used to calculate a full coverage random path according to the full coverage path;
[0052] A sixth module is used to calculate a path processing speed according to the polygon center point and the edge set;
[0053] The seventh module is used to process the surface of the workpiece according to the full coverage random path and the path processing speed.
[0054] In another aspect, an embodiment of the present invention provides a computer device, comprising:
[0055] at least one processor;
[0056] at least one memory for storing at least one program;
[0057] When the at least one program is executed by the at least one processor, the at least one processor implements the described method.
[0058] On the other hand, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0059] The beneficial effects of the present invention are as follows:
[0060] The embodiment of the present invention first obtains the edge contour information of the workpiece, generates a vertex set and an edge set according to the edge contour information, then calculates the polygon center point according to the vertex set and the edge set, calculates the full coverage path according to the vertex set and the polygon center point, then calculates the full coverage random path according to the full coverage path, calculates the path processing speed according to the polygon center point and the edge set, and finally processes the workpiece surface according to the full coverage random path and the path processing speed, thereby realizing workpiece surface processing and improving efficiency, coverage and uniformity.
[0061] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0063] Figure 1 This is a flow chart of a workpiece surface treatment method based on a full coverage random path according to an embodiment of the present invention;
[0064] Figure 2 A schematic diagram of an edge profile of a workpiece according to an embodiment of the present invention;
[0065] Figure 3 A schematic diagram of a full coverage path according to an embodiment of the present invention;
[0066] Figure 4 A schematic diagram of marking path points in a full coverage path according to an embodiment of the present invention;
[0067] Figure 5 A schematic diagram of a fully covered random path according to an embodiment of the present invention;
[0068] Figure 6 A schematic diagram of an overall process of calculating a full coverage random path according to an embodiment of the present invention;
[0069] Figure 7 It is a structural schematic diagram of a workpiece surface treatment device based on a full coverage random path according to an embodiment of the present invention;
[0070] Figure 8 The figure is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0071] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0072] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0073] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0074] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0075] Before describing the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.
[0076] Distressed: refers to the process of giving new items the look and feel of old items through various means and techniques. Distressed can simulate the effects of natural use and wear, making new items look like old items that have been used for a long time and the baptism of time.
[0077] In the related art, the natural oxidation of metal is a complex surface effect that cannot be described by a simple model or parameter. This surface effect is usually random and uncertain because its occurrence and development are affected by many factors, such as environmental conditions, material properties, temperature and humidity. During the natural oxidation process, a thin oxide film is formed on the surface, which can change the properties and appearance of the material, such as color, hardness, wear resistance and corrosion resistance. The thickness and composition of this oxide film will change with time and environmental conditions, so the shape, color and texture of the natural oxidation surface effect will also change. This random and uncertain effect is usually described in the language of adoption. The aging treatment of metal crafts refers to processing the metal surface into a form that simulates natural aging. This process mostly uses manual processing to ensure that the texture and color of the metal surface present a natural, random, and non-obvious artificial treatment effect. Individual differences caused by manual processing help to improve the effect of aging treatment, but this aging process has high labor intensity and low efficiency, and there is a risk of occupational diseases in long-term work. In order to reduce labor intensity, the industry hopes to use robots to replace manual labor. In addition, the paths generated by traditional methods may not be able to completely cover the machining surface, with low coverage and uneven coverage density, with the density at the edge being significantly higher than that in some areas in the center. This uneven density is random, and in actual generation, due to parameter problems, some areas of the workpiece may be over-machined and some areas may be under-machined, resulting in low uniformity.
[0078] In view of this, an embodiment of the present invention provides a workpiece surface treatment method based on a full coverage random path. By calculating the full coverage random path, the workpiece surface treatment is performed, which can not only ensure that the processing path for each workpiece is different, but also ensure that the processing path can completely cover the surface to be processed, thereby improving efficiency, coverage and uniformity.
[0079] The workpiece surface treatment method based on full coverage random path provided in the embodiment of the present application relates to the field of aging treatment technology. The workpiece surface treatment method based on full coverage random path provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or it can be configured as a server cluster or distributed system composed of multiple physical servers, and can also be configured to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms and other basic cloud computing services. The server can also be a node server in a blockchain network; the software can be an application that implements a workpiece surface treatment method based on a full coverage random path, etc., but is not limited to the above forms.
[0080] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0081] The following is a detailed explanation of the embodiments of the present application in conjunction with the accompanying drawings:
[0082] Figure 1 is an optional flow chart of a workpiece surface treatment method based on a full coverage random path provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S107.
[0083] Step S101, obtaining edge contour information of a workpiece, where the edge contour of the workpiece is a polygon;
[0084] Step S102, generating a vertex set and an edge set according to edge contour information;
[0085] Step S103, calculating the center point of the polygon according to the vertex set and the edge set;
[0086] Step S104, calculating a full coverage path according to the vertex set and the polygon center point;
[0087] Step S105, calculating a full coverage random path according to the full coverage path;
[0088] Step S106, calculating the path processing speed according to the polygon center point and edge set;
[0089] Step S107: Processing the workpiece surface according to the full coverage random path and the path processing speed.
[0090] Steps S101 to S107 shown in the embodiment of the present application realize the surface treatment of the workpiece and improve the efficiency, coverage and uniformity.
[0091] In step S101 of some embodiments, the edge contour information of the workpiece can be obtained by scanning the workpiece. The edge contour information of the workpiece can also be obtained by other methods, not limited thereto. The edge contour of the workpiece is a polygon.
[0092] In some embodiments, in step S102, a vertex set and an edge set may be generated according to the edge profile information. Figure 2 As shown, the edge contour of the workpiece is a hexagon, which is a convex polygon. Each vertex is numbered to obtain a vertex set V = {V1, V2, V3, V4, V5, V6}, and each edge is numbered to obtain an edge set D = {D1, D2, D3, D4, D5, D6}.
[0093] In some embodiments, in step S103, the polygon center point is calculated according to the vertex set and the edge set, which may include but is not limited to the following steps:
[0094] Extract two adjacent vertices from the vertex set;
[0095] Extract the edges corresponding to two adjacent vertices from the edge set;
[0096] Calculate the edge center point of the edge based on two adjacent vertices;
[0097] Calculates the center point of a polygon based on multiple edge centers.
[0098] In some embodiments, two adjacent vertices may be first extracted from the vertex set, and then the edges corresponding to the two adjacent vertices may be extracted from the edge set. Figure 2In the example, when the two adjacent vertices extracted are V1 and V2, the corresponding edge is D1. Then, based on the two adjacent vertices, the edge center point is calculated. The calculation formula of the edge center point is: In the formula, C i is the center point of the ith edge, V i is the i-th vertex, V i+1 is the i+1th vertex. We can get the edge center point set C = {C1, C2, C3, C4, C5, C6}. Finally, the polygon center point is calculated based on multiple edge center points, where the calculation formula for the polygon center point is: Where O is the center point of the polygon, D i is the i-th edge, and I is the total number of edges.
[0099] In some embodiments, in step S104, the full coverage path is calculated according to the vertex set and the polygon center point, which may include but is not limited to the following steps:
[0100] Calculate the distance from each vertex in the vertex set to the center point of the polygon;
[0101] Select a minimum value from the distances from multiple vertices to the center point as the first distance;
[0102] Calculate the number of paths covered according to the working radius of the machining tool and the first distance;
[0103] According to the number of circles covered by the path, the line segment from each vertex in the vertex set to the center point of the polygon is segmented to obtain the corresponding path point;
[0104] Combine multiple path points to obtain a path point set;
[0105] Connect every two adjacent path points in the path point set to obtain a fully covered path.
[0106] In some embodiments, the vertex-to-center distance corresponding to each vertex in the vertex set and the center point of the polygon can be calculated first, wherein the vertex-to-center distance is calculated as follows: R = |V i -O|, where R is the distance from the vertex to the center, V i is the i-th vertex, and O is the center point of the polygon. Then, a minimum value is selected from the distances from multiple vertices to the center point as the first distance, where the mathematical expression for selecting the minimum value is: R min =min(R), where R min is the first distance, and min(*) is the minimum value function. Then, according to the working radius of the machining tool and the first distance, the path coverage circle number is calculated by the path coverage circle number calculation formula, where the path coverage circle number calculation formula is: Where ncirl is the number of circles covered by the path, floor(*) is the rounding function, R min is the first distance, and w is the working radius of the machining tool. Then, according to the number of circles covered by the path, the line segment from each vertex in the vertex set to the center point of the polygon is segmented to obtain the corresponding path point. For example, for each vertex V i , OV i The segment is divided into a number of sub-segments with the path covering the circle, and each path point is recorded as Then, multiple path points are combined to obtain a path point set, and finally, every two adjacent path points in the path point set are connected to obtain a full coverage path. Figure 3 As shown, for each j = 1, 2, ..., n cirl ,Will Connect them in the order of i=1,2,...,n to get a full coverage path.
[0107] In some embodiments, in step S105, calculating a full coverage random path based on the full coverage path may include but is not limited to the following steps:
[0108] A section of the path is selected from the fully covered path as a path to be processed, and the path to be processed is located between two adjacent path points;
[0109] Calculate the path length of the path to be processed;
[0110] According to the path length, the normalized path direction is calculated;
[0111] Calculate the number of interpolation segments according to the working radius of the machining tool and the path length;
[0112] Calculate interpolation points based on path length, normalized path direction and number of interpolation segments;
[0113] Generate a random disturbance value according to the preset working radius range;
[0114] Calculate random disturbance points based on interpolation points and disturbance random values;
[0115] Connect multiple random perturbation points to obtain a fully covered random path.
[0116] In some embodiments, a section of the path may be selected from the full coverage path as the path to be processed P. i P i+1 , where the path to be processed is located between two adjacent path points. For example, the path point annotation examples in the full coverage path are as follows: Figure 4 As shown, the path to be processed can be P1P2, P2P3, P3P4... Then the path length of the path to be processed is calculated, where the calculation formula of the path length is: L i=|P i+1 -P i |, where L i is the path length, P i+1 is the i+1th path point in the full coverage path, P i is the i-th path point in the full coverage path. Then, according to the path length, the normalized path direction is calculated, where the calculation formula of the normalized path direction is: In the formula, dp i is the normalized path direction. Then, the number of interpolation segments is calculated according to the working radius of the machining tool and the path length, where the calculation formula for the number of interpolation segments is: n sec =floor(L i / w), where n sec is the number of interpolation segments, floor(*) is the rounding function, and w is the working radius of the machining tool. Then, according to the path length, normalized path direction, and the number of interpolation segments, the interpolation point is calculated using the interpolation point calculation formula. i P i+1 Segment path, the interpolation point calculation formula is: Where, PS k is the kth interpolation point, P i is the i-th path point, L i is the path length, n sec is the number of interpolation segments, dp i is the normalized path direction, k = 1, 2, ..., n sec In order to increase the randomness of the interpolation point, a perturbation random value can be generated according to the preset working radius range. For example, a perturbation random value s can be taken within the range of [-w, w] as the interpolation point PS k Then, according to the interpolation point and the random value of the perturbation, the random perturbation point is calculated, where the calculation formula of the random perturbation point is: PF k =PS k +s, where PF k is a random perturbation point, and s is a random perturbation value. Finally, traverse each sub-path in the full coverage path, connect multiple random perturbation points, and obtain a full coverage random path as follows Figure 5 shown.
[0117] In some embodiments, in step S106, the path processing speed is calculated according to the polygon center point and the edge set, which may include but is not limited to the following steps:
[0118] Calculate the edge-to-center distance from each edge in the edge set to the center point of the polygon;
[0119] Select a maximum value from the distances from multiple edges to the center point as the second distance;
[0120] The path processing speed is calculated based on the preset maximum processing speed, the second distance and the distance from the edge to the center point.
[0121] In some embodiments, the edge-to-center distance corresponding to each edge in the edge set to the center point of the polygon can be calculated according to the straight-line-to-point distance formula, and then a maximum value is selected from multiple edge-to-center distances as the second distance. Finally, the path processing speed is calculated according to the preset maximum processing speed, the second distance and the edge-to-center distance, wherein the calculation formula of the path processing speed is: In the formula, v ij For waypoints Path processing speed, H i is the distance from the edge to the center, H max is the second distance, v max It is the preset maximum processing speed.
[0122] In some embodiments, in step S107, the workpiece surface can be processed according to the full coverage random path and the path processing speed. Exemplarily, the workpiece surface can be processed in sequence from the start path point to the end path point according to the full coverage random path, and different path segments are processed according to the calculated path processing speed. After the workpiece surface is processed, the aging process is completed to obtain an aged workpiece.
[0123] In some embodiments, the overall process of calculating the full coverage random path is as follows: Figure 6 As shown, we can first calculate the center point of the polygon based on the vertex coordinates of the convex polygon, then calculate the distance of the vertex closest to the center point, that is, the minimum value of the distance from the vertex to the center point of the polygon, then calculate the number of path coverage circles, calculate the full coverage path, and finally calculate the full coverage random path.
[0124] In some embodiments, this embodiment allows the area inside the entire polygon to be evenly covered, without the situation where the local coverage density is too dense or too sparse, thus avoiding serious unevenness during processing. This embodiment adds segmented disturbance to each sub-path in the full coverage path, so that each sub-path has a certain degree of randomness, ensuring that the repetition rate of the paths generated multiple times is low, so as to meet personalized processing needs. At the same time, this embodiment adjusts the processing speed according to the spacing of the paths, ensuring that the degree of processing is basically close when the width of adjacent paths changes. If the same speed is used, then when the two adjacent paths are relatively narrow, the repeated processing part will be more, and conversely when the path spacing is wider, the repeated processing part will be less. And this embodiment controls the processing time of each partial path by adjusting the speed to be basically consistent.
[0125] The beneficial effects of implementing the embodiments of the present invention include: the embodiments of the present invention first obtain edge contour information of the workpiece, generate a vertex set and an edge set based on the edge contour information, then calculate the polygon center point based on the vertex set and the edge set, calculate the full coverage path based on the vertex set and the polygon center point, then calculate the full coverage random path based on the full coverage path, calculate the path processing speed based on the polygon center point and the edge set, and finally process the workpiece surface based on the full coverage random path and the path processing speed, thereby achieving workpiece surface processing and improving efficiency, coverage and uniformity.
[0126] like Figure 7 As shown, an embodiment of the present invention further provides a workpiece surface treatment device based on a full coverage random path, comprising:
[0127] The first module 801 is used to obtain edge contour information of a workpiece, where the edge contour of the workpiece is a polygon;
[0128] The second module 802 is used to generate a vertex set and an edge set according to the edge contour information;
[0129] The third module 803 is used to calculate the center point of the polygon according to the vertex set and the edge set;
[0130] The fourth module 804 is used to calculate a full coverage path according to the vertex set and the polygon center point;
[0131] The fifth module 805 is used to calculate a full coverage random path according to the full coverage path;
[0132] The sixth module 806 is used to calculate the path processing speed according to the polygon center point and the edge set;
[0133] The seventh module 807 is used to process the surface of the workpiece according to the full coverage random path and the path processing speed.
[0134] The contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0135] like Figure 8 As shown, an embodiment of the present invention further provides a computer device, including:
[0136] at least one processor 901;
[0137] At least one memory 902, used to store at least one program;
[0138] When at least one program is executed by at least one processor, the at least one processor implements Figure 1The method shown.
[0139] The contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0140] The embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, Figure 1 The method shown.
[0141] The contents of the above method embodiments are all applicable to the present storage medium embodiments. The functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0142] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A workpiece surface treatment method based on a full coverage random path, characterized in that: The following steps are involved: Acquiring edge contour information of a workpiece, wherein the edge contour of the workpiece is a polygon; Generate a vertex set and an edge set according to the edge contour information; Calculate the center point of the polygon according to the vertex set and the edge set; Calculate a full coverage path according to the vertex set and the polygon center point; According to the full coverage path, calculating a full coverage random path; Calculating a path processing speed according to the polygon center point and the edge set; The workpiece surface is processed according to the full coverage random path and the path processing speed.
2. The method according to claim 1, characterized in that The step of calculating the center point of a polygon according to the vertex set and the edge set comprises: Extract two adjacent vertices from the vertex set; Extracting edges corresponding to the two adjacent vertices from the edge set; Calculate the edge center point of the edge according to the two adjacent vertices; The polygon center point is calculated based on the multiple edge center points.
3. The method according to claim 1, characterized in that The calculating the full coverage path according to the vertex set and the polygon center point comprises: Calculate the distance from each vertex in the vertex set to the center point of the polygon; Select a minimum value from the distances from the plurality of vertices to the center point as the first distance; Calculating the number of paths covered according to the working radius of the machining tool and the first distance; According to the number of circles covered by the path, segment the line segment from each vertex in the vertex set to the center point of the polygon to obtain the corresponding path point; Combining a plurality of the path points to obtain a path point set; Every two adjacent path points in the path point set are connected to obtain the full coverage path.
4. The method according to claim 1, characterized in that The calculating of a full coverage random path according to the full coverage path includes: Selecting a section of the path from the fully covered path as a path to be processed, wherein the path to be processed is located between two adjacent path points; Calculating the path length of the path to be processed; Calculating a normalized path direction according to the path length; Calculating the number of interpolation segments according to the working radius of the machining tool and the path length; Calculating an interpolation point according to the path length, the normalized path direction and the number of interpolation segments; Generate a random disturbance value according to the preset working radius range; Calculating a random disturbance point according to the interpolation point and the disturbance random value; Connecting multiple random disturbance points to obtain the full coverage random path.
5. The method according to claim 1, characterized in that The calculating the path processing speed according to the polygon center point and the edge set includes: Calculate the edge-to-center distance from each edge in the edge set to the center point of the polygon; Select a maximum value from the distances from the edges to the center point as the second distance; The path processing speed is calculated according to the preset maximum processing speed, the second distance and the distance from the edge to the center point.
6. The method according to claim 3, characterized in that The step of calculating the number of paths covered according to the working radius of the machining tool and the first distance includes: According to the working radius of the machining tool and the first distance, the path coverage number is calculated by a path coverage number calculation formula, and the path coverage number calculation formula is: Where n cirl is the number of circles covered by the path, floor(*) is the rounding function, R min is the first distance, and w is the working radius of the processing tool.
7. The method according to claim 4, characterized in that The calculating the interpolation point according to the path length, the normalized path direction and the number of interpolation segments includes: According to the path length, the normalized path direction and the number of interpolation segments, the interpolation point is calculated by using an interpolation point calculation formula, and the interpolation point calculation formula is: Where, PS k is the kth interpolation point, P i is the i-th path point, L i is the path length, n sec is the number of interpolation segments, dp i is the normalized path direction, k=1,2,…,n sec .
8. A workpiece surface treatment device based on a fully covered random path, characterized in that: include: The first module is used to obtain edge contour information of a workpiece, where the edge contour of the workpiece is a polygon; A second module is used to generate a vertex set and an edge set according to the edge contour information; A third module is used to calculate the center point of the polygon according to the vertex set and the edge set; A fourth module is used to calculate a full coverage path according to the vertex set and the polygon center point; A fifth module is used to calculate a full coverage random path according to the full coverage path; A sixth module is used to calculate a path processing speed according to the polygon center point and the edge set; The seventh module is used to process the surface of the workpiece according to the full coverage random path and the path processing speed.
9. A computer device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.