Five-axis numerical control machining programming method and system

By performing geometric analysis and feature representation on 3D model files and combining adaptive normal selection, machine tool motion commands are generated, solving the efficiency problem of five-axis programming systems when converting between different formats, and realizing unified processing and efficient programming of multiple formats.

CN122386908APending Publication Date: 2026-07-14
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610598376.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Filing Date
2026-04-30
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing five-axis programming systems cannot effectively handle the conversion between parametric surfaces and triangular mesh formats, forcing engineers to use completely different software tools and programming processes when switching between different formats, which seriously affects production efficiency.

Method used

A five-axis CNC machining programming method is provided, which performs geometric analysis on a three-dimensional model file, converts it into a feature representation based on a region, and generates machine tool motion commands by combining a predetermined two-level machining method and adaptive normal selection, thereby achieving unified processing of different formats.

Benefits of technology

It has achieved a unified programming process for 3D model files of different formats, improved production efficiency across formats, and can handle precision parts and reverse-engineered parts, covering multiple application scenarios such as aerospace, mold making, and figurine carving.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122386908A_ABST
    Figure CN122386908A_ABST
Patent Text Reader

Abstract

The application relates to a five-axis numerical control machining programming method and system. The method comprises the following steps: performing geometric analysis on a three-dimensional model file according to a file format of the three-dimensional model file of a part to be machined, and uniformly converting an analysis result into a feature representation in a region unit; distributing a machining strategy for the part to be machined according to a predetermined two-level machining mode and in combination with the feature representation; adaptively selecting a corresponding normal according to a format source mark, and calculating a tool axis direction based on the normal in combination with a rake angle and a side rake angle constraint; converting a tool contact point and the tool axis direction into machine tool motion instruction coordinates based on a geometric compensation framework of a tool contact point, a tool center point and a tool reference point; calculating an allowed step distance of each tool position point according to a curvature description value and a specified target residual height, and generating a target tool path of the part to be machined; and outputting a digital control program file according to the machine tool motion instruction coordinates and the target tool path. The method can break through the barrier of multiple formats and establish a unified automatic programming channel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer-aided manufacturing technology, and in particular to a five-axis CNC machining programming method, system, computer equipment, computer-readable storage medium, and computer program product. Background Technology

[0002] Five-axis CNC machining is a core technology for manufacturing high-precision, complex curved surface parts, and is widely used in aerospace, mold making, figurine carving, cultural relic replication, medical devices and other fields. In actual production, engineers face a variety of 3D models. For example, precision parts are usually provided in parametric surface formats such as STEP (Standard for the Exchange of Product Model Data) / IGES (Initial Graphics Exchange Specification), while scenarios such as reverse engineering, 3D scanning, artistic modeling, and post-processing of 3D printed parts can only provide triangular mesh formats such as STL (Standard Tessellation Language).

[0003] However, existing five-axis programming systems are either based on parametric surfaces and cannot handle pure triangular mesh formats, or they are simplified systems designed for reverse engineering and cannot utilize the rich and precise geometric information in parametric surface format files. Therefore, engineers need to use completely different software tools and programming workflows when switching between the two formats, which seriously affects production efficiency in cross-format scenarios. Summary of the Invention

[0004] Therefore, it is necessary to provide a five-axis CNC machining programming method, system, computer equipment, computer-readable storage medium, and computer program product that can break down the barriers between multiple formats and establish a unified automatic programming channel to address the above-mentioned technical problems.

[0005] Firstly, this application provides a five-axis CNC machining programming method, including:

[0006] Determine the file format of the 3D model file of the part to be processed;

[0007] According to the file format of the 3D model file, the 3D model file is geometrically analyzed, and the analysis results are uniformly converted into feature representations in units of regions; the feature representations include tilt angle, normal field, curvature description value, surface type, and format source mark;

[0008] According to the predetermined two-level processing method, and in combination with the feature representation, a processing strategy is assigned to the part to be processed;

[0009] The corresponding normal is adaptively selected based on the format source mark. The tool axis direction is calculated based on the normal and combined with the tilt angle and side tilt angle constraints. Based on the geometric compensation framework of the tool contact point, tool center point and tool reference point, the tool contact point and tool axis direction are converted into machine tool motion command coordinates.

[0010] The allowable step distance for each tool position is calculated based on the curvature description value and the specified target residual height, and the target toolpath for the part to be machined is generated; a digital control program file is output based on the machine tool motion command coordinates and the target toolpath.

[0011] In one embodiment, the step of performing geometric analysis on the 3D model file according to its file format includes:

[0012] When the file format is parametric surface format, topological parsing is performed on the 3D model file to establish a topological graph and extract the shared edge relationships between each surface patch;

[0013] For each surface patch in the 3D model file, surface type identification is performed to obtain the surface type of each surface patch, and the precise normal and principal curvature of each surface patch are calculated. Based on the principal curvature, Gaussian curvature and average curvature are calculated.

[0014] The region representation of each surface patch is obtained based on its surface type, precise normal, and principal curvature, and is used as the analytical result.

[0015] In one embodiment, the method further includes:

[0016] Identify manufacturing features for a group of surfaces composed of topologically connected surface patches;

[0017] The feature types of the identified manufacturing features are written into the region representation of each surface patch in the surface group.

[0018] In one embodiment, the step of performing geometric analysis on the 3D model file according to its file format includes:

[0019] When the file format is a triangular mesh format, connectivity analysis is performed on the three-dimensional model file to establish a triangular patch adjacency graph, and the region is segmented according to the rule that adjacent triangular patches with similar normal vector directions are divided into the same region;

[0020] Calculate the smooth normal and surrogate curvature of each triangle in the 3D model file; the smooth normal of each triangle is the area-weighted average normal of its adjacent triangles, and the surrogate curvature is the mean and maximum value of the dihedral angles of its adjacent triangles.

[0021] The region representation of each triangle is obtained based on the smooth normal and surrogate curvature of each triangle, as the analytical result.

[0022] In one embodiment, before performing connectivity analysis on the 3D model file and establishing the triangular patch adjacency graph, the method further includes:

[0023] Perform a mesh health check on the 3D model file to obtain a health score;

[0024] If the health score does not reach the qualified threshold, automatic repair will be performed until the health score reaches the qualified threshold.

[0025] In one embodiment, the two-stage processing method involves first performing global rough machining on the entire workpiece, and then performing fine machining on each area.

[0026] The process of assigning a processing strategy to the part to be processed according to a predetermined two-level processing method, combined with the feature representation, includes:

[0027] In the global roughing stage, an offset region removal strategy is used to remove the blank;

[0028] During the refinement stage, based on the feature representation of each region, a pre-defined refinement strategy table is queried to obtain a matching refinement strategy.

[0029] In one embodiment, the step of refining the process by querying a predetermined refining strategy table based on the feature representation of each region to obtain a matching refining strategy includes:

[0030] For any given region, if the tilt angle of the region is less than the first tilt angle threshold and the curvature description value is less than the first curvature threshold, then the matching fine-tuning strategy is determined to be the planar region clearing strategy.

[0031] If the tilt angle of the region is greater than or equal to the first tilt angle threshold and less than the second tilt angle threshold, then the matching fine processing strategy is determined to be the surface streamline processing strategy.

[0032] If the dip angle of the region is greater than or equal to the second dip angle threshold and less than the third dip angle threshold, then the matching fine-machining strategy is determined to be the Z-axis contour fine-machining strategy.

[0033] If the tilt angle of the region is greater than or equal to the third tilt angle threshold, or the surface type is a cylindrical surface or a conical surface, then the matching fine machining strategy is determined to be a five-axis side-cutting machining strategy.

[0034] If the curvature description value of the region is greater than the second curvature threshold, then the matching fine processing strategy is determined to be the residual material removal strategy.

[0035] In one embodiment, the adaptive selection of the corresponding normal based on the format source marker includes:

[0036] If the format source is marked as parametric surface format, the normal used is the exact normal;

[0037] If the source format is marked as triangular mesh format, the normal used is the smooth normal;

[0038] If the format source is marked as a mixed scene containing parametric surface format and triangular mesh format, the normal used is the normal after consistent alignment at the boundary of the two format regions.

[0039] In one embodiment, after adaptively selecting the corresponding normal based on the format source mark, and calculating the tool axis direction based on the normal and in combination with the tilt angle and side tilt angle constraints, the method further includes:

[0040] Spherical linear interpolation is used to perform multiple rounds of iterative smoothing on the tool axis sequence.

[0041] In one embodiment, calculating the allowable step distance for each tool position based on the curvature description value and the specified target residual height includes:

[0042] Obtain the tool radius;

[0043] At each tool position point, the effective radius of curvature is calculated based on the curvature description value corresponding to that tool position point and the tool radius.

[0044] Input the effective radius of curvature and the target residual height into the residual height formula to calculate the allowable step distance of the tool position.

[0045] In one embodiment, after calculating the allowable step distance for each tool position based on the curvature description value and the specified target residual height, and generating the target toolpath for the part to be machined, the method further includes:

[0046] Perform tool-workpiece collision detection at each tool position point;

[0047] Adjust the tool positions where the detection result indicates a collision. If the collision still cannot be eliminated after adjustment, perform filtering to obtain the filtered toolpath.

[0048] The filtered toolpaths for each region are globally sorted and optimized. Based on the machine tool motion command coordinates and the optimized toolpaths, a digital control program file is output.

[0049] Secondly, this application also provides a five-axis CNC machining programming system, including:

[0050] The multi-format model parsing and unified feature extraction module is used to perform geometric parsing on the three-dimensional model file of the part to be processed according to the file format of the three-dimensional model file, and to uniformly convert the parsing results into feature representations in units of regions; the feature representations include tilt angle, normal field, curvature description value, surface type and format source mark;

[0051] A process decision engine is used to assign processing strategies to the parts to be processed according to a predetermined two-level processing method, combined with the feature representation;

[0052] The multi-format adaptive five-axis tool axis planning module is used to adaptively select the corresponding normal according to the format source mark, and calculate the tool axis direction based on the normal and combined with the tilt angle and side tilt angle constraints; based on the geometric compensation framework of the tool contact point, tool center point and tool reference point, the tool contact point and tool axis direction are converted into machine tool motion command coordinates;

[0053] The toolpath generation and residual height drive step distance adaptive module is used to calculate the allowable step distance of each tool position point according to the curvature description value and the specified target residual height, and generate the target toolpath of the part to be machined; and output the digital control program file according to the machine tool motion command coordinates and the target toolpath.

[0054] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method as described in any of the preceding claims.

[0055] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method as described in any of the preceding claims.

[0056] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method as described in any of the preceding claims.

[0057] The aforementioned five-axis CNC machining programming method, system, computer equipment, computer-readable storage medium, and computer program product, for any format of 3D model file, perform geometric analysis according to its file format, and uniformly convert the analysis results into feature representations in units of regions; then, according to a predetermined two-level machining method, combined with the feature representation, assign machining strategies to the parts to be machined; adaptively select the corresponding normal based on the format source mark, and calculate the tool axis direction based on the normal and combined with the tilt angle and side tilt angle constraints; based on the geometric compensation framework of the tool contact point, tool center point, and tool reference point, convert the tool contact point and tool axis direction into machine tool motion command coordinates; calculate the allowable step distance of each tool position point according to the curvature description value and the specified target residual height, and generate the target toolpath of the parts to be machined; and output the digital control program file according to the machine tool motion command coordinates and the target toolpath. This method uses a unified regional feature representation layer to process inputs of different file formats in a unified manner. Engineers can use the same programming process to process precision parts (parametric surface format source) and reverse-engineered parts (triangular mesh format source), thereby eliminating the format barriers of existing tools and covering different application scenarios such as precision parts, figurine carving, cultural relic replication, and reverse engineering. Attached Figure Description

[0058] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0059] Figure 1 This is a flowchart illustrating a five-axis CNC machining programming method in one embodiment;

[0060] Figure 2 This is a schematic diagram of the geometric compensation framework for the tool contact point, tool center point, and tool reference point in one embodiment;

[0061] Figure 3 This is a schematic diagram illustrating the parsing paths of files in parametric surface format and triangular mesh format in one embodiment;

[0062] Figure 4 This is a schematic diagram illustrating the analysis of the parametric surface format in one embodiment;

[0063] Figure 5 This is a schematic diagram illustrating the analysis of a triangular mesh format in one embodiment;

[0064] Figure 6 This is a schematic diagram of the framework for a two-stage processing method in one embodiment;

[0065] Figure 7 This is a schematic diagram of the adaptive format tool axis planning in one embodiment;

[0066] Figure 8 This is a schematic diagram of SLERP spherical interpolation tool axis smoothing in one embodiment;

[0067] Figure 9 This is a schematic diagram of adaptive calculation of residual height driving step distance in one embodiment;

[0068] Figure 10 This is an overall flowchart of a five-axis CNC machining programming method in one embodiment;

[0069] Figure 11 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0070] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0071] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. The terms "comprising" and "having," and any variations thereof, as used in this application, are intended to cover non-exclusive inclusion. The term "a plurality" as used in this application refers to two or more. The term "and / or" as used in this application refers to one of the embodiments or any combination of multiple embodiments.

[0072] In one exemplary embodiment, such as Figure 1 As shown, a five-axis CNC machining programming method is provided, including the following steps:

[0073] Step S110: Determine the file format of the 3D model file of the part to be processed.

[0074] This solution can accept input 3D model files in multiple formats, such as parametric surface format and triangular mesh format.

[0075] Step S120: According to the file format of the 3D model file, perform geometric analysis on the 3D model file and convert the analysis results into a feature representation based on the region. The feature representation includes tilt angle, normal field, curvature description value, surface type and format source mark.

[0076] Specifically, the parsing process differs for different file formats. This step designs separate parsing processes for 3D model files in parametric surface and triangular mesh formats, and finally converts the parsing results of both into the same data structure, that is, uniformly converting them into feature representations based on regions, for subsequent processing without differentiation. Specifically, regions in parametric surface format are surface patches, i.e., units of surface patches; regions in triangular mesh format are triangular patches, i.e., units of triangular patches.

[0077] In this step, 3D model files of different formats are parsed and converted into a unified feature representation, so that subsequent process decisions, tool axis planning and toolpath generation are completely decoupled from the file format of the input 3D model files, making different file formats applicable to the subsequent processing flow.

[0078] Step S130: According to the predetermined two-level processing method, combined with feature representation, a processing strategy is assigned to the part to be processed.

[0079] Specifically, the two-level machining method involves first performing global roughing on the entire workpiece, followed by fine machining on each region. Based on a unified feature representation (tilt angle, curvature description value, surface type, etc.) at the region level and the material type specified by the user, the machining strategy and cutting parameters are automatically assigned to each process according to a two-level decision framework of global roughing followed by region-based fine machining.

[0080] Step S140: Adaptively select the corresponding normal according to the format source mark, calculate the tool axis direction based on the normal and combined with the tilt angle and side tilt angle constraints; and convert the tool contact point and tool axis direction into machine tool motion command coordinates based on the geometric compensation framework of the tool contact point, tool center point and tool reference point.

[0081] In the geometric compensation framework, the tool contact point can be directly extracted from the 3D model file, the tool center point is calculated and compensated through the tool contact point, and the tool reference point is calculated and compensated through the tool center point.

[0082] In this step, based on a unified feature representation, the corresponding normal is adaptively selected to plan the five-axis tool axis according to the format source mark of the region. The starting point for tool axis planning is the reliable normal of the workpiece surface. Therefore, after determining the normal, the five-axis tool axis direction is calculated based on the normal of each region, combined with the tilt angle and side tilt angle constraints. Specifically, for each region, based on the normal of that region, the tool axis is tilted forward by a first angle along the feed direction, tilted to the side by a second angle perpendicular to the feed direction, and the direction that minimizes the interference between the tool envelope and the workpiece is automatically selected from the positive and negative directions of the second angle as the optimal side tilt direction, thus obtaining the tool axis direction of that region; wherein, if the tilt angle of the region is greater than or equal to the third tilt angle threshold, or the surface type is a cylindrical surface, the tool axis is locked in a plane perpendicular to the normal of that region to achieve a pure side-cutting posture.

[0083] For example, the front / lateral tilt angle is controlled as follows:

[0084] Let the lead angle be... Incline the tool axis forward along the feed direction from the feed direction. (Default 10°) to avoid the singular point of the ball end mill tip from participating in cutting.

[0085] Let the roll angle be... Tilting in the vertical feed direction (Default 5°) to further avoid singularities and improve side cutting efficiency.

[0086] Automatically selects the optimal roll direction: within ± Of the two directions, the direction that minimizes interference between the tool envelope and the workpiece is automatically selected.

[0087] Extremely steep / side-edge region tool axis locking: For regions with an inclination angle α ≥ 80° or for parametric surface formats where the surface type is identified as a cylindrical surface, the tool axis is locked in a plane perpendicular to the region's normal, achieving a pure side-edge machining posture.

[0088] This step, through dual control of the tilt angle and lateral tilt angle, can avoid singularities in the ball end mill, comprehensively improving the surface quality of the machined part. Precise input of the parametric surface format can further improve the accuracy of the tool axis planning.

[0089] In addition, this step establishes a unified three-point geometric compensation framework for the tool contact point (CC), tool center point (TCP), and tool reference point (TRP), applicable to both parametric surface and triangular mesh formats. For example... Figure 2 The diagram shown is a schematic of the geometric compensation framework for the tool contact point, tool center point, and tool reference point.

[0090] Among them, the tool contact point (CC) represents the actual contact point between the tool and the workpiece surface, which is determined by region sampling; the tool contact point can be sampled directly on the precise surface in the parametric surface format, and sampled at the center of the triangular facet in the triangular mesh format.

[0091] Tool center point (TCP): the center of the ball end mill (or the center of the bottom of the flat end mill). Where R is the tool radius, Indicates the direction of the tool axis.

[0092] Tool Reference Point (TRP): The reference point for machine tool motion commands. , where L is the tool overhang.

[0093] After establishing a three-point geometric compensation framework for the tool contact point, tool center point, and tool reference point, the tool contact point and tool axis direction are converted into machine tool motion command coordinates according to the machine tool structure parameters configured by the user (swivel head / rotary table / hybrid). This automatically completes the forward / inverse kinematic transformation from the tool reference point (TRP) to the machine tool axis coordinates (X / Y / Z / A / C or X / Y / Z / B / C), generating digital control (NC) commands.

[0094] Step S150: Calculate the allowable step distance of each tool position point based on the curvature description value and the specified target residual height, and generate the target toolpath of the part to be machined; output the digital control program file based on the machine tool motion command coordinates and the target toolpath.

[0095] In this step, the effective radius of curvature is adaptively calculated based on the region source (i.e., from a parametric surface format or a triangular mesh format). The allowable step distance for each tool position is calculated based on the target residual height, and the step distance adaptive toolpath is generated by driving the residual height. Then, tool-workpiece collision detection is performed for each tool position, the tilt angle is automatically adjusted for colliding tool positions, and a digital control (NC) program file is output.

[0096] In the aforementioned five-axis CNC machining programming method, for any format of 3D model file, geometric analysis is performed according to its file format, and the analysis results are uniformly converted into feature representations based on regions. Then, according to a predetermined two-level machining method, combined with the feature representation, a machining strategy is assigned to the part to be machined. The corresponding normal is adaptively selected based on the format source mark, and the tool axis direction is calculated based on the normal and combined with the tilt angle and side tilt angle constraints. Based on the geometric compensation framework of the tool contact point, tool center point, and tool reference point, the tool contact point and tool axis direction are converted into machine tool motion command coordinates. The allowable step distance of each tool position point is calculated according to the curvature description value and the specified target residual height, generating the target toolpath of the part to be machined. Based on the machine tool motion command coordinates and the target toolpath, the digital control program file is output. This method unifies the processing of inputs from different file formats by unifying the region feature representation layer. Engineers can use the same programming process to process precision parts (parametric surface format source) and reverse-engineered parts (triangular mesh format source), thereby eliminating the format barriers of existing tools and covering different application scenarios such as precision parts, figurine carving, cultural relic replication, and reverse engineering.

[0097] In some embodiments, the file format of the 3D model file includes parametric surface format and triangular mesh format, such as Figure 3 The diagram shows the parsing paths for two different formats of 3D model files. The parsing process for each format will be explained below.

[0098] When the file format is a parametric surface format (such as STEP or IGES format), in an exemplary embodiment, step S120 performs geometric analysis on the 3D model file according to the file format of the 3D model file, including: performing topological analysis on the 3D model file, establishing a topological graph, and extracting the shared edge relationships between each surface patch; identifying the surface type of each surface patch in the 3D model file to obtain the surface type of each surface patch, and calculating the precise normal and principal curvature of each surface patch, and calculating the Gaussian curvature and average curvature based on the principal curvature; obtaining the region representation of each surface patch based on the surface type, precise normal, and principal curvature of each surface patch as the analysis result.

[0099] Among them, the surface types of the surface patch can be plane, cylinder, cone, sphere, torus, NURBS (Non-Uniform Rational B-Spline) freeform surface, etc.

[0100] Specifically, such as Figure 4The diagram shown illustrates the analytical process for parametric surface formats. For 3D model files in parametric surface format, the processing includes: 1. B-rep (Boundary Representation) topology analysis: Reading the face-edge-vertex adjacency relationships in the file, establishing a complete topology graph, and extracting shared edge relationships between each surface patch (Face), providing an accurate topological basis for region segmentation; 2. Surface type identification: Identifying the geometric type of each surface patch. The normal and curvature of a standard analytical surface can be accurately calculated using analytical formulas without numerical approximation; 3. Accurate normal and curvature extraction: For each surface patch, uniformly sampling several points according to the parametric domain, and directly calculating the accurate unit normal vector (i.e., accurate normal) and principal curvature (...) of each sampling point using the analytical surface equations. , The Gaussian curvature K and mean curvature H are calculated based on the principal curvatures and used as curvature descriptions for the region. , This allows for full utilization of STEP's precise geometric information, thereby improving the accuracy of subsequent programming.

[0101] Furthermore, in addition to topology analysis, surface type identification, and extraction of normals and curvatures, manufacturing feature pre-identification can also be performed on 3D model files in parametric surface format. Accordingly, in some embodiments, the method further includes: identifying manufacturing features in a surface group composed of topologically connected surface patches; and writing the feature type of the identified manufacturing features into the region representation of each surface patch in the surface group.

[0102] Specifically, for topologically connected surface groups, common manufacturing features are identified, such as cylindrical holes (coaxial cylindrical surface + end face), rectangular grooves (parallel plane combination), and fillets (equal radius torus), and the feature type is written as an additional attribute into the region representation.

[0103] In this embodiment, accurate principal curvature calculation for the parametric surface format (STEP path) can be used for subsequent adaptive calculation of residual height step distance, accurate normal calculation can be used for subsequent tool axis planning, analytical surface type can be used for strategy allocation (such as automatic side-edge triggering strategy for cylindrical surfaces), and B-rep topology can be used for toolpath sequence optimization. This fully transforms the rich geometric information in the 3D model file of the parametric surface format into improved programming quality, achieving higher toolpath accuracy than the pure triangular mesh system (STL system). Simultaneously, by identifying manufacturing features of topologically connected surface groups and writing them into the region representation of surface patches, higher-level semantic information can be provided for process decisions.

[0104] When the file format is a triangular mesh format (such as STL, OBJ, etc.), in an exemplary embodiment, step S120 performs geometric analysis on the 3D model file according to the file format of the 3D model file, including: performing connectivity analysis on the 3D model file, establishing a triangle adjacency graph, and dividing the region according to the rule that adjacent triangles with similar normal vector directions are divided into the same region; calculating the smooth normal and surrogate curvature of each triangle in the 3D model file; and obtaining the region representation of each triangle based on the smooth normal and surrogate curvature of each triangle as the analysis result.

[0105] The smoothed normal of each triangle is the area-weighted average normal of its adjacent triangles. The surrogate curvature is the mean and maximum dihedral angles of its adjacent triangles.

[0106] Specifically, such as Figure 5 The diagram shown illustrates the analysis of a triangular mesh format. For a 3D model file in triangular mesh format, the following processes are performed: 1. Connectivity analysis and region segmentation: A triangular adjacency graph is established using shared edges as the connectivity criterion. Breadth-First Search (BFS) is then performed, grouping regions with similar normal vector directions (dihedral angle < threshold). 1. Adjacent triangles (default 30°) are merged into the same region. 2. Dihedral angle statistical curvature proxy: For each triangle, calculate its dihedral angle with all adjacent triangles, and take the mean and maximum values ​​as the proxy curvature, avoiding the high sensitivity to STL noise when estimating the true curvature based on vertex normals. 3. Area-weighted neighborhood smoothing normal: For each triangle... Collect its vertices Nearest neighbor triangular set Calculate the area-weighted average normal: After normalization, it serves as a reliable normal estimate for the triangular piece, effectively eliminating normal jitter caused by STL noise.

[0107] In this embodiment, area-weighted neighborhood smoothing of the normal can effectively suppress normal noise in the scanned and repaired parts, and the dihedral curvature proxy is robust to noise, ensuring that high-quality five-axis toolpaths can still be generated in scenarios without parametric surface information.

[0108] In some embodiments, before performing connectivity analysis on the 3D model file and establishing a triangular patch adjacency graph, the method further includes: performing a mesh health check on the 3D model file to obtain a health score; and automatically repairing the health score if it does not reach the qualified threshold until the health score reaches the qualified threshold.

[0109] It is understandable that, in order to ensure the effectiveness and accuracy of connectivity analysis, a mesh health check and automatic repair can be performed before parsing the 3D model file in triangular mesh format.

[0110] Specifically, it detects multiple types of geometric defects in pre-defined locations, such as detecting duplicate vertices (K-dimensional tree merging, thresholding). Degenerate triangle (area) The system identifies six types of geometric defects: non-manifold edges (number of associated faces ≠ 2), holes (boundary edges), normal flips (adjacent face consistency), and self-intersections (BVH accelerated detection). A health score (e.g., 0-100 points) is calculated using a weighted deduction formula. If the health score does not reach the acceptable threshold, each defect is automatically repaired sequentially according to its priority, for example, from highest to lowest priority, until the health score reaches the acceptable threshold (e.g., 70 points). Then, geometric analysis is performed.

[0111] In this embodiment, before parsing the 3D model file in triangular mesh format, a mesh health check is performed. If the health score does not reach the pass threshold, automatic repair is performed until the pass threshold is reached. This process of detecting and automatically repairing six types of defects can ensure the usability of low-quality triangular mesh format (STL) 3D models and adapt to low-quality mesh input.

[0112] In some embodiments, the analytical results of parametric surface format and triangular mesh format are uniformly converted into feature representations based on regions, including the following unified fields:

[0113] Tilt angle α: The mean angle between the normal of the sampling points within the region and the Z-axis (tool axis direction). For parametric surface format (STEP path), it is calculated using the exact normal; for triangular mesh format (STL path), it is calculated using the smoothed normal.

[0114] Normal field: Parametric surface format (STEP path) provides an accurate analytical normal; triangular mesh format (STL path) provides an area-weighted smooth normal; subsequent processing uniformly calls this field, without distinguishing the source.

[0115] Curvature description value: Parametric surface format (STEP path) stores the precise principal curvature ( , The triangular mesh format (STL path) stores the statistical surrogate values ​​of dihedral angles, i.e., surrogate curvature; both are mapped to a uniform dimension of curvature magnitude description (low / medium / high) for use in process decisions.

[0116] Surface type: Parametric surface format (STEP path) is directly given by analytical recognition, such as plane, cylinder, freeform surface, etc.; Triangular mesh format (STL path) is estimated by curvature surrogate value, such as near plane, gradient, high curvature, etc.

[0117] Format source marker: Records whether the region comes from the parametric surface format (STEP path) or the triangular mesh format (STL path), providing information for tool axis planning to select the optimal strategy.

[0118] In this application, the two-level processing method for the workpiece is to first perform global roughing on the entire workpiece, and then perform fine processing on each region. In an exemplary embodiment, step S130 assigns a processing strategy to the part to be processed according to the predetermined two-level processing method and in combination with the feature representation, including: in the global roughing stage, using the bias region clearing strategy to remove the blank; in the fine processing stage, based on the feature representation of each region, querying the predetermined fine processing strategy table to obtain the matching fine processing strategy.

[0119] refer to Figure 6 The image below is a schematic diagram illustrating a two-stage processing method in one embodiment. Figure 5 This embodiment will be described.

[0120] First-level decision: Global roughing. Regardless of the input 3D model file format, a global roughing process is first performed on the entire workpiece, using an offset area clearing strategy to quickly remove the main material of the blank. The roughing step distances (step_down, step_over) are automatically loaded from the roughing configuration in the material parameter file, and the recommended roughing tool type is selected. This stage does not distinguish between area types, aiming to cover the entire area with maximum efficiency.

[0121] Second-level decision: Regional finishing. After roughing is completed, finishing strategies are assigned according to the tilt angle classification and surface type of each region, following predetermined priority rules. Specifically, in an exemplary embodiment, during the fine machining stage, based on the feature representation of each region, a predetermined fine machining strategy table is queried to obtain a matching fine machining strategy, including: for any region, if the tilt angle of the region is less than a first tilt angle threshold and the curvature description value is less than a first curvature threshold, then the matching fine machining strategy is determined to be a planar region clearing strategy; if the tilt angle of the region is greater than or equal to the first tilt angle threshold and less than a second tilt angle threshold, then the matching fine machining strategy is determined to be a curved surface streamline machining strategy; if the tilt angle of the region is greater than or equal to the second tilt angle threshold and less than a third tilt angle threshold, then the matching fine machining strategy is determined to be a Z-axis contour finishing strategy; if the tilt angle of the region is greater than or equal to the third tilt angle threshold, or the surface type is a cylindrical surface or a conical surface, then the matching fine machining strategy is determined to be a five-axis side-edge machining strategy; if the curvature description value of the region is greater than the second curvature threshold, then the matching fine machining strategy is determined to be a residual material removal strategy.

[0122] For example, for any region, if the tilt angle α of the region is less than 30° (horizontal region) and the curvature description value is low (e.g., less than the first curvature threshold), then the Planar Area Clearance strategy is selected; if the STEP path has been identified as the analytical plane, the toolpath spacing can be directly optimized using the precise normal.

[0123] If the slope of the region is 30°≤α<60° (sloping region), then the surface streamline machining strategy is selected; among them, the STEP path can use the precise principal curvature direction as the streamline direction, and the STL path is estimated by proxy curvature.

[0124] If the slope of the region is 60°≤α<80° (steep region), then the Z-level contour finishing strategy is selected.

[0125] If the tilt angle α of the region is ≥80° (extremely steep region) or the surface type identified by STEP path is cylindrical / conical, then the five-axis side-cutting machining strategy is preferred.

[0126] If the curvature description value of a region is high, such as exceeding the second curvature threshold (local high curvature transition zone), then the residual material clearing strategy (Rest Machining / Pencil Milling) is triggered.

[0127] The system incorporates multiple material parameter files (JSON format), defining complete sets of cutting parameters (spindle speed RPM, feed rate mm / min, step_over, step_down, tolerance, thickness) for both roughing and finishing strategies. After determining the machining strategy, the corresponding parameters are automatically loaded, and an external parameter overriding mechanism allows for local modifications. Adding a new material file only requires creating a new JSON file; no modification to the algorithm code is needed.

[0128] In this embodiment, fully automated decision-making across all processes is achieved, covering the complete process chain from roughing to finishing. Specifically, the two-level process decision framework automatically completes the full process planning from roughing to finishing. The decoupled design driven by material parameter tables enables the system to support multiple materials out of the box for both input file formats. Furthermore, adding new materials or processing scenarios only requires configuring a JSON file, without modifying the algorithm, demonstrating excellent scalability.

[0129] In an exemplary embodiment, step S140 adaptively selects the corresponding normal according to the format source mark, including: if the format source mark is a parametric surface format, the normal used is the precise normal; if the format source mark is a triangular mesh format, the normal used is the smooth normal; if the format source mark is a mixed scene containing parametric surface format and triangular mesh format, the normal used is the normal after consistent alignment at the boundary of the two format regions.

[0130] refer to Figure 7 This is a schematic diagram of tool axis planning under adaptive formats in parametric surface format and triangular mesh format, as shown in one embodiment.

[0131] For regions in the parametric surface format (STEP path): the accurate normal is calculated directly using the analytical surface equations, with no noise, no need for smoothing, and the accuracy is guaranteed by the geometric kernel.

[0132] For regions in the triangular mesh format (STL path): area-weighted neighborhood smoothing of the normal is used to eliminate normal jitter caused by triangular mesh discretization and scan noise through smoothing.

[0133] For mixed scenarios (part of the same workpiece comes from STEP and part from STL repair): the normals are aligned consistently at the boundaries of the two types of regions to avoid cross-regional tool axis abrupt changes due to differences in normal quality.

[0134] Furthermore, in step S140, after adaptively selecting the corresponding normal based on the format source mark and calculating the tool axis direction based on the normal and combined with the tilt angle and side tilt angle constraints, the process further includes: performing multi-round iterative smoothing processing on the tool axis sequence using spherical linear interpolation.

[0135] It is understandable that abrupt changes in the tool axis between adjacent tool points in a continuous toolpath can cause violent movement of the machine tool's rotary axis. Therefore, this embodiment further employs SLERP (Spherical Linear Interpolation) to perform multi-round iterative smoothing (e.g., 3 rounds) on the tool axis sequence, as expressed by the formula:

[0136]

[0137] refer to Figure 8 This is a schematic diagram of SLERP spherical interpolation for tool axis smoothing. SLERP interpolates on a unit sphere, ensuring the tool axis remains a unit vector, and the interpolation path is a great circle arc on the sphere (the shortest path), ensuring optimal movement of the machine tool's rotary axis. For regions sourced from parametric surface formats, the accurate normal itself has better continuity, and the required number of smoothing rounds can be appropriately reduced; for regions sourced from triangular mesh formats, the number of smoothing rounds remains at the default value to fully suppress discretization errors.

[0138] In this embodiment, by using format-adaptive normal selection, it can be ensured that both the parametric surface format and the triangular mesh format use the normal with the highest available quality; and by using SLERP spherical interpolation tool axis smoothing, abrupt changes in the rotation axis are eliminated.

[0139] In an exemplary embodiment, step S150, which calculates the allowable step distance for each tool position based on the curvature description value and the specified target residual height, includes: obtaining the tool radius; calculating the effective curvature radius at each tool position based on the curvature description value and the tool radius corresponding to that tool position; and inputting the effective curvature radius and the target residual height into the residual height formula to calculate the allowable step distance for the tool position.

[0140] refer to Figure 9 This is a schematic diagram of adaptive step size calculation driven by residual height. In this embodiment, the step size is automatically adjusted through the residual height driving mechanism, which is applicable to both parametric surface format and triangular mesh format inputs.

[0141] For parametric surface formats, the effective radius of curvature The principal curvature corresponding to the tool position ( , ) and tool radius The calculation formula is determined together as follows:

[0142]

[0143] For triangular mesh format, effective radius of curvature Estimation of surrogate curvature determined by dihedral angle.

[0144] Both formats use a unified residual height driving step distance formula to calculate the allowable step distance, which is as follows:

[0145]

[0146] in, To allow step size, The target residual height specified by the user.

[0147] The principle for calculating the allowable step size is as follows: the step size is automatically reduced in high curvature regions to control the residual height, and the step size is automatically increased in low curvature flat regions to improve efficiency, thereby achieving global uniformity of residual height.

[0148] In this embodiment, a unified residual height driving step formula is used, which is applicable to both parametric surface format (precise curvature) and triangular mesh format (proxy curvature) input formats. The step size is automatically reduced in high curvature regions and automatically increased in low curvature regions, thereby achieving global residual height uniformity. This balances machining quality and efficiency under both input formats.

[0149] In an exemplary embodiment, after step S150 calculates the allowable step distance of each tool position point based on the curvature description value and the specified target residual height, and generates the target toolpath for the part to be machined, the method further includes: performing tool-workpiece collision detection on each tool position point; adjusting the tool positions point where the detection result is a collision; if the collision still cannot be eliminated after adjustment, performing filtering processing to obtain the filtered toolpath; performing global sorting optimization on the filtered toolpaths of each region; and outputting a digital control program file based on the machine tool motion command coordinates and the optimized toolpath.

[0150] Specifically, for each tool position point (CC, TCP, TRP), tool-workpiece collision detection is performed using BVH (Bounding Volume Hierarchy) acceleration. This detects interference between the cutting portion of the tool and the non-machined area, as well as interference between the tool holder and the workpiece. For tool positions where collisions are detected, the tilt angle is automatically increased (up to a maximum of 45°), and collision detection is performed again. If the collision still cannot be eliminated, it is marked as unreachable and included in subsequent supplementary root clearing processes. For parametric surface formats (STEP paths), precise B-rep boundaries can be used to further improve collision detection accuracy.

[0151] Globally optimize toolpath sorting for all regions: prioritize continuous machining of adjacent regions with the same tilt angle type to reduce posture switching; arrange toolpaths within a region in a spiral or unidirectional / reciprocating manner to reduce tool lifting frequency; and minimize tool lifting paths at safe heights during inter-region transitions. For parametric surface formats, further optimize the machining sequence of adjacent regions using face adjacency relationships in B-rep topology to reduce tool posture switching frequency.

[0152] Based on the same inventive concept, this application also provides a five-axis CNC machining programming system for implementing the aforementioned five-axis CNC machining programming method. The solution provided by this system is similar to the implementation scheme described in the above method; therefore, the specific limitations of the five-axis CNC machining programming system embodiments described below can be found in the limitations of the five-axis CNC machining programming method described above, and will not be repeated here.

[0153] In one exemplary embodiment, a five-axis CNC machining programming system is provided, comprising:

[0154] The multi-format model parsing and unified feature extraction module is used to perform geometric parsing on the 3D model file of the part to be processed according to the file format, and to convert the parsing results into feature representations in units of regions. The feature representations include tilt angle, normal field, curvature description value, surface type and format source mark.

[0155] The process decision engine is used to assign processing strategies to the parts to be processed according to a predetermined two-level processing method, combined with feature representation;

[0156] The multi-format adaptive five-axis tool axis planning module is used to adaptively select the corresponding normal based on the format source mark. Based on the normal, it calculates the tool axis direction by combining the tilt angle and side tilt angle constraints. Based on the geometric compensation framework of the tool contact point, tool center point and tool reference point, it converts the tool contact point and tool axis direction into machine tool motion command coordinates.

[0157] The toolpath generation and residual height drive step distance adaptive module is used to calculate the allowable step distance of each tool position point based on the curvature description value and the specified target residual height, and generate the target toolpath of the part to be machined; based on the machine tool motion command coordinates and the target toolpath, it outputs a digital control program file.

[0158] In one embodiment, the multi-format model parsing and unified feature extraction module is further configured to perform topological parsing on the 3D model file when the file format is parametric surface format, establish a topological graph, and extract the shared edge relationships between each surface patch; perform surface type identification on each surface patch of the 3D model file to obtain the surface type of each surface patch, and calculate the precise normal and principal curvature of each surface patch, and calculate the Gaussian curvature and average curvature based on the principal curvature; and obtain the region representation of each surface patch based on the surface type, precise normal, and principal curvature of each surface patch as the parsing result.

[0159] In one embodiment, the multi-format model parsing and unified feature extraction module is also used to identify manufacturing features of a surface group composed of topologically connected surface patches; and to write the feature type of the identified manufacturing features into the region representation of each surface patch in the surface group.

[0160] In one embodiment, the multi-format model parsing and unified feature extraction module is further configured to perform connectivity analysis on the 3D model file when the file format is a triangular mesh format, establish a triangular patch adjacency graph, and perform region segmentation according to the rule that adjacent triangular patches with similar normal vector directions are divided into the same region; calculate the smooth normal and surrogate curvature of each triangular patch in the 3D model file; the smooth normal of each triangular patch is the area-weighted average normal of its adjacent triangular patches, and the surrogate curvature is the mean and maximum value of the dihedral angles of its adjacent triangular patches; and obtain the region representation of each triangular patch based on the smooth normal and surrogate curvature of each triangular patch as the parsing result.

[0161] In one embodiment, the multi-format model parsing and unified feature extraction module is also used to perform mesh health checks on the 3D model file to obtain a health score; if the health score does not reach the qualified threshold, automatic repair is performed until the health score reaches the qualified threshold.

[0162] In one embodiment, the two-stage processing method involves first performing global roughing on the entire workpiece, and then performing fine processing on each region. The process decision engine is also used to remove the blank using an offset region clearing strategy during the global roughing stage. During the fine processing stage, a predetermined fine processing strategy table is queried based on the feature representation of each region to obtain a matching fine processing strategy.

[0163] In one embodiment, the process decision engine is further configured to, for any given region, determine the matching fine machining strategy as a planar region clearing strategy if the region's tilt angle is less than a first tilt angle threshold and its curvature description value is less than a first curvature threshold; determine the matching fine machining strategy as a curved surface streamline machining strategy if the region's tilt angle is greater than or equal to the first tilt angle threshold and less than a second tilt angle threshold; determine the matching fine machining strategy as a Z-axis contour finishing strategy if the region's tilt angle is greater than or equal to the third tilt angle threshold, or if the surface type is a cylindrical surface or a conical surface; and determine the matching fine machining strategy as a five-axis side-edge machining strategy if the region's curvature description value is greater than the second curvature threshold.

[0164] In one embodiment, the multi-format adaptive five-axis tool axis planning module is further configured to use an exact normal if the format source is marked as a parametric surface format; use a smooth normal if the format source is marked as a triangular mesh format; and use a normal after consistent alignment at the boundaries of the two format regions if the format source is marked as a mixed scene containing parametric surface format and triangular mesh format. Spherical linear interpolation is used to perform multi-round iterative smoothing processing on the tool axis sequence.

[0165] In one embodiment, the toolpath generation and residual height drive step distance adaptive module is also used to obtain the tool radius; at each tool position point, the effective curvature radius is calculated based on the curvature description value corresponding to the tool position point and the tool radius; the effective curvature radius and the target residual height are input into the residual height formula to calculate the allowable step distance of the tool position point.

[0166] In one embodiment, the toolpath generation and residual height drive step pitch adaptive module is also used to perform tool-workpiece collision detection at each tool position point; adjust the tool positions where the detection result is a collision, and if the collision still cannot be eliminated after adjustment, perform filtering to obtain a filtered toolpath; perform global sorting optimization on the filtered toolpaths of each region, and output a digital control program file based on the machine tool motion command coordinates and the optimized toolpaths.

[0167] refer to Figure 10To illustrate the overall flowchart of the five-axis CNC machining programming method through various modules, the system receives three-dimensional model files in parametric surface format, triangular mesh format, and other formats as input. After passing through the following four core functional modules, it finally outputs NC program files that can be used for five-axis CNC machine tools.

[0168] Module 1: Multi-format model parsing and unified feature extraction module.

[0169] This module accepts 3D model files in parametric surface format such as STEP / IGES or triangular mesh format such as STL / OBJ as input. Different methods are used to parse the two formats. For parametric surface files, B-rep topology analysis, analytical surface type identification, and accurate normal and curvature extraction are performed; optionally, manufacturing feature pre-identification can also be performed. For triangular mesh files, health checks and repairs, connectivity region segmentation, dihedral curvature proxy calculation, and area-weighted smoothing normal calculation are performed.

[0170] The outputs of the two paths are uniformly transformed into a unified feature representation at the region level through a unified region feature representation layer, which includes tilt angle, curvature description value, surface type, normal field and format source markup.

[0171] Module 2: Full-process automated process decision engine driven by material parameter tables.

[0172] Based on the unified feature representation (tilt angle, curvature description, surface type, etc.) output by Module 1 and the material type specified by the user, this module automatically assigns machining strategies and cutting parameters to each process according to a two-level decision framework of first global roughing and then regional finishing.

[0173] Specifically, the processing strategy is automatically allocated according to the two-level process decision framework: First, global roughing is performed on the entire area (using the offset area removal strategy); after the roughing is completed, based on the tilt angle classification, curvature description and material parameter file of each area, fine processing strategies (planar area removal, curved surface streamline processing, Z-axis contour line finishing, side edge processing or residual material removal strategy) are allocated to different types of areas.

[0174] Module 3: Multi-format adaptive five-axis tool axis planning module.

[0175] This module adaptively selects either precise analytical normal (parametric surface format) or area-weighted smoothed normal (triangular mesh format) based on the region's format source markers. Building upon this, it calculates the tool axis direction using tilt and yaw angle constraints, and smooths the tool axis sequence through SLERP spherical interpolation. Furthermore, based on the TRP / CC / TCP unified geometric compensation framework, it converts the tool contact point and tool axis direction into machine tool motion command coordinates, supporting forward / inverse kinematic transformations for swivel head, rotary table, and hybrid machine tool structures.

[0176] This module consists of four sub-steps:

[0177] Sub-step 3a: Adaptively select the normal based on the format source of the region. That is: for regions from parametric surface format, directly use the analytically accurate normal; for regions from triangular mesh format, use the area-weighted smoothed normal; perform normal consistency alignment at the boundaries of the two types of regions.

[0178] Sub-step 3b: Calculation of tool axis direction and control of forward / side tilt angle.

[0179] Sub-step 3c: SLERP spherical interpolation tool axis smoothing.

[0180] Sub-step 3d: Establish a unified geometric compensation framework for TRP / CC / TCP. Based on the user-configured machine tool structure parameters (swivel head / rotary table / hybrid), automatically complete the forward / inverse kinematic transformation from TRP to machine tool axis coordinates (X / Y / Z / A / C or X / Y / Z / B / C), and generate correct NC instructions.

[0181] Module 4: Toolpath Generation and Residual Height Drive Step Angle Adaptive Module.

[0182] This module generates the final toolpath based on the machining strategy determined in Module 2 and the tool axis direction planned in Module 3, and automatically adjusts the step distance through the residual height driving mechanism. It is applicable to both input formats.

[0183] Specifically, the effective radius of curvature is adaptively calculated based on the region of origin. The allowable step distance for each tool position is calculated based on the target residual height, and the step distance adaptive toolpath generation driven by residual height is executed; BVH accelerated tool-workpiece collision detection is performed for each tool position, the tilt angle of the colliding tool position is automatically adjusted, and the NC program file is output.

[0184] The following beneficial effects can be achieved through this solution:

[0185] 1. Break down the barriers between multiple formats and establish a unified automatic programming channel: This solution uses a unified regional feature representation layer to process inputs such as parametric surface formats like STEP / IGES and triangular mesh formats like STL / OBJ in a unified manner. Engineers can use the same programming process to process precision parts (STEP source) and reverse-engineered parts (STL source), completely eliminating the format barriers of existing tools and covering different application scenarios such as precision parts, figurine carving, cultural relic replication, and reverse engineering.

[0186] 2. Fully utilize the precise geometric information in parametric surface format files to improve programming accuracy: the precise principal curvature of the parametric surface format path is used for adaptive calculation of residual height step distance, the precise normal is used for tool axis planning, the analytical surface type is used for strategy allocation (such as the automatic triggering of side cutting edge strategy for cylindrical surfaces), and the B-rep topology is used for toolpath sequence optimization. The rich geometric information in the parametric surface format file is fully transformed into improved programming quality, achieving higher toolpath accuracy than the pure triangular mesh format system.

[0187] 3. Robust processing of triangular mesh format, adapting to low-quality mesh input: Six types of defect detection and automatic repair ensure the usability of 3D models with low-quality triangular mesh format. Area-weighted neighborhood smoothing of normal effectively suppresses normal noise in scanned and repaired parts. Dihedral curvature proxy is robust to noise, ensuring that high-quality five-axis toolpaths can still be generated in scenarios without parametric surface information.

[0188] 4. Full-process automatic decision-making, covering the complete process chain from roughing to finishing: The two-level process decision framework automatically completes the full process planning from roughing to finishing. The decoupled design driven by the material parameter table enables the system to support multiple materials out of the box for both input formats. Adding new materials or processing scenarios only requires configuring the JSON file, without modifying the algorithm, and has good scalability.

[0189] 5. High-quality five-axis tool axis, stable machine tool movement: Adaptive normal selection ensures that both paths use the highest available quality normal; SLERP spherical interpolation tool axis smoothly eliminates abrupt changes in rotation axis; dual control of tilt angle and lateral tilt angle avoids singularities in ball end mills, comprehensively improving the quality of machined surfaces; precise STEP input can further improve the accuracy of tool axis planning.

[0190] 6. Uniform residual height and adaptive step size are effective for both formats: The unified residual height-driven step size formula is applicable to both parametric surface format (precise curvature) and triangular mesh format (proxy curvature) inputs. The step size is automatically reduced in high curvature areas and automatically increased in low curvature areas, achieving global uniformity of residual height. It can balance machining quality and efficiency under both input formats.

[0191] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0192] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 11 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a five-axis CNC machining programming method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0193] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0194] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0195] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0196] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0197] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0198] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0199] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A five-axis CNC machining programming method, characterized in that, The method includes: Determine the file format of the 3D model file of the part to be processed; According to the file format of the 3D model file, the 3D model file is geometrically analyzed, and the analysis results are uniformly converted into feature representations in units of regions; the feature representations include tilt angle, normal field, curvature description value, surface type, and format source mark; According to the predetermined two-level processing method, and in combination with the feature representation, a processing strategy is assigned to the part to be processed; The corresponding normal is adaptively selected based on the format source mark. The tool axis direction is calculated based on the normal and combined with the tilt angle and side tilt angle constraints. Based on the geometric compensation framework of the tool contact point, tool center point and tool reference point, the tool contact point and tool axis direction are converted into machine tool motion command coordinates. The allowable step distance for each tool position is calculated based on the curvature description value and the specified target residual height, and the target toolpath for the part to be machined is generated; a digital control program file is output based on the machine tool motion command coordinates and the target toolpath.

2. The method according to claim 1, characterized in that, The step of performing geometric analysis on the 3D model file according to its file format includes: When the file format is parametric surface format, topological parsing is performed on the 3D model file to establish a topological graph and extract the shared edge relationships between each surface patch; For each surface patch in the 3D model file, surface type identification is performed to obtain the surface type of each surface patch, and the precise normal and principal curvature of each surface patch are calculated. Based on the principal curvature, Gaussian curvature and average curvature are calculated. The region representation of each surface patch is obtained based on its surface type, precise normal, and principal curvature, and is used as the analytical result.

3. The method according to claim 2, characterized in that, The method further includes: Identify manufacturing features for a group of surfaces composed of topologically connected surface patches; The feature types of the identified manufacturing features are written into the region representation of each surface patch in the surface group.

4. The method according to claim 1, characterized in that, The step of performing geometric analysis on the 3D model file according to its file format includes: When the file format is a triangular mesh format, connectivity analysis is performed on the three-dimensional model file to establish a triangular patch adjacency graph, and the region is segmented according to the rule that adjacent triangular patches with similar normal vector directions are divided into the same region; Calculate the smooth normal and surrogate curvature of each triangle in the 3D model file; the smooth normal of each triangle is the area-weighted average normal of its adjacent triangles, and the surrogate curvature is the mean and maximum value of the dihedral angles of its adjacent triangles. The region representation of each triangle is obtained based on the smooth normal and surrogate curvature of each triangle, as the analytical result.

5. The method according to claim 4, characterized in that, Before performing connectivity analysis on the 3D model file and building the triangular patch adjacency graph, the following steps are also included: Perform a mesh health check on the 3D model file to obtain a health score; If the health score does not reach the qualified threshold, automatic repair will be performed until the health score reaches the qualified threshold.

6. The method according to claim 1, characterized in that, The two-stage processing method involves first performing overall rough machining on the entire workpiece, and then performing fine machining on each area. The process of assigning a processing strategy to the part to be processed according to a predetermined two-level processing method, combined with the feature representation, includes: In the global roughing stage, an offset region removal strategy is used to remove the blank; During the refinement stage, based on the feature representation of each region, a pre-defined refinement strategy table is queried to obtain a matching refinement strategy.

7. The method according to claim 6, characterized in that, In the fine-tuning stage, based on the feature representation of each region, a predetermined fine-tuning strategy table is queried to obtain a matching fine-tuning strategy, including: For any given region, if the tilt angle of the region is less than the first tilt angle threshold and the curvature description value is less than the first curvature threshold, then the matching fine-tuning strategy is determined to be the planar region clearing strategy. If the tilt angle of the region is greater than or equal to the first tilt angle threshold and less than the second tilt angle threshold, then the matching fine processing strategy is determined to be the surface streamline processing strategy. If the dip angle of the region is greater than or equal to the second dip angle threshold and less than the third dip angle threshold, then the matching fine-machining strategy is determined to be the Z-axis contour fine-machining strategy. If the tilt angle of the region is greater than or equal to the third tilt angle threshold, or the surface type is a cylindrical surface or a conical surface, then the matching fine machining strategy is determined to be a five-axis side-cutting machining strategy. If the curvature description value of the region is greater than the second curvature threshold, then the matching fine processing strategy is determined to be the residual material removal strategy.

8. The method according to claim 1, characterized in that, The step of adaptively selecting the corresponding normal based on the format source marker includes: If the format source is marked as parametric surface format, the normal used is the exact normal; If the source format is marked as triangular mesh format, the normal used is the smooth normal; If the format source is marked as a mixed scene containing parametric surface format and triangular mesh format, the normal used is the normal after consistent alignment at the boundary of the two format regions.

9. The method according to claim 1, characterized in that, The step of adaptively selecting the corresponding normal based on the format source marker, and calculating the tool axis direction based on the normal and combined with the tilt angle and side tilt angle constraints, further includes: Spherical linear interpolation is used to perform multiple rounds of iterative smoothing on the tool axis sequence.

10. The method according to claim 1, characterized in that, The calculation of the allowable step distance for each tool position based on the curvature description value and the specified target residual height includes: Obtain the tool radius; At each tool position point, the effective radius of curvature is calculated based on the curvature description value corresponding to that tool position point and the tool radius. Input the effective radius of curvature and the target residual height into the residual height formula to calculate the allowable step distance of the tool position.

11. The method according to claim 1, characterized in that, After calculating the allowable step distance for each tool position based on the curvature description value and the specified target residual height, and generating the target toolpath for the part to be machined, the process further includes: Perform tool-workpiece collision detection at each tool position point; Adjust the tool positions where the detection result indicates a collision. If the collision still cannot be eliminated after adjustment, perform filtering to obtain the filtered toolpath. The filtered toolpaths for each region are globally sorted and optimized. Based on the machine tool motion command coordinates and the optimized toolpaths, a digital control program file is output.

12. A five-axis CNC machining programming system, characterized in that, The system includes: The multi-format model parsing and unified feature extraction module is used to perform geometric parsing on the three-dimensional model file of the part to be processed according to the file format of the three-dimensional model file, and to uniformly convert the parsing results into feature representations in units of regions; the feature representations include tilt angle, normal field, curvature description value, surface type and format source mark; A process decision engine is used to assign processing strategies to the parts to be processed according to a predetermined two-level processing method, combined with the feature representation; The multi-format adaptive five-axis tool axis planning module is used to adaptively select the corresponding normal according to the format source mark, and calculate the tool axis direction based on the normal and combined with the tilt angle and side tilt angle constraints; based on the geometric compensation framework of the tool contact point, tool center point and tool reference point, the tool contact point and tool axis direction are converted into machine tool motion command coordinates; The toolpath generation and residual height drive step distance adaptive module is used to calculate the allowable step distance of each tool position point according to the curvature description value and the specified target residual height, and generate the target toolpath of the part to be machined; and output the digital control program file according to the machine tool motion command coordinates and the target toolpath.