A fully automated, programmable-free method for generating multi-axis precision engraving machining paths
By automatically generating multi-axis precision carving paths, the problem of relying on CAM software and process engineers in existing technologies has been solved, realizing efficient and safe multi-axis machining without manual programming. It is suitable for machining complex curved surface parts in small batches and with a variety of products.
Patent Information
- Application Number
- CN202611256802.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-11-10
AI Technical Summary
Existing multi-axis precision carving technology relies on professional CAM software and process engineers, which has a high learning threshold, complex programming and is prone to errors, making it difficult to adapt to the processing needs of small batches, multiple varieties and personalized customization.
By acquiring a 3D mesh model and machining parameters, a 3+2 roughing and/or wraparound roughing path is automatically generated. Combined with geometric topology analysis, adaptive equidistant offset, and collision detection, a finishing path is automatically planned, generating NC code executable by CNC machine tools.
It enables the generation of safe and reliable multi-axis machining toolpaths without manual programming, lowers the professional threshold, improves machining efficiency and quality, and avoids tool damage and workpiece scrap caused by manual programming.
Smart Images

Figure CN123067348A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of CNC machining technology, and in particular to a fully automatic, non-programmable multi-axis precision carving machining path generation method. Background Technology
[0002] In the field of CNC precision machining, the precision machining of complex curved surface parts (such as mold cavities, impeller blades, and relief carvings for handicrafts) places high demands on the flexibility of tool posture. Traditional three-axis CNC machining, due to its fixed tool posture, is prone to problems such as tool interference, machining dead angles, and uneven surface quality when machining deep cavities, undercut surfaces, and complex free-form surfaces. To address these issues, 4 / 5-axis CNC technology, by adding a rotary axis, allows the tool to approach the workpiece surface in any posture in space, effectively improving machining accessibility and surface quality, and has become the mainstream method for manufacturing high-precision complex parts.
[0003] However, current 4 / 5-axis precision engraving still heavily relies on professional CAM software and experienced process engineers in practical applications. Operators need to complete a series of complex processes, including importing 3D models, setting machining coordinate systems, selecting tools, formulating multi-axis toolpath strategies, collision detection and avoidance, and post-processing. This not only has a high learning curve and a long learning cycle, but also, due to improper parameter settings or insufficient collision prediction during manual programming, tool damage, workpiece scrapping, and even machine tool damage are very likely to occur. Especially for small-batch, multi-variety, and customized production scenarios, frequent programming and debugging severely restrict processing efficiency and delivery cycle.
[0004] In recent years, although some automated programming solutions for specific scenarios have emerged in the industry, such as feature recognition-based three-axis automatic programming and template-based macro program generation, they still face significant bottlenecks in the field of multi-axis linkage machining. On the one hand, the coupling between complex curved surfaces and rotary axis motions dramatically increases the computational complexity of tool axis vector planning and collision interference detection. On the other hand, existing automatic programming systems are mostly limited to simple geometric features or fixed process templates, making it difficult to adapt to the machining requirements of complex free-form surfaces, variable allowance offsets, and local geometric constraints. They cannot achieve true "programming-free" operation, where users only need to input a 3D model and basic machining requirements, and the system can autonomously complete the entire process from geometric analysis, toolpath planning, multi-axis motion calculation to safety verification. Summary of the Invention
[0005] This specification provides an embodiment of a fully automatic, non-programmable multi-axis precision engraving machining path generation method to solve at least one of the technical problems mentioned above.
[0006] To solve the above-mentioned technical problems, the embodiments in this specification are implemented as follows: According to the embodiments of this specification, a fully automatic, programming-free multi-axis precision carving machining path generation method is provided, including: Obtain the 3D mesh model and machining parameters of the workpiece to be processed; Based on the three-dimensional mesh model, a roughing path is generated, which includes a 3+2 roughing path and / or a wraparound roughing path. Based on the 3D mesh model, a finishing path is generated, which is generated through the following sub-steps: Geometric topology analysis is performed on the three-dimensional mesh model to identify local concave and convex features, and an adaptive equidistant offset is applied to the machining surface based on the local concave and convex features to generate an offset mesh. Construct a set of cross-sectional planes with consistent normals, and find the intersection lines between each cross-sectional plane and the offset mesh to obtain the layered contour lines; Perform intersection calculations on the contour lines of the same layer, eliminate internal intersection lines, and retain the outermost contour; The outermost contour is discretized into an ordered set of points, and atomic segments are defined by adjacent points. The feasible processing domain of each atomic segment is determined by collision detection. Atomic segments with compatible and non-interfering feasible processing domains within the same contour layer are spliced into continuous path segments to generate a complete finishing toolpath. The 3+2 roughing toolpath or the surrounding roughing toolpath and the finishing toolpath are subjected to kinematic post-processing to generate the NC code corresponding to the CNC engraving machine tool.
[0007] In some optional implementations, the step of generating a roughing path based on the three-dimensional mesh model, wherein the roughing path includes a 3+2 roughing path, and the step of generating the 3+2 roughing path includes: Select a blank bounding box, project the vertices of the blank bounding box along the cutting direction to obtain the boundary points of the processing range, and calculate the pixel step size with the tool radius as a constraint to generate regular grid points in the projection domain; ZigZag reference points are generated for the front and back sides according to the machining axis direction, and collision detection points are constructed for the top and bottom layers. For each sampling point, the validity of the blank is judged, and invalid pixels located outside the blank area are removed; An expanded tool is formed by superimposing the tool radius with a radial allowance, and GPU parallel collision detection is used to calculate the maximum number of layers that each effective pixel can reach along the cutting direction. This yields a discrete depth field, where the subscripts are... , These are the index numbers of the pixel in the two coordinate directions of the projection domain; Multiply the number of layers in the depth field by the layer height to convert it into the actual depth, and generate the front and back ZigZag roughing trajectories layer by layer; Collinearity points are merged and redundant points are cleared from the generated path. The cumulative rotation angle of each toolpath point is calculated and angle jumps are handled. The tool lifting point is inserted by combining the maximum turning radius of the model and the safety height to obtain a 3+2 roughing toolpath.
[0008] In some optional implementations, the step of performing intersection operations on the contour lines of the same layer, eliminating internal intersection lines, and retaining the outermost contour includes: Extract all contour lines on the same cross-sectional plane and sort them counterclockwise around the axis of rotation; Create an axis-aligned bounding box for each contour line segment, and use the bounding box overlap test to filter candidate intersecting line segments; Calculate the exact intersection point for the selected line segments, with the intersection point parameters being: ,in The intersection point parameter of the first intersecting line segment. The intersection point parameter of the second intersecting line segment. For distance tolerance; Each original line segment is sorted according to the strict intersection parameters on the original line segment and broken at the intersection to obtain atomic split line segments; Select the initial segment of each original contour chain, and set the interference index of the initial segment... Traverse the segments sequentially along the contour direction, each time crossing a strict intersection point Based on the current line segment tangent vector Intersecting line segments at the strict intersection point Counterclockwise normal vector at the location The same or opposite relationship updates the interference index. ; The segment with the smallest interference index is retained, the internal redundant segments are eliminated, and the retained segments are connected into an ordered outer contour line according to the endpoint distance tolerance and the tangential angle.
[0009] In some alternative implementations, the step of determining the tangent vector of the current line segment is... Intersecting line segments at the strict intersection point Counterclockwise normal vector at the location The same or opposite relationship updates the interference index. The steps include: If they are in the same direction, the contribution is... If the opposite is true, the contribution is... ,Right now ,in For symbolic functions, Representing vectors and dot product operation; When multiple intersecting line segments exist at the same intersection point, they are accumulated separately. And the updated interference index The mark is placed on the split segment after crossing the same intersection point.
[0010] One embodiment of this specification can achieve at least the following beneficial effects: In this technical solution, after obtaining the 3D mesh model and machining parameters of the workpiece to be processed, a roughing path including 3+2 roughing and / or wrap-around roughing is first generated based on the model to quickly remove large excess material and avoid the risk of overcutting during finishing. Then, without the need for manual CAM process planning, the system automatically completes geometric feature extraction, layered contour acquisition, feasible machining domain analysis, and tool axis posture planning through internal calculations, directly generating the finishing path. Finally, kinematic post-processing outputs NC code executable by the machine tool. Furthermore, this solution limits the entire machining process, from model input to final output machining instructions, to relying solely on the user-imported 3D mesh model and the specified machining direction and accuracy requirements. It eliminates the need for user intervention in tool position calculation, collision avoidance, and posture planning, and does not rely on manual programming intervention by process engineers or complex CAM software settings.
[0011] This solution establishes a complete closed-loop process of "model input - intelligent analysis - autonomous planning - safety verification," transforming the toolpath calculation and attitude determination work, which originally relied heavily on professional CAM engineers, into fully automated algorithmic computation. This solution lowers the professional threshold and learning cycle for multi-axis CNC machining, enabling ordinary operators to efficiently machine complex curved surface parts. It overcomes the defects of traditional processes, such as tool damage and workpiece scrap caused by improper manual parameter settings or insufficient collision prediction. Furthermore, because this solution can internally and uniformly complete geometric feature analysis, path regularization under 4 / 5-axis kinematic constraints, and kinematic post-processing of the entire toolpath, it effectively eliminates the risks of machining breakpoints and interference caused by attitude jumps or point deviations during manual programming. This is equivalent to constructing an autonomous and controllable machining solution logic at the algorithm level, allowing this method to automatically generate safe, reliable, and continuously stable multi-axis machining toolpaths based solely on the input basic model and parameters, without relying on the operator's process experience. This, to a certain extent, solves the technical problems of existing multi-axis precision engraving technology, which heavily relies on CAM programming and process engineers and is difficult to adapt to the needs of small-batch, multi-variety, and rapid delivery. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 A schematic diagram of a single-sided 3+2 roughing toolpath in the fully automatic, programming-free multi-axis precision carving machining path generation method provided in this application; Figure 2 A schematic diagram of the surrounding roughing toolpath in the fully automatic, programming-free multi-axis precision engraving machining path generation method provided in this application; Figure 3 A schematic diagram illustrating the calculation of the entire finishing process in the fully automatic, programming-free multi-axis precision carving machining path generation method provided in this application; Figure 4 A schematic diagram of the process of finding the intersection of the same layer contours and extracting the outer contour in the fully automatic, programming-free multi-axis precision carving machining path generation method provided in this application; Figure 5 A schematic diagram of the five-axis segmented tilting angle machining in the fully automatic, programming-free multi-axis precision carving machining path generation method provided in this application; Figure 6 A schematic diagram of the contour and representative directional sector distribution generated by the cross-sectional plane method in the fully automatic, programming-free multi-axis precision carving path generation method provided in this application; Figure 7 is a schematic diagram of the atomic segment merging algorithm based on front and back traversal in the fully automatic, programming-free multi-axis precision carving machining path generation method provided by the technical solution of this application; Figure 8 is a schematic diagram of the experimental verification of a simple rabbit model four-axis machining in the fully automatic, programming-free multi-axis precision carving machining path generation method provided by the technical solution of this application; Figure 9 is a schematic diagram of the experimental verification of four-axis machining of a non-watertight gourd model in the fully automatic, programming-free multi-axis precision carving machining path generation method provided by the technical solution of this application. Figure 10 is a schematic diagram of the experimental verification of the five-axis segmented precision machining of a complex dragon-horse model in the fully automatic, non-programming multi-axis precision carving machining path generation method provided by the technical solution of this application. Detailed Implementation
[0014] To make the objectives, technical solutions, and advantages of one or more embodiments of this specification clearer, the technical solutions of one or more embodiments of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of one or more embodiments of this specification.
[0015] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another.
[0016] This application provides a fully automatic, non-programmable multi-axis precision carving machining path generation method. This method mainly achieves fully automatic generation from a 3D model to a 4 / 5-axis precision carving machining toolpath through 3D mesh adaptive offset, layered contour extraction, contour intersection filtering, and atomic segment feasible machining domain merging and collision detection.
[0017] The following is a detailed explanation of this scheme, such as... Figure 1 As shown, the method may include: Step 102: Obtain the 3D mesh model and machining parameters of the workpiece to be processed.
[0018] In the embodiments of this specification, the three-dimensional mesh model can refer to a digital model composed of a large number of triangular facets, used to characterize the geometric shape of the workpiece to be machined, such as an STL format model file acquired by a 3D scanner or designed by CAD software. For subsequent toolpath planning and machining simulation, this three-dimensional mesh model is the most basic input data for the system to perform geometric analysis, collision detection, and path calculation. Machining parameters can be understood as user-specified tool information, machining direction, accuracy requirements, and necessary process constraints, such as tool type, tool length, tool radius, maximum allowable residual height for finishing, inter-layer step size for roughing, and safety height. The above-mentioned three-dimensional mesh model and machining parameters can be obtained by the user directly importing and configuring them through a human-computer interaction interface, or automatically loaded from the upstream process database. After obtaining the three-dimensional mesh model and machining parameters, all the geometric and process information required for subsequent fully automatic toolpath planning is obtained.
[0019] Step 104: Based on the three-dimensional mesh model, generate a roughing path, which includes a 3+2 roughing path and / or a wraparound roughing path.
[0020] In the embodiments of this specification, the roughing path can refer to the initial cutting trajectory used to quickly remove most of the excess material from the workpiece surface. Its goal is to cut the blank material to near its final shape in the shortest possible time, while leaving a uniform machining allowance for subsequent finishing processes. For 4 / 5-axis precision carving of complex curved surface parts, the quality of the roughing stage directly affects the cutting stability and surface quality of the finishing stage. Due to the significant differences in the geometry, blank type, and processing scenarios of different parts, a single roughing strategy often fails to achieve ideal results under various working conditions. Therefore, the technical solution of this application designs two roughing path generation methods that can be selected independently or used in combination: the 3+2 roughing path and the wraparound roughing path. The 3+2 roughing path decomposes the four-axis machining problem into two fixed postures for three-axis layered cutting of the front and back surfaces, which is suitable for parts with obvious front and back surface features and a relatively open processing area. The wraparound roughing path removes material layer by layer at multiple angles along the circumference in a cylindrical coordinate system, which is suitable for rotating bodies and parts with dominant carving features. In actual machining, one method can be selected based on the part geometry and blank type, or the two can be combined. In regular areas, 3+2 roughing can be used to improve efficiency, while in rotating contours and areas prone to material residue, wraparound roughing can be used to ensure complete material removal. When a part contains both planar regular areas and rotating engraving areas, machining zones can be automatically divided based on geometric features. The two types of paths are connected at the zone boundaries by a safe tool lifting height, achieving a complementary advantage in both machining efficiency and tool path safety.
[0021] Step 106: Generate a finishing path based on the three-dimensional mesh model.
[0022] In the embodiments of this specification, the finishing path can refer to the cutting trajectory used to complete the final surface shaping of the part. Its goal is to achieve the final geometric accuracy and surface quality requirements of the part by using 4-axis or 5-axis linkage motion to make the tool fit the workpiece surface in a suitable posture after roughing to remove most of the excess material. Compared with roughing, finishing has higher requirements for tool posture planning, collision detection and path continuity, especially when machining deep cavities, undercut surfaces and complex freeform surfaces. It is necessary to ensure that the tool can avoid interference with the workpiece at every cutting position. The finishing path generation process in this application first performs geometric topology analysis on the input three-dimensional mesh model to identify local concave and convex features, and then implements adaptive equidistant offset on the machining surface based on the local concave and convex features to generate an offset mesh as the reference surface for toolpath planning. Subsequently, a set of cross-sectional planes with consistent normals are constructed, and the intersection lines of each cross-sectional plane with the offset mesh are obtained to obtain layered contour lines. Then, intersection operations are performed on the contour lines within the same layer, internal intersection lines are eliminated, and the outermost contour is retained. Next, the outermost contour is discretized into an ordered set of points, and atomic segments are defined by adjacent points. Collision detection is used to determine the feasible machining domain of each atomic segment, and atomic segments with compatible and non-interfering feasible machining domains within the same contour layer are spliced into continuous path segments, ultimately generating a complete 4 / 5-axis linkage finishing toolpath. For example... Figure 3 As shown in the figure, this diagram fully illustrates the calculation results of the entire finishing process in this step. a represents the input 3D machining model; b represents the offset mesh generated after adaptive equidistant offsetting of the model; c represents the layered contour lines obtained by intersection of the cutting planes; d represents the single-layer contour line of a certain cross-section in c; e represents the outer contour line obtained after filtering the inner and outer boundaries of this layer; f represents a partial schematic of the toolpath obtained after collision detection analysis of each atomic segment on the contour line, with the red arrow indicating the optimal tool axis direction at that location; g represents the final generated complete finishing toolpath; and h represents the result after importing the toolpath into the simulation environment for solid cutting verification.
[0023] In step 106, the generation of the finishing path can be further achieved through the following sub-steps.
[0024] Sub-step 1062: Perform geometric topology analysis on the three-dimensional mesh model, identify local concave and convex features, and implement adaptive equidistant offset on the processing surface based on the local concave and convex features to generate an offset mesh.
[0025] In the embodiments of this specification, geometric topology analysis refers to the process of quantitatively calculating the connection relationships between vertices and faces in a 3D mesh model, as well as the curvature of surfaces at vertices. The purpose of this analysis is to identify which areas on the model surface are flat or convex, and which are concave, thus providing a geometric basis for subsequent offset processing. An offset mesh can be understood as a new surface obtained by extending the surface of the original model outwards along its normal direction by a certain distance. Its function is to provide a reference surface that is slightly expanded outwards from the theoretical surface of the workpiece for the actual movement of the tool. For flat and convex areas, a uniform offset distance can be directly used for outward expansion; however, for concave areas, to avoid self-overlapping or shape distortion of the offset surface at concave corners, the offset distance needs to be appropriately reduced in this area. Through the above adaptive processing, a geometrically continuous, non-self-intersecting offset mesh can be generated as a reference surface for subsequent toolpath planning.
[0026] Sub-step 1064: Construct a set of cross-sectional planes with consistent normals, and find the intersection lines between each cross-sectional plane and the offset mesh to obtain the layered contour lines.
[0027] In the embodiments of this specification, a cutting plane can refer to a set of parallel virtual planes with consistent normal vectors. Its function is to divide the offset mesh in three-dimensional space into several two-dimensional sections from top to bottom according to a certain layer spacing. This transformation is necessary because directly planning the tool motion in three-dimensional space is quite complex. By slicing the three-dimensional model into layers, the toolpath planning problem on each layer can be simplified to solving the tool's motion trajectory on that two-dimensional section. Specifically, the normal vector and layer spacing of the cutting plane can be determined based on the workpiece clamping direction and the machining accuracy set by the user. Then, the intersection lines between the cutting plane and the offset mesh are calculated layer by layer. These intersection lines are the contour curves on each layer. These layered contour lines transform the three-dimensional offset surface into a series of ordered two-dimensional contour sequences, allowing subsequent toolpath planning to be performed independently on each layer, thereby reducing the complexity of the problem.
[0028] Sub-step 1066: Perform intersection operation on the contour lines of the same layer, remove the internal intersection lines, and retain the outermost contour.
[0029] In the embodiments of this specification, when the workpiece model to be machined is composed of multiple sub-models, the intersection of the cutting plane and the offset mesh often generates multiple contour lines on the same cutting plane. These include not only the outer contour lines located on the outer surface of the part, but also redundant intersection lines located inside or penetrating the overlapping areas of the sub-models. If these internal redundant intersection lines participate in subsequent toolpath calculations, it will increase the computational load of collision detection and may cause intersection confusion during path splicing, affecting the continuity of the toolpath and machining quality. Therefore, the system performs intersection analysis on all contour lines on the same layer, and uses interference judgment to remove redundant line segments located inside or occluded by external boundaries, retaining only the outermost effective contour boundary. After this processing, the retained outer contour line is the effective boundary that the tool actually needs to cut on that layer.
[0030] Sub-step 1068: Discretize the outermost contour into an ordered set of points, define atomic segments by adjacent points; determine the feasible processing domain of each atomic segment through collision detection, and splice atomic segments with compatible and non-interfering feasible processing domains within the same contour layer into continuous path segments to generate a complete finishing toolpath.
[0031] In the embodiments of this specification, an atomic segment can refer to the smallest machining unit obtained by discretizing a continuous contour line according to a certain length step. During actual cutting, as the tool moves along a contour, the curvature, normal vector, and other geometric properties at different positions on the contour may change. Therefore, it is necessary to divide the long contour into sufficiently small units, approximating the geometric conditions as constant within each unit, thereby independently calculating the optimal tool posture for each unit. Specifically, discretization can be achieved by sequentially sampling an ordered set of points along the direction of the outer contour at a preset step size, defining the contour segment between every two adjacent points as an atomic segment. After obtaining each atomic segment, the feasible machining domain of each atomic segment needs to be determined, which is the angular range formed by all tool axis directions on which the tool can cut in a collision-free manner within that atomic segment. The feasible machining domain is determined by performing collision detection on each candidate tool axis direction, filtering out all safe directions that can avoid interference between the tool and the workpiece or fixture. After obtaining the feasible machining domain of each atomic segment, adjacent atomic segments with compatible and non-interfering tool axis directions on the same contour layer are merged into continuous path segments, enabling the tool to cut continuously during machining without frequent tool lifting and repositioning. This process is repeated until all atomic segments are assigned to their corresponding path segments, ultimately generating a complete finishing toolpath.
[0032] Sub-step 1070: Perform kinematic post-processing on the 3+2 roughing toolpath or the surrounding roughing toolpath and the finishing toolpath to generate the NC code corresponding to the CNC engraving machine tool.
[0033] In the embodiments of this specification, kinematic post-processing refers to the process of converting planned toolpath trajectory data into NC code that can be recognized and executed by a specific CNC machine tool. Because different models of CNC engraving machine tools differ in axis configuration, kinematic parameters, coordinate system definition, and instruction format, the calculated tool position coordinates and tool axis directions need to be converted into position instructions for each motion axis through inverse kinematics, and then formatted and output according to the NC programming specifications of the target machine tool. NC code is a sequence of instructions directly read and executed by the CNC machine tool, containing all machining instructions such as tool movement trajectory, feed rate, spindle speed, tool change, and cooling switch. Through this post-processing step, the entire process from 3D model input to machine tool-executable machining instructions can be automated.
[0034] Based on the technical solutions described above, this specification also provides some specific implementation schemes, which are described below.
[0035] In an optional embodiment, the step of generating a roughing path based on the three-dimensional mesh model, wherein the roughing path includes 3+2 roughing paths, and the step of generating the 3+2 roughing paths specifically includes: Select a blank bounding box, project the vertices of the blank bounding box along the cutting direction to obtain the boundary points of the machining range, and calculate the pixel step size with the tool radius as a constraint to generate regular mesh points within the projection domain; the machining projection domain can be defined as... ;in, and These respectively represent the processing range within the projection domain. Minimum and maximum coordinate boundary values along the axis. and These respectively represent the processing range within the projection domain. Minimum and maximum coordinate boundary values along the axis; ZigZag reference points are generated for the front and back sides according to the machining axis direction, and collision detection points are constructed for the top and bottom layers. For each sampling point, the validity of the blank is judged, and invalid pixels located outside the blank area are removed; An expanded tool is formed by superimposing the tool radius with a radial allowance, and GPU parallel collision detection is used to calculate the maximum number of layers that each effective pixel can reach along the cutting direction. The discrete depth field is obtained, where the maximum number of layers satisfies subscript , These are the index numbers of the pixel in the two coordinate directions of the projection domain; where, the symbol... This represents the maximum number of layers of depth of cut allowed along the tool cutting direction (i.e., the depth direction of the projected domain) in the 3+2 roughing strategy (i.e., the upper limit of the number of layer cutting operations). Multiply the number of layers in the depth field by the layer height to convert it into the actual depth, and generate the front and back ZigZag roughing trajectories layer by layer; Collinearity points are merged and redundant points are cleared from the generated path. The cumulative rotation angle of each toolpath point is calculated and angle jumps are handled. The tool lifting point is inserted by combining the maximum turning radius of the model and the safety height to obtain a 3+2 roughing toolpath.
[0036] In the embodiments of this specification, the 3+2 roughing path can be understood as a machining strategy that decomposes a problem that originally required continuous four-axis linkage control into a three-axis layered cutting problem under two fixed postures. For parts with obvious front and back features and a relatively open machining area, this method can significantly reduce posture changes and idle travel, and improve roughing efficiency. In specific implementation, the blank bounding box can be selected first, that is, the smallest hexahedral region containing the entire workpiece blank can be determined. Then, each vertex of the bounding box is projected onto a two-dimensional plane along the cutting direction to obtain the projection boundary points of the machining range on the plane, thereby determining which two-dimensional areas the tool needs to perform cutting operations in. Based on this, the pixel step size is calculated with the tool radius as a constraint, that is, the sampling interval when dividing the grid in the projection domain. This step size needs to ensure that the spacing between adjacent sampling points is neither too dense, which would cause a surge in computation, nor too sparse, which would cause machining residue. Subsequently, regular grid points are generated in the projection domain, and each grid point represents a sampling position where its cutting depth needs to be evaluated. Then, ZigZag reference points are generated for the front (0° direction) and back (180° direction) sides according to the machining axis direction. Top and bottom collision detection points are constructed for each direction to determine the deepest point the tool can penetrate from the outermost surface in that direction. For each sampling point, validity is judged based on the blank type (cube or cylinder), eliminating sampling points located outside the blank area to reduce the computational scale of subsequent collision detection. After validity judgment, the tool radius is superimposed with radial allowance to form an expanded tool model. The massively parallel computing power of the GPU is used to perform triangular facet collision detection on each valid pixel along the cutting direction, calculating the maximum number of layers that the pixel position can reach. These maximum layer numbers constitute a discrete depth field reflecting the material removal depth. It should be noted that... subscript , These represent the index numbers of the pixel in the two coordinate directions of the projection domain, i.e., the row and column positions of the pixel in the grid, thus corresponding each sampling position on the 2D plane to a unique depth value. Then, the number of layers in the depth field is multiplied by the corresponding layer height to convert it into an actual depth value. The outermost layer is generated by offsetting the axial margin along the axis, and the middle layers are progressively advanced according to the tool step size. The front and back paths are planned separately, and the cutting directions of adjacent layers alternately reverse, thus forming a continuous ZigZag roughing trajectory. Finally, all generated paths are post-processed, including merging collinear points to reduce redundant points, cleaning up nearby redundant points, calculating the cumulative rotation angle of the rotation axis at each toolpath point and handling angle jumps caused by crossing ±180° boundaries, and inserting tool lift-off points at path breakpoints based on the model's maximum turning radius and a set safety height. The final output is a 3+2 roughing toolpath containing a sequence of tool lift-off points, a sequence of path nodes, and a complete toolpath. This scheme transforms the material removal problem in 3D space into a depth field calculation problem in a 2D projection domain, generating regular and reliable roughing trajectories while maintaining high computational efficiency. Figure 1 As shown in the figure, this figure is a typical schematic of a single-sided 3+2 roughing toolpath generated by the above steps. The figure shows the shape of the ZigZag layered cutting path on the front side. The path is regularly arranged in the projection domain and the large amount of material is quickly removed by reciprocating cutting under a fixed posture.
[0037] In an optional embodiment, the step of generating a roughing path based on the three-dimensional mesh model, wherein the roughing path includes a wraparound roughing path, and the step of generating the wraparound roughing path specifically includes: Obtain the boundary points of the blank bounding box in the cutting direction, and calculate the axial sampling step size by pixel step size. The pixel step size calculation can be... ,in Define the radius of rotation of the blank; generate rectangular coordinate grid points and cylindrical coordinate grid points; If the blank is a cube, the rectangular section is divided into four quadrants to generate a reciprocating cutting path from the outside to the inside and from the large circle to the small circle, thus realizing the pre-machining of the square material into a circle; if the blank is a cylinder, it directly enters the surrounding layered cutting stage. The tool radius is superimposed with radial increments to form an expansion tool. Collision detection is performed on the cylindrical mesh points to obtain a one-dimensional depth array, which is then reorganized into a two-dimensional depth structure according to the angular direction. Select either single-path or multi-path mode to generate the cylindrical cutting path according to process requirements, calculate the tool direction point by point, organize the trajectory in layers according to angle and radius, and form a continuous reciprocating circular cutting path. The pre-machining path of the cubic blank is merged with the circular path, collinear point merging and redundant point cleaning are performed, the cumulative rotation angle of each path point is calculated, and a tool lifting point is inserted at a safe height at the path breakpoint to output the circular roughing toolpath.
[0038] In the embodiments described in this specification, the wraparound roughing path can be understood as a type of roughing path in a cylindrical coordinate system. The roughing strategy of removing material layer by layer at multiple angles along the lower circumference is based on the core idea of clamping the workpiece on a rotating axis and advancing the tool layer by layer from the outer periphery of the blank inward along the circumferential direction. This allows the tool to approach the blank envelope at various angles, resulting in more thorough and uniform material removal. This method is suitable for rotating parts and complex curved surfaces with engraving features. It enables a more uniform distribution of allowance before finishing and a more stable cutting depth, thereby reducing the risk of encountering large depths of cut or deep cavities during the finishing stage, protecting the tool, and improving surface quality consistency. In practical implementation, the boundary points of the blank's bounding box in the cutting direction can be obtained first. Then, the sampling step size along the axial direction can be calculated according to a preset pixel step size, and both rectangular coordinate grid points and cylindrical coordinate grid points can be generated simultaneously in a new coordinate system. For a cubic blank, the rectangular section can be divided into four quadrants, generating reciprocating cutting paths from the outside in and from the large circle to the small circle, achieving a pre-processing effect of "turning a square blank into a round shape," that is, first machining the square blank into an approximate cylindrical shape during rotation. If the blank itself is a cylinder, this pre-machining stage is skipped, and the process proceeds directly to circumferential layered cutting. Based on this, a radial increment is added to the tool radius to form an expanded tool model. GPU-accelerated collision detection is performed on the cylindrical mesh points to obtain a one-dimensional depth array whose length is the product of the number of angular directions and the number of axial pixels. This one-dimensional array is then reorganized into a two-dimensional depth structure according to the angular directions, so that each angular direction corresponds to a set of radially machinable layers. In circumferential roughing, the circumferential direction is incremented by angular steps. Uniformly distributed, with the number of circumferential directions being Subsequently, a single-path or multi-path mode is selected to generate the cylindrical cutting path according to the process requirements. Specifically, the single-path mode refers to generating only one surface path that fits the surface of the envelope model. This surface path is a continuous trajectory that fits the shape features of the model surface. This mode is used for wraparound cutting scenarios combined with 3+2 roughing. The multi-path mode is a complete wraparound toolpath, including an outer path and a surface path. The outer path is a long straight line segment, which will lift the tool to avoid interference. The surface path is a continuous trajectory of broken line segments that fit the features of the model surface. During path reconstruction, the tool pointing direction is calculated point by point, and the trajectory is organized in layers according to angle and radius. The middle layer merges adjacent paths and alternately reverses the cutting direction to form a continuous reciprocating wraparound cutting pattern. Finally, the pre-machining path of the cubic blank and the wraparound path of the cylinder are merged in sequence. Collinearity point merging and redundant point cleaning are performed uniformly. The cumulative rotation angle of the rotation axis at each path point is calculated, and a lifting point is inserted at the path breakpoint according to the set safety height. Finally, a complete wraparound roughing toolpath is output. This scheme, through circumferential multi-angle layered material removal in a cylindrical coordinate system, can more fully approximate the blank envelope and homogenize the machining allowance, complementing the 3+2 roughing strategy and jointly covering the roughing needs of parts with different geometric features. For example... Figure 2 As shown in the figure, this is a schematic diagram of a circular roughing toolpath. The toolpath advances radially layer by layer with the rotation axis as the center, covering a circumferential range of 0° to 360° in the cylindrical coordinate system. It can approach the blank envelope along multiple angular directions, making the allowance more uniform before finishing.
[0039] In an optional embodiment, the step of performing geometric topology analysis on the three-dimensional mesh model, identifying local concave and convex features, and applying adaptive equidistant offset to the processed surface based on the local concave and convex features to generate an offset mesh may specifically include: The three-dimensional mesh model is a triangular mesh model, denoted as... ,in For the set of vertices, Let be the set of edges. Given a set of triangular faces; traverse the triangular mesh. Count each vertex Calculate the unit normal vector of a vertex in a ring-shaped neighborhood patch. ; Calculate vertex normal vectors The angle between the angle and the normal vector of the neighboring surface of the ring, combined with the dihedral angle sign, determines the type of local region and marks the flat region, convex region or concave feature region. For the vertices of the flat and convex regions, let the offset distance be... Move the vertex along the normal direction to obtain ; For the vertices of the concave feature region, extract the minimum angle between the vertex normal vector and the normal vector of the neighboring face, and construct locally similar triangles to solve for the effective offset distance. ; The revised Substitution Update all vertices, maintain the original mesh topology connections, and rebuild the offset mesh. .
[0040] In the embodiments described in this specification, the triangular mesh model is a discretized representation of a three-dimensional surface in a computer, wherein... Represents the set of all vertices in the grid. Represents the set of all edges connecting vertices. This represents the set of all triangular faces. In CNC machining toolpath planning, the quality of the offset mesh directly affects the accuracy and reliability of subsequent plane intersection calculations and toolpath generation. Therefore, it is necessary to ensure that the offset mesh is geometrically continuous and free of self-intersections. In practical implementation, the entire triangular mesh can be traversed first, and for each vertex... We count all triangular faces within the one-ring neighborhood of the vertex, i.e., all triangles containing the vertex, and then calculate the unit normal vector at the vertex using a combination of area-weighted and angle-weighted methods. The reason for using a weighted approach instead of a simple mean is that triangles with larger areas have a greater influence on the local surface orientation, while angle weighting can better reflect the distribution of incident edges at the vertices. Combining the two weighting methods yields a more accurate and stable estimate of the normal vector. After calculating the normal vector of each vertex, the normal vector of each vertex is further calculated. The angle between the vertex and the normal vectors of each facet within its neighborhood is considered, along with the sign of the dihedral angles between adjacent faces, to determine the type of local region in which the vertex is located. When the angle changes gradually and the normal vectors of each facet tend to be consistent, it is marked as a flat or convex region. When there are obvious sharp turns in the normal vectors or concave edges, it is marked as a concave region. The result of this region type determination directly affects the method of calculating the offset distance. Flat and convex regions can directly use the user-defined target offset distance. Moving the vertex along the direction of the normal vector, its calculation formula is: However, for concave feature regions, if a uniform offset distance is used, the offset mesh will self-intersect or distort at the concave corners. This manifests as offset vertices penetrating the material or adjacent faces overlapping, leading to incorrect contour lines when calculating intersections of subsequent cross-sections. Therefore, for vertices in concave feature regions, the minimum angle between the vertex normal and the normal of the neighboring face, or the characteristic concave angle, can be extracted to construct a target offset distance. Using a locally similar triangle as the reference, the effective offset distance of the vertex under the constrained concave angle is solved by utilizing the proportional relationships of similar triangles. Specifically, the smaller the concave angle and the more severe the curvature of the surface, the smaller the effective offset distance. Relative target offset distance The more pronounced the shrinkage, the better, ensuring that the offset vertices do not intrude into the material or cause mesh self-intersections. After calculating the offset distances of all vertices, the corrected... Unified substitution of vertex update formula The system updates the position coordinates of all vertices while maintaining the original mesh topology (i.e., the relationship between vertices and between edges and faces), ultimately reconstructing an adaptively corrected bias mesh. This scheme, by distinguishing between flat / convex regions and concave feature regions and employing different offset distance calculation strategies for each, can effectively eliminate geometric distortion at concave features while maintaining uniform and equidistant distances between the offset surface and the original mesh, thus providing a high-quality offset reference surface for subsequent cross-sectional profile extraction.
[0041] In an optional embodiment, the step of constructing a set of cross-sectional planes with consistent normals, obtaining the intersection lines of each cross-sectional plane with the offset mesh, and thus obtaining the layered contour lines may specifically include: Record No. The cross-sectional plane of the layer is ,in Let be the unit normal vector of the cutting plane. Let be a point on the cutting plane. Interlayer distance; Calculate the relative position of the mesh vertex to the first Directed distance of the cross-sectional plane ; Based on the minimum directed distance between the three vertices of the triangle With the maximum value Filter candidate triangular faces that intersect with the cutting plane, if If the three vertices are on the same side, the triangle does not intersect the cutting plane; otherwise, the triangle intersects the cutting plane. Wherein, the symbol... It represents the distance tolerance, which is a tiny positive real number threshold used to accommodate the small errors caused by computer floating-point operations when processing geometric intersections, and to determine whether a vertex falls near the cutting plane; Traverse each half of the triangular mesh and calculate the intersection parameters. ,in The directed distance is the starting point of the half-side. The directed distance to the endpoint of the half-side is given, and the location and type of the intersection point are determined. Generate segments based on the combination of the intersection points of the interior sides of the triangle and the intersection points of the vertices, and record the start point, end point, normal, predecessor index and successor index of each segment; The segments are connected into a closed mesh sectional plane profile by using half-side duality and vertex adjacency relations.
[0042] In the embodiments of this specification, finding the intersection of the cutting plane and the triangular mesh is a geometric calculation method that transforms the three-dimensional surface toolpath planning problem into a two-dimensional contour processing problem. The idea is to use an infinitely extending virtual plane to cut the three-dimensional mesh model; the intersection of the plane and the mesh surface is the cross-sectional contour at that height level. For each cutting plane level... Its position is determined by the plane normal vector. A point on a plane Interlayer distance and the current floor number Together, the equations are determined. Describes a normal vector as And to the reference point The directed distance is The plane. For any vertex in the offset mesh. Its relative to the first Directed distance of the cross-sectional plane The sign of the vector indicates which side of the cutting plane the vertex is located on. A positive value indicates the vertex is on the side pointed to by the plane's normal vector, a negative value indicates the other side, and an absolute value close to zero indicates the vertex lies near the cutting plane. For a triangle, if the directed distances to its three vertices are not all of the same sign, it means the triangle intersects the cutting plane, and the cutting plane passes through the interior of the triangle or its boundary. Such triangles are retained as candidate triangular faces. To accurately calculate the intersection point, each half-edge (i.e., a directed edge of the triangle, starting from the origin) in the triangular mesh can be traversed. Pointing to the end If the two endpoints of the half are located on opposite sides of the cutting plane (i.e., satisfying the intersection criterion) According to the linear interpolation formula... Calculate intersection parameters ,in The directed distance from the starting point of this half. This is the directed distance to the endpoint of that half. When When the intersection point is located within the open interval (0,1), the intersection point is located inside the edge; when When the value is close to 0 or 1, the intersection point degenerates into the endpoint of the edge. After obtaining the combination of the intersection points of the inner edges and the intersection points of the vertices of each triangle (the specific location of the intersection point is determined by...), (Calculated) Based on the combination type, corresponding segments are generated: two edge intersections constitute a normal segment; an edge intersection and a vertex intersection constitute a vertex-crossing segment; two vertex intersections indicate that the cutting plane passes through the mesh edge, and the segment normal needs to be determined in conjunction with adjacent faces. Each segment needs to record its starting coordinates. End point coordinates Normal vector Precursor Index and successor index This ensures that subsequent contour connection operations can correctly track the topological order of the segments. Finally, the duality in the half-edge structure (i.e., each half-edge can find its adjacent triangle through its reverse half-edge) is used to establish connections between segments: for intersections within edges, adjacent segments sharing that intersection are found through the dual half-edge; for intersections at vertices, adjacent faces are traversed along a ring of adjacent edges of that vertex to find matching segments. Starting from unvisited segments, the forward chain is first traced along the successor index order. If it is not closed, the reverse chain is traced back from the starting segment along the predecessor index and then concatenated to the contour head after being reversed, thus ensuring the continuity of the point order and finally obtaining a closed mesh cross-plane contour. This algorithm can ensure the consistency of segment connection relationships with the mesh topology through the half-edge adjacency structure, effectively handle complex situations such as edge crossing, vertex crossing, and shared edge degradation, and generate topologically continuous and normal-synchronized cross-sectional contours.
[0043] In an optional embodiment, the step of performing intersection calculations on the contour lines of the same layer, eliminating internal intersection lines, and retaining the outermost contour line may specifically include: Extract all contour lines on the same cross-sectional plane, sort them counterclockwise around the axis of rotation, and denote them as follows: The set of contours obtained by the cross-sectional plane is Among them, symbols Indicates the first The total number of contour lines on the cross-sectional plane. Indicates the first Each individual contour line contained in the cross-sectional plane; Create an axis-aligned bounding box for each contour line segment, and use the bounding box overlap test to filter candidate intersecting line segments; Calculate the exact intersection point for the selected line segments, with the intersection point parameters being: ,in The intersection point parameter of the first intersecting line segment. The intersection point parameter of the second intersecting line segment. For distance tolerance; Each original line segment is sorted according to the strict intersection parameters on the original line segment and broken at the intersection to obtain atomic split line segments; Select the initial segment of each original contour chain, and set the interference index of the initial segment... Traverse the segments sequentially along the contour direction, each time crossing a strict intersection point Based on the current line segment tangent vector Intersecting line segments at the strict intersection point Counterclockwise normal vector at the location The same or opposite relationship updates the interference index. ; The segment with the smallest interference index is retained, the internal redundant segments are eliminated, and the retained segments are connected into an ordered outer contour line according to the endpoint distance tolerance and the tangential angle.
[0044] In the embodiments of this specification, when the model to be processed is composed of multiple watertight sub-models, multiple contour lines will be generated on the same layer of the cross-section after the intersection of the cross-section plane and the offset mesh. These include outer contour lines located on the outer surface of the part, as well as redundant intersection lines located inside the overlapping area of the sub-models or penetrating the interior. If these internal redundant intersection lines are retained in subsequent processing, it will lead to an increase in the collision detection calculation scale and cross-breaks during path splicing, so they must be removed. In this scheme, all contour lines on the same layer of the cross-section plane are first extracted and sorted counterclockwise around the rotation axis to establish a consistent traversal benchmark for subsequent intersection operations. In order to efficiently filter potentially intersecting line segment pairs, an axis-aligned bounding box can be established for each contour line segment, that is, a rectangular area covering the minimum and maximum values of the line segment in two coordinate directions in the plane. Then, the overlap test of the bounding box is used for wide-phase filtering, and only line segment pairs with overlapping bounding boxes are retained for subsequent precise intersection calculations, thereby avoiding the O(n²) complexity overhead of performing pairwise precise intersections on all line segments in the layer. In the precise intersection stage, the intersection parameters can be calculated for the line segments retained in the wide phase. Only when and All are strictly within the open interval Only when the intersection point is within the specified time is it accepted as a strict intersection point, among which To allow for distance tolerance, cases of near-endpoint proximity due to numerical errors are excluded; endpoint contact, collinear overlap, or near-tangency are not included in the splitting criteria to prevent non-crossing contact from being misjudged as an inner / outer boundary switch. After obtaining all strict intersection points, each original line segment is sorted according to its strict intersection point parameters, and the line segment is broken at each intersection point to obtain atomically split line segments. Each split segment retains the original line segment's direction and inherits the tangent vector of its corresponding contour. With counterclockwise normal vector To determine which segments belong to the outer contour and which belong to internal redundant segments, the interferometric index propagation algorithm can be used: select the starting segment of each original contour chain and set its interferometric index... Then, iterate through each segment along the contour direction, each time crossing a strict intersection point. At that point, calculate the contribution of other line segments intersecting the current line segment to the current interferometric index. If the tangent vector of the current line segment... The counterclockwise normal vector at the intersection point of the intersecting line segment If they are in the same direction, then the contribution is... This indicates that the current contour enters the outer boundary at this intersection point; if the opposite is true, the contribution is... This indicates entry into the inner boundary. When multiple intersecting line segments exist at the same intersection point, the contribution of each line segment is accumulated separately, and the updated interference index is then used. The intersection point is marked on the split segment after crossing it. After traversal, the split segment with the smallest interference index is the part located at the outermost boundary. Only these split segments with the smallest interference index are retained, and all other redundant segments located inside the sub-model or occluded by the outer contour are removed. Finally, based on the endpoint distance tolerance and the tangential angle between adjacent segments, the retained split segments are reconnected into one or more ordered outer contour lines, which serve as the effective boundaries for subsequent collision detection and path splicing. This scheme, through rigorous intersection point calculation and interference index propagation, can accurately distinguish between outer boundaries and internal redundant boundaries, ensuring that subsequent toolpaths are explicitly broken at contour intersections and can be spliced in the correct order.
[0045] In an optional embodiment, the step of determining the tangent vector of the current line segment is... Intersecting line segments at the strict intersection point Counterclockwise normal vector at the location The same or opposite relationship updates the interference index. The specific steps may include: If they are in the same direction, the contribution is... If the opposite is true, the contribution is... ,Right now ,in For symbolic functions, Representing vectors and dot product operation; When multiple intersecting line segments exist at the same intersection point, they are accumulated separately. And the updated interference index The mark is placed on the split segment after crossing the same intersection point.
[0046] In the embodiments of this specification, the interferometric index is a numerical marker used to determine whether a contour segment belongs to the outer or inner boundary. Its principle is based on the geometric topological constraints between the direction of travel of a planar curve and the relationship between the inner and outer sides at the intersection. For a directed contour line, when it travels counterclockwise, the outer side of the contour is always located to the left of the directed line segment (i.e., in the counterclockwise normal direction), while the inner side is located to the right. When two contour lines intersect internally, they follow a fixed entry and exit rule at the intersection point; that is, each time they cross the intersection point, the "inner / outer attribute" of the contour switches. The essence of the interferometric index propagation algorithm is to utilize this topological property to determine which boundary layer each segment belongs to by accumulating the directional contribution each time it crosses the intersection point. In a specific implementation, for a strict intersection point... The tangent vector of the current line segment is The counterclockwise normal vector of the intersecting line segments at the intersection point is .calculate and inner product If the inner product is positive, it means and The directions are the same or the angle is less than 90°, meaning the current line segment crosses the intersecting line segment in a counter-clockwise direction and the normal vector of the intersecting line segment points in the same direction as the intersection. In the same direction, the contribution is... If the inner product is negative, it indicates that the two directions are opposite or the included angle is greater than 90°, and the contribution is... Signed functions This judgment can be uniformly expressed as That is, when the inner product is positive When the inner product is negative When multiple intersecting line segments exist at the same intersection point, the contribution of each intersecting line segment to that intersection point can be calculated separately and then summed up. The summed result is taken as the total contribution at that intersection point, and then the updated interferometry is applied. The mark is placed on the segment after crossing the intersection point. In this way, the segment on the outer boundary accumulates the minimum interference index (usually 0), the segment on the inner boundary of the first layer accumulates 1, and so on. Subsequently, only the segment with the minimum interference index is retained, thus eliminating all internal redundant segments and retaining only the outermost contour, thereby accurately completing the outer contour extraction of the non-watertight model.
[0047] In an optional embodiment, the step of determining the feasible processing domain of each atomic segment through collision detection and splicing atomic segments with compatible and non-interfering feasible processing domains within the same contour layer into a continuous path segment may specifically include: Based on the machine tool structure, kinematic constraints are introduced to determine the candidate direction set of the tool axis; Atomic segments obtained by discretizing the contour lines The reachable direction domain is obtained by marking the reachable angles in the candidate tool axis direction set through collision detection. The Represented as several continuously reachable sectors The union of the sets, where the subscripts are... The atomic segment index number, subscript For sector index number, For the first The first atomic segment Lower limit of angle for each sector For the first The first atomic segment Upper limit of angle for each sector; Let the starting segment number be Select representative The unassigned atomic segment with the largest angular width is used as the starting segment. With the starting segment Representative As the initial traversal ,in Indicates the first The traversal corresponding to each atomic segment ; Perform a backward traversal: Let the index of the currently processed atomic segment be... ,and If the current atomic segment There exists a certain satisfy If the directions are compatible, then the direction will be determined to be compatible. Merge into the current path segment, and select the one with the first... Traversal of atomic segments Larger intersection As the current atomic segment traversal ; When the backward traversal cannot continue, start from the initial segment. Re-execute the forward traversal, setting the current atomic segment number to 1. ,and Extend forward according to the same compatibility conditions until both ends can no longer be merged; Remove merged atomic segments from the candidate set and reselect representatives from the remaining atomic segments. The largest one is used as the new seed, and the above process is repeated until all atomic segments are assigned, resulting in a complete finishing toolpath.
[0048] In the embodiments of this specification, the feasible machining domain of an atomic segment refers to the set of angles formed by safe directions that can avoid collision between the tool and the workpiece among all candidate tool axis directions of that atomic segment. Due to the physical limitations of the motion mechanism of CNC machine tools, the actually usable tool axis directions are not all directions on a sphere, but are limited by the machine tool's structural type: in 4-axis machining, the tool axis is constrained in a plane perpendicular to the rotation axis, while in 5-axis machining, the tool axis is limited by the travel range of each rotation axis. Therefore, corresponding kinematic constraints can be introduced based on the machine tool structure to limit the candidate tool axis directions to the range actually achievable by the equipment, excluding those directions that are theoretically collision-free but inaccessible to the machine tool. This reduces the search space for collision detection while ensuring the executability of the generated toolpath on the actual machine tool. For each atomic segment obtained by contour discretization... Collision detection can be performed on candidate directions at fixed angular intervals under kinematic constraints, marking which angular directions are collision-free, and then merging all continuous reachable angular intervals into several reachable direction sectors. The union of all sectors constitutes the reachable directional domain of that atomic segment. After obtaining each atomic segment After aggregation, an atomic segment merging algorithm based on forward and backward traversal is used to stitch adjacent atomic segments with compatible directions and no interference into longer continuous cutting path segments. The idea is that on the same connected contour, if the feasible direction sectors of two adjacent atomic segments intersect, then there exists at least one common tool axis direction that can simultaneously satisfy the collision constraints of these two atomic segments. Therefore, they can be continuously machined under this common direction without tool lifting and repositioning. The algorithm first selects representative atomic segments from all unassigned atomic segments. The largest atomic segment (i.e., the sector with the largest angular width) is used as the starting segment. , with its representative This serves as the initial traversal direction. Then, a backward traversal is performed, starting from the next atomic segment after the initial segment and examining each segment sequentially backward. If the current atomic segment... There exists a certain Traversal of the previous atomic segment (recorded as) The condition that the intersection is non-empty is satisfied. If the two directions are considered compatible, the atomic segment is merged into the current path segment, and a sector is selected from all compatible sectors. Larger intersection and wider angle Traversal of the current atomic segment This allows for greater flexibility in subsequent adjustments. When the backward traversal reaches a segment that no longer meets the compatibility condition, the backward expansion is paused, and the forward traversal is restarted from the starting segment, expanding forward according to the exact same compatibility condition until neither end can be merged. At this point, the growth of one path segment is complete. All merged segments are removed from the candidate set, and then representatives are reselected from the remaining unassigned segments. The largest segment is used as the new seed segment, and the above forward and backward traversal process is repeated until all atomic segments are assigned to a cutting path segment. This merging strategy effectively reduces the probability of path segments being split prematurely by prioritizing growth from the "most picky" atomic segment (i.e., the atomic segment with the narrowest feasible direction) and selecting the traversal direction in a maximum intersection-first manner. It obtains the longest and most stable continuous cutting path segments while maintaining collision-free constraints. As shown in Figure 7, this figure is a schematic diagram of the above traversal algorithm. Figure a shows the initially selected atomic segment and its representative MDS; b shows the forward traversal process. When the intersection of the current atomic segment and the MDS of the previous segment is not empty (the green area in the figure represents the intersection), the atomic segment is merged into the path segment; c shows the case where the path segment traversal terminates when the intersection of the MDS of adjacent atomic segments is an empty set.
[0049] In an optional embodiment, the step of introducing kinematic constraints based on the machine tool structure to determine the candidate tool axis direction set, specifically the step of introducing kinematic constraints under a five-axis machining scenario, may include: A fixed pitch angle can be set within each cutting path segment. , This represents the deviation angle of the cutter axis relative to the cutting plane, where the normal to the cutting plane is taken as... Establish orthogonal basis in the cutting plane Then the first Candidate tool axes for each path segment Parameterized as:
[0050] in It is the azimuth angle within the cross-section plane.
[0051] In the embodiments of this specification, for a five-axis machining scenario, the tool axis direction can theoretically be freely chosen in any direction on a three-dimensional sphere. However, if two-dimensional discrete sampling is performed on a complete sphere, the number of sampling points increases quadratically with the density of the depression and azimuth angles, leading to a sharp increase in the computational load of collision detection. To control the computational scale while ensuring machining quality, this solution constrains the search space of the five-axis tool axis direction to the form of "segmented fixed depression angle plus single-parameter sweep in the plane". Specifically, for each cutting path segment, a fixed depression angle that remains unchanged within that segment is allowed to be set. The depression angle represents the angle by which the tool axis direction deviates from the normal direction of the cutting plane, and its value range is limited to... Between. When When the tool axis direction is the normal direction of the cutting plane, that is, the tool is machining perpendicular to the cutting plane; when When the tool axis is tilted towards the side normal to the cutting plane, this tilt helps avoid interference between the tool holder and the workpiece when machining deep cavities or undercut surfaces. With a fixed pitch angle, the degree of freedom of the tool axis direction is reduced from a two-dimensional sphere to a one-dimensional torus, meaning the tool axis can rotate arbitrarily on a conical surface centered on the normal to the cutting plane. To parameterize this rotational degree of freedom, the normal vector of the cutting plane can be taken. As a reference direction, a set of orthonormal bases is established within the cutting plane. Then the first Any tool axis direction on any path segment can be determined by the azimuth angle. It is uniquely determined that its parameterized expression is In this formula, Indicates the azimuth angle within the cross-section plane. The unit vector of direction, multiplied by Then the projection component of the tool axis direction in the cutting plane is obtained; The component of the tool axis direction in the normal direction of the cutting plane is represented by the vector; their superposition constitutes the actual unit vector of the tool axis in three-dimensional space. Using this parameterization method, it is only necessary to parameterize each path segment at the azimuth angle... One-dimensional sampling collision detection within the range of values can cover all candidate tool axis directions of the path segment at a fixed tilt angle. The search efficiency can be improved by an order of magnitude compared to two-dimensional sampling on a complete sphere. At the same time, the segmented fixed tilt angle setting can ensure that the tool axis direction within the same path segment changes continuously only along the single parameter range, reducing attitude jumps between adjacent atomic segments. Figure 5 This is a schematic diagram of the five-axis segmented pitch angle machining strategy. In the figure, three green tools with different tilt angles represent the fixed pitch angle direction used in the three cutting path segments. Figure 6 This shows the relationship between the profile generated by the cross-plane method and the reachable direction domain (MDR) of the corresponding atomic segment. The circular area on the right side of the figure indicates the feasible direction domain of a single atomic segment, and the green fan-shaped area is the representative MDS with the largest upper corner width of the atomic segment.
[0052] In an optional embodiment, the step of introducing kinematic constraints based on the machine tool structure to determine the candidate tool axis direction set, specifically the step of introducing kinematic constraints under a four-axis machining scenario, may include: Let the unit vector of the rotation axis be... Unit vector of the tool axis The uniform constraint lies in the plane perpendicular to the axis of rotation, i.e. The candidate tool axis degenerates from a two-dimensional sphere into a one-dimensional ring.
[0053] In the embodiments of this specification, for four-axis machining scenarios, the machine tool typically has three linear translation axes (X, Y, Z) and one rotational axis (e.g., a rotary table or tilting head structure rotating around the X or Y axis), which has one less rotational degree of freedom than a five-axis machine tool. Under this structural constraint, the tool orientation cannot be arbitrarily oriented in three-dimensional space as in five-axis machining, but is restricted to the tool axis direction always being perpendicular to the rotational axis direction. Specifically, let the unit vector of the rotational axis be... Then for any tool axis direction Must meet The constraint condition is that the tool axis direction must lie in a plane perpendicular to the rotation axis. All possible directions in this plane form a one-dimensional toroidal manifold, which is equivalent to the tool axis direction being uniquely determined by a single angular parameter in a two-dimensional plane perpendicular to the rotation axis. This degradation means that the search space for candidate tool axis directions in four-axis machining is greatly reduced compared to five-axis machining, and the computational complexity of collision detection is correspondingly reduced. However, it also means that four-axis machining may have limitations in terms of flexibility in tool axis attitude adjustment when dealing with certain parts with complex lateral concave features. In this scheme, when actually handling four-axis machining scenarios, sampling can be performed on the one-dimensional toroidal manifold at fixed angular steps. After performing collision detection on each sampled direction, the reachable direction interval is marked, thereby obtaining the feasible direction sectors of each atomic segment on the one-dimensional toroidal manifold. The subsequent atomic segment merging algorithm is consistent with the principle of the five-axis scenario, the only difference being that the set of feasible directions is degenerated from two-dimensional sectors to one-dimensional intervals.
[0054] To verify the adaptability of this scheme to models of different complexities and topologies, this application also designed three sets of typical experiments, corresponding to three typical scenarios: simple watertight models, non-watertight combined models, and complex five-axis models, to comprehensively cover various machining situations that may be encountered in practical applications. Each set of experiments includes three parts: roughing toolpath, finishing toolpath, and CNC machine tool solid cutting results. Example 1 is a simple rabbit model, which belongs to a simple watertight model. Roughing adopts a surrounding roughing strategy, and finishing adopts a four-axis finishing strategy. Its specific machining path and cutting results are shown in Figure 8, where a is the surrounding roughing toolpath, b is the four-axis finishing toolpath, and c is the final solid cutting part. Example 2 is a gourd model, which belongs to a complex non-watertight model composed of multiple sub-watertight models. Roughing adopts a surrounding roughing strategy, and finishing adopts a four-axis finishing strategy. Its specific machining path and cutting results are shown in Figure 9, where a is the surrounding roughing toolpath, b is the four-axis finishing toolpath, and c is the final solid cutting part. Example 3 uses the Longma model, a complex watertight model. Roughing employs a 3+2 roughing strategy, while finishing uses a five-axis segmented finishing strategy. The specific machining path and cutting results are shown in Figure 10, where a is the 3+2 roughing toolpath, b is the five-axis segmented finishing toolpath, and c is the final solid part. The three sets of experiments verified the adaptability of this scheme to different topology models and different process combinations. All experimental results show that this scheme can automatically generate collision-free machinable toolpaths and complete solid cutting verification. Compared to traditional manual CAM programming, this scheme's toolpath generation process requires no manual parameter adjustment, avoiding the risk of tool collisions and workpiece scrap due to manual programming errors. Simultaneously, the toolpath generation time is significantly shortened, effectively supporting the rapid manufacturing needs of small batches, multiple varieties, and personalized customization.
[0055] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A fully automated, programming-free multi-axis precision engraving machining path generation method, characterized in that, Including the following steps: Obtain the 3D mesh model and machining parameters of the workpiece to be processed; Based on the three-dimensional mesh model, a roughing path is generated, which includes a 3+2 roughing path and / or a wraparound roughing path. Based on the 3D mesh model, a finishing path is generated, which is generated through the following sub-steps: Geometric topology analysis is performed on the three-dimensional mesh model to identify local concave and convex features, and an adaptive equidistant offset is applied to the machining surface based on the local concave and convex features to generate an offset mesh. Construct a set of cross-sectional planes with consistent normals, and find the intersection lines between each cross-sectional plane and the offset mesh to obtain the layered contour lines; Perform intersection calculations on the contour lines of the same layer, eliminate internal intersection lines, and retain the outermost contour; The outermost contour is discretized into an ordered set of points, and atomic segments are defined by adjacent points. The feasible processing domain of each atomic segment is determined by collision detection. Atomic segments with compatible and non-interfering feasible processing domains within the same contour layer are spliced into continuous path segments to generate a complete finishing toolpath. The 3+2 roughing toolpath or the surrounding roughing toolpath and the finishing toolpath are subjected to kinematic post-processing to generate the NC code corresponding to the CNC engraving machine tool.
2. The fully automatic, programming-free multi-axis precision carving path generation method according to claim 1, characterized in that, Based on the 3D mesh model, a roughing path is generated, which includes a 3+2 roughing path. The steps for generating the 3+2 roughing path include: Select a blank bounding box, project the vertices of the blank bounding box along the cutting direction to obtain the boundary points of the processing range, and calculate the pixel step size with the tool radius as a constraint to generate regular grid points in the projection domain; ZigZag reference points are generated for the front and back sides according to the machining axis direction, and collision detection points are constructed for the top and bottom layers. For each sampling point, the validity of the blank is judged, and invalid pixels located outside the blank area are removed; An expanded tool is formed by superimposing the tool radius with a radial allowance, and GPU parallel collision detection is used to calculate the maximum number of layers that each effective pixel can reach along the cutting direction. This yields a discrete depth field, where the subscripts are... , These are the index numbers of the pixel in the two coordinate directions of the projection domain; Multiply the number of layers in the depth field by the layer height to convert it into the actual depth, and generate the front and back ZigZag roughing trajectories layer by layer; Collinearity points are merged and redundant points are cleared from the generated path. The cumulative rotation angle of each toolpath point is calculated and angle jumps are handled. The tool lifting point is inserted by combining the maximum turning radius of the model and the safety height to obtain a 3+2 roughing toolpath.
3. The fully automatic, programming-free multi-axis precision carving machining path generation method according to claim 1, characterized in that, Based on the three-dimensional mesh model, a roughing path is generated, including a wraparound roughing path. The steps for generating the wraparound roughing path include: Obtain the boundary points of the blank bounding box in the cutting direction, calculate the axial sampling step size by pixel step size, and generate rectangular coordinate grid points and cylindrical coordinate grid points; If the blank is a cube, the rectangular section is divided into four quadrants to generate a reciprocating cutting path from the outside to the inside and from the large circle to the small circle, thus realizing the pre-machining of the square material into a circle; if the blank is a cylinder, it directly enters the surrounding layered cutting stage. The tool radius is superimposed with radial increments to form an expansion tool. Collision detection is performed on the cylindrical mesh points to obtain a one-dimensional depth array, which is then reorganized into a two-dimensional depth structure according to the angular direction. Select a single-path or multi-path mode to generate a cylindrical cutting path according to process requirements, calculate the tool direction point by point, organize the trajectory in layers according to angle and radius, and form a continuous reciprocating circular cutting path. The pre-machining path of the cubic blank is merged with the circular path, collinear point merging and redundant point cleaning are performed, the cumulative rotation angle of each path point is calculated, and a tool lifting point is inserted at a safe height at the path breakpoint to output the circular roughing toolpath.
4. The fully automatic, programming-free multi-axis precision carving path generation method according to claim 1, characterized in that, The steps of performing geometric topology analysis on the three-dimensional mesh model, identifying local concave and convex features, and applying adaptive equidistant offsets to the machined surface based on the local concave and convex features to generate an offset mesh include: The three-dimensional mesh model is a triangular mesh model, denoted as... ,in For the set of vertices, Let be the set of edges. Given a set of triangular faces; traverse the triangular mesh. Count each vertex Calculate the unit normal vector of a vertex in a ring-shaped neighborhood patch. ; Calculate vertex normal vectors The angle between the angle and the normal vector of the neighboring surface of the ring, combined with the dihedral angle sign, determines the type of local region and marks the flat region, convex region or concave feature region. For the vertices of the flat and convex regions, let the offset distance be... Move the vertex along the normal direction to obtain ; For the vertices of the concave feature region, extract the minimum angle between the vertex normal vector and the normal vector of the neighboring face, and construct locally similar triangles to solve for the effective offset distance. ; The revised Substitution Update all vertices, maintain the original mesh topology connections, and rebuild the offset mesh. .
5. The fully automatic, programming-free multi-axis precision carving machining path generation method according to claim 1, characterized in that, The steps of constructing a set of cross-sectional planes with consistent normals, and obtaining the intersection lines of each cross-sectional plane with the offset mesh to obtain the layered contour lines include: Record No. The cross-sectional plane of the layer is ,in Let be the unit normal vector of the cutting plane. Let be a point on the cutting plane. Interlayer distance; Calculate the relative position of the mesh vertex to the first Directed distance of the cross-sectional plane ; Based on the minimum directed distance between the three vertices of the triangle With the maximum value Filter candidate triangular faces that intersect with the cutting plane; Traverse each half of the triangular mesh and calculate the intersection parameters. ,in The directed distance is the starting point of the half-side. The directed distance to the endpoint of the half-side is given, and the location and type of the intersection point are determined. Generate segments based on the combination of the intersection points of the interior sides of the triangle and the intersection points of the vertices, and record the start point, end point, normal, predecessor index and successor index of each segment; The segments are connected into a closed mesh sectional plane profile by using half-side duality and vertex adjacency relations.
6. The fully automatic, programming-free multi-axis precision carving path generation method according to claim 1, characterized in that, The step of performing intersection calculations on the contour lines of the same layer, eliminating internal intersection lines, and retaining the outermost contour includes: Extract all contour lines on the same cross-sectional plane and sort them counterclockwise around the axis of rotation; Create an axis-aligned bounding box for each contour line segment, and use the bounding box overlap test to filter candidate intersecting line segments; Calculate the exact intersection point for the selected line segments, with the intersection point parameters being: ,in The intersection point parameter of the first intersecting line segment. The intersection point parameter of the second intersecting line segment. For distance tolerance; Each original line segment is sorted according to the strict intersection parameters on the original line segment and broken at the intersection to obtain atomic split line segments; Select the initial segment of each original contour chain, and set the interference index of the initial segment... Traverse the segments sequentially along the contour direction, each time crossing a strict intersection point Based on the current line segment tangent vector Intersecting line segments at the strict intersection point Counterclockwise normal vector at the location The same or opposite relationship updates the interference index. ; The segment with the smallest interference index is retained, the internal redundant segments are eliminated, and the retained segments are connected into an ordered outer contour line according to the endpoint distance tolerance and the tangential angle.
7. The fully automatic, programming-free multi-axis precision carving path generation method according to claim 6, characterized in that, The method based on the current line segment tangent vector Intersecting line segments at the strict intersection point Counterclockwise normal vector at the location The same or opposite relationship updates the interference index. The steps include: If they are in the same direction, the contribution is... If the opposite is true, the contribution is... ,Right now ,in For symbolic functions, Representing vectors and dot product operation; When multiple intersecting line segments exist at the same intersection point, they are accumulated separately. And the updated interference index The mark is placed on the split segment after crossing the same intersection point.
8. The fully automatic, programming-free multi-axis precision carving machining path generation method according to claim 1, characterized in that, The step of determining the feasible processing domain of each atomic segment through collision detection and splicing atomic segments with compatible and non-interfering feasible processing domains within the same contour layer into a continuous path segment includes: Based on the machine tool structure, kinematic constraints are introduced to determine the candidate direction set of the tool axis; Atomic segments obtained by discretizing the contour lines The reachable direction domain is obtained by marking the reachable angles in the candidate tool axis direction set through collision detection. The Represented as several continuously reachable sectors The union of the sets, where the subscripts are... The atomic segment index number, subscript For sector index number, For the first The first atomic segment Lower limit of angle for each sector For the first The first atomic segment Upper limit of angle for each sector; Let the starting segment number be Select representative The unassigned atomic segment with the largest angular width is used as the starting segment. With the starting segment Representative As the initial traversal ,in Indicates the first The traversal corresponding to each atomic segment ; Performing a backward traversal specifically includes: setting the current atomic segment number to be... ,and If the current atomic segment There exists a certain satisfy If the directions are compatible, then the direction will be determined to be compatible. Merge into the current path segment, and select the one with the first... Traversal of atomic segments Larger intersection As the current atomic segment traversal ; When the backward traversal cannot continue, start from the initial segment. Re-execute the forward traversal, setting the current atomic segment number to 1. ,and Extend forward according to the same compatibility conditions until both ends can no longer be merged; Remove merged atomic segments from the candidate set, and reselect representatives from the remaining atomic segments. The largest one is used as the new seed, and the above process is repeated until all atomic segments are assigned, resulting in a complete finishing toolpath.
9. The fully automatic, programming-free multi-axis precision carving machining path generation method according to claim 8, characterized in that, The step of introducing kinematic constraints based on the machine tool structure to determine the candidate tool axis direction set, specifically the steps of introducing kinematic constraints in a five-axis machining scenario, includes: A fixed pitch angle can be set within each cutting path segment. , This represents the deviation angle of the cutter axis relative to the cutting plane, where the normal to the cutting plane is taken as... Establish orthogonal basis in the cutting plane Then the first Candidate tool axes for each path segment Parameterized as: ; in It is the azimuth angle within the cross-section plane.
10. The fully automatic, programming-free multi-axis precision carving machining path generation method according to claim 8, characterized in that, The step of introducing kinematic constraints based on the machine tool structure to determine the candidate tool axis direction set, specifically the constraints under a four-axis machining scenario, includes: Let the unit vector of the rotation axis be... Unit vector of the tool axis The uniform constraint lies in the plane perpendicular to the axis of rotation, i.e. The candidate tool axis degenerates from a two-dimensional sphere into a one-dimensional ring.
