Virtual model-based milling equipment complex surface machining path optimization system for furniture
Patent Information
- Application Number
- CN202611166140.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-03
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]现有方法中,等参数线法在曲面参数分布不均时导致路径疏密不一,截平面法在曲率变化较大区域造成路径间距不均或重复切削,投影法未考虑曲面局部曲率特征导致路径在陡峭区域产生拉伸变形,且生成的初始路径需要大量人工局部调整,针对现有技术的不足,本发明提供了基于虚拟模型的家具铣削设备复杂曲面加工路径优化系统
本发明通过将曲面划分为与曲面几何特征区域对应的曲面子片,并将初始加工基准路径按各曲面子片的投影长度比例对应拆分为子路径单元,使得每个子路径单元与其对应的曲面子片在空间位置上精确对应,针对每个子路径单元,依据对应曲面子片的弧长、弦长和曲率方向进行路径长度缩放与弯曲适配,使适配后的子路径单元在长度和走向上与曲面子片的实际几何形态一致,在曲率变化较大的区域能够保持路径与曲面的贴合;
Smart Images

Figure CN122923984A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of CNC machining technology, specifically to a system for optimizing the machining path of complex curved surfaces in furniture milling equipment based on a virtual model. Background Technology
[0002] In the furniture manufacturing industry, furniture components with complex curved shapes are becoming increasingly common, such as curved chair backs, wave-shaped tabletops, and decorative carved panels. These components are usually machined using CNC milling, which requires planning the tool path on a three-dimensional curved surface model. The quality of the machining path directly affects the machining efficiency and the surface quality of the finished product.
[0003] Existing methods for generating machining paths on curved surfaces mainly include the isoparametric line method, the cross-sectional plane method, and the projection method. The isoparametric line method generates paths along the direction of the surface parameter domain. When the surface parameters are unevenly distributed, the actual machining paths will have varying density. The cross-sectional plane method obtains the path by intersecting the surface with a series of parallel planes. However, for complex surfaces with large curvature variations, the path spacing in local areas may be too large or too small, resulting in uneven residual height or repeated cutting. The projection method generates paths by projecting a planar pattern onto the surface. However, it does not consider the local curvature characteristics of the surface. The projected path may be stretched and deformed in steep areas of the surface. Summary of the Invention
[0004] In existing methods, the isoparametric line method results in uneven path density when the surface parameters are unevenly distributed, the cutting plane method causes uneven path spacing or repeated cutting in areas with large curvature changes, and the projection method does not consider the local curvature characteristics of the surface, causing the path to be stretched and deformed in steep areas. Moreover, the generated initial path requires a lot of manual local adjustment. In order to address the shortcomings of the existing technology, this invention provides a complex surface machining path optimization system for furniture milling equipment based on a virtual model.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a complex curved surface machining path optimization system for furniture milling equipment based on a virtual model, specifically comprising: Data acquisition module: Acquires the 3D surface model of the target furniture surface and the initial machining reference path; Segmentation and splitting module: Extracts surface feature points along the surface extension direction of the three-dimensional surface model, divides the surface region between adjacent surface feature points into surface sub-segments, and splits the initial processing reference path into sub-path units that correspond one-to-one with the surface sub-segments; The splicing and embedding module: For each sub-path unit, the path is adapted according to the boundary parameters of the corresponding curved surface sub-piece, and the adapted sub-path units are connected in sequence to form a splicing processing path; Verification and correction module: Based on the machining constraints of the milling tool, the module performs segment-by-segment verification and local correction on the spliced machining path to generate the final optimized machining path.
[0006] Preferably, the data acquisition module acquires triangular mesh data of the three-dimensional surface model. The triangular mesh is composed of several triangular patches, and each triangular patch contains three vertex coordinates and a patch normal vector. Traverse each vertex in the triangular mesh. For the current vertex, obtain the normal vector of all triangular patches that share the current vertex as a common vertex, and calculate the arithmetic mean of all the normal vectors as the vertex normal vector of the current vertex. Move the coordinates of the current vertex along the direction of its vertex normal vector by an adjustment distance, which is the projection length of the difference between the weighted average of the coordinates of the current vertex's one neighboring vertices and the current vertex's coordinates onto the current vertex's normal vector. Repeatedly traverse all vertices until the root mean square value of the coordinate changes of all vertices between two consecutive traversals is less than the smoothing stopping threshold. Read the initial machining reference path, which consists of a series of path points arranged in the machining order, and each path point contains three-dimensional spatial coordinates; Starting from the second path point to the second-to-last path point, take each path point as the current path point in turn, calculate the first direction vector from the previous adjacent path point to the current path point, calculate the second direction vector from the current path point to the next adjacent path point, and calculate the angle between the first direction vector and the second direction vector. When the included angle is greater than the breakpoint determination angle, the three-dimensional spatial coordinates of the current path point are replaced with the arithmetic mean of the coordinates of the previous adjacent path point and the next adjacent path point. The breakpoint determination angle is calculated by statistically analyzing the angles between the first and second direction vectors corresponding to all path points on the initial machining reference path, excluding the beginning and end endpoints, and then calculating the arithmetic mean and standard deviation of these angles.
[0007] Preferably, the segmentation module calculates the first principal curvature direction, the second principal curvature direction, the first principal curvature value, and the second principal curvature value at each mesh vertex on the curved surface, compares the absolute values of the first principal curvature value and the second principal curvature value, and selects the principal curvature direction corresponding to the principal curvature value with the smaller absolute value as the candidate extension direction of the mesh vertex. The candidate extension directions of all grid vertices are counted, and the main extension direction of the surface is obtained by direction clustering, which is used as the extension direction of the surface. Along the direction of surface extension, a series of cross-sectional planes perpendicular to the direction of surface extension are established on the surface at preset intervals, and the intersection of each cross-sectional plane with the surface is taken as the cross-sectional curve. Discrete sampling is performed on each cross-sectional curve to obtain a series of sampling points. For each sampling point, a local arc is fitted using adjacent sampling points and the curvature value of adjacent sampling points is calculated. Sampling points with curvature values greater than the curvature determination benchmark are marked as curvature feature candidate points. Connectivity matching is performed on all candidate points of curvature features on cross-sectional curves. Candidate points on adjacent cross-sectional curves whose spatial distance is less than the distance threshold and whose angle of curvature change direction is less than the angle threshold are grouped into the same connected set. The center line of each connected set is used as the surface feature line. The projection positions of each surface feature line on the surface extension direction are determined as surface feature points. The surface is divided into several surface sub-pieces with two adjacent surface feature points as boundaries. Each surface sub-piece is assigned a sub-piece number along the surface extension direction, and the total number of surface sub-pieces is counted. Along the extension direction of the initial machining reference path, starting from the first path point, the Euclidean distance between adjacent path points is successively accumulated to obtain the total length of the initial machining reference path; For each surface sub-patch, calculate the projected length of the surface sub-patch in the direction of surface extension, and sum the projected lengths of all surface sub-patch to obtain the total projected length of the surface in the direction of surface extension. Divide the projected length of the curved surface sub-patch by the total projected length of the curved surface to obtain the length distribution ratio of the curved surface sub-patch. Multiply the total length of the initial machining reference path by the length allocation ratio of each surface sub-piece to obtain the corresponding length of each sub-path unit; According to the corresponding length of each sub-path unit, starting from the starting point of the initial processing reference path, path segments of corresponding lengths are sequentially cut along the path extension direction, and each path segment is a sub-path unit. Each sub-path unit is assigned a one-to-one correspondence with each surface sub-piece according to the segmentation number, based on the extraction order.
[0008] Preferably, the splicing and embedding module extracts the surface patch arc length, surface patch chord length, and surface patch curvature direction of each corresponding set of surface patch and sub-path unit; The arc length of the surface patch is the length of the longer of the two boundary curves of the surface sub-pattern along the direction of surface extension; The chord length of a surface patch is the straight-line spatial distance between the two endpoints of the surface patch along the direction of surface extension. The curvature direction of the surface patch is determined as follows: calculate the projection direction of the principal curvature direction of all mesh vertices on the surface patch onto the tangent plane of the surface, statistically analyze the direction distribution histogram of these projection directions, and take the direction corresponding to the peak value as the curvature direction of the surface patch; Extract the path length of the sub-path cell. The path length is the sum of the Euclidean distances between adjacent path points within the sub-path cell. Divide the arc length of the surface patch by the path length to obtain the path length scaling ratio; Multiply the path distance of each path point in the sub-path unit relative to the starting point of the sub-path unit by the path length scaling ratio to obtain the scaled path distance of each path point relative to the starting point. Generate new path points between the original path points through linear interpolation so that the total length of the scaled sub-path unit is equal to the arc length of the surface patch. The arithmetic mean of the curvature radii of each cross section curve on the surface sub-pattern is calculated as the fitting curvature radius; Using the radius of curvature of the adaptive sub-path unit as the radius and the curvature direction of the surface patch as the bending direction, the scaled sub-path unit is bent and deformed along the bending direction. During bending, the arc length between the path points remains unchanged, so that the spatial orientation of the bent sub-path unit is consistent with the surface orientation of the surface patch. The start and end points of the bent sub-path unit are aligned with the two boundary points of the surface patch, respectively. All sub-path units that have completed the bending adaptation are arranged in order of their corresponding surface sub-piece number; For each pair of adjacent preceding and following sub-path units, the last few path points of the preceding sub-path unit and the first few path points of the following sub-path unit are taken as the fusion transition interval. Within the fusion transition interval, for each pair of path points corresponding to each position, the weighted average coordinates are calculated: from one end of the fusion transition interval to the other, the weight of the path point in the previous sub-path unit decreases linearly from 1 to 0, and the weight of the path point in the next sub-path unit increases linearly from 0 to 1. The fused path point coordinates are obtained by multiplying the three-dimensional coordinates of the two path points by their respective weights and then adding them together. Replace the original path points in the fusion transition interval with the fused path points to achieve a smooth transition between adjacent sub-path units. All sub-path units after fusion processing are connected end to end to form a continuous spatial curve, which serves as the splicing processing path.
[0009] Preferably, the verification and correction module obtains the minimum turning radius value of the current milling tool from the tool parameter library of the CNC machining system; Traverse every path point on the splicing processing path except for the beginning and end endpoints, take the current path point, the previous path point, and the next path point, determine an arc through the three points, and calculate the radius of the arc as the turning radius at the current path point. The turning radius is compared with the minimum turning radius value. If the turning radius is less than the minimum turning radius value, the current path point is determined to not meet the minimum turning radius constraint and is marked as a turning violation point. Obtain the triangular mesh data of the surface from the 3D surface model; Project each path point on the splicing processing path onto the curved surface. The projection method is to find the foot of the perpendicular from the path point to the nearest point on the triangular mesh, and calculate the Euclidean distance from the path point to the foot of the perpendicular as the normal distance. If the normal vector of the triangular mesh corresponding to the foot of the perpendicular is in the same direction as the vector pointing from the path point to the foot of the perpendicular, the normal distance is positive; otherwise, it is negative. If the normal distance is negative and its absolute value is greater than the surface overcut tolerance value, then the path point is determined not to satisfy the surface overcut constraint and is marked as an overcut violation point. For each turning violation point, the current turning violation point and several adjacent path points before and after it are offset outward along the normal vector direction of the surface at that point, and the offset distance is the surface overcut tolerance value. Recalculate the turning radius at the point of violation after offset. If the turning radius is still less than the minimum turning radius, insert several path points on both sides of the point of violation. The inserted path points are evenly distributed along the tangent of the arc of the current point of violation to increase the density of path points at the turn and smooth the path. For each point of overcut violation, offset the point of overcut violation outward along the direction of the normal vector of the surface at that point by the overcut tolerance value of the surface; Repeat the above verification and correction process until there are no turning violations or overcut violations on the splicing processing path. Then, take the splicing processing path at this point as the final optimized processing path.
[0010] This invention provides a system for optimizing the machining path of complex curved surfaces in furniture milling equipment based on a virtual model, which has the following advantages: This invention divides a curved surface into curved surface sub-patterns corresponding to the geometric feature regions of the curved surface, and splits the initial processing reference path into sub-path units according to the projection length ratio of each curved surface sub-pattern. This ensures that each sub-path unit corresponds precisely to its corresponding curved surface sub-pattern in spatial position. For each sub-path unit, the path length is scaled and bent to adapt according to the arc length, chord length and curvature direction of the corresponding curved surface sub-pattern. This makes the adapted sub-path unit consistent with the actual geometric shape of the curved surface sub-pattern in length and direction, and can maintain the fit between the path and the curved surface in areas with large curvature changes. When connecting sub-path units, the weighted average fusion process of the transition interval is used to make the transition between adjacent sub-path units smooth, thereby improving the overall smoothness of the splicing process path. Based on the minimum turning radius constraint and surface overcut constraint of the milling tool, the spliced machining path is checked segment by segment. The turning violation points are locally smoothed by offset and insertion of path points, and the overcut violation points are corrected by normal offset to ensure that the final optimized machining path meets the machining requirements in terms of tool kinematic constraints and surface machining accuracy. Attached Figure Description
[0011] Figure 1 This is a system flowchart of the present invention. Detailed Implementation
[0012] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0013] Please see Figure 1 This invention provides a system for optimizing the machining path of complex curved surfaces in furniture milling equipment based on a virtual model, comprising: Data acquisition module: Acquires the 3D surface model of the target furniture surface and the initial machining reference path; Furthermore, the data acquisition module acquires the triangular mesh data of the three-dimensional surface model. The triangular mesh is composed of several triangular patches, and each triangular patch contains three vertex coordinates and a patch normal vector. Traverse each vertex in the triangular mesh. For the current vertex, obtain the normal vector of all triangular patches that share the current vertex as a common vertex, and calculate the arithmetic mean of all the normal vectors as the vertex normal vector of the current vertex. Move the coordinates of the current vertex along its vertex normal vector by an adjustment distance, the adjustment distance being the projection length of the difference between the weighted average of the coordinates of the current vertex's neighboring vertices and the current vertex's coordinates onto the current vertex's normal vector; Repeatedly traverse all vertices until the root mean square value of the coordinate changes of all vertices between two consecutive traversals is less than the smoothing stopping threshold. Read the initial machining reference path, which consists of a series of path points arranged in the machining order, and each path point contains three-dimensional spatial coordinates; Starting from the second path point to the second-to-last path point, take each path point as the current path point in turn, calculate the first direction vector from the previous adjacent path point to the current path point, calculate the second direction vector from the current path point to the next adjacent path point, and calculate the angle between the first direction vector and the second direction vector. When the included angle is greater than the breakpoint determination angle, the three-dimensional spatial coordinates of the current path point are replaced with the arithmetic mean of the coordinates of the previous adjacent path point and the coordinates of the next adjacent path point. The breakpoint determination angle is calculated by statistically analyzing the angles between the first and second direction vectors corresponding to all path points on the initial processing reference path, excluding the beginning and end endpoints, and then calculating the arithmetic mean and standard deviation of these angles.
[0014] It should be noted that the surface smoothing process for the 3D surface model is as follows: traverse each vertex in the triangular mesh, for the current vertex, retrieve all triangular patches that share the current vertex as a common vertex, extract the patch normal vector of each triangular patch, sum the three components of all patch normal vectors respectively and divide by the number of patches to obtain the average normal vector, and use the average normal vector as the vertex normal vector of the current vertex.
[0015] Calculate the set of one-neighbor vertices of the current vertex. A one-neighbor vertex is a vertex that is directly connected to the current vertex through a triangle edge.
[0016] Calculate the weighted average of the coordinates of a neighboring vertex, where the weights are the inverse normalized values of the Euclidean distances from the current vertex to each neighboring vertex.
[0017] The projection length of the difference between the weighted average and the current vertex coordinates onto the current vertex normal vector is used as the adjustment distance. The current vertex coordinates are moved along the vertex normal vector direction by this adjustment distance to obtain the new current vertex coordinates. After performing the above operation on all vertices, the root mean square value of the change in the coordinates of all vertices before and after this round of traversal is calculated. If the root mean square value is greater than or equal to the smoothing stopping threshold, the next round of traversal is continued. If the root mean square value is less than the smoothing stopping threshold, the smoothing process is terminated. The smoothing stopping threshold is one-thousandth of the diagonal length of the bounding box of the 3D surface model.
[0018] Perform breakpoint cleanup on the initial processing reference path: Starting from the second path point in the path point sequence to the second-to-last path point, take each path point as the current path point in turn, calculate the three-dimensional vector pointing from the previous adjacent path point to the current path point and normalize it to obtain the forward direction vector, calculate the three-dimensional vector pointing from the current path point to the next adjacent path point and normalize it to obtain the backward direction vector, calculate the dot product of the forward direction vector and the backward direction vector and restrict the dot product value to between -1 and 1, and calculate the arccosine of the dot product value to obtain the angle between the two direction vectors.
[0019] Calculate the included angles for all path points except the beginning and end points. Sum all included angle values and divide by the total number of path points to obtain the arithmetic mean of the included angles. Sum the squares of the differences between each included angle value and the arithmetic mean of the included angles, divide by the total number of path points, and then take the square root to obtain the standard deviation of the included angles. Take the arithmetic mean of the included angles and add one standard deviation to obtain the angle for determining the breakpoint.
[0020] The included angle of each current path point is compared with the breakpoint determination angle. If the included angle is greater than the breakpoint determination angle, the X, Y, and Z coordinates of the current path point are replaced with the arithmetic mean of the corresponding coordinates of the two adjacent path points. If the included angle is less than or equal to the breakpoint determination angle, the coordinates of the current path point remain unchanged.
[0021] Segmentation and splitting module: Extracts surface feature points along the surface extension direction of the three-dimensional surface model, divides the surface region between adjacent surface feature points into surface sub-segments, and splits the initial processing reference path into sub-path units that correspond one-to-one with the surface sub-segments; Furthermore, the segmentation module calculates the first principal curvature direction, the second principal curvature direction, the first principal curvature value, and the second principal curvature value at each mesh vertex on the surface, compares the absolute values of the first principal curvature value and the second principal curvature value, and selects the principal curvature direction corresponding to the principal curvature value with the smaller absolute value as the candidate extension direction of the mesh vertex. The candidate extension directions of all mesh vertices are counted, and the main extension direction of the surface is obtained by direction clustering, which is used as the extension direction of the surface. Along the extension direction of the curved surface, a series of cross-sectional planes perpendicular to the extension direction of the curved surface are established on the curved surface at a preset interval, and the intersection line of each cross-sectional plane and the curved surface is taken as the cross-sectional curve. Discrete sampling is performed on each cross-sectional curve to obtain a series of sampling points. For each sampling point, a local arc is fitted using adjacent sampling points and the curvature value of adjacent sampling points is calculated. Sampling points with curvature values greater than the curvature determination benchmark are marked as curvature feature candidate points. The curvature determination benchmark is the median of the curvature values of all sampling points on the cross-sectional curve. Connectivity matching is performed on all candidate points of curvature features on cross-sectional curves. Candidate points on adjacent cross-sectional curves whose spatial distance is less than the distance threshold and whose angle of curvature change direction is less than the angle threshold are grouped into the same connected set. The center line of each connected set is used as the surface feature line. The projection positions of each surface feature line in the direction of surface extension are determined as surface feature points. The surface is divided into several surface sub-pieces with two adjacent surface feature points as boundaries. Each surface sub-piece is assigned a sub-piece number along the direction of surface extension, and the total number of surface sub-pieces is counted. Along the extension direction of the initial machining reference path, starting from the first path point, the Euclidean distance between adjacent path points is successively accumulated to obtain the total length of the initial machining reference path; For each surface sub-piece, calculate the projected length of the surface sub-piece in the direction of surface extension, and sum the projected lengths of all surface sub-pieces to obtain the total projected length of the surface in the direction of surface extension. Divide the projected length of the curved surface sub-patch by the total projected length of the curved surface to obtain the length distribution ratio of the curved surface sub-patch. Multiply the total length of the initial processing reference path by the length allocation ratio of each surface sub-piece to obtain the corresponding length of each sub-path unit; According to the corresponding length of each sub-path unit, starting from the starting point of the initial processing reference path, path segments of corresponding lengths are sequentially cut along the path extension direction, and each path segment is a sub-path unit. Each sub-path unit is assigned a one-to-one correspondence with each surface sub-piece according to the segmentation number, based on the extraction order.
[0022] It should be noted that for each vertex in the surface mesh, the Gaussian curvature, mean curvature, two principal curvature values, and two principal curvature directions at that vertex are calculated. The absolute values of the two principal curvature values are compared, and the principal curvature direction corresponding to the principal curvature value with the smaller absolute value is taken as the extension candidate direction of that vertex. The extension candidate directions of all mesh vertices are converted into unit vectors, and the mean drift clustering algorithm is used to cluster all unit vectors. The vector direction of the cluster center containing the most vectors is taken as the surface extension direction.
[0023] Project the 3D surface model onto the direction of surface extension, and take the start and end points of the projection length. Establish a series of equidistant cross-sections between the start and end points at a preset interval. The normal vector of the cross-section is in the same direction as the surface extension. For each cross-section, find the intersection line with each triangular facet in the surface mesh. If the cross-section intersects with a certain triangular facet, find the intersection line segment. Connect all the intersection line segments on the same cross-section to form the cross-sectional curve corresponding to that cross-section.
[0024] For each cross-sectional curve, a sequence of sampling points is obtained by discrete sampling with equal arc length. For each sampling point, multiple sampling points before and after the sampling point are taken. A local arc is fitted by the least squares method, and the reciprocal of the arc radius is calculated as the curvature value of the sampling point.
[0025] Arrange the curvature values of all sampling points on the same cross-sectional curve from smallest to largest, and take the curvature value in the middle position after arrangement as the curvature judgment benchmark of the cross-sectional curve. Compare the curvature value of each sampling point with the curvature judgment benchmark of the cross-sectional curve one by one. If the curvature value is greater than the curvature judgment benchmark, then mark the sampling point as a candidate point of curvature feature of the cross-sectional curve.
[0026] Connectivity matching is performed on all candidate points of curvature features of cross-sectional curves. Starting from the first cross-sectional curve, each candidate point on the current cross-sectional curve is paired with the candidate point with the closest spatial distance on the next adjacent cross-sectional curve. The spatial Euclidean distance and the angle between the curvature change direction between the paired candidate points are calculated. If the spatial distance is less than twice the distance between adjacent cross-sectional curves and the angle between the curvature change direction is less than 30 degrees, then the two candidate points are connected. This process is repeated from the first cross-sectional curve to the next to form several connected sets. For each connected set, the arithmetic mean of the coordinates of all candidate points in the set is taken as the center line of the connected set, and the center line is taken as a surface feature line.
[0027] Project each surface feature line onto the surface extension direction, and take the projection position as the position of the surface feature point. Sort the surface feature points in ascending order according to the projection coordinates of the surface feature points in the surface extension direction. Divide the surface region between two adjacent surface feature points into a surface sub-patch. Assign a sub-patch number to each surface sub-patch along the surface extension direction, and count the total number of surface sub-patch.
[0028] Starting from the first path point of the initial machining reference path, the Euclidean distance between adjacent path points is calculated sequentially and accumulated to obtain the total length of the initial machining reference path. For each surface sub-piece, the starting point projection coordinates and ending point projection coordinates of the surface sub-piece in the surface extension direction are taken. The starting point projection coordinates are subtracted from the ending point projection coordinates to obtain the projection length of the surface sub-piece. The projection lengths of all surface sub-pieces are added together to obtain the total projection length of the surface. The projection length of each surface sub-piece is divided by the total projection length of the surface to obtain the length allocation ratio of each surface sub-piece. The total length of the initial machining reference path is multiplied by the length allocation ratio of each surface sub-piece to obtain the target length of each sub-path unit.
[0029] Starting from the initial processing reference path, the distance between path points is accumulated one by one along the path extension direction. When the accumulated value reaches the target length of the first sub-path unit, the accumulated path segment is cut off as the first sub-path unit. The accumulation continues from the cut-off position, and each sub-path unit is cut off in turn. Each sub-path unit is established in a one-to-one correspondence with each surface sub-piece according to the cut-off order and the piece number.
[0030] The splicing and embedding module: For each sub-path unit, the path is adapted according to the boundary parameters of the corresponding curved surface sub-piece, and the adapted sub-path units are connected in sequence to form a splicing processing path; Furthermore, the splicing and embedding module extracts the surface patch arc length, surface patch chord length, and surface patch curvature direction of each corresponding set of surface patch and sub-path unit. The arc length of the surface patch is the length of the longer of the two boundary curves of the surface sub-pattern in the direction of surface extension; The chord length of the surface patch is the spatial straight-line distance between the two endpoints of the surface sub-pattern in the direction of surface extension; The curvature direction of the surface patch is determined as follows: calculate the projection direction of the principal curvature direction of all grid vertices on the surface sub-pattern onto the tangent plane of the surface, statistically analyze the direction distribution histogram of these projection directions, and take the direction corresponding to the peak value as the curvature direction of the surface patch. Extract the path length of the sub-path unit, where the path length is the sum of the Euclidean distances between adjacent path points within the sub-path unit; Divide the arc length of the surface patch by the path length to obtain the path length scaling ratio; Multiply the path distance of each path point in the sub-path unit relative to the starting point of the sub-path unit by the path length scaling ratio to obtain the scaled path distance of each path point relative to the starting point. Generate new path points between the original path points through linear interpolation, so that the total length of the scaled sub-path unit is equal to the arc length of the surface patch. The arithmetic mean of the curvature radii of each cross-section curve on the surface sub-piece is calculated as the fitting curvature radius; Using the adaptive curvature radius as the radius and the curvature direction of the surface patch as the bending direction, the scaled sub-path unit is bent and deformed along the bending direction. During bending, the arc length between path points remains unchanged, so that the spatial orientation of the bent sub-path unit is consistent with the surface orientation of the surface patch. The start and end points of the bent sub-path unit are aligned with the two boundary points of the surface patch. All sub-path units that have completed the bending adaptation are arranged in order of their corresponding surface sub-piece number; For each pair of adjacent preceding and following sub-path units, the last few path points of the preceding sub-path unit and the first few path points of the following sub-path unit are taken as the fusion transition interval. Within the fusion transition interval, for each pair of path points corresponding to each position, the weighted average coordinates are calculated: from one end of the fusion transition interval to the other, the path point weight of the previous sub-path unit decreases linearly from 1 to 0, and the path point weight of the next sub-path unit increases linearly from 0 to 1. The three-dimensional coordinates of the two path points are multiplied by their respective weights and then added together to obtain the fused path point coordinates. Replace the original path points in the fusion transition interval with the fused path points to achieve a smooth transition between adjacent sub-path units. All sub-path units after fusion processing are connected end to end to form a continuous spatial curve, which serves as the splicing processing path.
[0031] It should be noted that, for each corresponding surface sub-patch and sub-path element, the length of the longer of the two boundary curves of the surface sub-patch along the surface extension direction is calculated as the surface patch arc length. The coordinates of the two endpoints of the surface sub-patch along the surface extension direction are taken, and the Euclidean distance between the two points is calculated as the surface patch chord length. The projection direction of the principal curvature direction of all mesh vertices on the surface sub-patch onto the surface tangent plane is calculated. The 360-degree directional range is divided into several directional intervals. The number of vertices falling into each interval for each projection direction is counted to form a directional distribution histogram. The direction corresponding to the directional interval with the most vertices is taken as the surface patch curvature direction.
[0032] The sum of the Euclidean distances between all adjacent path points within a sub-path unit is calculated as the path length of the sub-path unit. The arc length of the surface patch is divided by the path length to obtain the path length scaling ratio. The path distance of each path point in the sub-path unit relative to the starting point of the sub-path unit is multiplied by the path length scaling ratio to obtain the scaled path distance of that path point relative to the starting point. Equidistant resampling is performed on the scaled path distance sequence. New path points are generated between the original path points through linear interpolation, so that the total length of the scaled sub-path unit is equal to the arc length of the surface patch.
[0033] The arithmetic mean of the curvature radii of each section curve on the surface sub-patch is calculated as the fitting curvature radius. Using the fitting curvature radius as the radius and the curvature direction of the surface patch as the bending direction, the scaled sub-path unit is bent and deformed along the bending direction. During bending, the center of the circle corresponding to the fitting curvature radius is used as the reference center. Each path point on the sub-path unit is rotated around the reference center by a corresponding angle. The rotation angle is equal to the arc length of the path point relative to the bending start point divided by the fitting curvature radius. The start and end points of the bent sub-path unit are aligned with the two boundary points of the surface sub-patch, respectively.
[0034] All sub-path units that have completed the bending adaptation are arranged in sequence according to the segment number of their respective surface sub-pieces. For each pair of adjacent preceding and following sub-path units, the last few path points of the preceding sub-path unit and the first few path points of the following sub-path unit are taken to form a fusion transition interval. The number of path points is one-fifth of the total number of path points of the sub-path unit.
[0035] Within the fusion transition interval, path points at each location are merged sequentially from one end of the interval to the other. The position index of each path point in its sub-path unit is divided by the total number of path points in the fusion transition interval to obtain the position ratio. The weight of the next sub-path unit is equal to the position ratio, and the weight of the previous sub-path unit is equal to one minus the position ratio. The X, Y, and Z coordinates of the path points at corresponding locations in the two sub-path units are multiplied by their respective weights and then added together to obtain the coordinates of the merged path points. The original path point coordinates in the fusion transition interval are replaced with the coordinates of all merged path points. All the merged sub-path units are then connected end to end to form a continuous spatial curve, which serves as the splicing processing path.
[0036] Verification and correction module: Based on the machining constraints of the milling tool, the module performs segment-by-segment verification and local correction on the spliced machining path to generate the final optimized machining path.
[0037] Furthermore, the verification and correction module obtains the minimum turning radius value of the current milling tool from the tool parameter library of the CNC machining system; Traverse every path point on the splicing processing path except for the beginning and end endpoints, take the current path point, the previous path point, and the next path point, determine an arc through the three points, and calculate the radius of the arc as the turning radius at the current path point. The turning radius is compared with the minimum turning radius value. If the turning radius is less than the minimum turning radius value, the current path point is determined to not meet the minimum turning radius constraint, and the current path point is marked as a turning violation point. Obtain the triangular mesh data of the surface from the three-dimensional surface model; Project each path point on the splicing processing path onto the curved surface. The projection method is to find the foot of the perpendicular from the path point to the nearest point on the triangular mesh, and calculate the Euclidean distance from the path point to the foot of the perpendicular as the normal distance. If the normal vector of the triangular mesh corresponding to the foot of the perpendicular is in the same direction as the vector pointing from the path point to the foot of the perpendicular, the normal distance is positive; otherwise, it is negative. If the normal distance is negative and its absolute value is greater than the surface overcut tolerance value, then the path point is determined not to satisfy the surface overcut constraint and is marked as an overcut violation point. For each turning violation point, the current turning violation point and several adjacent path points before and after it are offset outward along the normal vector direction of the surface at that point, and the offset distance is the overcut tolerance value of the surface. Recalculate the turning radius at the point of violation after offset. If the turning radius is still less than the minimum turning radius, insert several path points on both sides of the point of violation. The inserted path points are evenly distributed along the tangent of the arc of the current point of violation to increase the density of path points at the turn and smooth the path. For each overcut violation point, the overcut violation point is offset outward along the normal vector direction of the surface at that point by the overcut tolerance value of the surface; Repeat the above verification and correction process until there are no turning violations or overcut violations on the splicing processing path. Then, take the splicing processing path at this point as the final optimized processing path.
[0038] It should be noted that the minimum turning radius value of the current milling tool is read from the tool parameter library of the CNC machining system. Every path point on the splicing machining path except for the beginning and end points is traversed. The current path point, the previous path point, and the next path point are taken, and the radius of the arc determined by the three points is calculated. If the three points are collinear, the turning radius is set to infinity. The turning radius is compared with the minimum turning radius value. If the turning radius is less than the minimum turning radius value, the path point is marked as a turning violation point.
[0039] Obtain the triangular mesh data of the surface from the 3D surface model. Project each path point on the splicing processing path onto the surface. Search for the triangular mesh that has the closest Euclidean distance to the path point. Calculate the Euclidean distance from the path point to the nearest perpendicular foot on the triangular mesh. Take the dot product of the vector pointing from the path point to the perpendicular foot and the normal vector of the triangular mesh. If the dot product is positive, the normal distance is taken as positive; if the dot product is negative, the normal distance is taken as negative. If the normal distance is negative and its absolute value is greater than the surface overcut tolerance value, then mark the path point as an overcut violation point. The surface overcut tolerance value is one-tenth of the arithmetic mean of all side lengths in the triangular mesh.
[0040] For each turning violation point, the turning violation point and all adjacent path points before and after it are offset outward along the normal vector direction of the surface at their respective projection points. The offset distance is the surface overcut tolerance value. The turning radius at the turning violation point after offset is recalculated. If it is still less than the minimum turning radius value, new path points are inserted at equal intervals on both sides of the turning violation point along the tangent direction of the arc. The number of newly inserted points is determined according to the ratio of the turning radius to the minimum turning radius. The smaller the ratio, the more points are inserted.
[0041] Newly inserted path points are also projected onto the surface and checked for overcutting. If overcutting exists, it is offset outwards. For each overcutting violation point, the overcutting violation point is offset outwards along the surface normal vector direction at its projection point by the surface overcutting tolerance value. After completing one round of correction, the splicing processing path is retraced to check if there are still turning violation points and overcutting violation points. If they exist, the correction continues. If they do not exist, the current splicing processing path is used as the final optimized processing path.
[0042] The path segment between two consecutive path points in the final optimized machining path is converted into CNC machining code. If the path segment is a straight line, a linear interpolation instruction is generated; if the path segment is a curve, a circular interpolation instruction is generated. The machining feed rate is calculated based on the surface curvature radius corresponding to each path point position. The smaller the curvature radius, the lower the feed rate. The generated linear interpolation instructions and circular interpolation instructions are written into the CNC machining code file according to the machining sequence and sent to the controller of the milling machine.
[0043] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0044] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0045] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0046] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0047] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of protection of the described technical solution.
Claims
1. A system for optimizing the machining path of complex curved surfaces in furniture milling equipment based on a virtual model, characterized in that, include: Data acquisition module: Acquires the 3D surface model of the target furniture surface and the initial machining reference path; Segmentation and splitting module: Extracts surface feature points along the surface extension direction of the three-dimensional surface model, divides the surface region between adjacent surface feature points into surface sub-segments, and splits the initial processing reference path into sub-path units that correspond one-to-one with the surface sub-segments; The splicing and embedding module: For each sub-path unit, the path is adapted according to the boundary parameters of the corresponding curved surface sub-piece, and the adapted sub-path units are connected in sequence to form a splicing processing path; Verification and correction module: Based on the machining constraints of the milling tool, the module performs segment-by-segment verification and local correction on the spliced machining path to generate the final optimized machining path.
2. The system for optimizing the machining path of complex curved surfaces in furniture milling equipment based on a virtual model according to claim 1, characterized in that, The data acquisition module acquires the triangular mesh data of the three-dimensional surface model. The triangular mesh is composed of several triangular patches, and each triangular patch contains three vertex coordinates and a patch normal vector. Traverse each vertex in the triangular mesh. For the current vertex, obtain the normal vector of all triangular patches that share the current vertex as a common vertex, and calculate the arithmetic mean of all the normal vectors as the vertex normal vector of the current vertex. Move the coordinates of the current vertex along the direction of its vertex normal vector by an adjustment distance, which is the projection length of the difference between the weighted average of the coordinates of the current vertex's one neighboring vertices and the current vertex's coordinates onto the current vertex's normal vector. Repeatedly traverse all vertices until the root mean square value of the coordinate changes of all vertices between two adjacent traversals is less than the smoothing stopping threshold.
3. The system for optimizing the machining path of complex curved surfaces in furniture milling equipment based on a virtual model according to claim 2, characterized in that, Read the initial machining reference path, which consists of a series of path points arranged in the machining order, and each path point contains three-dimensional spatial coordinates; Starting from the second path point to the second-to-last path point, take each path point as the current path point in turn, calculate the first direction vector from the previous adjacent path point to the current path point, calculate the second direction vector from the current path point to the next adjacent path point, and calculate the angle between the first direction vector and the second direction vector. When the included angle is greater than the breakpoint determination angle, the three-dimensional spatial coordinates of the current path point are replaced with the arithmetic mean of the coordinates of the previous adjacent path point and the next adjacent path point. The breakpoint determination angle is calculated by statistically analyzing the angles between the first and second direction vectors corresponding to all path points on the initial machining reference path, excluding the beginning and end endpoints, and then calculating the arithmetic mean and standard deviation of these angles.
4. The system for optimizing the machining path of complex curved surfaces in furniture milling equipment based on a virtual model according to claim 1, characterized in that, The segmentation module calculates the first principal curvature direction, the second principal curvature direction, the first principal curvature value, and the second principal curvature value at each grid vertex on the surface. It compares the absolute values of the first principal curvature value and the second principal curvature value and selects the principal curvature direction corresponding to the principal curvature value with the smaller absolute value as the candidate extension direction of the grid vertex. The candidate extension directions of all grid vertices are counted, and the main extension direction of the surface is obtained by direction clustering, which is used as the extension direction of the surface. Along the direction of surface extension, a series of cross-sectional planes perpendicular to the direction of surface extension are established on the surface at preset intervals, and the intersection of each cross-sectional plane with the surface is taken as the cross-sectional curve. Discrete sampling is performed on each cross-sectional curve to obtain a series of sampling points. For each sampling point, a local arc is fitted using adjacent sampling points and the curvature value of adjacent sampling points is calculated. Sampling points with curvature values greater than the curvature determination benchmark are marked as curvature feature candidate points.
5. The system for optimizing the machining path of complex curved surfaces in furniture milling equipment based on a virtual model according to claim 4, characterized in that, Connectivity matching is performed on all candidate points of curvature features on cross-sectional curves. Candidate points on adjacent cross-sectional curves whose spatial distance is less than the distance threshold and whose angle of curvature change direction is less than the angle threshold are grouped into the same connected set. The center line of each connected set is used as the surface feature line. The projection positions of each surface feature line on the surface extension direction are determined as surface feature points. The surface is divided into several surface sub-pieces with two adjacent surface feature points as boundaries. Each surface sub-piece is assigned a sub-piece number along the surface extension direction, and the total number of surface sub-pieces is counted. Along the extension direction of the initial machining reference path, starting from the first path point, the Euclidean distance between adjacent path points is successively accumulated to obtain the total length of the initial machining reference path.
6. The system for optimizing the machining path of complex curved surfaces in furniture milling equipment based on a virtual model according to claim 5, characterized in that, For each surface sub-patch, calculate the projected length of the surface sub-patch in the direction of surface extension, and sum the projected lengths of all surface sub-patch to obtain the total projected length of the surface in the direction of surface extension. Divide the projected length of the curved surface sub-patch by the total projected length of the curved surface to obtain the length distribution ratio of the curved surface sub-patch. Multiply the total length of the initial machining reference path by the length allocation ratio of each surface sub-piece to obtain the corresponding length of each sub-path unit; According to the corresponding length of each sub-path unit, starting from the starting point of the initial processing reference path, path segments of corresponding lengths are sequentially cut along the path extension direction, and each path segment is a sub-path unit. Each sub-path unit is assigned a one-to-one correspondence with each surface sub-piece according to the segmentation number, based on the extraction order.
7. The system for optimizing the machining path of complex curved surfaces in furniture milling equipment based on a virtual model according to claim 1, characterized in that, The splicing and embedding module extracts the surface patch arc length, surface patch chord length, and surface patch curvature direction of each corresponding set of surface patch and sub-path unit. The arc length of the surface patch is the length of the longer of the two boundary curves of the surface sub-pattern along the direction of surface extension; The chord length of a surface patch is the straight-line spatial distance between the two endpoints of the surface patch along the direction of surface extension. The curvature direction of the surface patch is determined as follows: calculate the projection direction of the principal curvature direction of all mesh vertices on the surface patch onto the tangent plane of the surface, statistically analyze the direction distribution histogram of these projection directions, and take the direction corresponding to the peak value as the curvature direction of the surface patch; Extract the path length of the sub-path cell. The path length is the sum of the Euclidean distances between adjacent path points within the sub-path cell. Divide the arc length of the surface patch by the path length to obtain the path length scaling ratio.
8. The system for optimizing the machining path of complex curved surfaces in furniture milling equipment based on a virtual model according to claim 7, characterized in that, Multiply the path distance of each path point in the sub-path unit relative to the starting point of the sub-path unit by the path length scaling ratio to obtain the scaled path distance of each path point relative to the starting point. Generate new path points between the original path points through linear interpolation so that the total length of the scaled sub-path unit is equal to the arc length of the surface patch. The arithmetic mean of the curvature radii of each cross section curve on the surface sub-pattern is calculated as the fitting curvature radius; Using the radius of curvature of the adaptive sub-path unit as the radius and the curvature direction of the surface patch as the bending direction, the scaled sub-path unit is bent and deformed along the bending direction. During bending, the arc length between the path points remains unchanged, so that the spatial orientation of the bent sub-path unit is consistent with the surface orientation of the surface patch. The start and end points of the bent sub-path unit are aligned with the two boundary points of the surface patch, respectively. All sub-path units that have completed the bending adaptation are arranged in order of their corresponding surface sub-piece number; For each pair of adjacent preceding and following sub-path units, the last few path points of the preceding sub-path unit and the first few path points of the following sub-path unit are taken as the fusion transition interval.
9. The system for optimizing the machining path of complex curved surfaces in furniture milling equipment based on a virtual model according to claim 8, characterized in that, Within the fusion transition interval, for each pair of path points corresponding to each position, the weighted average coordinates are calculated: from one end of the fusion transition interval to the other, the weight of the path point in the previous sub-path unit decreases linearly from 1 to 0, and the weight of the path point in the next sub-path unit increases linearly from 0 to 1. The fused path point coordinates are obtained by multiplying the three-dimensional coordinates of the two path points by their respective weights and then adding them together. Replace the original path points in the fusion transition interval with the fused path points to achieve a smooth transition between adjacent sub-path units. All sub-path units after fusion processing are connected end to end to form a continuous spatial curve, which serves as the splicing processing path.
10. The system for optimizing the machining path of complex curved surfaces in furniture milling equipment based on a virtual model according to claim 1, characterized in that, The verification and correction module obtains the minimum turning radius value of the current milling tool from the tool parameter library of the CNC machining system; Traverse every path point on the splicing processing path except for the beginning and end endpoints, take the current path point, the previous path point, and the next path point, determine an arc through the three points, and calculate the radius of the arc as the turning radius at the current path point. The turning radius is compared with the minimum turning radius value. If the turning radius is less than the minimum turning radius value, the current path point is determined to not meet the minimum turning radius constraint and is marked as a turning violation point. Obtain the triangular mesh data of the surface from the 3D surface model; Project each path point on the splicing processing path onto the curved surface. The projection method is to find the foot of the perpendicular from the path point to the nearest point on the triangular mesh, and calculate the Euclidean distance from the path point to the foot of the perpendicular as the normal distance. If the normal vector of the triangular mesh corresponding to the foot of the perpendicular is in the same direction as the vector pointing from the path point to the foot of the perpendicular, the normal distance is positive; otherwise, it is negative. If the normal distance is negative and its absolute value is greater than the surface overcut tolerance value, then the path point is determined not to satisfy the surface overcut constraint and is marked as an overcut violation point. For each turning violation point, the current turning violation point and several adjacent path points before and after it are offset outward along the normal vector direction of the surface at that point, and the offset distance is the surface overcut tolerance value. Recalculate the turning radius at the point of violation after offset. If the turning radius is still less than the minimum turning radius, insert several path points on both sides of the point of violation. The inserted path points are evenly distributed along the tangent of the arc of the current point of violation to increase the density of path points at the turn and smooth the path. For each point of overcut violation, offset the point of overcut violation outward along the direction of the normal vector of the surface at that point by the overcut tolerance value of the surface; Repeat the above verification and correction process until there are no turning violations or overcut violations on the splicing processing path. Then, take the splicing processing path at this point as the final optimized processing path.