Processing path planning method, computer equipment, storage medium and program product

By clustering the triangular facets of the 3D object model and planning the intersection of the scanning plane, the problem of uneven machining density of complex 3D curved surface workpieces is solved, and efficient and smooth machining path planning is achieved.

CN120724745APending Publication Date: 2025-09-30SHENZHEN SHUMA ELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510821403.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-17
Publication Date
2025-09-30

AI Technical Summary

Technical Problem

Traditional machining path planning methods are difficult to ensure consistent machining density of complex three-dimensional curved workpieces, resulting in significant differences in machining effects between different areas.

Method used

By acquiring the triangular face data in the 3D object model, clustering processing is performed to form a triangular face group, and a reference scanning plane with a preset angle to the triangular face group is determined. The scanning plane is moved to determine the intersection point, and the target processing path is planned according to the intersection point. Interpolation processing is used to ensure consistent processing density.

Benefits of technology

It achieves smooth and uniform processing of three-dimensional models, improves processing quality and efficiency, reduces laser reflection errors, and simplifies the calculation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120724745A_ABST
    Figure CN120724745A_ABST
Patent Text Reader

Abstract

The invention relates to a machining path planning method, computer equipment, a storage medium and a program product. The method comprises the following steps: acquiring data of a triangular patch in a three-dimensional object model; the data of the triangular patches comprises vector data of the triangular patches; performing clustering processing on the triangular patches according to the vector data to obtain a triangular patch group; for each triangular patch group in the three-dimensional object model, determining a reference scanning plane forming a preset included angle with the triangular patch group; the preset included angle comprises an angle in a vertical range; moving the reference scanning plane, and determining an intersection point of the moved reference scanning plane and each triangular patch in the corresponding triangular patch group; and determining a target processing path of the three-dimensional object model according to the intersection point. By adopting the method, a smooth and uniform processing path can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer-aided manufacturing technology, and in particular to a processing path planning method, computer equipment, storage medium, and program product. Background Art

[0002] Processing equipment usually relies on preset path trajectories to operate on workpieces (such as cutting, welding, and engraving). For simple two-dimensional plane paths, traditional technologies can generate them efficiently. The current mainstream process uses surface parametric unfolding technology to project the three-dimensional model onto a two-dimensional plane for path planning, and then generate a three-dimensional processing trajectory through inverse coordinate transformation. However, when the processing object is a complex three-dimensional surface (such as automotive parts, complex molds), the traditional processing path planning method is difficult to ensure a large gap in processing density, resulting in significant differences in processing effects between different areas. Summary of the Invention

[0003] Based on this, it is necessary to provide a processing path planning method, computer equipment, storage medium and program product to address the above technical problems, so as to obtain a smooth and uniform processing path.

[0004] A machining path planning method, the method comprising:

[0005] Acquire data of triangular facets in a three-dimensional object model; the data of the triangular facets includes vector data of the triangular facets;

[0006] Performing clustering processing on the triangular facets according to the vector data to obtain a triangular facet group;

[0007] For each triangular facet group in the three-dimensional object model, determining a reference scanning plane that forms a preset angle with the triangular facet group; the preset angle includes an angle within a vertical range;

[0008] Moving the reference scanning plane, and determining the intersection of the moved reference scanning plane and each triangular facet in the corresponding triangular facet group;

[0009] A target processing path of the three-dimensional object model is determined according to the intersection point.

[0010] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of each embodiment of a machining path planning method when executing the computer program.

[0011] A computer-readable storage medium stores a computer program, which implements the steps of each machining path planning method embodiment when executed by a processor.

[0012] A computer program product includes a computer program, which implements the steps of each machining path planning method embodiment when the computer program is executed by a processor.

[0013] The above-mentioned processing path planning method, computer equipment, storage medium and program product obtain the data of triangular facets in the three-dimensional object model, cluster the triangular facets according to the vector data, and obtain a triangular facet group, and the obtained triangular facet group has similar vectors; determine a reference scanning plane with a preset angle to the triangular facet group, and the preset angle includes an angle within a vertical range to ensure that the angle between the reference scanning plane and the triangular facet is maximized, reduce laser reflection errors, and is suitable for large-scale three-dimensional object models; move the scanning plane, determine the intersection points of the moved reference scanning plane and each triangular facet in the corresponding triangular facet group, and determine the target processing path of the three-dimensional object model according to the intersection points, which can control the spacing of the intersection points, ensure that the processing density is as consistent as possible, obtain a smooth and uniform processing path, and improve the processing effect of the three-dimensional model; in addition, the above-mentioned method is simple and fast to calculate, not prone to errors, and improves the efficiency of processing path planning. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. 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 paying any creative work.

[0015] Figure 1 1 is a flow chart of a processing path planning method in one embodiment;

[0016] Figure 2 A schematic diagram of a process of clustering triangles in one embodiment;

[0017] Figure 3 A schematic diagram of a reference scanning plane in one embodiment;

[0018] Figure 4 is a schematic diagram of the intersection points and processing paths during the movement of the scanning plane in one embodiment;

[0019] Figure 5 is a schematic diagram of a target processing path in one embodiment;

[0020] Figure 6 Schematic diagram of a process flow of a processing path planning method in another embodiment;

[0021] Figure 7 Schematic diagram of a clustering process in one embodiment;

[0022] Figure 8 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0023] 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.

[0024] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0025] It should be noted that all directional indications in the embodiments of the present application (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly. The connection can be a direct connection or an indirect connection.

[0026] In addition, the descriptions of "first", "second", etc. in this application are for descriptive purposes only and should not be understood as indicating or implying their relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0027] It can be understood that the “connection” in the following embodiments should be understood as “electrical connection”, “communication connection”, etc. if there is transmission of electrical signals or data between the connected circuits, modules, units, etc.

[0028] It can be understood that the operation of "obtaining data" in the embodiments of the present application includes but is not limited to the following implementation methods: directly reading the original data pre-stored in the device; or indirect acquisition after data collection, conversion and processing.

[0029] The processing path planning method provided in this application can be applied to computer devices. Computer devices can include, but are not limited to, various terminal devices such as personal computers, laptops, smartphones, tablet computers, and portable wearable devices, as well as various processing equipment such as CNC machines and laser processing equipment.

[0030] In one embodiment, Figure 1 FIG. 1 is a flow chart of a processing path planning method according to an embodiment. Taking the method applied to a computer device as an example, the method includes the following steps:

[0031] Step 102: Acquire data of triangular facets in the three-dimensional object model; the data of triangular facets includes vector data of the triangular facets.

[0032] Among them, in computer graphics, a three-dimensional object model is a way to describe the shape of an object through mathematical methods. It is usually composed of a series of vertices, edges and faces. The formats of three-dimensional object models include but are not limited to STL (STereoLithography) and OBJ (Object File Format). STL is a file format used for rapid prototyping and computer-aided design, which represents a three-dimensional model as a series of triangular facets. OBJ is a general 3D graphics file format that can also represent a three-dimensional model composed of triangular facets. The three-dimensional object model can specifically be a three-dimensional model of a workpiece, which is used to describe a three-dimensional digital model of a mechanical part, product component or other physical object. These models can be used for various purposes, such as design verification, manufacturing preparation, simulation analysis, etc.

[0033] In 3D models, the surface of an object is typically broken down into many small triangular facets. The data for these triangular facets is called triangle facet data. Triangle facet data can include vertex coordinates, facet indices, normal vectors (and optionally tangent vectors), as well as UV coordinates, color, and material information. In 3D models, vector data is preferably the normal vector of a triangle facet.

[0034] Specifically, the three-dimensional object model is pre-stored in a computer device. The computer device reads the three-dimensional object model and parses the data of the triangular facets contained in the three-dimensional object model. Each triangular facet contains three vertices, vertex coordinates v = {v1, v2, v3}, and facet index F = {f1, f2, ..., fm}. The system will automatically detect the integrity of the three-dimensional object model to ensure that all faces form a manifold surface. For each triangular facet fi, according to the vertex (v a ,v b ,v c ), specifically expressed as

[0035] fi={v a (x1,y1,z1),v b (x2,y2,z2),v c (x3,y3,z3)}

[0036] Calculate the unit normal vector n according to its vertex as follows

[0037]

[0038] The above formula first obtains the geometric normal of the face through the vector cross product, and then obtains the unit normal vector through normalization.

[0039] Step 104 : clustering the triangles according to the vector data to obtain a triangle group.

[0040] Clustering is a process of dividing a dataset into several subsets, so that the data within the same subset has high similarity, while the data between different subsets has low similarity. A triangle group includes multiple triangles with high similarity.

[0041] Specifically, the vector data is the normal vector of a triangle face. The computer device can use an improved tree growth algorithm to cluster adjacent triangle facets with similar normal vectors into groups. The process starts with a randomly selected seed facet and gradually absorbs adjacent facets that meet the similarity conditions until no further expansion is possible. Figure 2 FIG. 1 is a schematic diagram of a process of clustering triangles in one embodiment, including ungrouped triangles with black frames, grouped triangles with khaki frames, seed patch normals, and ungrouped adjacent patch normals.

[0042] The cosine value of the angle between the normal vectors of the triangles is calculated as the similarity index. When the normal cosine similarity of two adjacent triangles is greater than the set threshold, such as 0.9 to 0.95, they are considered to be in the same feature area. The similarity sim(fi,fj) of two triangles fi and fj is as follows

[0043]

[0044] Among them, n i is the normal vector of fi, n j is the normal vector of fj.

[0045] After clustering, triangles with similar characteristics (similar vector data such as normal vectors) are grouped into the same group to form a triangle group.

[0046] Alternatively, curvature is an important parameter that measures the degree of curvature of a geometric surface. In a 3D model, curvature can be determined by calculating the angle between the normal vectors of adjacent triangles. A larger angle indicates a more dramatic change in curvature and a more complex model. Based on the magnitude of the curvature, the model is divided into regions with dramatic changes and flat regions. A stricter similarity threshold is set for regions with dramatic changes in curvature, while a looser similarity threshold is set for regions with flat curvature.

[0047] Step 106 : For each triangular face group in the three-dimensional object model, determine a reference scanning plane that forms a preset angle with the triangular face group; the preset angle includes an angle within a vertical range.

[0048] The preset angle refers to the angle between the reference scanning plane and the triangular facet group. This angle is within the perpendicular range, meaning it is greater than 45 degrees, preferably greater than 75 degrees and close to 90 degrees. The reference scanning plane actually represents the cross-sectional orientation of the 3D object model and is used to determine a uniform laser planning path. An angle within the perpendicular range avoids interference caused by simultaneous intersections with multiple planes.

[0049] Specifically, for each triangular face group in the 3D object model, the computer device can determine a vector, such as a normal vector, of the triangular face group and a reference scanning plane that is approximately perpendicular to the triangular face group. That is, each triangular face group corresponds to a reference scanning plane.

[0050] like Figure 3 The figure shows a schematic diagram of a reference scanning plane in an embodiment. The red arrows in the figure are the normal vectors of each triangle, the triangles in the blue area belong to the same triangle group, the purple plane is the reference scanning plane, and the blue arrows are the normal vectors of the reference scanning plane. Figure 3 It can be seen that the angles between the reference scanning plane and the normal vectors of each triangle in the triangle group are close to 90 degrees.

[0051] Step 108 : Move the reference scanning plane and determine the intersection points between the moved reference scanning plane and each triangular facet in the corresponding triangular facet group.

[0052] The intersection of the reference scanning plane and the triangular patch specifically refers to the intersection of the reference scanning plane and the edge of the triangular patch. In most cases, there is only one intersection point, and in a few cases, there are two.

[0053] Specifically, after the reference scan plane is moved, its intersection with each triangular facet is at a different location. The computer device can translate the reference scan plane at constant intervals so that it intersects with different triangular facets and records the intersections with the edges of the triangular facets. Alternatively, the computer device can continuously translate the reference scan plane to obtain intersections with the edges of the triangular facets at constant intervals. The direction of movement of the reference scan plane does not include the direction of the plane's tangent vector.

[0054] like Figure 4 Figure 2 shows a schematic diagram of the intersection points and machining path during the movement of the scanning plane in one embodiment. As can be seen, since the reference scanning plane is nearly perpendicular to the triangle group, the reference scanning plane and the edges of the triangles will intersect. Connecting these intersections yields a discrete curve, which represents part of the machining path for the triangle group.

[0055] Step 110 : determining a target processing path of the three-dimensional object model according to the intersection point.

[0056] The three-dimensional object model can be processed according to the target processing path.

[0057] Specifically, the computer device can perform path planning to obtain the target processing path of the entire three-dimensional object model after obtaining the intersection of the triangular face group on the three-dimensional object model, or it can obtain the target processing path of the entire three-dimensional object model after obtaining the processing path of each triangular face group.

[0058] like Figure 5 FIG. 1 is a schematic diagram of a target processing path in an embodiment. Figure 5 The black lines in the figure represent triangles, while the blue, green, and purple points represent the intersections between the reference scan plane and the corresponding triangle groups, with different colors representing the intersections corresponding to different triangle groups. The red lines connect the dots, forming the target machining path for the 3D object model. As can be seen, the uniform distribution of the target machining path across the entire 3D object model ensures uniform machining density and accurate machining positions, improving machining quality.

[0059] Optionally, the computer device connects the intersection points corresponding to the reference scanning planes at the same position, and connects the tail intersection point of the reference scanning plane at the previous position with the head intersection point of the reference scanning plane at the current position, that is, connects them according to a Z-shaped trajectory. This process continues until the reference scanning plane exceeds the area where the triangular facets are located, and the processing path corresponding to the triangular facet group is obtained.

[0060] Optionally, after obtaining the intersection points corresponding to all triangular facet groups, the computer device may connect the intersection points on the reference scanning plane at the same position to form a target processing path of the three-dimensional object model.

[0061] Optionally, the computer device uses a path optimization algorithm, such as a shortest path algorithm, a greedy algorithm, etc. to plan a target processing path for the three-dimensional object model.

[0062] Optionally, when the triangular face group has not been traversed, the process returns to execute for each triangular face group in the three-dimensional object model, determines a reference scanning plane with a preset angle to the triangular face group, until the triangular face group is the last face group of the model, and obtains the target processing path of the three-dimensional object model based on the intersection point.

[0063] In this embodiment, data of triangular facets in a three-dimensional object model is obtained, and the triangular facets are clustered according to vector data to obtain a triangular facet group, wherein the obtained triangular facet group has similar vectors; a reference scanning plane is determined at a preset angle to the triangular facet group, and the preset angle includes an angle within a vertical range, so as to maximize the angle between the reference scanning plane and the triangular facets, reduce laser reflection errors, and be suitable for large-scale three-dimensional object models; the scanning plane is moved, and the intersection points of the moved reference scanning plane and each triangular facet in the corresponding triangular facet group are determined, and the target processing path of the three-dimensional object model is determined according to the intersection points, which can control the spacing of the intersection points, ensure that the processing density is as consistent as possible, obtain a smooth and uniform processing path, and improve the processing effect of the three-dimensional model; in addition, the above method is simple and fast to calculate, is not prone to errors, and improves the efficiency of processing path planning.

[0064] In one embodiment, determining a target processing path of a three-dimensional object model according to the intersection point includes:

[0065] For adjacent point pairs in the intersection, interpolation processing is performed on adjacent point pairs representing that the distance between adjacent points is greater than a preset distance to obtain a target processing path of the three-dimensional object model.

[0066] The preset distance is set as needed and can be preset in the computer device or calculated. If the distance between adjacent points is greater than the preset distance, it indicates that the two points are far apart. This can be determined by determining whether the distance between adjacent points is greater than the preset distance or the number of points inserted between adjacent points is greater than zero.

[0067] Specifically, a large distance between the intersection points of the reference scanning plane and the triangular facet group will result in an insufficient continuity of the processing path. Therefore, for such adjacent point pairs, it is necessary to perform interpolation processing on the adjacent point pairs representing the distance between the adjacent points that is greater than the preset distance to increase the density of the processing path.

[0068] In this embodiment, the intersections between the reference scanning plane and the triangular facet group constitute the basic nodes of the processing path. However, the path generated solely by these intersections may not be smooth and continuous enough, especially when the distance between adjacent intersections is large. Through interpolation processing, additional points can be inserted between adjacent intersections to make the distance between adjacent points more uniform. The generated processing path is smoother and continuous, avoiding the fault and discontinuity problems caused by the large distance between adjacent points, thereby improving the processing quality.

[0069] In one embodiment, interpolation processing is performed on adjacent point pairs representing adjacent points whose distances are greater than a preset distance to obtain a target processing path for the three-dimensional object model, including:

[0070] Determine the distance between adjacent pairs of points;

[0071] Determine the number of insertion points based on the distance and preset point interval;

[0072] When the number of insertion points meets the quantity condition, interpolation processing is performed on adjacent point pairs according to the number of insertion points to obtain the target processing path of the three-dimensional object model.

[0073] The distance between adjacent pairs of points is the length of a line segment. The preset point interval can be set as needed and can be preset in the computer device or input by the user. The number of insertion points can be rounded to an integer. The number of insertion points meets quantity conditions, such as being greater than or equal to 1, or greater than 0.

[0074] Specifically, in the initial curve set generated by the above steps, each curve consists of a series of discrete points P0, P1, ..., P n The goal is to use linear interpolation to insert new points between the sparser line segments so that the spacing between points on the entire curve becomes uniform. For an input point spacing d, the interpolation steps are as follows:

[0075] For adjacent point pairs P k and P k+1 , calculate the current line segment length L:

[0076]

[0077] Then calculate the number of insertion points N

[0078]

[0079] If N≤0, skip the line segment and do not need interpolation. Otherwise, calculate the point set {Q0, {Q0,…,Q N}

[0080]

[0081] Until the interpolation between each adjacent point pair is completed.

[0082] In this embodiment, by determining the distance between adjacent point pairs, the number of insertion points is determined based on the distance and the preset point interval. When the number of insertion points meets the quantity conditions, the adjacent point pairs are interpolated according to the number of insertion points to obtain the target processing path. Additional points can be inserted between adjacent intersections to make the distance between adjacent points more uniform, avoiding faults and discontinuities caused by excessive distances between adjacent points, thereby improving the processing quality.

[0083] In one embodiment, determining a reference scanning plane that forms a preset angle with the triangular face group includes:

[0084] Get the covariance matrix of the triangle group;

[0085] Perform eigenvalue decomposition on the covariance matrix to obtain the minimum eigenvector;

[0086] The normal vector corresponding to the minimum eigenvector is used as the normal vector of the reference scanning plane to obtain the reference scanning plane.

[0087] Among them, the covariance matrix is ​​a core tool in statistics and data analysis. Its main function is to quantify and describe the relationship (covariance) between multiple random variables (features) and the degree of discreteness (variance) of each variable itself.

[0088] The core of PCA (Principal Components Analysis) is to find the eigenvalues ​​and eigenvectors of the covariance matrix (or correlation coefficient matrix) of the data.

[0089] The minimum eigenvector indicates that the normal direction of the triangular face group has the smallest change in this direction and the data variance is the smallest; that is, it represents a unified normal vector of the triangular face group.

[0090] Specifically, an ideal scanning plane is found for each triangular facet group, which should maximize the angle between the plane and the normal of all the facets in the group. This ensures that the laser beam incident angle is close to vertical, minimizing energy loss due to reflection.

[0091] The computer equipment uses the PCA algorithm to solve the optimal plane. First, the intra-group covariance matrix is ​​calculated, and then the eigenvalue decomposition is performed to obtain the eigenvector corresponding to the minimum eigenvalue (referred to as the minimum eigenvector), thereby obtaining the normal vector of the reference scanning plane. The specific calculation process is as follows:

[0092] ① Get the covariance matrix C of the triangle group

[0093]

[0094] Where N is the number of triangles in the triangle group, n k is the normal vector of the kth triangle, is the average normal vector of the triangle group.

[0095] ②Perform eigendecomposition on the covariance matrix

[0096] C=QΛQ T

[0097] Among them, Λ is a diagonal matrix, the eigenvalues ​​of its diagonal elements are λ1,λ2,λ3, and the corresponding values ​​of the columns of Q are eigenvectors q1,q2,q3.

[0098] ③ Get the reference scanning plane

[0099] Take the eigenvector corresponding to the minimum eigenvalue among λ1,λ2,λ3, and assume it is q3. This vector represents the direction in which the normal of the triangle group changes the least. Then find the normal direction perpendicular to q3, and you will get the scanning plane.

[0100] In this embodiment, the covariance matrix of the triangular face group is eigendecomposed to obtain the minimum eigenvector, which can obtain the vector with the smallest difference from the normal vector of the triangular face in the triangular face group; the normal vector corresponding to the minimum eigenvector is used as the normal vector of the reference scanning plane to obtain the reference scanning plane, which can ensure that the incident angle of the laser beam during laser processing is close to vertical, thereby minimizing the energy loss caused by reflection.

[0101] In one embodiment, the machining path planning method further comprises: determining an average angle between the reference scanning plane and the triangular facets in the corresponding triangular facet group;

[0102] When the average angle is less than the preset effective value, the process returns to the step of clustering the triangles according to the vector data to obtain a triangle group.

[0103] Among them, the preset effective value is set according to demand, specifically a value close to vertical, such as a value between 60° and 90°, including 65°, 70°, 75°, 80°, 85°, etc.

[0104] Specifically, after obtaining the reference scan plane, further verification is required to ensure that the angle between the reference scan plane and the triangular facets is close to perpendicular. The computer device then determines the difference between the reference scan plane and each triangular facet in the corresponding triangular facet group, and then calculates the average angle based on the difference. If the average angle is less than a preset effective value, the process returns to clustering the triangular facets based on the vector data to obtain the triangular facet group, re-clustering the triangular facet groups with the same characteristics until the average angle is greater than or equal to the preset effective value, thus obtaining the reference scan plane.

[0105] In this embodiment, by determining the average angle between the reference scanning plane and the corresponding triangular facets, when the average angle is less than a preset effective value, it indicates that the clustering effect of the triangular facet group is poor, and re-clustering is performed to obtain a qualified triangular facet group and the corresponding reference scanning plane, that is, further verification of the reference scanning plane, which can ensure that the incident angle of the laser beam is close to vertical when laser processing is used, thereby minimizing the energy loss caused by reflection.

[0106] In one embodiment, moving the reference scanning plane and determining the intersection of the moved reference scanning plane and each triangular facet in the corresponding triangular facet group includes:

[0107] Move the reference scan plane at set intervals;

[0108] For the endpoints of each edge of each triangle in the triangle group, the intersection parameter value is determined according to the moved reference scanning plane and the endpoints of the edge;

[0109] The intersection point of the reference scanning plane and the corresponding triangular facet is determined according to the intersection point parameter value and the endpoint of the edge.

[0110] The set interval is set as needed, can be pre-stored in a computer device, or can be obtained through other calculations. Preferably, the set interval is close to or the same as the preset point interval value.

[0111] Specifically, the reference scanning plane is placed outside the geometric bounding box of the corresponding face group, and is gradually translated along the specified scanning direction v = (A, B, C) (this parameter can be set according to the operator's desired scanning direction) at the set resolution (i.e., the set interval). After each translation, the reference scanning plane equation is defined as Face ABCD (x, y, z), satisfying Ax + By + Cz + D = 0. When D is updated, the plane moves along the normal vector, and the plane position can be updated, thus realizing the plane scanning process. The specific value of D can change uniformly.

[0112] Then for the triangle fi we have

[0113] fi={a(x1,y1,z1),B(x2,y2,z2),C(x3,y3,z3)}

[0114] Substitute the edges of the triangle: AB, BC, CA into the following formula to calculate the intersection parameter value t:

[0115]

[0116] (x0, y0, z0), (x1, y1, z1) are the coordinates of the endpoints of the input edge. According to this formula, when t∈[0,1], it means that there is an intersection between the edge of the patch input and the plane. When calculating for each scanning plane, the intersection point P=A+t(BA) is determined based on the intersection parameter value and the endpoints A and B of the edge.

[0117] In this embodiment, the reference scanning plane is moved at set intervals, and for the endpoints of each edge in the triangular facet, the intersection parameter value is determined based on the moved reference scanning plane and the endpoints of the edge, and the intersection is determined based on the intersection parameter value and the endpoints of the edge. The calculation is simple and fast, and can ensure that the sampling points on the three-dimensional object model are evenly distributed, generating a smooth and continuous processing path.

[0118] In one embodiment, determining the intersection parameter value based on the moved reference scanning plane and the endpoint of the edge includes:

[0119] When both endpoints of an edge intersect with the reference scan plane, the two endpoints of the edge are taken as intersection points;

[0120] When both endpoints of the edge do not intersect the reference scanning plane, the intersection parameter value is determined according to the reference scanning plane and the endpoints of the edge.

[0121] Specifically, since the angle between the reference scan plane and the triangular facet group is within the vertical range, the triangular facet and the reference scan plane will not overlap or be parallel. However, when the reference scan plane is scanned across the triangular facet group, it is possible that an edge may be completely within the reference scan plane. In this case, only the two endpoints of the edge need to be saved as the intersection result. In other words, when both endpoints of the edge intersect with the reference scan plane, the two endpoints of the edge are used as the intersection points. If both endpoints of the edge do not intersect with the reference scan plane, the intersection parameter value is determined based on the reference scan plane and the endpoints of the edge, thereby obtaining an intersection point between the line segment and the face.

[0122] In this embodiment, when the endpoints of the edge both intersect with the reference scanning plane, the two endpoints of the edge are taken as intersection points; when there is a situation where both endpoints of the edge do not intersect with the reference scanning plane, the intersection parameter value is determined based on the reference scanning plane and the endpoints of the edge, which includes the cases where there are one or two intersection points, and the endpoints of the reference scanning plane and the triangle edge can be correctly obtained.

[0123] In one embodiment, the processing path planning method in this embodiment completes the generation of the laser processing path from the three-dimensional object model through five core operations. First, the model data is loaded and preprocessed, then the model surface is intelligently partitioned, and then the optimal scanning plane is calculated for each partition, and then the initial path curve is generated. Finally, a high-precision scanning path is output through interpolation optimization. The complete process is as follows: Figure 6 FIG. 1 is a flow chart of a processing path planning method in another embodiment.

[0124] Step 602: 3D mesh model loading and normal calculation

[0125] Input processing: Read the workpiece 3D model file (STL / OBJ format) and parse the triangular face data contained therein. Each triangular face is composed of three vertex coordinates, including vertex coordinates v = {v1, v2, v3} and face index F = {f1, f2, ..., fm}. The system will automatically check the model integrity to ensure that all faces form a closed manifold surface.

[0126] Normal calculation: For each triangle fi, record it as (v a ,v b ,v c), and calculate the unit normal vector n based on its vertex coordinates (as shown in Formula 1), as shown in Formula 2. The calculation first obtains the geometric normal of the patch through a vector cross product, and then normalizes it to obtain the unit normal vector. The specific calculation formula is shown below.

[0127] After the calculation is completed, the system will record the normal data of all patches for subsequent steps.

[0128]

[0129] Step 604: Grouping patches based on cosine similarity

[0130] Grouping principle: Adopting the improved tree growing algorithm, adjacent triangles with similar normals are clustered into groups. The process starts with a randomly selected seed patch and gradually absorbs adjacent patches that meet the similarity conditions until no further expansion is possible. The complete grouping process is as follows: Figure 7 As shown, it is a flow chart of clustering in one embodiment. The terminal device starts to select a seed face, which is marked as a member of the current group, obtains unprocessed adjacent faces, and determines whether the similarity is greater than or equal to the preset similarity θ. If so, join the current group; if not, mark it as processed. After joining the current group, determine whether there are unprocessed adjacent faces; if so, return to the step of selecting seed faces; if not, output all groups (i.e., triangular face groups). The grouping diagram is shown in FIG. Figure 2 shown.

[0131] Similarity Determination: Calculate the cosine of the normal angle between facets as a similarity metric. When the cosine similarity of the normals of two adjacent facets exceeds a set threshold (typically 0.9-0.95), they are considered to belong to the same feature region. The formula for calculating the similarity between two triangle facets fi and fj is shown below.

[0132]

[0133] Among them, n i is the normal vector of fi, n j is the normal vector of fj.

[0134] Grouping optimization: For areas with complex model features, the system automatically adjusts the similarity threshold: a stricter threshold (such as 0.95) is used in areas with drastic curvature changes, and a more relaxed threshold (such as 0.85) is appropriately relaxed in flat areas to ensure that the grouping results are neither too fragmented nor too mixed.

[0135] Step 606: Calculate the optimal scanning plane

[0136] The goal of the plane solution is to find an ideal scanning plane for each facet group. This plane should maximize the angle with the normals of all the facets in the group. This plane is the reference scanning plane. This ensures that the laser beam incident angle is close to vertical, minimizing energy loss due to reflections.

[0137] Calculation method: The principal component analysis (PCA) method is used to solve the optimal plane. First, the covariance matrix of the normal direction within the group is calculated, and then the eigenvalue decomposition is performed to obtain the eigenvector corresponding to the minimum eigenvalue. This vector is the normal vector of the plane to be solved. The specific calculation process is as follows:

[0138] ① Calculate the covariance matrix of the normal vector

[0139]

[0140] Where N is the number of triangles in the triangle group, n k is the normal vector of the kth triangle, is the average normal vector of the triangle group.

[0141] ② Perform eigendecomposition on the covariance matrix results:

[0142]

[0143] Among them, Λ is a diagonal matrix, the eigenvalues ​​of its diagonal elements are λ1,λ2,λ3, and the corresponding values ​​of the columns of Q are eigenvectors q1,q2,q3.

[0144] ④ Obtain the optimal scanning plane normal:

[0145] Take the eigenvector corresponding to the minimum eigenvalue among λ1,λ2,λ3, and assume it is q3. This vector represents the direction in which the normal of the triangular face group changes the least. Then find the normal direction perpendicular to q3, and the scanning plane is obtained. The result diagram is as follows: Figure 4 shown.

[0146] Geometric Verification: The system automatically calculates the average angle between the obtained plane and each facet in the group, ensuring that it is greater than the preset minimum valid value (usually ≥75°). If it does not meet the requirements, the group optimization process will be triggered to recalculate.

[0147] Step 608: Initial scanning curve generation

[0148] Plane layout strategy: Place the calculated optimal plane outside the geometric bounding box of the corresponding face group, and gradually translate it along the specified scanning direction v = (A, B, C) (this parameter can be set according to the scanning direction desired by the operator) at the set resolution. After each translation, the plane equation is defined as Face ABCD(x, y, z), satisfying Ax+By+Cz+D=0, when D is updated, the plane position can be updated, thus realizing the plane scanning process. The plane scans the path diagram in the patch group as shown in Figure 4 shown.

[0149] Intersection calculation: According to the loaded triangle content, extract the triangle:

[0150]

[0151] Please note: ABCD The intersection of (x,y,z) and ΔABC requires first entering the triangle vertex coordinates into the plane equation to verify whether the triangle coincides with the plane. However, in this step, the plane equation and the triangle face group are nearly perpendicular, so there will be no coincidence or parallelism. Secondly, when the plane begins to scan the face group, it is possible that an edge is completely in the plane. In this case, only the two endpoints of the edge need to be saved as the intersection result. If this is not the case, follow the steps below to calculate the intersection:

[0152] Substitute the sides of the triangle: AB, BC, CA into the following formula to calculate the parameter t:

[0153]

[0154] In Formula 7, (x0, y0, z0) and (x1, y1, z1) are the endpoint coordinates of the input edge. According to this formula, when t∈[0,1], it means that the edge of the patch input intersects with the plane. When calculating for each scan plane, the scan intersection P=A+t(BA) on each plane is stored.

[0155] Curve construction: Figure 4 As shown, the scanning plane intersects with the triangular facets in the facet group at the specified position, which generates discrete point data of the curve. Adjacent triangular facets will generate intersections at the same position, so the intersections are connected to obtain the initial curve data.

[0156] Step 610: Path interpolation optimization

[0157] In the initial curve set generated by the above steps, each curve consists of a series of discrete points P0, P1, ..., P n The goal is to use linear interpolation to insert new points between the sparser line segments so that the spacing between points on the entire curve becomes uniform. For an input point spacing d, the interpolation steps are as follows:

[0158] For each pair of adjacent points P k and P k+1 , calculate the current line segment length:

[0159]

[0160] Then calculate the number of points that need to be inserted:

[0161]

[0162] If N≤0, skip the line segment and do not need interpolation. Otherwise, calculate the point set {Q0, {Q0,…,Q N}:

[0163]

[0164] Until the point interpolation of this curve is completed.

[0165] The beneficial effects of this embodiment are as follows:

[0166] ① Efficient grouping: The tree growing algorithm is based on local similarity and has a complexity close to O(m) (m is the number of faces), which is suitable for large-scale grids.

[0167] ②PCA ensures the maximum angle between the scanning plane and the normal of the patch, reduces laser reflection errors, and improves scanning quality.

[0168] ③ Path uniformity: Ensure consistent scanning density by translating the plane and interpolating the control point spacing.

[0169] ④ Compatible with complex geometry: Robust to concave and convex surfaces and hole structures, each local area can be processed independently after grouping.

[0170] ⑤ Parallelizable: The calculations of different face groups are independent of each other, which is suitable for GPU acceleration or multi-threaded implementation.

[0171] Through simulation verification and feasibility, a smooth and uniform scanning path can be calculated.

[0172] In one embodiment, a machining path planning method includes:

[0173] Step (a1), obtaining the data of triangular facets in the three-dimensional object model; the data of triangular facets includes vector data of the triangular facets.

[0174] Step (a2): clustering the triangular facets according to the vector data to obtain a triangular facet group.

[0175] Step (a3): obtain the covariance matrix of the triangle face group.

[0176] Step (a4): perform eigenvalue decomposition on the covariance matrix to obtain the minimum eigenvector.

[0177] Step (a5): using the normal vector corresponding to the minimum eigenvector as the normal vector of the reference scanning plane to obtain the reference scanning plane.

[0178] Step (a6): determining the average angle between the reference scanning plane and the triangular facets in the corresponding triangular facet group.

[0179] Step (a7): When the average angle is less than the preset effective value, the process returns to the step of clustering the triangular facets according to the vector data to obtain a triangular facet group.

[0180] Step (a8), moving the reference scanning plane at a set interval.

[0181] Step (a9): for the endpoints of each edge of each triangular face in the triangular face group, when both endpoints of the edge intersect with the moved reference scanning plane, the two endpoints of the edge are taken as intersection points.

[0182] Step (a10): when both end points of the edge do not intersect with the reference scanning plane, determining the intersection parameter value according to the moved reference scanning plane and the end points of the edge.

[0183] Step (a11): determining the intersection of the reference scanning plane and the corresponding triangular facet according to the intersection parameter value and the endpoint of the edge.

[0184] Step (a12): for adjacent point pairs in the intersection, determine the distance between the adjacent point pairs.

[0185] Step (a13), determining the number of insertion points based on the distance and the preset point interval.

[0186] Step (a14): when the number of insertion points meets the quantity condition, interpolation processing is performed on adjacent point pairs according to the number of insertion points to obtain the target processing path of the three-dimensional object model.

[0187] In this embodiment, data of triangular facets in a three-dimensional object model is obtained, and the triangular facets are clustered according to vector data to obtain a triangular facet group, wherein the obtained triangular facet group has similar vectors; a reference scanning plane is determined at a preset angle to the triangular facet group, and the preset angle includes an angle within a vertical range, so as to ensure that the angle between the reference scanning plane and the triangular facets is maximized, thereby reducing laser reflection errors and being suitable for large-scale three-dimensional object models; the scanning plane is moved, and the intersection points of the moved reference scanning plane and each triangular facet in the corresponding triangular facet group are determined, and the target processing path of the three-dimensional object model is determined according to the intersection points, which can control the spacing of the intersection points, ensure that the processing density is as consistent as possible, and improve the processing effect of the three-dimensional model; in addition, the above method is simple and fast to calculate, is not prone to errors, and improves the efficiency of processing path planning.

[0188] It should be understood that although the above Figure 1 、 Figure 6 and Figure 7 The steps in the flowchart are shown in sequence as indicated by arrows, and the steps (a1) to (a14) are shown in sequence as indicated by numbers, but these steps are not necessarily performed in the order indicated by arrows or numbers. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be performed in other orders. Moreover, Figure 1 、 Figure 6 and Figure 7 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The order of execution of these steps or stages is not necessarily one by one, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0189] In one embodiment, a machining path planning device is provided. The device may be implemented as a software module or a hardware module, or a combination of both, and may be part of a computer device. The device specifically includes: a data acquisition module, a grouping module, a scanning plane determination module, an intersection determination module, and a path determination module, wherein:

[0190] A data acquisition module is used to acquire data of triangular facets in a three-dimensional object model; the data of triangular facets includes vector data of the triangular facets;

[0191] A grouping module is used to cluster the triangles according to the vector data to obtain triangle groups;

[0192] A scanning plane determination module is used to determine, for each triangular facet group in the three-dimensional object model, a reference scanning plane that forms a preset angle with the triangular facet group; the preset angle includes an angle within a vertical range;

[0193] An intersection determination module is used to move the reference scanning plane and determine the intersection of the moved reference scanning plane and each triangular facet in the corresponding triangular facet group;

[0194] The path determination module is used to determine the target processing path of the three-dimensional object model according to the intersection point.

[0195] In one embodiment, the path determination module is configured to perform interpolation processing on adjacent point pairs in the intersection, where the distance between the adjacent points is greater than a preset distance, to obtain a target processing path for the three-dimensional object model.

[0196] In one embodiment, a path determination module is used to determine the distance between adjacent point pairs; determine the number of insertion points based on the distance and the preset point interval; when the number of insertion points meets the quantity conditions, interpolate the adjacent point pairs according to the number of insertion points to obtain the target processing path of the three-dimensional object model.

[0197] In one embodiment, the scanning plane determination module is used to obtain the covariance matrix of the triangular face group; perform eigenvalue decomposition on the covariance matrix to obtain the minimum eigenvector; and use the normal vector corresponding to the minimum eigenvector as the normal vector of the reference scanning plane to obtain the reference scanning plane.

[0198] In one embodiment, the scanning plane determination module is also used to determine the average angle between the reference scanning plane and the triangular facets in the corresponding triangular facet group; when the average angle is less than a preset effective value, the grouping module is used to cluster the triangular facets according to the vector data to obtain the triangular facet group.

[0199] In one embodiment, an intersection determination module is used to move the reference scanning plane at set intervals; for the endpoints of each edge of each triangular facet in the triangular facet group, the intersection parameter value is determined based on the moved reference scanning plane and the endpoints of the edge; and the intersection of the reference scanning plane and the corresponding triangular facet is determined based on the intersection parameter value and the endpoints of the edge.

[0200] In one embodiment, the intersection determination module is used to use the two endpoints of the edge as intersection points when both endpoints of the edge intersect with the reference scanning plane; when both endpoints of the edge do not intersect with the reference scanning plane, determine the intersection parameter value based on the moved reference scanning plane and the endpoints of the edge.

[0201] For the specific definition of the processing path planning device, please refer to the definition of the processing path planning method above, which will not be repeated here. The various modules in the above-mentioned processing path planning device can be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0202] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 8As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a processing path planning method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a key, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse. Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0203] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0204] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.

[0205] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method embodiments are implemented.

[0206] In one embodiment, a computer program product is provided, including a computer program, which implements the steps of the above-mentioned method embodiments when executed by a processor.

[0207] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0208] The above description is only a preferred embodiment of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A processing path planning method, characterized in that: The method comprises: Acquire data of triangular facets in a three-dimensional object model; the data of the triangular facets includes vector data of the triangular facets; Performing clustering processing on the triangular facets according to the vector data to obtain a triangular facet group; For each triangular facet group in the three-dimensional object model, determining a reference scanning plane that forms a preset angle with the triangular facet group; the preset angle includes an angle within a vertical range; Moving the reference scanning plane, and determining the intersection of the moved reference scanning plane and each triangular facet in the corresponding triangular facet group; A target processing path of the three-dimensional object model is determined according to the intersection point.

2. The method according to claim 1, characterized in that Determining a target processing path of the three-dimensional object model according to the intersection point includes: For the adjacent point pairs in the intersection, interpolation processing is performed on the adjacent point pairs representing that the distance between the adjacent points is greater than a preset distance to obtain a target processing path of the three-dimensional object model.

3. The method according to claim 2, characterized in that The interpolation processing is performed on adjacent point pairs representing adjacent points whose distances are greater than a preset distance to obtain a target processing path of the three-dimensional object model, including: determining the distance between the adjacent point pairs; Determine the number of insertion points according to the distance and the preset point interval; When the number of the insertion points meets the quantity condition, interpolation processing is performed on the adjacent point pairs according to the number of the insertion points to obtain a target processing path of the three-dimensional object model.

4. The method according to claim 1, wherein The determining of a reference scanning plane having a preset angle with the triangular face group includes: Obtaining the covariance matrix of the triangle group; Performing eigenvalue decomposition on the covariance matrix to obtain a minimum eigenvector; The normal vector corresponding to the minimum eigenvector is used as the normal vector of the reference scanning plane to obtain the reference scanning plane.

5. The method according to claim 4, characterized in that The method further comprises: Determining an average angle between the reference scanning plane and the triangular facets in the corresponding triangular facet group; When the average angle is less than the preset effective value, the process returns to the step of clustering the triangular facets according to the vector data to obtain a triangular facet group.

6. The method according to claim 1, characterized in that The moving the reference scanning plane and determining the intersection of the moved reference scanning plane and each triangular facet in the corresponding triangular facet group includes: moving the reference scanning plane at set intervals; For the endpoints of each edge of each triangular face in the triangular face group, determining an intersection parameter value according to the moved reference scanning plane and the endpoints of the edge; The intersection point between the reference scanning plane and the corresponding triangular facet is determined according to the intersection point parameter value and the endpoint of the edge.

7. The method according to claim 6, characterized in that The determining of the intersection parameter value according to the moved reference scanning plane and the endpoint of the edge includes: When both endpoints of an edge intersect with the reference scanning plane, the two endpoints of the edge are taken as intersection points; When both endpoints of the edge do not intersect with the reference scanning plane, an intersection parameter value is determined according to the moved reference scanning plane and the endpoints of the edge.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.