Method for generating parallel tool path for complex free-form surface profile based on voxels
By using a voxel-based adaptive partitioning and iterative generation method, the problem of path breakage at holes and C0 continuous surfaces was solved, achieving efficient and high-quality machining of complex freeform surfaces.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEBEI UNIV OF TECH
- Filing Date
- 2026-03-23
- Publication Date
- 2026-06-12
Smart Images

Figure CN122194834A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of CNC machining technology, specifically a method for generating parallel tool paths for complex free-form surface contours based on voxels. Background Technology
[0002] Computer Numerical Control (CNC) technology plays a vital role in modern manufacturing, especially in the high-precision machining of complex curved surface parts. With the rapid development of technologies such as aerospace, automotive manufacturing, and precision mold making, the demands for the quality and efficiency of complex surface machining are constantly increasing. Toolpath planning, as a core component of the CNC machining process, directly determines the tool's trajectory during machining, ultimately affecting machining quality and efficiency. An unreasonable toolpath can lead to increased surface errors, prolonged machining time, and accelerated tool wear. Therefore, researching toolpath generation methods that can balance geometric accuracy and manufacturing efficiency is of great significance for achieving high-quality, high-efficiency machining of complex surface parts.
[0003] However, existing toolpath generation methods produce broken paths in hole regions and C0 continuous surfaces, requiring manual intervention to segment these areas, which affects machining efficiency and accuracy. Summary of the Invention
[0004] To address the shortcomings of existing technologies, the technical problem this invention aims to solve is to provide a method for generating parallel toolpaths for freeform surface profiles based on voxels.
[0005] The present invention solves the aforementioned technical problem by adopting the following technical solution: A method for generating parallel toolpaths for complex free-form surface contours based on voxels, characterized by the following steps: Step 1: Construct a surface model and voxelize the surface along the height direction; starting from each voxel point, emit rays along the height direction of the surface, and take the voxel where the ray intersects the surface as the surface voxel; Step 2: Divide the surface into multiple regions and extract the boundaries of each region; Calculate the surface normal vector at each point according to equation (5): (5) In the formula, Point The normal vector at that point, Represents a three-dimensional surface function. Represents a two-dimensional surface function; Calculate the angle between the surface normal vector and the machine tool operating plane normal vector at each point according to equation (6): (6) In the formula, Point The angle between the surface normal vector at a given location and the machine tool operating plane normal vector. , and They are points The surface normal vector at the point is , and Components in direction; An angle threshold is set, and the entire surface is divided into multiple regions based on the angle between the surface normal vector at each surface voxel point and the machine tool operating plane normal vector. The surface voxels in each region are projected onto the same two-dimensional mesh, and the surface voxels in the same region are marked as 1, while the surface voxels in other regions are marked as 0. All surface voxels marked as 1 are traversed. If a voxel point is adjacent to a surface voxel point marked as 0, then the surface voxel point is taken as a boundary point, thus obtaining the boundary points of the region. The boundary points are mapped from the two-dimensional surface to the three-dimensional surface to obtain the boundaries of each region. Step 3: Generate the knife contact path iteratively within each region; Using the region boundary as the initial tool contact path, an offset path is generated based on the initial tool contact path and the residual height. If the residual height of all points on the offset path is less than or equal to the residual height threshold, the offset path is selected as a candidate path. The next offset path is then generated and compared with the residual height threshold until at least one point on the offset path has a residual height greater than the residual height threshold. In this case, the previous candidate path of the offset path is selected as the tool contact path generated in the current iteration, and the remaining candidate paths are deleted. The tool contact path generated in the current iteration is selected as the initial tool contact path for the next iteration. The above process is repeated until the number of points on the offset path is less than 3, at which point the iteration terminates, resulting in the tool contact path for a single region. Step 4: Process the intersecting parts of the tool contact paths within the area to obtain the effective tool contact paths; The tool contact path is divided into an inner offset path and an outer offset path. When the inner offset path intersects with the outer offset path, the part of the path located inside the inner offset path and the part located outside the outer offset path is considered an invalid path and is discarded, and the remaining path is considered a valid tool contact path. When the inner offset path intersects with the inner offset path, the part of the path located inside the inner offset path is considered an invalid path and is discarded, and the remaining path is considered a valid tool contact path.
[0006] Furthermore, the optimal voxel size for the voxelization is: (2) (3) In the formula, Indicates the optimal voxel size. Point Lateral step length at the location, Represents the set of points on the surface. Point The residual height at that location Indicates the tool radius. Point The radius of curvature at that point Point The curvature at that point.
[0007] Furthermore, when the angle threshold includes a first angle threshold and a second angle threshold, and the first angle threshold is less than the second angle threshold, all surface voxels with an included angle greater than 0° and less than or equal to the first angle threshold are divided into one region, all surface voxels with an included angle greater than the first angle threshold and less than or equal to the second angle threshold are divided into one region, and all voxels with an included angle greater than the second angle threshold and less than or equal to 180° are divided into one region.
[0008] Compared with the prior art, the beneficial effects of the present invention are as follows: The surface is adaptively divided into multiple regions based on the surface inclination (represented by the angle between the surface normal vector at a voxel point and the machine tool operating plane normal vector), and each region is treated as an independent machining area. This avoids areas with holes and the critical ridges of C0 continuous surfaces, thus eliminating the need for manual intervention when processing surfaces with holes or C0 continuous surfaces, improving machining efficiency and quality. The region boundaries are used as initial tool contact paths, and contour-parallel tool contact paths that satisfy equal residual height constraints are generated iteratively, eliminating the need to calculate curvature and improving path generation efficiency. A position-based merging strategy is employed to merge intersecting paths that occur during contour offsetting, thereby obtaining effective tool contact paths. Attached Figure Description
[0009] Figure 1 This is an overall flowchart of the present invention; Figure 2 This is a schematic diagram of the region division and knife contact path generation of the present invention; Figure 3 This is a schematic diagram of intersecting path merging according to the present invention; Figure 4 This is a schematic diagram of the tool path for different methods in embodiments of the present invention. Detailed Implementation
[0010] Specific embodiments are given below with reference to the accompanying drawings. These specific embodiments are only used to describe the technical solution of the present invention in detail, but are not intended to limit the scope of protection of this application.
[0011] like Figure 1 As shown, this invention provides a method for generating parallel toolpaths for complex freeform surface profiles based on voxels, comprising the following steps: Step 1: Construct a surface model and use ray tracing to voxelize the surface to obtain all surface voxels; First, the optimal voxel size is determined according to Shannon's sampling theorem and the geometric constraints of residual height. Then, the surface is voxelized along the z-direction (i.e., the height direction) according to the optimal voxel size to obtain several voxels. According to Shannon's sampling theorem, the sampling frequency must be greater than twice the highest frequency of the signal; within the spatial geometric domain, in order to accurately distinguish and generate toolpaths, the sampling interval must be less than half of the feature scale. Therefore, the optimal voxel size should satisfy: (1) if This will cause spatial aliasing, making it impossible for the algorithm to correctly distinguish adjacent toolpaths, resulting in path overlap or excessive residual height. Therefore, the optimal voxel size can be obtained as follows: (2) In the formula, Indicates the optimal voxel size. Point Lateral step length at the location, Represents the set of points on the surface; The relationship between lateral step length and residual height is as follows: (3) in, Point The residual height at that location Indicates the tool radius. Point The radius of curvature at that point Point normal curvature at the location; Then, starting from each voxel point (i.e., the geometric center point of the voxel), rays are emitted along the z-direction; the intersection points of each ray with the surface are counted, and the voxels where the intersection points are located are taken as surface voxels, thus obtaining all surface voxels.
[0012] Step 2: Divide the surface into multiple regions and extract the boundaries of each region; First, calculate the angle between the surface normal vector and the machine tool operating plane normal vector at each surface voxel point. This angle characterizes the surface inclination at that point. For the surface, the gradient at each point is expressed as: (4) In the formula, Point gradient at, Represents a two-dimensional surface function; Rewriting the surface from two dimensions to three dimensions yields a three-dimensional surface function. Then the surface normal vector at each point is: (5) In the formula, Point The normal vector at that location; The angle between the surface normal vector at each point and the machine tool operating plane normal vector is expressed as: (6) In the formula, Point The angle between the surface normal vector at a given location and the machine tool operating plane normal vector. , and They are points The surface normal vector at the point is , and Components in direction; Then, angle thresholds are set to divide the entire surface into multiple regions based on these included angles. For example, a first angle threshold and a second angle threshold are set, with the first angle threshold being less than the second angle threshold. All surface voxels with included angles greater than 0° and less than or equal to the first angle threshold are divided into one region, all surface voxels with included angles greater than the first angle threshold and less than or equal to the second angle threshold are divided into one region, and all voxels with included angles greater than the second angle threshold and less than or equal to 180° are divided into one region. For surfaces with complex and varied curvature, multiple angle thresholds can be set to make the region division more refined. Finally, as Figure 2 As shown, surface voxels in each region are projected onto the same two-dimensional grid. Surface voxels in the same region are marked as 1, and surface voxels in other regions are marked as 0. All surface voxels marked as 1 are traversed. If a voxel is adjacent to a surface voxel marked as 0, then the surface voxel is a boundary point, thus obtaining the boundary point of the region and its two-dimensional coordinates. The two-dimensional coordinates of the boundary point are mapped onto a three-dimensional surface to obtain the three-dimensional coordinates of the boundary point, thus obtaining the boundary of each region.
[0013] Step 3: Within each region, based on the constraint of equal residual height, the tool contact path is generated iteratively step by step; like Figure 2As shown, each region is treated as an independent processing area, and the region boundary is taken as the initial tool contact path. For a single region, a continuous offset path is generated based on the initial tool contact path and the residual height. If the residual height of all points on the offset path is less than or equal to the residual height threshold, the offset path is taken as a candidate path. The next offset path is then generated and compared with the residual height threshold until at least one point on the offset path has a residual height greater than the residual height threshold. In this case, the previous candidate path of the offset path is taken as the tool contact path generated in the current iteration, and the remaining candidate paths are deleted. The tool contact path generated in the current iteration is taken as the initial tool contact path for the next iteration. The above iteration process is repeated until the number of points on the offset path is less than 3, at which point the iteration terminates, resulting in a tool contact path that covers a single region.
[0014] Step 4: Use a location-based merging strategy to process the intersecting parts of the tool contact paths in each region to obtain the effective tool contact paths; Based on the initial tool contact path position, the tool contact path is divided into an inner offset path and an outer offset path. The inner offset path is generated based on the inner contour of the surface (e.g., the boundary of a cavity region), while the outer offset path is generated based on the outer contour of the surface (e.g., the outer edge of the surface). For example... Figure 3 As shown, when the inner offset path intersects with the outer offset path, the part of the path located inside the inner offset path (i.e., the part of the outer offset path located inside the inner offset path) and the part of the path located outside the outer offset path (i.e., the part of the inner offset path located outside the outer offset path) are considered invalid paths and are discarded, while the remaining paths are considered valid tool contact paths; when the inner offset path intersects with the inner offset path, the part of the path located inside the inner offset path (i.e., the intersection of the two inner offset paths) is considered invalid paths and is discarded, while the remaining paths are considered valid tool contact paths.
[0015] Example This embodiment uses the method of the present invention and traditional isoplanar toolpaths (including X-axis and Y-axis paths) and envelope paths to generate toolpaths for the mouse shell. Figure 4 (a), (b), (c), and (d) are the X-axis path, Y-axis path, envelope path, and path graph generated by the method of this invention, respectively. Figure 4As shown in (a), (b), and (c), the planar toolpath and envelope path are generally smooth, which is a commonly used path for machining this type of part. However, the generated path is broken in the hole area, requiring either skipping or manual intervention. Skipping the hole area results in a decrease in machining quality because the tool contact path does not conform to the hole boundary, while manual intervention significantly increases the toolpath generation time. The method of this invention, however, bypasses the hole area by dividing the entire curved surface into regions, treating each region as an independent machining area.
[0016] Table 1 Comparison of processing parameters for different methods
[0017] As shown in Table 1, multiple simulation and actual five-axis machining experiments demonstrate that, compared with traditional isoplanar and envelope paths, the method of this invention performs better in terms of path length, machining time, machine tool axis motion amplitude, and surface quality. The machining efficiency is improved by up to about 33%, and the residual height error is reduced by up to about 40%, providing a feasible approach for efficient and high-quality CNC machining of complex freeform surfaces.
[0018] Any aspects not covered in this invention are applicable to existing technologies.
Claims
1. A method for generating parallel toolpaths for complex freeform surface profiles based on voxels, characterized in that, Includes the following steps: Step 1: Construct a surface model and voxelize the surface along the height direction; starting from each voxel point, emit rays along the height direction of the surface, and take the voxel where the ray intersects the surface as the surface voxel; Step 2: Divide the surface into multiple regions and extract the boundaries of each region; Calculate the surface normal vector at each point according to equation (5): (5) In the formula, Point The normal vector at that point, Represents a three-dimensional surface function. Represents a two-dimensional surface function; Calculate the angle between the surface normal vector and the machine tool operating plane normal vector at each point according to equation (6): (6) In the formula, Point The angle between the surface normal vector at a given location and the machine tool operating plane normal vector. , and They are points The surface normal vector at the point is , and Components in direction; An angle threshold is set, and the entire surface is divided into multiple regions based on the angle between the surface normal vector at each surface voxel point and the machine tool operating plane normal vector. The surface voxels in each region are projected onto the same two-dimensional mesh, and the surface voxels in the same region are marked as 1, while the surface voxels in other regions are marked as 0. All surface voxels marked as 1 are traversed. If a voxel point is adjacent to a surface voxel point marked as 0, then the surface voxel point is taken as a boundary point, thus obtaining the boundary points of the region. The boundary points are mapped from the two-dimensional surface to the three-dimensional surface to obtain the boundaries of each region. Step 3: Generate the knife contact path iteratively within each region; Using the region boundary as the initial tool contact path, an offset path is generated based on the initial tool contact path and the residual height. If the residual height of all points on the offset path is less than or equal to the residual height threshold, the offset path is selected as a candidate path. The next offset path is then generated and compared with the residual height threshold until at least one point on the offset path has a residual height greater than the residual height threshold. In this case, the previous candidate path of the offset path is selected as the tool contact path generated in the current iteration, and the remaining candidate paths are deleted. The tool contact path generated in the current iteration is selected as the initial tool contact path for the next iteration. The above process is repeated until the number of points on the offset path is less than 3, at which point the iteration terminates, resulting in the tool contact path for a single region. Step 4: Process the intersecting parts of the tool contact paths within the area to obtain the effective tool contact paths; The tool contact path is divided into an inner offset path and an outer offset path. When the inner offset path intersects with the outer offset path, the part of the path located inside the inner offset path and the part located outside the outer offset path is considered an invalid path and is discarded, and the remaining path is considered a valid tool contact path. When the inner offset path intersects with the inner offset path, the part of the path located inside the inner offset path is considered an invalid path and is discarded, and the remaining path is considered a valid tool contact path.
2. The method for generating parallel toolpaths for complex free-form surface contours based on voxels according to claim 1, characterized in that, The optimal voxel size for the voxelization is: (2) (3) In the formula, Indicates the optimal voxel size. Point Lateral step length at the location, Represents the set of points on the surface. Point The residual height at that location Indicates the tool radius. Point The radius of curvature at that point Point The curvature at that point.
3. The method for generating parallel toolpaths for complex free-form surface contours based on voxels according to claim 1 or 2, characterized in that, When the angle threshold includes a first angle threshold and a second angle threshold, and the first angle threshold is less than the second angle threshold, all surface voxels with an included angle greater than 0° and less than or equal to the first angle threshold are divided into one region, all surface voxels with an included angle greater than the first angle threshold and less than or equal to the second angle threshold are divided into one region, and all voxels with an included angle greater than the second angle threshold and less than or equal to 180° are divided into one region.