A method for generating CNC five-axis toolpaths based on freeform surface models
By using a surface model-based five-axis toolpath generation method, and employing Delaunay triangulation and pipe model intersection strategies, five-axis machining toolpaths for complex surfaces are generated. This solves the problems of insufficient machining efficiency and accuracy of complex surfaces in existing technologies, and achieves efficient and accurate machining results.
Patent Information
- Application Number
- CN202510228262.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-02-28
AI Technical Summary
Existing five-axis CNC machining technology struggles to guarantee high efficiency and high precision when generating toolpaths for complex curved surfaces, especially in the machining of complex parts in the aerospace field, where existing methods have failed to effectively meet the machining requirements of complex curved surfaces.
A five-axis toolpath generation method based on a surface model is adopted. A discrete surface model is generated by Delaunay triangulation. Parallel polylines are generated by intersecting the pipe model with the discrete surface model. The complete toolpath is formed by boundary processing.
It significantly improves the uniformity of toolpath generation and machining accuracy, optimizes boundary treatment strategies, ensures the continuity and integrity of toolpaths, and enhances machining efficiency and surface quality.
Smart Images

Figure BDA0005290722950000031 
Figure HDA0005290722960000011 
Figure HDA0005290722960000021
Abstract
Description
Technical Field
[0001] This invention belongs to the field of CNC machining and toolpath planning technology, specifically relating to a five-axis CNC toolpath generation method based on a freeform surface model. Background Technology
[0002] In modern manufacturing, numerical control (CNC) technology plays a crucial role, especially in fields such as aerospace, automotive, and mold manufacturing, which require high-precision machining of complex parts. Five-axis CNC machining, as an advanced form of CNC machining, offers advantages such as high machining flexibility, excellent precision, and the ability to handle complex curved surfaces. It is particularly suitable for shell machining in the aerospace field, such as aircraft wings, fuselage shells, and engine casings. These complex parts typically have large curvatures, free-form surfaces, and thin-walled structures, requiring high-precision and high-quality machining. Five-axis CNC machining can perform cutting at multiple angles and directions, meeting these requirements.
[0003] However, five-axis machining places extremely high demands on toolpath generation, requiring precise analysis and planning of complex surface models to ensure machining efficiency and quality. Currently, CNC machining of complex surfaces mainly relies on toolpath generation technology. Toolpath generation methods for free-form surfaces are a key research focus in the field of CAM (Computer-Aided Manufacturing). In the aerospace industry, the manufacturing of complex components such as wings, fuselage shells, and engine shells typically employs free-form surface machining technology, which places even higher demands on the accuracy and efficiency of toolpath generation.
[0004] In the aerospace field, the manufacturing of complex components such as aircraft wings, fuselage shells, and engine casings requires toolpath generation technology to handle the complexity of these surfaces, surface quality requirements, and machining accuracy. By discretizing the complex surfaces of these components into mesh models, the toolpath generation process can be accelerated and machining efficiency improved without sacrificing accuracy. Summary of the Invention
[0005] In view of the shortcomings of the existing technology, the present invention proposes a five-axis toolpath generation method based on a surface model to solve the defects existing in the prior art.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: a five-axis toolpath generation method based on a surface model, comprising:
[0007] (1) Discretize the surface model to generate a discrete surface model composed of triangular patches;
[0008] (2) Select the initial cross section based on the discrete surface model and generate the initial polyline (the first polyline);
[0009] (3) Generate a pipe model using the obtained polyline as the center line;
[0010] (4) Find the intersection of the pipe model and the discrete surface model to obtain two new polylines, and select the one-sided polyline as the new polyline to return to step (3).
[0011] (5) Repeat steps (3) to (4) to generate parallel polylines one by one until the entire surface is covered;
[0012] (6) Connect all the obtained parallel polylines in sequence to form a complete toolpath.
[0013] In step (1), the discrete surface model composed of triangular patches can be generated using Delaunay triangulation.
[0014] Preferably, in step (1), when discretizing the surface model, the Delaunay triangulation method is usually used to generate uniform triangular patches; of course, any existing parametric surface discretization method can also be selected.
[0015] Preferably, in step (1), the surface model generated by the triangular facets is usually saved in STL format; if the processing or application scenario has special requirements for the format, other custom formats can be used for saving.
[0016] In step (2), the method for obtaining the initial cross-section is as follows:
[0017] (2-1) Obtain the bounding box (usually a three-dimensional cuboid) of the discrete surface model and find the center position of the bounding box.
[0018] (2-2) Obtain the initial cross-section based on the obtained center position;
[0019] (2-3) Find the intersection line between the initial cross section and the discrete surface model to obtain the initial polyline.
[0020] Preferably, in step (2), based on the center position of the boundary box of the discrete surface model, a plane passing through the center position of the boundary box and parallel to any plane of the boundary box is made, and this plane is used as the selected initial section.
[0021] Preferably, in step (2), the initial cross section intersects with the discrete freeform surface in STL format to obtain the initial polyline.
[0022] In step (3), the lateral step distance of each point under the residual height constraint is calculated based on the points on the polyline, and the minimum lateral step distance of all points is taken as R. In other words, in step (3), the method to obtain the radius of the pipe model is as follows: using the classic residual height model, the curvature of each point of the current polyline is calculated, and the lateral step distance of each point under the residual height constraint is calculated based on the curvature. The minimum lateral step distance of all points on the polyline is taken as the radius of the pipe model.
[0023] Furthermore, the specific methods are as follows:
[0024] According to the classic residual height model, such as Figure 2 As shown, taking the ball-end cutter model as an example, with a ball-end cutter radius of r, the relationship between the lateral step distance d and the residual height h and curvature ρ is as follows:
[0025]
[0026] Where: sign is the sign operator, 0 for a plane, 1 for a convex surface, and -1 for a concave surface.
[0027] To determine the average curvature of a point on a polyline, we first use the Tabin approximation. By finding one or more triangular faces corresponding to the edges or vertices of the triangular facets to which the point on the polyline belongs, we take the minimum curvature of the vertices of all triangular faces as the curvature of the corresponding point on the polyline.
[0028] In step (3), a pipeline model is constructed with the initial polyline extension as the center, and the curvature of each point of the polyline and the pipeline radius are set to a value R. In further, in step (3), the method for obtaining the polyline extension is as follows: for the two ends of the obtained polyline, find the point that is closest to the endpoint on the bounding box and use it as the extension point of the polyline for extension processing, and use the extended polyline as the center line to generate the pipeline model.
[0029] In step (4), the pipe model intersects with the discrete surface model to generate two new polylines, and a single-sided polyline is selected based on the surface normal vector and positional relationship.
[0030] More specifically, the method for selecting a single-sided polyline in step (4) is as follows: Perform a geometric intersection operation using the pipe STL model and the discrete shell model to generate two new polylines; then,
[0031] (4-1) Using the starting and ending points of the central polyline corresponding to the centerline of the pipeline model, a direction vector of the central polyline is formed by pointing from the starting point to the ending point.
[0032] (4-2) Obtain the midpoint of the center polyline, denoted as point A. Traverse the points on both sides of the polyline, find the point closest to the midpoint, denoted as point B on one side and point C on the other side, and obtain the direction vectors of AB and AC. and
[0033] (4-3) Obtain the normal vector of the triangular facet corresponding to the midpoint of the central polyline as the vertex vector of the midpoint.
[0034] (4-5) Calculate the direction vectors of AB and AC respectively. and With direction vector The cross product of the two vectors is then combined with the vector of the intermediate vertex. Perform a dot product; if the result is greater than 0, it is one side; if it is less than 0, it is the other side. After selecting one side, it will be used as the direction for subsequent steps.
[0035] Furthermore, in step (4), for the two new polylines (initial new polylines) obtained from the pipe model corresponding to the initial polyline, steps (3) to (4) are repeated to generate parallel polylines one by one until the entire surface is covered. After selecting one of the initial new polylines, all parallel polylines corresponding to that side direction are first obtained, and then for the other initial new polyline, all parallel polylines corresponding to the corresponding side in its corresponding direction are obtained, thus obtaining all parallel polylines.
[0036] In step (5), the selected polyline is used to repeat the steps in step (3) to generate the pipeline model, and the corresponding radius value is set and the discrete surface is intersected to generate parallel polylines one by one until the entire surface is covered.
[0037] Using the selected polyline, the pipeline model is repeatedly generated and the intersection is processed. Parallel polylines are generated layer by layer until the entire surface is covered. The specific method is as follows: Based on the selected single-sided polyline, the two ends are appropriately extended as the center line. Steps (3) to (4) are repeated to generate parallel polylines one by one until the entire surface is covered.
[0038] After step (5) is completed, the short polylines generated for the surface boundary are filtered and connected with parallel polylines to form a complete toolpath layer. The specific method is as follows:
[0039] By detecting the boundary region of the surface model, short polylines generated by the boundary are extracted (formed by the intersection of the obtained parallel polylines and the boundary line of the surface model, and the endpoints of the short polylines are the intersections of two adjacent parallel polylines). Then, one endpoint of the polyline is sequentially found and connected to the nearest boundary polyline, and the other endpoint is found and connected to the nearest boundary polyline in the same direction. This process is repeated step by step to traverse and connect all parallel polylines and boundary polylines, thus forming a complete and continuous toolpath layer.
[0040] Compared with existing technologies, this invention has the following advantages: This invention employs a toolpath generation method based on a discrete surface model. Through Delaunay triangulation and pipe model intersection strategies, it can efficiently handle complex surface structures, significantly improving the uniformity of toolpath generation and machining accuracy. By selecting short polylines at boundaries and efficiently connecting parallel polylines, the boundary processing strategy is optimized, ensuring consistency in toolpath direction while maintaining the continuity and integrity of the toolpath. This invention can generate five-axis machining toolpaths for complex surfaces, suitable for multi-axis machining scenarios such as aerospace and mold manufacturing. It fully leverages the flexibility and high degree of freedom of five-axis CNC equipment, effectively improving machining efficiency, surface quality, and machining accuracy, providing reliable technical support for the machining of complex parts. Attached Figure Description
[0041] Figure 1 This is a flowchart of an embodiment of the present invention.
[0042] Figure 2 This is a schematic diagram of the classic residual height model in an embodiment of the present invention.
[0043] Figure 3 This is a schematic diagram of the surface model in an embodiment of the present invention.
[0044] Figure 4 This is a schematic diagram of the discretized surface model in an embodiment of the present invention.
[0045] Figure 5 This is a schematic diagram of the intersection of the initial plane and the discretized surface in an embodiment of the present invention.
[0046] Figure 6 This is a schematic diagram illustrating the generation of a polyline by the intersection of the initial plane and the discretized surface in an embodiment of the present invention.
[0047] Figure 7 This is a schematic diagram showing the intersection of the pipeline model formed by the initial polyline and the discretized surface in an embodiment of the present invention.
[0048] Figure 8 This is a schematic diagram of generating a pipeline by traversing in a certain direction to form an offset line on one side, as shown in an embodiment of the present invention.
[0049] Figure 9This is a schematic diagram of the double-sided offset lines in an embodiment of the present invention.
[0050] Figure 10 for Figure 9 A partially enlarged structural diagram.
[0051] Figure 11 This is a schematic diagram of a complete toolpath formed by connecting short polylines generated from the extracted boundary with the offset line in an embodiment of the present invention. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0053] like Figures 1 to 9 As shown, a method for generating toolpaths for five-axis CNC surface machining includes the following steps:
[0054] S10 discretizes the surface model to generate a surface model composed of triangular facets.
[0055] The surface model can be processed using the Delaunay triangulation method to generate uniform triangular patches, and the generated discrete surface model can be exported as an STL file.
[0056] In this step, the surface model file is read, and the supported formats include IGES, STEP or other CAD file formats. It is then parsed into surface parameter form (such as control points, basis functions and parameter ranges). The model file is then parsed to extract the control points, basis functions and parameter range information of the surface.
[0057] The model file is parsed to extract the control points, basis functions, and parameter range information of the surface model. Based on the parameter form of the surface model, a set of sampling points is generated according to the set discrete density. Delaunay triangulation is performed on the sampling point set to generate a uniform triangular mesh. The triangulation result is mapped from the UV parameter space to the three-dimensional space to form a surface model composed of triangular patches.
[0058] The generated triangular facet model is saved as an STL file for easy use in subsequent toolpath generation and CNC machining.
[0059] S20. Based on the discrete surface model, an initial cross section is selected to generate the first polyline (i.e., the initial polyline). The specific method is as follows:
[0060] Obtain the bounding box of the discrete surface model and find the center position of the bounding box;
[0061] Based on the center position of the bounding box, construct a plane that passes through the center position of the bounding box and is parallel to any plane of the bounding box. This plane is used as the selected initial cross section.
[0062] This allows the initial cross section to intersect with the discrete freeform surface in STL format, resulting in an initial polyline.
[0063] S30: Based on the points on the polyline, calculate the lateral step distance of each point under the residual height constraint, take the minimum value of the lateral step distance of all points as R, and construct the pipeline region with the currently obtained polyline extension line as the center, and the pipeline radius is the set value R.
[0064] First, using a classic residual height model (such as Research on Computer-Aided Manufacturing Methods and Key Technologies of T-Spline Surfaces (Gan Wenfeng), Zhejiang University, 2014, Doctoral Dissertation), the curvature of each point on the initial polyline is calculated. Based on the curvature, the lateral step distance of each point under the residual height constraint is calculated, and the minimum lateral step distance of all points on the central polyline is taken as R.
[0065] Then, the polyline extension is obtained by finding the point on the bounding box that is closest to the two endpoints of the polyline (initial polyline or current polyline) and using it as the endpoint of the extension line.
[0066] Finally, after obtaining R and the centerline: using the extended polyline as the center, and the obtained radius R as the curvature of the polyline at each point, construct a pipeline model, generate a pipeline model with radius R, and save it in STL format.
[0067] S40, the pipe model intersects with the discrete surface model to generate two new polylines, and a single-sided polyline is selected based on the surface normal vector and positional relationship;
[0068] The specific method is as follows:
[0069] Perform a geometric intersection operation between the pipeline STL model and the discrete surface model to generate two new polylines;
[0070] Take the start and end points of the central polyline, and draw a direction vector from the start point to the end point to form the direction vector of the central polyline.
[0071] Take the midpoint of the central polyline, denoted as point A. Traverse the points on both sides of the polyline, finding the point closest to the midpoint. Denote the point on one side as point B and the point on the other side as point C. Let... and As the direction vector of the polyline on both sides;
[0072] Take the vector of the face corresponding to the midpoint of the center polyline as the vertex vector of the midpoint.
[0073] calculate and respectively with The result of the cross product of the vectors is then multiplied by the two vectors obtained. Perform a dot product on the vectors. If the result is greater than 0, it represents one side; if it is less than 0, it represents the other side. Once one side is selected, it becomes the direction for subsequent steps.
[0074] S50 involves repeatedly generating a pipe model and performing intersection processing using selected polylines, generating parallel polylines layer by layer until the entire surface is covered; the specific method is as follows:
[0075] Based on the selected single-sided polyline, extend both ends appropriately as center lines, repeat steps S30-S50 to generate parallel polylines that meet the residual height constraints one by one until the entire surface is covered.
[0076] S60 filters short polylines generated at the surface boundary and connects them with parallel polylines to form a complete toolpath layer. The specific method is as follows:
[0077] Detect the intersection points of the boundary region of the curved surface model with parallel polylines, and extract the short polylines generated by the boundary.
[0078] Find the short boundary polyline closest to one endpoint of the polyline and connect them. Then find the short boundary polyline closest to the other endpoint and in the same direction. Continue traversing the entire parallel polyline until all parallel polylines are connected to form a complete toolpath.
[0079] In this embodiment, in step S10, as follows Figure 3 , Figure 4 As shown, a surface model in STEP format ( Figure 3 As shown, uniform triangular patches are generated using the Delaunay triangulation method. The resulting surface model composed of triangular patches is usually saved in STL format.
[0080] In this embodiment, in step S20, as follows Figure 5 , Figure 6 As shown, based on the center position of the boundary box of the discrete surface model, a plane passing through the center position of the boundary box and parallel to any plane of the boundary box is constructed. This plane is used as the selected initial section. The initial section intersects with the discrete freeform surface in STL format to obtain the initial polyline.
[0081] In this embodiment, in step S30, the points closest to the endpoints on the bounding box at both ends of the initial or current polyline are found and used as extension points of the initial polyline to obtain the extension line of the initial or current polyline. The extended polyline is then used as the centerline to generate the pipeline model; for example... Figure 7As shown in the figure (the radius of the pipe model has been enlarged for clearer display), the pipe model intersects with the discrete surface model, generating two new polylines. A single-sided polyline is selected based on the surface normal vector and positional relationship, as detailed below:
[0082] Perform a geometric intersection operation using the pipe STL model and the discrete shell model (surface model) to generate two new polylines;
[0083] Take the start and end points of the central polyline, and draw a direction vector from the start point to the end point to form the direction vector of the central polyline.
[0084] Take the midpoint of the central polyline, denoted as point A. Traverse the points on both sides of the polyline, finding the point closest to the midpoint. Denote the point on one side as point B and the point on the other side as point C. Let... and As the direction vector of the polyline on both sides;
[0085] Take the vector of the face corresponding to the midpoint of the center polyline as the vertex vector of the midpoint.
[0086] calculate and respectively with The result of the cross product of the vectors is then multiplied by the two vectors obtained. Perform a dot product on the vectors. If the result is greater than 0, it is one side; if it is less than 0, it is the other side. Once one side is selected, it will be used as the direction for subsequent steps.
[0087] In this embodiment, in step S50, as follows Figure 8 , Figure 9 As shown, the pipeline model is repeatedly generated and intersection processing is performed using selected polylines, generating parallel polylines layer by layer until the entire surface is covered. The specific method is as follows:
[0088] Based on the selected one-sided polyline, extend both ends appropriately as center lines, and repeat steps S30 and S40 to generate parallel polylines one by one until the entire surface is covered.
[0089] For the two polylines (polyline Ia and polyline Ib) obtained by intersecting the pipe model corresponding to the initial polyline (or the first polyline), select the polyline in one direction (e.g., polyline Ia), extend it, and repeat S30 and S40 until the polyline on the corresponding side in that direction is generated. Figure 8 As shown. Then, for a polyline in another direction (e.g., polyline Ib), the same operation is performed in that direction, repeating S30 and S40 until the polyline on the corresponding side in that direction is generated. Finally, parallel polylines covering the entire surface are obtained, as shown. Figure 9As shown.
[0090] In this embodiment, in step S60, as follows Figure 10 and Figure 11 As shown, short polylines generated at the surface boundary are filtered and connected with parallel polylines to form a complete toolpath layer. The specific method is as follows:
[0091] By detecting the boundary region of the surface model, short polylines 101 (i.e., formed by the intersection of the surface model boundary and parallel polylines) are extracted from the boundary region. Starting from one side of the parallel polyline, one endpoint of the parallel polyline 102 is sequentially found and connected to the nearest boundary short polyline. Then, the other endpoint is found in the same direction and connected to the nearest boundary short polyline. This process is repeated step by step to traverse and connect all parallel polylines and boundary short polylines, thus forming a complete and continuous toolpath layer.
Claims
1. A method for generating CNC five-axis toolpaths based on a freeform surface model, characterized in that, include: (1) Discretize the surface model to generate a discrete surface model composed of triangular patches; (2) Select the initial cross section based on the discrete surface model and generate the initial polyline; (3) Generate a pipeline model using the obtained polyline as the center line; (4) Find the intersection of the pipe model and the discrete surface model to obtain two new polylines, and select the one-sided polyline as the new polyline to return to step (3). (5) Repeat steps (3) to (4) to generate parallel polylines one by one until the entire surface is covered; (6) Connect all the obtained parallel polylines in sequence to form a complete toolpath; In step (2), the method for obtaining the initial cross-section is as follows: (2-1) Obtain the bounding box of the discrete surface model and find the center position of the bounding box; (2-2) Obtain the initial cross-section based on the obtained center position; (2-3) Find the intersection line between the initial cross section and the discrete surface model to obtain the initial polyline; The method for selecting a single-sided polyline in step (4) is as follows: (4-1) Using the starting point and ending point of the central polyline corresponding to the centerline of the pipeline model, the direction vector of the central polyline is formed from the starting point to the ending point; (4-2) Obtain the midpoint of the central polyline, denoted as point A. Traverse the points on the polylines obtained by finding the intersection on both sides, find the point closest to the midpoint, denoted as point B on one side and point C on the other side, and obtain the direction vectors of AB and AC. (4-3) Obtain the normal vector of the triangular facet corresponding to the midpoint of the central polyline as the vertex vector of the midpoint; (4-5) Calculate the cross product of the direction vectors of AB and AC with the direction vector of the center polyline, and then perform dot product of the two vectors with the vector of the midpoint vertex. If the result is greater than 0, it is one side; if it is less than 0, it is the other side. Select one side as the single-sided polyline.
2. The method for generating CNC five-axis toolpaths based on a freeform surface model according to claim 1, characterized in that, In step (2-2), the initial cross section is a plane that passes through the center position and is parallel to any plane of the boundary frame.
3. The method for generating CNC five-axis toolpaths based on a freeform surface model according to claim 1, characterized in that, In step (3), the method for obtaining the radius of the pipeline model is as follows: using the classic residual height model, calculate the curvature of each point of the current polyline, calculate the lateral step distance of each point under the residual height constraint based on the curvature, and take the minimum lateral step distance of all points on the polyline as the radius of the pipeline model.
4. The method for generating CNC five-axis toolpaths based on a freeform surface model according to claim 1, characterized in that, In step (3), for the two ends of the obtained polyline, find the point that is closest to the endpoint on the bounding box and use it as the extension point of the polyline for extension processing, and use the extended polyline as the center line to generate the pipeline model.
5. The method for generating CNC five-axis toolpaths based on a freeform surface model according to claim 1, characterized in that, In step (4), for the two new polylines obtained from the pipe model corresponding to the initial polyline, steps (3) to (4) are repeated to generate parallel polylines one by one until the entire surface is covered.
6. The method for generating CNC five-axis toolpaths based on a freeform surface model according to claim 1, characterized in that, The discrete surface model composed of triangular patches is generated using Delaunay triangulation.
Citation Information
Patent Citations
High-precision numerical control machining tool track fast generation method for triangular gridding curved surface model
CN101403908A
Large-curvature workpiece machining five-axis tool path generation method based on subdivision
CN118838249A