Real-time cutting simulation method and system for staged processing

By switching between voxel meshes and triangular meshes in stages, the contradiction between efficiency and accuracy in real-time cutting simulation is resolved. This achieves efficient real-time interaction in the roughing stage and high-precision simulation in the finishing stage, and is applicable to CNC machining and virtual manufacturing scenarios.

CN121328138APending Publication Date: 2026-01-13AVICIT CO LTD

Patent Information

Application Number
CN202511568520.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing solid cutting simulation technology cannot simultaneously meet the requirements of real-time performance and high precision, especially in the entire cutting process from roughing to finishing. Existing single discrete models cannot resolve the contradiction between efficiency and accuracy.

Method used

A phased real-time cutting simulation method is adopted. Initially, voxel meshes are used for low-precision real-time cutting, and then triangular meshes are used for high-precision cutting. The transition is achieved through voxel boundary extraction-patch fitting algorithm, combined with multi-dimensional switching trigger conditions to adapt to the needs of different machining stages.

Benefits of technology

It achieves improved accuracy of final simulation results while ensuring real-time interaction, adapts to different cutting scenarios, reduces computational costs, and ensures the reliability and continuity of simulation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121328138A_ABST
    Figure CN121328138A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer-aided manufacturing, and provides a staged processing real-time cutting simulation method and system.The method comprises the steps that S1, initialization modeling is conducted, specifically, a blank voxel grid model, a tool body voxel grid and a triangular grid are built; s2, performing a first simulation stage of low-precision real-time cutting dominated by voxel grids, judging a space overlapping relationship between the tool body voxel grids and the blank voxel grids in real time so as to determine a voxel region to be removed, and deleting blank voxels in the overlapping region through Boolean operation; s3, in the execution process of the first simulation stage, monitoring a preset multi-dimensional switching trigger condition in real time, and when any condition or a combination of multiple conditions is met, entering a second simulation stage; and S4, a second simulation stage of high-precision real-time cutting with the triangular network as the dominant is carried out, the voxel grid intermediate workpiece is converted into a transition triangular grid, and high-precision cutting calculation is carried out based on the triangular grid. And the efficiency-precision contradiction is broken through through a staged strategy.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer-aided manufacturing, and particularly to a real-time cutting simulation method and system with phased processing. BACKGROUND

[0002] The core requirements of physical cutting simulation are real-time performance (simulating tool movement and material removal process synchronously to meet human-computer interaction or online verification requirements) and accuracy (the final simulation result accurately reflects the geometry of the workpiece to support subsequent machining parameter optimization or process verification). The existing technology mainly realizes material removal and collision detection through a "single discrete model", which makes different compromises between efficiency and accuracy, but cannot meet both requirements at the same time. Specifically, there are four typical technical solutions, including voxel, triangular mesh, dexel, and tri-dexel. Dexel and tri-dexel are improved solutions proposed in recent years to address the "voxel-triangular mesh contradiction", and belong to the closest prior art of the present application.

[0003] The existing technology mainly relies on a single mesh model to achieve the following solutions: I. Voxel mesh Core principle: discretize the three-dimensional space of the workpiece into regular cubic units (voxels), and realize the geometric expression of the workpiece by recording the binary state (retained / deleted) of each voxel "whether it belongs to material"; collision detection and material removal are converted into "spatial overlap judgment of tool voxels and blank voxels", which only needs to traverse the voxel units to complete the operation.

[0004] Advantages: simple operation logic, no need to maintain complex topological relationships, high efficiency (regular workpiece simulation frame rate can reach 30~60fps), can easily meet the real-time cutting simulation requirements in the rough machining stage; low hardware resource consumption, ordinary computer can run smoothly.

[0005] Defects: there is an inherent "step effect" - the regularity of voxel units causes the workpiece boundary to be jagged, and the accuracy completely depends on the voxel resolution; if the accuracy needs to be improved (such as reducing the voxel edge length from 0.2mm to 0.05mm), the number of voxels will increase by a factor of three (when the volume remains unchanged, the number increases by 64 times), and the amount of calculation will increase exponentially, ultimately still cannot balance "high resolution + real-time performance", the boundary error is usually greater than 0.1mm, which cannot meet the accuracy requirements of the final workpiece.

[0006] II. Triangular mesh Core principle: fit the workpiece surface by irregular triangle patches, build a continuous 3D geometric model; collision detection needs to calculate the intersection relationship between tool triangle patches and workpiece triangle patches (such as line segment-patch, patch-patch intersection), material removal needs to update the workpiece model through topological reconstruction (patch segmentation, fragment merging, redundant patch deletion).

[0007] Advantages: continuous and fine geometric expression, triangle patches can flexibly adapt to complex surfaces (such as free-form surfaces, thin walls, sharp corners), high precision (boundary error can be controlled within 0.001~0.01mm, surface roughness simulation error ≤0.1μm), can meet the precise verification requirements of workpiece shape in the finishing stage.

[0008] Defects: the operation complexity is positively related to the number of triangle patches - the number of triangle patches of complex workpieces (such as aircraft engine blades, precision molds) can reach millions to tens of millions, and when collision detection is performed, a large number of patch pairs need to be traversed, and when material removal is performed, the topological relationship needs to be frequently updated, resulting in extremely low operation efficiency (regular frame rate is less than 5fps, complex workpieces are even less than 1fps), which completely cannot meet the interactive requirements of real-time simulation.

[0009] Three, Dexel Dexel (Depth Element) method is a compromise solution for "voxel regular discretization" and "triangle mesh topological complexity", and has been widely used in medium-precision cutting simulation scenarios in recent years.

[0010] Core principle: (1) based on the two-dimensional depth buffer idea, the three-dimensional workpiece is discretized into parallel "dexel rays" (one-dimensional line segments) along a fixed direction (such as Z-axis), and the intersection points of each ray and the workpiece surface form "depth intervals" (record the starting and ending depths of the ray passing through the workpiece), and the workpiece geometric expression is realized by storing the depth intervals of all rays. (2) Material removal: update the dexel depth interval of the overlapping area (such as shorten the depth interval, split the interval), no need to maintain the three-dimensional topological relationship. (3) Collision detection: calculate the projection range of the tool along the dexel ray direction, judge the overlapping part with the workpiece depth interval, determine the area to be removed; Advantages: (1) reduced dimensionality (from three-dimensional voxel to one-dimensional ray), higher operation efficiency than triangle mesh (complex workpiece frame rate can reach 10~20fps), and the accuracy along the ray direction can be flexibly adjusted (such as increasing the ray density); (2) avoid the "staircase effect" of voxel, the workpiece boundary along the ray direction shows continuous linear characteristics, the accuracy is higher than that of voxel mesh (the boundary error can be controlled within 0.05~0.1mm); (3) data storage is smaller than voxel mesh (only store the ray depth interval, no need to record the empty voxel), moderate hardware resource consumption.

[0011] Defects: (1) Strong direction dependence: dexel ray direction is fixed (such as only along the Z axis), if the included angle between the workpiece curved surface and the ray direction is too small (such as inclined plane, complex free curved surface), the "stripe effect" (the boundary is in discrete stripe shape) will appear, and the precision will be significantly reduced; if multi-directional rays (such as X / Y / Z three-axis simultaneous discretization) are used to improve accuracy, the data redundancy will be multiplied, the complexity of Boolean operation will be increased, and the real-time advantage will disappear; (2) Poor adaptation to complex features: for thin-walled (thickness <0.5mm), sharp corners (radius <0.1mm) and other fine features, the ray density needs to be greatly improved to accurately capture, at this time the calculation amount is close to voxel grid, and the real-time performance cannot be guaranteed; (3) Insufficient final accuracy: even if multi-directional rays are used, dexel method still relies on one-dimensional discrete interval to express three-dimensional geometry, and there is a substantial gap in boundary smoothness compared with triangular mesh (error is usually ≥0.05mm), which cannot meet the final simulation requirements of high-precision workpieces (such as medical device parts, precision instrument core parts).

[0012] Four, tri-dexel Tri-dexel is an advanced improvement of dexel method, aiming to combine the "geometric fineness" of triangular mesh with the "operational efficiency" of dexel method, and is currently the mainstream exploration direction in the field of medium and high precision cutting simulation, and also belongs to the closest prior art of the present application.

[0013] Core principle: (1) Take the triangular mesh as the "surface geometric reference" of the workpiece, and emit dexel rays along the preset direction (such as the normal vector direction, the coordinate axis direction) at each vertex or face center of the triangular mesh, and the rays penetrate the interior of the workpiece and record the depth information; through the mixed model of "surface triangular mesh + internal dexel ray", the "surface continuity + internal discretization" expression of the workpiece geometry is realized. (2) Material removal: the surface area is updated by triangular face topology (to ensure the accuracy of fine features), and the internal area is updated by dexel depth interval (to reduce the calculation amount). (3) Collision detection: surface collision is judged by triangular face intersection (to ensure surface accuracy), and internal collision is judged by dexel ray depth interval (to improve efficiency); Advantages: (1) Higher accuracy than traditional dexel method: the surface is fitted by triangular mesh, avoiding "stripe effect", and the expression accuracy of fine features (such as sharp corners, curved surfaces) is close to pure triangular mesh (boundary error can be controlled within 0.02-0.05mm); (2) Higher efficiency than pure triangular mesh: the interior is discretized by dexel, without the need for topology update of all triangular faces, and the frame rate of complex workpieces can reach 15-25fps, balancing the needs of medium accuracy and medium real-time performance.

[0014] Defects: (1) "efficiency-precision" balance is still a bottleneck: if the high precision requirement (error ≤0.01mm) of the final workpiece needs to be met, the surface triangle and internal dexel ray density needs to be encrypted, at this time the calculation amount is close to pure triangle mesh, the real-time performance decreases significantly (frame rate <10fps); if the real-time performance is to be guaranteed (frame rate ≥20fps), the internal dexel ray density is insufficient, and simulation errors such as "internal void" or "material residue" are prone to occur; (2) model consistency maintenance is complex: the mixed model of "surface triangle mesh + internal dexel" needs to be updated synchronously, when the cutting process involves a large number of surface topological changes (such as deep cavity cutting, multi-tool collaborative cutting), it is easy to appear "surface and internal geometry mismatch" (such as surface patch has been deleted but internal dexel has not been updated), which leads to distorted simulation results; (3) limited scene adaptability: for the rough machining stage (large material removal amount, low precision requirement), the surface triangle mesh of tri-dexel method still needs to participate in operation, which is less efficient than voxel grid (voxel frame rate ≥30fps); for the finishing stage (high precision requirement), the internal dexel discretization still introduces errors, and the precision is lower than that of pure triangle mesh.

[0015] In summary, the field of solid cutting simulation has been limited by the inherent defects of "single discrete model" for a long time. Although the voxel grid can meet the real-time performance, it is not accurate enough. Although the triangle mesh is excellent in accuracy, it is low in efficiency. As a targeted improvement scheme, dexel and tri-dexel can achieve a certain compromise between efficiency and accuracy, but they still have problems such as strong direction dependence, poor adaptation to complex features, "efficiency-precision" balance bottleneck, and difficulty in maintaining model consistency. They cannot completely solve the core contradiction between real-time performance and high precision requirement, especially they cannot adapt to the whole process cutting scene from rough machining to finishing. Therefore, an innovative simulation method that can dynamically adjust the model according to the requirements of different stages and balance real-time interaction and final accuracy is urgently needed. SUMMARY

[0016] To solve the above problems, the purpose of the present application is to provide a real-time cutting simulation method and system for processing in stages, which is particularly suitable for real-time cutting process visualization and final workpiece precision verification in scenes such as numerical control machining process simulation, virtual manufacturing, and tool path verification. Especially for the problem that "simulation real-time performance" and "result accuracy" are difficult to balance, according to the different stage requirements of cutting simulation, a stage-by-stage solving strategy is provided. In the middle stage with low precision requirement and high speed requirement, voxel grid is used, and in the final stage with high precision requirement and relatively relaxed speed requirement, triangle mesh is used. Through the stage-by-stage strategy, the "efficiency-precision" contradiction is broken, and the accuracy of the final simulation result is improved while ensuring real-time performance.

[0017] The above invention purpose of the present application is realized by the following technical scheme: This invention provides a staged real-time cutting simulation method, comprising the following steps: S1: Perform initial modeling, including building a blank voxel mesh model of the workpiece to be cut to meet the simulation requirements, and generating the corresponding tool voxel mesh and triangular mesh according to the tool model, while setting the basic parameters for real-time cutting simulation. S2: The first simulation stage of low-precision real-time cutting is carried out with voxel mesh as the main component. After the cutting simulation is started, the spatial overlap relationship between the tool voxel mesh and the blank voxel mesh is determined in real time to identify the voxel area to be removed. The blank voxels in the overlapping area are deleted through Boolean operations and the retention / deletion status of the blank voxel mesh is updated. The workpiece shape is rendered based on the updated blank voxel mesh while ensuring that the simulation frame rate meets the real-time interaction requirements. S3: Perform the switching judgment phase. During the execution of the first simulation phase, the preset multi-dimensional switching trigger conditions are monitored in real time. When any condition or combination of multiple conditions is met, the mesh model is switched and the second simulation phase is entered. S4: The second simulation stage of high-precision real-time cutting, dominated by triangular meshes, is carried out. The voxel boundary extraction-patch fitting algorithm is used to convert the intermediate workpiece of the final voxel mesh in the first stage into a transitional triangular mesh. High-precision cutting calculations are performed based on the triangular mesh. Fine material removal is achieved by updating the topology relationship, including patch segmentation, fragment merging, and redundant patch deletion, to eliminate the voxel serration effect. Collision detection is achieved by judging the intersection of the tool triangular mesh and the transitional triangular mesh. The final high-precision workpiece triangular mesh model that meets the requirements of subsequent process verification or parameter optimization is output.

[0018] Further, in step S1, initial modeling is performed, including constructing a blank voxel mesh model of the workpiece to be cut to meet the simulation requirements, and generating corresponding tool voxel meshes and triangular meshes based on the tool model. Simultaneously, the basic parameters for real-time cutting simulation are set, specifically: S11: Generate the blank voxel mesh model of the workpiece to be cut: The pre-set three-dimensional geometric model of the workpiece blank to be cut is discretized using a voxelization algorithm. First, the design dimension parameters and material property parameters of the blank are obtained. Then, the voxel resolution is matched according to the different processing accuracy requirements of the real-time cutting simulation. Subsequently, the three-dimensional geometric model of the blank is mapped to the pre-set voxel mesh coordinate system. The ray method is used to determine whether the center of each voxel falls within the geometric area of ​​the blank. Voxels containing the geometric area of ​​the blank are marked as valid voxels and associated with material properties. Voxels not containing the geometric area of ​​the blank are marked as invalid voxels. Finally, the blank voxel mesh model adapted to the corresponding processing stage is constructed. S12: Generate the voxel mesh and triangular mesh corresponding to the tool: Obtain the type parameters and detailed geometric parameters of the target cutting tool, including end mills, ball end mills, and face mills, and construct a complete three-dimensional geometric model of the tool based on these parameters using a parametric modeling algorithm; Tool Voxel Mesh Generation: To meet the rapid collision detection requirements in the first simulation stage, a voxelization algorithm and resolution parameters that are completely consistent with the blank voxel mesh in the corresponding machining stage are used to discretize the three-dimensional geometric model of the tool, ensuring that the spatial scale of the tool voxels matches that of the blank voxels. The generated tool voxel mesh retains only the effective voxels of the tool cutting edge and tool tip areas, reducing the amount of subsequent collision detection calculations. Tool triangulation generation: To meet the high-precision calculation requirements of the second simulation stage, the Delaunay triangulation algorithm is used to discretize the three-dimensional geometric model of the tool. For the helical cutting edge of the end mill, sampling points are divided along the helical direction at preset angle intervals to ensure the fitting accuracy of the helical tooth profile. For the spherical part of the ball end mill, uniform sampling is performed based on the coordinates of the sphere center and the radius to control the deviation of the normal vector of the spherical surface to be less than the preset angle, thus avoiding sawtooth errors during spherical cutting simulation. S13: Set the basic parameters for real-time cutting simulation: Determine the specific dimensions of the blank; plan the tool motion path parameters, including the starting coordinates, ending coordinates, path segment trajectory type, and path connection method; determine the cutting process parameters, including feed rate and depth of cut; and pre-set the trigger condition threshold for multi-dimensional mesh switching. All basic parameters are stored in the parameter database of the simulation system to support real-time calling and dynamic adjustment in subsequent simulation stages.

[0019] Further, in step S2, a first simulation stage of low-precision real-time cutting based on voxel mesh is performed. After the cutting simulation is started, the spatial overlap relationship between the tool voxel mesh and the blank voxel mesh is determined in real time to identify the voxel region to be removed. Boolean operations are used to delete the blank voxels in the overlapping region and update the retain / delete status of the blank voxel mesh. The workpiece shape is rendered based on the updated blank voxel mesh, ensuring that the simulation frame rate meets the real-time interaction requirements. Specifically: S21: Start cutting simulation and initialize voxel mesh data: Call the motion control module of the simulation system, load the tool running path and cutting process parameters set in step S1, map the tool voxel mesh and the blank voxel mesh to the same world coordinate system; initialize the voxel mesh data buffer, initialize the retain / delete status of the blank voxel mesh to retain, and mark the tool voxel mesh as an active cutting element to provide a data basis for subsequent collision detection and material removal; S22: Perform real-time collision detection to determine the voxel region to be removed: Employ a dual detection logic of coordinate comparison + volume overlap determination to obtain the current position data of the tool body voxel mesh in real time; perform unit-by-unit coordinate matching between the tool body voxels and the blank voxels, and determine whether there is spatial overlap between them based on preset spatial overlap determination conditions; add all blank voxels determined to be spatially overlapped to the voxel list to be removed, and simultaneously record their spatial coordinates and the blank region to which they belong; dynamically adjust the collision detection frequency according to the feed rate to balance the real-time performance of detection and the computational load of the system. S23: Perform material removal and update voxel status via Boolean operations: Based on the list of voxels to be removed, call the geometry calculation module of the simulation system to perform a Boolean difference operation between the blank voxel mesh and the tool voxel mesh; delete the geometric data of all blank voxels in the list of voxels to be removed, update the retention / deletion state matrix of the blank voxel mesh, update the corresponding matrix position of the deleted voxels to deletion, and retain the retention state of non-overlapping blank voxels; at the same time, record the number of voxels removed and the cutting depth each time, and generate real-time cutting quantity statistics for operators to monitor the roughing progress; S24: Real-time rendering to meet interactive needs: A voxel ray casting rendering algorithm is used to construct a workpiece visualization model based on the updated blank voxel mesh data; a hierarchical rendering optimization strategy based on viewing distance is adopted to adjust the rendering resolution for areas with different viewing distances, simplifying the rendering data volume of non-critical areas while ensuring visual details; different color mappings are used to distinguish the uncut, cut, and uncut areas of the workpiece, ensuring that operators can intuitively distinguish the cutting progress; the rendering module, collision detection, and material removal modules adopt a parallel computing architecture to avoid the rendering process occupying core computing resources and ensure real-time interactive response speed.

[0020] S25: Defining the Accuracy Priority of Each Stage: This stage focuses on real-time performance and roughing progress feedback. The output is a voxel mesh intermediate workpiece used for subsequent triangular mesh conversion, rather than the final high-precision product. The sawtooth effect and dimensional accuracy deviation caused by voxel discretization can be ignored and will not affect the high-precision correction process in the subsequent second simulation stage.

[0021] Furthermore, in step S3, a switching judgment phase is performed. During the execution of the first simulation phase, preset multi-dimensional switching trigger conditions are monitored in real time. When any condition or a combination of conditions is met, the mesh model is switched, and the second simulation phase begins. Specifically: S31: Monitoring Module Initialization and Data Linkage: Call the switching monitoring module of the simulation system and load the multi-dimensional switching trigger condition thresholds preset in step S1; at the same time, establish a real-time data interaction channel between the switching monitoring module and the core calculation module of the first simulation stage to ensure that the monitoring module can obtain the dynamic data of the first stage in real time, including the remaining material status of the workpiece, the current cutting process parameters, the real-time geometric shape of the workpiece, and the information of the executed cutting path, so as to provide complete data support for the real-time determination of the trigger conditions; S32: Real-time monitoring of multi-dimensional triggering conditions: The switching monitoring module monitors the loaded multi-dimensional switching triggering conditions in real time according to the preset logic; the multi-dimensional switching triggering conditions cover core dimensions including geometric features, processing stage, accuracy requirements, and time cost. During the monitoring process, the current state of each dimension condition is determined in real time through a coherent process of data acquisition, feature extraction, and threshold comparison to confirm whether the preset triggering standard has been met. S33: Condition Satisfaction Judgment and Switching Execution: The switching monitoring module adopts a composite judgment mechanism of OR logic + AND logic to integrate the monitoring results of trigger conditions in each dimension in real time. If the trigger condition of any dimension reaches the preset standard, or the trigger conditions of multiple dimensions simultaneously reach the corresponding preset standard, a mesh switching trigger signal is immediately generated. This signal is synchronously sent to the control units of the first simulation stage and the second simulation stage. After receiving the signal, the first stage control unit stops the current cutting simulation operation and saves the complete data of the intermediate workpiece of the final voxel mesh in the first stage. After receiving the signal, the second stage control unit starts the initialization process of high-precision calculation, realizing the smooth connection and process switching between the two stages.

[0022] Furthermore, in step S3, the multi-dimensional switching trigger conditions for the voxel-triangular mesh phased process need to balance the adaptability to the machining scenario with the accuracy-efficiency balance, avoiding the limitations of a single condition. This includes five types of flexibly combinable switching trigger conditions, covering dimensions including geometric features, machining stage, accuracy requirements, and time cost, adapting to different cutting scenarios including roughing-semi-finishing-finishing and simple workpieces-complex workpieces. Specifically, these include: Remaining material volume ratio condition: The ratio of the remaining workpiece volume to the original blank volume is used as the judgment basis. When the ratio is less than or equal to the preset threshold, it is triggered. It is applicable to general scenarios and cutting scenarios where there are no special requirements for the complexity of the workpiece, including finishing after rough milling of block blanks. Cutting stage type conditions: The criteria for judgment are whether the cutting process has entered the finishing stage; applicable to multi-stage machining scenarios including rough milling → semi-finish milling → finish milling, and finish milling stage triggering switching. Workpiece geometric feature complexity condition: The criterion is whether the workpiece has high-precision sensitive features; applicable to complex workpiece scenarios including aerospace parts, precision molds, and sensitive features that require high-precision simulation. Preset accuracy threshold conditions: The criteria for judgment are whether the surface roughness and dimensional error required by the simulation meet the high-precision standards; applicable to high-precision machining scenarios including precision instrument parts and medical equipment parts. Remaining cutting time threshold condition: Based on the estimated remaining cutting time based on toolpath length and feed rate, it is triggered when the remaining cutting time is less than or equal to a preset value; it is suitable for fast simulation scenarios that prioritize real-time performance, including scenarios that quickly verify toolpaths and avoid long waiting times at the end.

[0023] Further, in step S4, a second simulation stage of high-precision real-time cutting, dominated by triangular meshes, is performed. A voxel boundary extraction-patch fitting algorithm is used to convert the final voxel mesh intermediate workpiece from the first stage into a transitional triangular mesh. High-precision cutting calculations are performed based on the triangular mesh. Fine material removal is achieved through topological updates, including patch segmentation, fragment merging, and redundant patch deletion, to eliminate voxel serration effects. Collision detection is achieved by judging the intersection of the tool triangular mesh and the transitional triangular mesh patches. The final high-precision workpiece triangular mesh model, meeting the requirements of subsequent process verification or parameter optimization, is output. Specifically: Mesh transformation: A voxel boundary extraction-triangular patch fitting algorithm, including the Marching Cubes algorithm, is used to perform the transformation operation. Specifically, the voxel boundaries of the intermediate workpieces in the final voxel mesh of the first stage are first identified, and the boundary voxel set at the intersection of the retention and deletion states is selected. The spatial isosurface of this set is then extracted. Based on the geometric curvature distribution of the spatial isosurface, the sampling density of the triangular patches is adjusted. The sampling density of the patches is increased in areas with large curvature changes, and the sampling density is appropriately reduced in areas with gentle curvature to ensure that the geometric shape of the triangular patches and the voxel boundaries are highly matched. Finally, a transitional triangular mesh is generated to achieve a smooth connection between the voxel boundaries and the triangular patches, eliminating the geometric discontinuities caused by voxel discretization. High-precision cutting calculation: Call the high-precision geometric calculation module of the simulation system, load the tool triangular mesh and the transition triangular mesh generated in step S1, first establish the spatial coordinate relationship between the two, and then perform collision detection and fine material removal operations in sequence, and finally output the workpiece triangular mesh model that meets the preset high-precision standard.

[0024] Furthermore, the specific implementation process of the high-precision cutting calculation includes: Collision detection: Based on the intersection judgment logic of the tool triangular mesh and the transition triangular mesh, the specific steps are as follows: First, the spatial range of the faces of the two meshes is pre-screened to exclude face pairs with no possibility of spatial overlap, reducing the amount of computation; then, for potentially intersecting face pairs, the coordinate range of the intersection area and the geometric parameters of the intersection line segments are calculated, and the contact type, including face-to-face contact, edge-to-face contact, and point-to-face contact, is determined by combining the angle relationship between the face normal vectors; finally, based on the calculation results, the geometric boundary, contact area, and contact depth of the cutting contact area are accurately identified, providing precise area positioning for fine material removal; Fine material removal: This is achieved through topology update operations. The specific process is as follows: Patch segmentation: Based on the boundary of the cutting contact area determined by collision detection, and combined with the geometric projection shape of the tool cutting edge, the patches in the contact area of ​​the transition triangular mesh are segmented into sub-patterns that fit the cutting contour; Fragment merging: For isolated sub-patterns that have no topological connection or only single-point connection after segmentation, it is determined whether they meet the merging conditions based on their spatial position relationship with adjacent effective patches and the consistency of their normal vectors. For isolated sub-patterns that meet the conditions, a fusion operation is performed to form a continuous geometric surface; Redundant patch deletion: Patterns that are completely covered by the tool triangular mesh or whose deviation from the workpiece design geometric model exceeds the preset range are selected and deleted; Through the above topology update operations, a difference Boolean operation is performed on the overlapping area of ​​the transition triangular mesh and the tool triangular mesh to achieve high-precision material removal and eliminate the voxel serration effect left over from the first stage; Output results: Generate the final high-precision workpiece triangular mesh model, which must meet the following requirements: geometric accuracy meets the preset standards to ensure the consistency of the shape and size of the key features of the workpiece; the model data can be directly used for subsequent process verification; support parameter optimization analysis to adapt to the application needs of high-precision machining scenarios.

[0025] The present invention also provides a real-time cutting simulation system for performing a real-time cutting simulation method with staged processing as described above, comprising: The initialization modeling module is used for initial modeling, including building a blank voxel mesh model of the workpiece to be cut to meet the simulation requirements, generating the corresponding tool voxel mesh and triangular mesh based on the tool model, and setting the basic parameters for real-time cutting simulation. The first simulation module is used to perform the first simulation stage of low-precision real-time cutting dominated by voxel mesh. After the cutting simulation is started, the spatial overlap relationship between the tool voxel mesh and the blank voxel mesh is determined in real time to determine the voxel area to be removed. The blank voxels in the overlapping area are deleted through Boolean operation and the retention / deletion status of the blank voxel mesh is updated. The workpiece shape is rendered based on the updated blank voxel mesh and the simulation frame rate is guaranteed to meet the real-time interaction requirements. The switching condition monitoring module is used for the switching judgment phase. During the execution of the first simulation phase, it monitors the preset multi-dimensional switching trigger conditions in real time. When any condition or a combination of conditions is met, the mesh model is switched and the second simulation phase begins. The second simulation module is used for the second simulation stage of high-precision real-time cutting dominated by triangular meshes. It uses a voxel boundary extraction-patch fitting algorithm to convert the intermediate workpiece of the final voxel mesh in the first stage into a transitional triangular mesh. Based on the triangular mesh, high-precision cutting calculations are performed. Fine material removal is achieved by updating the topology, including patch segmentation, fragment merging, and redundant patch deletion, to eliminate the voxel serration effect. Collision detection is achieved by judging the intersection of the tool triangular mesh and the transitional triangular mesh. The final high-precision workpiece triangular mesh model that meets the requirements of subsequent process verification or parameter optimization is output.

[0026] A computer device includes a memory and one or more processors, the memory storing computer code that, when executed by the one or more processors, causes the one or more processors to perform the method described above.

[0027] A computer-readable storage medium storing computer code that, when executed, performs the method described above.

[0028] Compared with the prior art, the present invention has at least one of the following beneficial effects: (1) Efficiently balances simulation real-time performance and result accuracy The first simulation stage uses voxel mesh-based computation, which improves computational efficiency by 5 to 10 times compared to traditional full-process triangular mesh computation. It can stably guarantee a simulation frame rate of ≥30fps, meeting the real-time interactive needs of CNC machining simulation, virtual manufacturing and other scenarios, and facilitating operators to monitor the cutting progress in real time. The second simulation stage switches to triangular mesh for high-precision computation, and the final output workpiece triangular mesh model has an accuracy error of ≤0.01mm. It can accurately match the accuracy requirements of the final simulation results in scenarios such as process verification and tool path verification, achieving the dual goal of "ensuring speed in the intermediate stage and ensuring accuracy in the final stage".

[0029] (2) Strong adaptability to multiple scenarios Based on preset multi-dimensional switching trigger conditions (covering geometric features, machining stages, accuracy requirements, time costs, etc.), it can flexibly adapt to different cutting simulation scenarios: it can meet the phased machining process of "roughing-semi-finishing-finishing", adapt to the different complexity requirements of "simple workpieces-complex workpieces", and take into account the real-time priority scenario of "rapid verification of toolpath" and the accuracy priority scenario of "high-precision simulation verification". Moreover, all scenario adaptations do not require modification of the core algorithm, but can be achieved by simply adjusting the trigger condition threshold, which greatly improves the versatility and practicality of the technical solution.

[0030] (3) Significantly optimize computational costs By employing a phased meshing strategy, the drawbacks of two extreme computational methods are avoided: on the one hand, it eliminates the need to use high-resolution voxel meshes throughout the process (reducing unnecessary voxel discretization computation), and on the other hand, it eliminates the need to use triangular meshes throughout the process (avoiding long waiting times caused by fine calculations of triangular facets). Practical application verification shows that compared with traditional single-mesh simulation schemes, this invention can reduce the hardware resource consumption (CPU utilization, memory usage) of the overall simulation process by 30% to 50%, further improving the stability of simulation operation while reducing hardware configuration requirements.

[0031] (4) The simulation results have high reliability and continuity. When switching from the first stage to the second stage, the Marching Cubes algorithm is used to perform the "voxel boundary extraction - triangular patch fitting" operation, which can achieve a smooth transition from the "voxel mesh intermediate workpiece" to the "transition triangular mesh", effectively avoiding problems such as geometric discontinuity and data loss that are prone to occur during mesh switching. At the same time, both stages are based on the same world coordinate system to establish spatial association, ensuring the continuity of cutting position and geometry, and ensuring that the final simulation results can truly reflect the actual cutting process, providing reliable data support for subsequent process optimization and tool path adjustment. Attached Figure Description

[0032] Figure 1 This is an overall flowchart of the real-time cutting simulation method with phased processing according to the present invention; Figure 2 This is a detailed flowchart of the real-time cutting simulation method with phased processing according to the present invention; Figure 3 This is an overall flowchart of the real-time cutting simulation system of the present invention, which processes data in stages. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0034] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0035] First Embodiment like Figure 1 and 2 As shown, this embodiment provides a real-time cutting simulation method with phased processing, including the following steps: S1: Perform initial modeling, including building a blank voxel mesh model of the workpiece to be cut to meet the simulation requirements, and generating corresponding tool voxel meshes and triangular meshes based on the tool model, while setting the basic parameters for real-time cutting simulation.

[0036] In this embodiment, step S1 specifically includes: S11: Generate the blank voxel mesh model of the workpiece to be cut: The pre-set three-dimensional geometric model of the workpiece blank to be cut is discretized using a voxelization algorithm. First, the design dimension parameters and material property parameters of the blank are obtained. Then, the voxel resolution is matched according to the different processing accuracy requirements of the real-time cutting simulation. Subsequently, the three-dimensional geometric model of the blank is mapped to the pre-set voxel mesh coordinate system. The ray method is used to determine whether the center of each voxel falls within the geometric area of ​​the blank. Voxels containing the geometric area of ​​the blank are marked as valid voxels and associated with material properties. Voxels not containing the geometric area of ​​the blank are marked as invalid voxels. Finally, the blank voxel mesh model adapted to the corresponding processing stage is constructed. S12: Generate the voxel mesh and triangular mesh corresponding to the tool: Obtain the type parameters and detailed geometric parameters of the target cutting tool, including end mills, ball end mills, and face mills, and construct a complete three-dimensional geometric model of the tool based on these parameters using a parametric modeling algorithm; Tool Voxel Mesh Generation: To meet the rapid collision detection requirements in the first simulation stage, a voxelization algorithm and resolution parameters that are completely consistent with the blank voxel mesh in the corresponding machining stage are used to discretize the three-dimensional geometric model of the tool, ensuring that the spatial scale of the tool voxels matches that of the blank voxels. The generated tool voxel mesh retains only the effective voxels of the tool cutting edge and tool tip areas, reducing the amount of subsequent collision detection calculations. Tool triangulation generation: To meet the high-precision calculation requirements of the second simulation stage, the Delaunay triangulation algorithm is used to discretize the three-dimensional geometric model of the tool. For the helical cutting edge of the end mill, sampling points are divided along the helical direction at preset angle intervals to ensure the fitting accuracy of the helical tooth profile. For the spherical part of the ball end mill, uniform sampling is performed based on the coordinates of the sphere center and the radius to control the deviation of the normal vector of the spherical surface to be less than the preset angle, thus avoiding sawtooth errors during spherical cutting simulation. S13: Set the basic parameters for real-time cutting simulation: Determine the specific dimensions of the blank; plan the tool motion path parameters, including the starting coordinates, ending coordinates, path segment trajectory type, and path connection method; determine the cutting process parameters, including feed rate and depth of cut; and pre-set the trigger condition threshold for multi-dimensional mesh switching. All basic parameters are stored in the parameter database of the simulation system to support real-time calling and dynamic adjustment in subsequent simulation stages.

[0037] Step S1, as the initialization step of the phased real-time cutting simulation method, plays a crucial role in building a precise and adaptable geometric model foundation and parameter framework for the subsequent two simulation stages, ensuring the smooth implementation of the phased strategy. Specifically, S11 focuses on constructing the blank voxel mesh model. The three-dimensional geometric model of the blank is discretized into a set of voxels using a voxelization algorithm. This process is not a simple geometric transformation but rather dynamically matches the voxel resolution to the simulation requirements—adjusting the voxel scale according to machining accuracy requirements (such as roughing and semi-finishing). This avoids computational redundancy caused by excessively high resolution and prevents excessively low resolution from affecting the basic accuracy of the first-stage simulation. Simultaneously, effective voxels (containing the blank geometric region) and ineffective voxels are marked using ray casting and associated with material properties. This provides data support for the material removal logic (such as Boolean operations) and cutting force correlation calculations in subsequent voxel mesh cutting, ensuring that the blank model can both meet the real-time computation requirements of the first stage and accurately reflect the initial shape of the workpiece. S12 employs a "dual-mesh parallel generation" strategy for the tool model, fully adapting to the differentiated needs of the two stages: the tool voxel mesh and the blank voxel mesh use completely consistent voxelization algorithms and resolutions, ensuring spatial scale matching during collision detection in the first stage. The design of retaining only effective voxels for the cutting edge and tip further simplifies the data volume and improves real-time collision judgment efficiency. Meanwhile, the tool triangular mesh achieves high-precision discretization through the Delaunay triangulation algorithm, and differentiated processing is applied to different tool features such as the helical cutting edge of end mills (with angular interval-based sampling) and the spherical surface of ball end mills (controlling normal vector deviation), ensuring that the triangular mesh accurately reproduces the tool's geometric details and provides a reliable tool model foundation for high-precision cutting calculations in the second stage (such as patch intersection judgment and topological relationship updates). S13 constructs a "parameter hub" throughout the entire process by setting basic parameters: blank size, tool path, and cutting parameters (feed rate, depth of cut, etc.) directly determine the realism of the simulated physical process; while preset multi-dimensional switching trigger thresholds provide quantitative standards for switching judgments in the S3 stage. These parameters are stored in a database and support dynamic retrieval and adjustment, ensuring the standardization of the simulation process while providing flexibility to adapt to different processing scenarios (such as different materials and different precision requirements), ultimately achieving deep collaboration between initial modeling and subsequent phased simulations. In summary, step S1, through "model adaptation construction + systematic parameter configuration," lays a unified and reliable foundation for the efficient real-time computation of the first-stage voxel mesh and the high-precision computation of the second-stage triangular mesh, which is a key prerequisite for achieving a balance between "real-time performance and accuracy."

[0038] S2: The first simulation stage of low-precision real-time cutting based on voxel mesh is carried out. After the cutting simulation is started, the spatial overlap relationship between the tool voxel mesh and the blank voxel mesh is determined in real time to identify the voxel region to be removed. The blank voxels in the overlapping region are deleted through Boolean operations and the retain / deletion status of the blank voxel mesh is updated. The workpiece shape is rendered based on the updated blank voxel mesh while ensuring that the simulation frame rate meets the real-time interaction requirements.

[0039] In this embodiment, step S2 specifically includes: S21: Start cutting simulation and initialize voxel mesh data: Call the motion control module of the simulation system, load the tool running path and cutting process parameters set in step S1, map the tool voxel mesh and the blank voxel mesh to the same world coordinate system; initialize the voxel mesh data buffer, initialize the retain / delete status of the blank voxel mesh to retain, and mark the tool voxel mesh as an active cutting element to provide a data basis for subsequent collision detection and material removal; S22: Perform real-time collision detection to determine the voxel region to be removed: Employ a dual detection logic of coordinate comparison + volume overlap determination to obtain the current position data of the tool body voxel mesh in real time; perform unit-by-unit coordinate matching between the tool body voxels and the blank voxels, and determine whether there is spatial overlap between them based on preset spatial overlap determination conditions; add all blank voxels determined to be spatially overlapped to the voxel list to be removed, and simultaneously record their spatial coordinates and the blank region to which they belong; dynamically adjust the collision detection frequency according to the feed rate to balance the real-time performance of detection and the computational load of the system. S23: Perform material removal and update voxel status via Boolean operations: Based on the list of voxels to be removed, call the geometry calculation module of the simulation system to perform a Boolean difference operation between the blank voxel mesh and the tool voxel mesh; delete the geometric data of all blank voxels in the list of voxels to be removed, update the retention / deletion state matrix of the blank voxel mesh, update the corresponding matrix position of the deleted voxels to deletion, and retain the retention state of non-overlapping blank voxels; at the same time, record the number of voxels removed and the cutting depth each time, and generate real-time cutting quantity statistics for operators to monitor the roughing progress; S24: Real-time rendering to meet interactive requirements: A voxel ray casting rendering algorithm is used to construct a workpiece visualization model based on the updated blank voxel mesh data; a hierarchical rendering optimization strategy based on viewing distance is adopted, adjusting the rendering resolution for areas at different viewing distances to simplify the rendering data volume of non-critical areas while ensuring visual detail; different color mappings are used to distinguish the uncut, cut, and uncut areas of the workpiece, ensuring that operators can intuitively distinguish the cutting progress; the rendering module, collision detection, and material removal modules adopt a parallel computing architecture to avoid the rendering process consuming core computing resources and ensure real-time interactive response speed. The simulation frame rate is set, such as ≥30fps, to meet real-time interactive requirements.

[0040] S25: Defining the Accuracy Priority of Each Stage: The core objectives of this stage are real-time performance and roughing progress feedback. The output is a voxel mesh intermediate workpiece used for subsequent triangular mesh conversion, rather than the final high-precision product. The sawtooth effect and dimensional accuracy deviation caused by voxel discretization can be ignored and will not affect the high-precision correction process in the subsequent second simulation stage. Absolute accuracy is not pursued in this stage.

[0041] Step S2, as the first simulation stage dominated by voxel meshes, aims to rapidly advance the cutting simulation process while ensuring real-time interaction, providing a reliable "intermediate workpiece" foundation for subsequent high-precision stages. Its technical solution achieves the stage goal of "efficiency first, accuracy adaptation" through multi-stage collaborative design. Specifically, this can be understood from the following dimensions: From the perspective of process initiation and data foundation, S21 loads preset parameters (tool path, cutting parameters) by calling the motion control module and maps the tool voxel mesh and the blank voxel mesh to the same world coordinate system, ensuring the consistency of their spatial positions and providing a prerequisite for the accuracy of subsequent collision detection and material removal. Simultaneously, it initializes the voxel mesh data buffer (marking the blank voxel's "reserved" state and the tool voxel's "active cutting unit" attribute), essentially establishing a "data ledger" for the simulation process, enabling each cutting operation to be executed efficiently based on clear state markings. In the core cutting calculation stage, collision detection in S22 employs a dual logic of "coordinate comparison + volume overlap judgment." This quickly narrows down the potential overlap range through coordinate matching and accurately identifies the voxels to be removed based on the volume overlap threshold, avoiding false positives or false negatives. The design of dynamically adjusting the detection frequency according to the feed rate (e.g., increasing the detection frequency during high-speed feed) ensures real-time collision judgment while avoiding unnecessary computational resource consumption, achieving "on-demand calculation." The material removal operation in S23, based on the collision detection results, directly deletes the blank voxels in the overlapping area through Boolean difference operations and simultaneously updates the state matrix ("retain" → "delete"). This closed-loop logic of "mark-delete-update" ensures the real-time accuracy of the voxel mesh state. Simultaneously, it records the cutting amount and depth and generates statistical data, providing operators with intuitive feedback on the roughing progress, demonstrating the practicality of the simulation. To address real-time interaction requirements, S24's rendering strategy underwent multiple optimizations: the voxel ray casting algorithm ensured rapid visualization generation; hierarchical rendering based on view distance (preserving detail in the near field and simplifying data in the far field) struck a balance between visual effects and computational efficiency; color mapping (differentiated display of uncut / cut / to-be-cut areas) enhanced the intuitiveness of progress perception; and the parallel architecture of the rendering module and the core computing module completely avoided rendering's occupation of cutting computational resources, ultimately ensuring a stable frame rate of ≥30fps, meeting the core requirements of real-time interaction. Finally, S25 clearly prioritized stage accuracy—focusing on real-time performance and progress feedback, allowing for the "jagged effect" and accuracy deviations caused by voxel discretization. This design did not ignore accuracy, but rather represented a reasonable trade-off based on a staged strategy: the output of the first stage was an "intermediate workpiece," its role being to provide a conversion basis for the second stage, rather than the final verification result. Therefore, there was no need to invest too many resources in pursuing high accuracy at this stage. This "doing what is necessary and not doing what is unnecessary" design is the key to achieving a balance between "real-time performance and accuracy."In summary, step S2, through a coherent process of "data initialization - collision detection - material removal - real-time rendering" and combined with multiple optimization strategies (dynamic detection frequency, hierarchical rendering, parallel computing, etc.), not only efficiently completed the cutting simulation of the roughing stage, but also provided reliable input for the subsequent high-precision stage, perfectly inheriting the results of the initialization modeling and promoting the implementation of the phased simulation strategy.

[0042] S3: During the switching judgment phase, the preset multi-dimensional switching trigger conditions are monitored in real time during the execution of the first simulation phase. When any condition or combination of conditions is met, the mesh model is switched and the second simulation phase begins.

[0043] In this embodiment, step S3 specifically includes: S31: Monitoring Module Initialization and Data Linkage: Call the switching monitoring module of the simulation system and load the multi-dimensional switching trigger condition thresholds preset in step S1; at the same time, establish a real-time data interaction channel between the switching monitoring module and the core calculation module of the first simulation stage to ensure that the monitoring module can obtain the dynamic data of the first stage in real time, including the remaining material status of the workpiece, the current cutting process parameters, the real-time geometric shape of the workpiece, and the information of the executed cutting path, so as to provide complete data support for the real-time determination of the trigger conditions; S32: Real-time monitoring of multi-dimensional triggering conditions: The switching monitoring module monitors the loaded multi-dimensional switching triggering conditions in real time according to the preset logic; the multi-dimensional switching triggering conditions cover core dimensions including geometric features, processing stage, accuracy requirements, and time cost. During the monitoring process, the current state of each dimension condition is determined in real time through a coherent process of data acquisition, feature extraction, and threshold comparison to confirm whether the preset triggering standard has been met. S33: Condition Satisfaction Judgment and Switching Execution: The switching monitoring module adopts a composite judgment mechanism of OR logic + AND logic to integrate the monitoring results of trigger conditions in each dimension in real time. If the trigger condition of any dimension reaches the preset standard, or the trigger conditions of multiple dimensions simultaneously reach the corresponding preset standard, a mesh switching trigger signal is immediately generated. This signal is synchronously sent to the control units of the first simulation stage and the second simulation stage. After receiving the signal, the first stage control unit stops the current cutting simulation operation and saves the complete data of the intermediate workpiece of the final voxel mesh in the first stage. After receiving the signal, the second stage control unit starts the initialization process of high-precision calculation, realizing the smooth connection and process switching between the two stages.

[0044] In step S3, the multi-dimensional switching trigger conditions for the voxel-triangular mesh phased process need to balance the adaptability to the machining scenario with the accuracy-efficiency balance, avoiding the limitations of a single condition. This includes five types of flexibly combinable switching trigger conditions, covering dimensions including geometric features, machining stage, accuracy requirements, and time cost, adapting to different cutting scenarios including roughing-semi-finishing-finishing and simple workpieces-complex workpieces. Specifically, these include: Remaining material volume ratio condition: The ratio of the remaining workpiece volume to the original blank volume is used as the judgment basis. When the ratio is less than or equal to the preset threshold, it is triggered. It is applicable to general scenarios and cutting scenarios where there are no special requirements for the complexity of the workpiece, including finishing after rough milling of block blanks. Cutting stage type conditions: The criteria for judgment are whether the cutting process has entered the finishing stage; applicable to multi-stage machining scenarios including rough milling → semi-finish milling → finish milling, and finish milling stage triggering switching. Workpiece geometric feature complexity condition: The criterion is whether the workpiece has high-precision sensitive features; applicable to complex workpiece scenarios including aerospace parts, precision molds, and sensitive features that require high-precision simulation. Preset accuracy threshold conditions: The criteria for judgment are whether the surface roughness and dimensional error required by the simulation meet the high-precision standards; applicable to high-precision machining scenarios including precision instrument parts and medical equipment parts. Remaining cutting time threshold condition: Based on the estimated remaining cutting time based on toolpath length and feed rate, it is triggered when the remaining cutting time is less than or equal to a preset value; it is suitable for fast simulation scenarios that prioritize real-time performance, including scenarios that quickly verify toolpaths and avoid long waiting times at the end.

[0045] The multi-dimensional switching conditions in this embodiment are shown in Table 1.

[0046] Table 1 Note: The above conditions can be used individually or in combination (e.g., "remaining volume ≤ 10% + thin-walled structure exists"), and the threshold can be dynamically adjusted according to specific simulation requirements.

[0047] Step S3, as the "decision hub" of the phased cutting simulation, plays a crucial role in accurately determining the timing of the switch from the first stage (voxel mesh) to the second stage (triangular mesh). It aims to avoid switching too early, which would result in a loss of real-time advantages, while also preventing a switch too late from affecting the final accuracy. Its technical solution achieves accuracy and scenario adaptability in switching decisions through a closed-loop design of "data support - multi-dimensional monitoring - flexible judgment - smooth execution." Specifically, it can be broken down as follows: From the perspective of "data foundation guarantee," the core of S31 is to build a real-time and complete data link for the switching judgment: calling the switching monitoring module and loading the thresholds preset by S1 (such as the proportion of remaining material volume, accuracy standards, etc.) is equivalent to providing a "quantitative benchmark" for the judgment; establishing a real-time data interaction channel between the monitoring module and the core calculation module of the first stage allows for the dynamic acquisition of key data such as the remaining material of the workpiece, current cutting parameters, and real-time geometric shape—for example, real-time capture of the "retain / delete" status of the blank voxels to calculate the remaining volume, and obtaining the tool path progress to estimate the remaining cutting time. These data are the "raw materials" for triggering the judgment, ensuring that the judgment does not deviate from the actual simulation process and avoiding "blind switching." At the level of "multi-dimensional monitoring logic," the design of S32 breaks through the limitations of traditional "single-condition judgment": the monitoring dimensions cover geometric features (such as whether the workpiece has thin walls or sharp corners), processing stages (such as whether it has entered the finishing stage), accuracy requirements (such as whether it needs to meet high surface roughness), and time costs (such as whether the remaining cutting time is short), basically covering the core scenarios of "when high precision is needed" in cutting simulation; and the coherent process of "data acquisition-feature extraction-threshold comparison" can transform real-time data into a judgmentable "condition signal" - for example, by extracting the boundary topological features of the workpiece voxel mesh, identifying whether "high precision sensitive features" appear, and then comparing it with the preset threshold, ensuring that each monitoring item has clear logical support, rather than subjective judgment. From the perspective of the "judgment and execution mechanism", S33 solves the problem of flexibility and stability of switching through "composite logic + smooth connection": adopting the judgment method of "OR logic + AND logic", it allows "triggering when any condition is met" (such as fast switching when only the remaining cutting time is ≤ threshold, adapting to real-time priority scenarios) and also supports "multi-condition combination triggering" (such as "remaining material volume ≤ threshold + workpiece has thin-walled features", adapting to the high-precision requirements of complex workpieces), which greatly improves the decision-making flexibility; while the "two-way synchronous operation" during switching execution - the first stage stops the calculation and saves the "voxel mesh intermediate workpiece" (to avoid data loss), and the second stage starts high-precision calculation initialization (preloads triangular mesh model and parameters) to ensure that the two stages are connected without gaps, and the simulation will not be interrupted or the geometric data will be distorted due to switching.Finally, the design of five multi-dimensional triggering conditions further enhances the "scenario adaptability" of S3: each condition corresponds to a specific simulation requirement—the remaining material volume ratio condition adapts to the general scenario of "finishing after rough milling of block blanks," the workpiece geometric feature complexity condition targets complex scenarios such as aerospace parts and precision molds where "sensitive features require high precision," and the remaining cutting time threshold condition serves the real-time priority scenario of "rapidly verifying toolpaths." These five conditions can be used individually or in combination without modifying the core algorithm; simply adjusting the thresholds adapts to different scenarios such as "roughing-finishing" and "simple workpieces-complex workpieces," completely solving the problem of "narrow scenario coverage and poor flexibility" inherent in traditional single-condition switching. In summary, step S3 is not simply a "condition judgment," but rather a crucial bridge connecting the "real-time stage" and the "high-precision stage" through the synergy of data link construction, multi-dimensional monitoring, flexible logical judgment, and smooth execution. This ensures that the phased strategy can leverage the efficiency advantages of voxel meshes while promptly switching to triangular meshes to guarantee accuracy, perfectly inheriting the results of previous stages and paving the way for subsequent high-precision calculations.

[0048] S4: The second simulation stage of high-precision real-time cutting, dominated by triangular meshes, is carried out. The voxel boundary extraction-patch fitting algorithm is used to convert the intermediate workpiece of the final voxel mesh in the first stage into a transitional triangular mesh. High-precision cutting calculations are performed based on the triangular mesh. Fine material removal is achieved by updating the topology relationship, including patch segmentation, fragment merging, and redundant patch deletion, to eliminate the voxel serration effect. Collision detection is achieved by judging the intersection of the tool triangular mesh and the transitional triangular mesh. The final high-precision workpiece triangular mesh model that meets the requirements of subsequent process verification or parameter optimization is output.

[0049] In this embodiment, step S4 specifically includes: Mesh transformation: A voxel boundary extraction-triangular patch fitting algorithm, including the Marching Cubes algorithm, is used to perform the transformation operation. Specifically, the voxel boundaries of the intermediate workpieces in the final voxel mesh of the first stage are first identified, and the boundary voxel set at the intersection of the retention and deletion states is selected. The spatial isosurface of this set is then extracted. Based on the geometric curvature distribution of the spatial isosurface, the sampling density of the triangular patches is adjusted. The sampling density of the patches is increased in areas with large curvature changes, and the sampling density is appropriately reduced in areas with gentle curvature to ensure that the geometric shape of the triangular patches and the voxel boundaries are highly matched. Finally, a transitional triangular mesh is generated to achieve a smooth connection between the voxel boundaries and the triangular patches, eliminating the geometric discontinuities caused by voxel discretization. High-precision cutting calculation: Call the high-precision geometric calculation module of the simulation system, load the tool triangular mesh and the transition triangular mesh generated in step S1, first establish the spatial coordinate relationship between the two, and then perform collision detection and fine material removal operations in sequence, and finally output the workpiece triangular mesh model that meets the preset high-precision standard.

[0050] The specific implementation process of the high-precision cutting calculation includes: Collision detection: Based on the intersection judgment logic of the tool triangular mesh and the transition triangular mesh, the specific steps are as follows: First, the spatial range of the faces of the two meshes is pre-screened to exclude face pairs with no possibility of spatial overlap, reducing the amount of computation; then, for potentially intersecting face pairs, the coordinate range of the intersection area and the geometric parameters of the intersection line segments are calculated, and the contact type, including face-to-face contact, edge-to-face contact, and point-to-face contact, is determined by combining the angle relationship between the face normal vectors; finally, based on the calculation results, the geometric boundary, contact area, and contact depth of the cutting contact area are accurately identified, providing precise area positioning for fine material removal; Fine material removal: This is achieved through topology update operations. The specific process is as follows: Patch segmentation: Based on the boundary of the cutting contact area determined by collision detection, and combined with the geometric projection shape of the tool cutting edge, the patches in the contact area of ​​the transition triangular mesh are segmented into sub-patterns that fit the cutting contour; Fragment merging: For isolated sub-patterns that have no topological connection or only single-point connection after segmentation, it is determined whether they meet the merging conditions based on their spatial position relationship with adjacent effective patches and the consistency of their normal vectors. For isolated sub-patterns that meet the conditions, a fusion operation is performed to form a continuous geometric surface; Redundant patch deletion: Patterns that are completely covered by the tool triangular mesh or whose deviation from the workpiece design geometric model exceeds the preset range are selected and deleted; Through the above topology update operations, a difference Boolean operation is performed on the overlapping area of ​​the transition triangular mesh and the tool triangular mesh to achieve high-precision material removal and eliminate the voxel serration effect left over from the first stage; Output results: Generate the final high-precision workpiece triangular mesh model, which must meet the following requirements: geometric accuracy meets the preset standard (e.g., accuracy error ≤ 0.01mm), ensuring the consistency of the shape and size of the key features of the workpiece; the model data can be directly used for subsequent process verification; support parameter optimization analysis, and adapt to the application requirements of high-precision machining scenarios.

[0051] Step S4, as the second simulation stage dominated by triangular meshes, aims to build upon the "voxel mesh intermediate workpiece" from the first stage. It eliminates voxel discretization defects through high-precision geometric calculations, ultimately outputting an accurate model that meets the requirements of process verification and parameter optimization. Its technical solution revolves around "smooth transition - accurate calculation - efficient optimization," with each step designed to achieve the core requirement of "high precision." Specifically, it can be analyzed from the following logical dimensions: First, "mesh transformation" is the key link to achieve a smooth transition between the two stages, solving the geometric compatibility problem of "voxel → triangle." This step is not a simple mesh type replacement, but rather a refined operation of "boundary recognition - isosurface extraction - dynamic sampling" performed using algorithms such as Marching Cubes: First, boundary voxels in the voxel mesh that are in a "keep / delete" state are screened, and spatial isosurfaces that can reflect the true contour of the workpiece are extracted (avoiding contour distortion caused by blocky voxel discretization); then, the sampling density of triangular patches is dynamically adjusted according to the curvature distribution of the isosurfaces—increasing the sampling density in areas with large curvature changes such as curved surfaces and sharp corners (ensuring the geometric accuracy of complex features), and reducing the density in areas with gentle curvature such as planes (reducing redundant computation). This "on-demand sampling" design not only achieves seamless fitting between voxel boundaries and triangular patches, but also eliminates the geometric discontinuities caused by voxel discretization from the source, laying a continuous and accurate geometric foundation for subsequent high-precision calculations. Secondly, "high-precision cutting calculation" ensures the accuracy and realism of the cutting simulation through a closed-loop process of "coordinate association - precise detection - fine removal". The first step, "spatial coordinate association," is a prerequisite for ensuring accuracy: It loads the tool triangular mesh generated by S1 (whose geometric accuracy has been guaranteed by the Delaunay algorithm) and the aforementioned transition triangular mesh, mapping both to the same world coordinate system as the first stage to avoid cutting position deviations caused by coordinate offsets. The second step, "collision detection," employs a layered strategy of "pre-screening - fine calculation" to improve efficiency and accuracy—first, it eliminates facet pairs with no possibility of overlap through spatial range comparison (reducing more than 80% of invalid calculations), then calculates the coordinates of the intersection region and line segment parameters for potentially intersecting faces, combined with the angle between the normal vectors. The first step, determining the contact type (face-to-face, edge-to-face, etc.), employs a "coarse-to-fine" detection logic. This approach accurately locates the boundaries, area, and depth of the cutting contact while avoiding the efficiency losses associated with calculating all facets. The third step, "fine material removal," achieves "micron-level" precision control through topological updates: facet segmentation ensures the removal area perfectly matches the tool's cutting edge contour (avoiding overcutting or undercutting); fragment merging eliminates model discontinuities caused by isolated facets after segmentation (ensuring surface smoothness); and redundant facet deletion removes invalid facets covered by cutting or deviating from the design geometry (purifying model data). These three steps, combined with Boolean difference operations, not only achieve high-precision control of material removal but also completely eliminate the "jagged effect" left over from the first-stage voxel mesh, ensuring a high degree of consistency between the workpiece surface morphology and the actual machining results.Finally, the "Results Output" section clarifies the "practical value orientation" of the high-precision model, ensuring that the simulation results directly serve actual production needs. The output triangular mesh model must meet two standards: first, geometric accuracy must be up to standard (e.g., error ≤ 0.01mm), ensuring the consistency of the dimensions and shape of key workpiece features (e.g., thin walls, chamfers); second, application adaptability must be up to standard—the model data can be directly used for process verification (e.g., 3D comparison with design drawings to detect machining errors) and can also support parameter optimization (e.g., calculating cutting forces based on the model and adjusting parameters such as feed rate and depth of cut). This dual positioning of "accuracy + practicality" makes the simulation results no longer just a simple "digital model," but a "decision-making basis" that can guide actual processing, truly realizing the application value of "high-precision simulation." In summary, the technical solution in step S4, through a progressive design of "connection-calculation-output," not only solves the problem of insufficient accuracy of voxel meshes but also avoids the efficiency loss of triangular meshes throughout the process. Ultimately, it achieves a unity of "high precision, high efficiency, and high practicality," perfectly fulfilling the core objective of "ensuring accuracy in the final stage" in the phased strategy. This provides reliable technical support for high-precision scenarios such as CNC machining simulation and precision mold verification.

[0052] Second Embodiment This embodiment uses "simulation of aero-engine blade cutting" as an example to illustrate the implementation process of the present invention: (1) Simulation initialization modeling Voxel mesh construction for the blank: Taking the titanium alloy blade blank of an aero-engine as the object, its design dimensions are 100mm×50mm×20mm. Based on the voxelization algorithm in step S11, and combined with the requirements of "efficiency first, accuracy adaptation" in the roughing stage of the blade, the voxel mesh resolution is set to 0.2mm; the three-dimensional geometric model of the blank is mapped to the preset voxel mesh coordinate system, and the ray casting method is used to determine whether the center of each voxel falls within the geometric area of ​​the blank. Voxels containing the blank are marked as "effective voxels" and associated with titanium alloy material properties (for subsequent cutting force correlation calculation), and finally a blank voxel mesh model adapted to roughing is constructed.

[0053] Tool Dual-Mesh Generation: A 10mm diameter ball end mill is selected as the cutting tool, following the "dual-mesh parallel generation" strategy in step S12: Tool Voxel Mesh: Using a resolution of 0.2mm and a voxelization algorithm that is completely consistent with the blank voxel mesh, only the "effective voxels" of the cutting edge and the spherical area of ​​the tool tip are retained (invalid areas of the tool holder are removed) to ensure spatial scale matching during the first stage of collision detection and reduce the amount of computation; Tool triangulation mesh: Generated using the Delaunay triangulation algorithm. For the spherical part of the ball end mill, it is uniformly sampled based on the sphere center coordinates and 10mm diameter parameters to control the normal vector deviation of the spherical surface patch to ≤0.3°, avoiding sawtooth errors during spherical cutting simulation and adapting to the high-precision calculation requirements of the second stage.

[0054] Basic parameters and switching conditions settings: Based on step S13, the basic parameters are defined as follows: the tool rough milling path is a helical trajectory adapted to the blade surface, and the cutting process parameters are set as follows (cutting depth 2mm and feed rate 1000mm / min in the rough milling stage). At the same time, a multi-dimensional switching trigger condition combination is preset: "remaining material volume ratio ≤12% + real-time detection of thin-walled blade structure (thickness ≤0.8mm)". This condition covers both "remaining volume" and "geometric features" dimensions, adapting to the scenario requirements of high-precision machining of thin-walled areas of the blade. All parameters are stored in the simulation system database.

[0055] (2) First simulation stage: voxel mesh-dominated rough milling Initiate the rough milling simulation of the aero-engine blade, fully following the voxel mesh calculation logic of step S2: Call the motion control module of the simulation system, load the above rough milling path and cutting parameters, map the tool body voxel mesh and the blank voxel mesh to the same world coordinate system, and initialize the voxel data buffer (set the blank voxel to "reserved" and the tool body voxel to "active cutting element"). Real-time collision detection is performed using a dual logic of "coordinate comparison + volume overlap determination": based on a feed speed of 1000 mm / min, the detection frequency is set to 50 Hz, and the spatial positions of the tool body voxels and blank voxels are matched unit by unit. After determining the overlapping area, it is added to the "voxel list to be removed". Overlapping voxels are removed using Boolean difference operations, the "keep / delete" status of the blank voxel mesh is updated, and the number of voxels removed is counted in real time (for monitoring the rough milling progress). The voxel ray casting rendering algorithm is adopted, combined with the "viewpoint hierarchical optimization" strategy (the near field of blades with a distance of less than 50mm from the viewing angle retains 0.2mm resolution, and the far field merges 2×2×2 voxels into a single rendering unit). Color mapping is used to distinguish between uncut (light gray) and cut (dark gray) areas, and finally a stable simulation frame rate of 35fps is achieved to meet the needs of operators to monitor the rough milling process in real time.

[0056] (3) Switching between judgment and triggering During the first stage of rough milling, real-time monitoring is performed based on the switching judgment logic in step S3: The switching monitoring module dynamically collects two key data points through real-time data interaction with the core calculation module of the first stage: first, the proportion of remaining material volume (calculated by the number of voxels removed and the initial total number of voxels; when 88% of the material is removed by rough milling, the proportion of remaining volume drops to 12%); second, the geometric features of the workpiece (identified by voxel mesh boundary topology analysis, which shows that the blade edge forms a thin-walled structure of 0.7mm after rough milling, which belongs to the preset "high-precision sensitive features"). When both data meet the preset conditions simultaneously—"remaining material volume ratio ≤ 12%" and "thin-walled structure with thickness ≤ 0.8 mm detected"—the switching monitoring module immediately generates a "mesh switching trigger signal." The signal is sent synchronously to the two-stage control unit: the first stage stops the rough milling operation and saves the final blade voxel mesh intermediate workpiece data; the second stage starts high-precision calculation initialization to achieve seamless connection between the two stages.

[0057] (4) Second simulation stage: triangular mesh-based high-precision milling Following the high-precision cutting process in step S4, complete the blade precision milling simulation and output the results: Mesh transformation: The Marching Cubes algorithm is used to perform the "voxel to triangle" transformation. First, the boundary voxel set in the "keep / delete" state in the voxel mesh is screened to extract the spatial isosurface reflecting the blade surface profile. Then, the sampling density of the facets is dynamically adjusted according to the curvature distribution of the blade surface (5 vertices are sampled per millimeter in areas with large curvature and 2 vertices are sampled per millimeter in planar areas). Finally, a transitional triangular mesh with 300,000 facets is generated to achieve a smooth connection between the voxel boundary and the triangular facets, eliminating the "jagged effect" of voxels in the rough milling stage.

[0058] High-precision finish milling calculation: Load the ball end mill triangular mesh generated in step S1, establish a unified world coordinate system with the transition triangular mesh, and perform finish milling operation (depth of cut 0.1mm, feed rate 500mm / min): Collision detection: First, pre-screen and eliminate face pairs that may not overlap by spatial range. Then, calculate the coordinates of the intersection area and the length of the line segment for potential intersecting face pairs. Combine the angle between the normal vectors to determine the type of "edge-face contact" (contact between the ball end mill and the blade surface) and accurately locate the cutting contact boundary and depth. Fine material removal: through patch segmentation (dividing transitional triangular mesh patches that conform to the ball end mill cutting edge contour) and fragment merging (fusion area ≤ 0.001mm). 2 The process involves removing isolated sub-surfaces and redundant facets (eliminating invalid facets covered by cutting), and performing Boolean difference operations to complete fine material removal.

[0059] Output results: The final generated triangular mesh model of the aero-engine blade with 450,000 facets was tested and found to have a dimensional accuracy error of ≤0.01mm and a surface roughness of 0.8μm, which fully meets the stringent requirements of aero-engine blades for the accuracy and surface quality of complex curved surfaces. It can be directly used for subsequent blade processing technology verification (such as 3D comparison with the design model) and cutting parameter optimization.

[0060] Third Embodiment like Figure 3 As shown, this embodiment provides a real-time cutting simulation system for performing a staged processing real-time cutting simulation method as described in the first embodiment, comprising: Initialization modeling module 1 is used for initial modeling, including building a blank voxel mesh model of the workpiece to be cut to meet the simulation requirements, generating the corresponding tool voxel mesh and triangular mesh according to the tool model, and setting the basic parameters for real-time cutting simulation. The first simulation module 2 is used to perform the first simulation stage of low-precision real-time cutting dominated by voxel mesh. After the cutting simulation is started, the spatial overlap relationship between the tool voxel mesh and the blank voxel mesh is determined in real time to determine the voxel area to be removed. The blank voxels in the overlapping area are deleted through Boolean operation and the retention / deletion status of the blank voxel mesh is updated. The workpiece shape is rendered based on the updated blank voxel mesh and the simulation frame rate is guaranteed to meet the real-time interaction requirements. The switching condition monitoring module 3 is used for the switching judgment stage. During the execution of the first simulation stage, it monitors the preset multi-dimensional switching trigger conditions in real time. When any condition or a combination of conditions is met, the mesh model is switched and the second simulation stage is entered. The second simulation module 4 is used for the second simulation stage of high-precision real-time cutting dominated by triangular meshes. It uses a voxel boundary extraction-patch fitting algorithm to convert the intermediate workpiece of the final voxel mesh in the first stage into a transitional triangular mesh. Based on the triangular mesh, high-precision cutting calculations are performed. Fine material removal is achieved by updating the topology relationship, including patch segmentation, fragment merging, and redundant patch deletion, to eliminate the voxel serration effect. Collision detection is achieved by judging the intersection of the tool triangular mesh and the transitional triangular mesh. The final high-precision workpiece triangular mesh model that meets the requirements of subsequent process verification or parameter optimization is output.

[0061] A computer-readable storage medium stores computer code that, when executed, performs the methods described above. Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. This program can be stored in a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0062] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

[0063] 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 specification.

[0064] It should be noted that the above embodiments can be freely combined as needed. The above description is only a preferred embodiment of the present invention. It should be pointed out that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A real-time cutting simulation method with phased processing, characterized in that, Includes the following steps: S1: Perform initial modeling, including building a blank voxel mesh model of the workpiece to be cut to meet the simulation requirements, and generating the corresponding tool voxel mesh and triangular mesh according to the tool model, while setting the basic parameters for real-time cutting simulation. S2: The first simulation stage of low-precision real-time cutting is carried out with voxel mesh as the main component. After the cutting simulation is started, the spatial overlap relationship between the tool voxel mesh and the blank voxel mesh is determined in real time to identify the voxel area to be removed. The blank voxels in the overlapping area are deleted through Boolean operations and the retention / deletion status of the blank voxel mesh is updated. The workpiece shape is rendered based on the updated blank voxel mesh while ensuring that the simulation frame rate meets the real-time interaction requirements. S3: Perform the switching judgment phase. During the execution of the first simulation phase, the preset multi-dimensional switching trigger conditions are monitored in real time. When any condition or combination of multiple conditions is met, the mesh model is switched and the second simulation phase is entered. S4: The second simulation stage of high-precision real-time cutting, dominated by triangular meshes, is carried out. The voxel boundary extraction-patch fitting algorithm is used to convert the intermediate workpiece of the final voxel mesh in the first stage into a transitional triangular mesh. High-precision cutting calculations are performed based on the triangular mesh. Fine material removal is achieved by updating the topology relationship, including patch segmentation, fragment merging, and redundant patch deletion, to eliminate the voxel serration effect. Collision detection is achieved by judging the intersection of the tool triangular mesh and the transitional triangular mesh. The final high-precision workpiece triangular mesh model that meets the requirements of subsequent process verification or parameter optimization is output.

2. The real-time cutting simulation method with phased processing according to claim 1, characterized in that, In step S1, initial modeling is performed, including constructing a blank voxel mesh model of the workpiece to be cut to meet the simulation requirements, and generating corresponding tool voxel meshes and triangular meshes based on the tool model. Simultaneously, the basic parameters for real-time cutting simulation are set, specifically: S11: Generate the blank voxel mesh model of the workpiece to be cut: The pre-set three-dimensional geometric model of the workpiece blank to be cut is discretized using a voxelization algorithm. First, the design dimension parameters and material property parameters of the blank are obtained. Then, the voxel resolution is matched according to the different processing accuracy requirements of the real-time cutting simulation. Subsequently, the three-dimensional geometric model of the blank is mapped to the pre-set voxel mesh coordinate system. The ray method is used to determine whether the center of each voxel falls within the geometric area of ​​the blank. Voxels containing the geometric area of ​​the blank are marked as valid voxels and associated with material properties. Voxels not containing the geometric area of ​​the blank are marked as invalid voxels. Finally, the blank voxel mesh model adapted to the corresponding processing stage is constructed. S12: Generate the voxel mesh and triangular mesh corresponding to the tool: Obtain the type parameters and detailed geometric parameters of the target cutting tool, including end mills, ball end mills, and face mills, and construct a complete three-dimensional geometric model of the tool based on these parameters using a parametric modeling algorithm; Tool Voxel Mesh Generation: To meet the rapid collision detection requirements in the first simulation stage, a voxelization algorithm and resolution parameters that are completely consistent with the blank voxel mesh in the corresponding machining stage are used to discretize the three-dimensional geometric model of the tool, ensuring that the spatial scale of the tool voxels matches that of the blank voxels. The generated tool voxel mesh retains only the effective voxels of the tool cutting edge and tool tip areas, reducing the amount of subsequent collision detection calculations. Tool triangulation generation: To meet the high-precision calculation requirements of the second simulation stage, the Delaunay triangulation algorithm is used to discretize the three-dimensional geometric model of the tool. For the helical cutting edge of the end mill, sampling points are divided along the helical direction at preset angle intervals to ensure the fitting accuracy of the helical tooth profile. For the spherical part of the ball end mill, uniform sampling is performed based on the coordinates of the sphere center and the radius to control the deviation of the normal vector of the spherical surface to be less than the preset angle, thus avoiding sawtooth errors during spherical cutting simulation. S13: Set the basic parameters for real-time cutting simulation: Determine the specific dimensions of the blank; plan the tool motion path parameters, including the starting coordinates, ending coordinates, path segment trajectory type, and path connection method; determine the cutting process parameters, including feed rate and depth of cut; and pre-set the trigger condition threshold for multi-dimensional mesh switching. All basic parameters are stored in the parameter database of the simulation system to support real-time calling and dynamic adjustment in subsequent simulation stages.

3. The real-time cutting simulation method with phased processing according to claim 1, characterized in that, In step S2, the first simulation stage of low-precision real-time cutting, dominated by voxel meshes, is performed. After the cutting simulation starts, the spatial overlap between the tool voxel mesh and the blank voxel mesh is determined in real time to identify the voxel regions to be removed. Boolean operations are used to delete the blank voxels in the overlapping regions and update the retain / delete status of the blank voxel mesh. The workpiece shape is rendered based on the updated blank voxel mesh, ensuring that the simulation frame rate meets the real-time interaction requirements. Specifically: S21: Start cutting simulation and initialize voxel mesh data: Call the motion control module of the simulation system, load the tool running path and cutting process parameters set in step S1, map the tool voxel mesh and the blank voxel mesh to the same world coordinate system; initialize the voxel mesh data buffer, initialize the retain / delete status of the blank voxel mesh to retain, and mark the tool voxel mesh as an active cutting element to provide a data basis for subsequent collision detection and material removal; S22: Perform real-time collision detection to determine the voxel region to be removed: Employ a dual detection logic of coordinate comparison + volume overlap determination to obtain the current position data of the tool body voxel mesh in real time; perform unit-by-unit coordinate matching between the tool body voxels and the blank voxels, and determine whether there is spatial overlap between them based on preset spatial overlap determination conditions; add all blank voxels determined to be spatially overlapped to the voxel list to be removed, and simultaneously record their spatial coordinates and the blank region to which they belong; dynamically adjust the collision detection frequency according to the feed rate to balance the real-time performance of detection and the computational load of the system. S23: Perform material removal and update voxel state via Boolean operation: Based on the list of voxels to be removed, call the geometric calculation module of the simulation system to perform a Boolean operation on the difference between the blank voxel mesh and the tool voxel mesh; Delete the geometric data of all blank voxels in the list of voxels to be removed, update the retain / delete state matrix of the blank voxel mesh, update the corresponding matrix position of the deleted voxels to delete, and retain the retain state of non-overlapping blank voxels; at the same time, record the number of voxels removed and the cutting depth each time, and generate real-time cutting quantity statistics for operators to monitor the roughing progress. S24: Real-time rendering to meet interactive needs: A voxel ray casting rendering algorithm is used to construct a workpiece visualization model based on the updated blank voxel mesh data; a hierarchical rendering optimization strategy based on viewing distance is adopted to adjust the rendering resolution for areas with different viewing distances, simplifying the rendering data volume of non-critical areas while ensuring visual details; different color mappings are used to distinguish the uncut, cut, and uncut areas of the workpiece, ensuring that operators can intuitively distinguish the cutting progress; the rendering module, collision detection, and material removal modules adopt a parallel computing architecture to avoid the rendering process occupying core computing resources and ensure real-time interactive response speed; S25: Defining the Accuracy Priority of Each Stage: This stage focuses on real-time performance and roughing progress feedback. The output is a voxel mesh intermediate workpiece used for subsequent triangular mesh conversion, rather than the final high-precision product. The sawtooth effect and dimensional accuracy deviation caused by voxel discretization can be ignored and will not affect the high-precision correction process in the subsequent second simulation stage.

4. The real-time cutting simulation method with phased processing according to claim 1, characterized in that, In step S3, a switching judgment phase is performed. During the execution of the first simulation phase, preset multi-dimensional switching trigger conditions are monitored in real time. When any condition or a combination of conditions is met, the mesh model is switched, and the second simulation phase begins. Specifically: S31: Monitoring Module Initialization and Data Linkage: Call the switching monitoring module of the simulation system and load the multi-dimensional switching trigger condition thresholds preset in step S1; at the same time, establish a real-time data interaction channel between the switching monitoring module and the core calculation module of the first simulation stage to ensure that the monitoring module can obtain the dynamic data of the first stage in real time, including the remaining material status of the workpiece, the current cutting process parameters, the real-time geometric shape of the workpiece, and the information of the executed cutting path, so as to provide complete data support for the real-time determination of the trigger conditions; S32: Real-time monitoring of multi-dimensional triggering conditions: The switching monitoring module monitors the loaded multi-dimensional switching triggering conditions in real time according to the preset logic; the multi-dimensional switching triggering conditions cover core dimensions including geometric features, processing stage, accuracy requirements, and time cost. During the monitoring process, the current state of each dimension condition is determined in real time through a coherent process of data acquisition, feature extraction, and threshold comparison to confirm whether the preset triggering standard has been met. S33: Condition fulfillment judgment and switching execution: The switching monitoring module adopts a compound judgment mechanism of OR logic + AND logic to integrate the monitoring results of trigger conditions in various dimensions in real time; if the trigger condition of any dimension reaches the preset standard, or the trigger conditions of multiple dimensions simultaneously reach the corresponding preset standard, a grid switching trigger signal is immediately generated. The signal is sent synchronously to the control units of the first and second simulation stages. After receiving the signal, the control unit of the first stage stops the current cutting simulation operation and saves the complete data of the intermediate workpiece of the final voxel mesh of the first stage. After receiving the signal, the control unit of the second stage starts the initialization process of high-precision calculation, realizing the smooth connection and process switching between the two stages.

5. The real-time cutting simulation method with phased processing according to claim 1, characterized in that, In step S3, the multi-dimensional switching trigger conditions for the voxel-triangular mesh phased process need to balance the adaptability to the machining scenario with the accuracy-efficiency balance, avoiding the limitations of a single condition. This includes five types of flexibly combinable switching trigger conditions, covering dimensions including geometric features, machining stage, accuracy requirements, and time cost, adapting to different cutting scenarios including roughing-semi-finishing-finishing and simple workpieces-complex workpieces. Specifically, these include: Remaining material volume ratio condition: The ratio of the remaining workpiece volume to the original blank volume is used as the judgment basis. When the ratio is less than or equal to the preset threshold, it is triggered. It is applicable to general scenarios and cutting scenarios where there are no special requirements for the complexity of the workpiece, including finishing after rough milling of block blanks. Cutting stage type conditions: The criteria for judgment are whether the cutting process has entered the finishing stage; applicable to multi-stage machining scenarios including rough milling → semi-finish milling → finish milling, and finish milling stage triggering switching. Workpiece geometric feature complexity condition: The criterion is whether the workpiece has high-precision sensitive features; applicable to complex workpiece scenarios including aerospace parts, precision molds, and sensitive features that require high-precision simulation. Preset accuracy threshold conditions: The criteria for judgment are whether the surface roughness and dimensional error required by the simulation meet the high-precision standards; applicable to high-precision machining scenarios including precision instrument parts and medical equipment parts. Remaining cutting time threshold condition: Based on the estimated remaining cutting time based on toolpath length and feed rate, it is triggered when the remaining cutting time is less than or equal to a preset value; it is suitable for fast simulation scenarios that prioritize real-time performance, including scenarios that quickly verify toolpaths and avoid long waiting times at the end.

6. The real-time cutting simulation method with phased processing according to claim 1, characterized in that, In step S4, the second simulation stage of high-precision real-time cutting, dominated by triangular meshes, is performed. A voxel boundary extraction-patch fitting algorithm is used to convert the intermediate workpiece from the final voxel mesh of the first stage into a transitional triangular mesh. High-precision cutting calculations are then performed based on the triangular mesh. Fine material removal is achieved through topological updates, including patch segmentation, fragment merging, and redundant patch deletion, to eliminate voxel serration effects. Collision detection is achieved by judging the intersection of the tool triangular mesh and the transitional triangular mesh patches. The final high-precision workpiece triangular mesh model, meeting the requirements of subsequent process verification or parameter optimization, is output. Specifically: Mesh transformation: A voxel boundary extraction-triangular patch fitting algorithm, including the Marching Cubes algorithm, is used to perform the transformation operation. Specifically, the voxel boundaries of the intermediate workpieces in the final voxel mesh of the first stage are first identified, and the boundary voxel set at the intersection of the retention and deletion states is selected. The spatial isosurface of this set is then extracted. Based on the geometric curvature distribution of the spatial isosurface, the sampling density of the triangular patches is adjusted. The sampling density of the patches is increased in areas with large curvature changes, and the sampling density is appropriately reduced in areas with gentle curvature to ensure that the geometric shape of the triangular patches and the voxel boundaries are highly matched. Finally, a transitional triangular mesh is generated to achieve a smooth connection between the voxel boundaries and the triangular patches, eliminating the geometric discontinuities caused by voxel discretization. High-precision cutting calculation: Call the high-precision geometric calculation module of the simulation system, load the tool triangular mesh and the transition triangular mesh generated in step S1, first establish the spatial coordinate relationship between the two, and then perform collision detection and fine material removal operations in sequence, and finally output the workpiece triangular mesh model that meets the preset high-precision standard.

7. The real-time cutting simulation method with phased processing according to claim 6, characterized in that, The specific implementation process of the high-precision cutting calculation includes: Collision detection: Based on the intersection judgment logic of the tool triangular mesh and the transition triangular mesh, the specific steps are as follows: First, the spatial range of the faces of the two meshes is pre-screened to exclude face pairs with no possibility of spatial overlap, reducing the amount of computation; then, for potentially intersecting face pairs, the coordinate range of the intersection area and the geometric parameters of the intersection line segments are calculated, and the contact type, including face-to-face contact, edge-to-face contact, and point-to-face contact, is determined by combining the angle relationship between the face normal vectors; finally, based on the calculation results, the geometric boundary, contact area, and contact depth of the cutting contact area are accurately identified, providing precise area positioning for fine material removal; Fine material removal: This is achieved through topology update operations. The specific process is as follows: Patch segmentation: Based on the boundary of the cutting contact area determined by collision detection, and combined with the geometric projection shape of the tool cutting edge, the patches in the contact area of ​​the transition triangular mesh are segmented into sub-patterns that fit the cutting contour; Fragment merging: For isolated sub-patterns that have no topological connection or only single-point connection after segmentation, it is determined whether they meet the merging conditions based on their spatial position relationship with adjacent effective patches and the consistency of their normal vectors. For isolated sub-patterns that meet the conditions, a fusion operation is performed to form a continuous geometric surface; Redundant patch deletion: Patterns that are completely covered by the tool triangular mesh or whose deviation from the workpiece design geometric model exceeds the preset range are selected and deleted; Through the above topology update operations, a difference Boolean operation is performed on the overlapping area of ​​the transition triangular mesh and the tool triangular mesh to achieve high-precision material removal and eliminate the voxel serration effect left over from the first stage; Output results: Generate the final high-precision workpiece triangular mesh model, which must meet the following requirements: geometric accuracy meets the preset standards to ensure the consistency of the shape and size of the key features of the workpiece; the model data can be directly used for subsequent process verification; support parameter optimization analysis to adapt to the application needs of high-precision machining scenarios.

8. A real-time cutting simulation system for performing a staged processing real-time cutting simulation method as described in any one of claims 1-7, characterized in that, include: The initialization modeling module is used for initial modeling, including building a blank voxel mesh model of the workpiece to be cut to meet the simulation requirements, generating the corresponding tool voxel mesh and triangular mesh based on the tool model, and setting the basic parameters for real-time cutting simulation. The first simulation module is used to perform the first simulation stage of low-precision real-time cutting dominated by voxel mesh. After the cutting simulation is started, the spatial overlap relationship between the tool voxel mesh and the blank voxel mesh is determined in real time to determine the voxel area to be removed. The blank voxels in the overlapping area are deleted through Boolean operation and the retention / deletion status of the blank voxel mesh is updated. The workpiece shape is rendered based on the updated blank voxel mesh and the simulation frame rate is guaranteed to meet the real-time interaction requirements. The switching condition monitoring module is used for the switching judgment phase. During the execution of the first simulation phase, it monitors the preset multi-dimensional switching trigger conditions in real time. When any condition or a combination of conditions is met, the mesh model is switched and the second simulation phase begins. The second simulation module is used for the second simulation stage of high-precision real-time cutting dominated by triangular meshes. It uses a voxel boundary extraction-patch fitting algorithm to convert the intermediate workpiece of the final voxel mesh in the first stage into a transitional triangular mesh. Based on the triangular mesh, high-precision cutting calculations are performed. Fine material removal is achieved by updating the topology, including patch segmentation, fragment merging, and redundant patch deletion, to eliminate the voxel serration effect. Collision detection is achieved by judging the intersection of the tool triangular mesh and the transitional triangular mesh. The final high-precision workpiece triangular mesh model that meets the requirements of subsequent process verification or parameter optimization is output.

9. A computer device comprising a memory and one or more processors, the memory storing computer code that, when executed by the one or more processors, causes the one or more processors to perform the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing computer code, wherein when the computer code is executed, the method of any one of claims 1 to 7 is performed.

Citation Information

Patent Citations

  • Voxelization processing method and device based on triangular mesh model

    CN108921928A

  • Cutting simulation implementation method for real-time machining monitoring

    CN110955934A

  • Numerical control machining milling real-time display method

    CN115047825A

  • Five-axis milling machine simulation method based on GPU (Graphics Processing Unit) parallel operation

    CN115268366A

  • Method and system for displaying, storing and backtracking residual blank in machining process

    CN119358063A

Cited By

  • Material removal process replay and cutting force parallel simulation method based on operation log

    CN121559910A

  • Combined cutter and workpiece contact detection and material removal simulation method in cutting process

    CN121613768A

  • Turning system and method for complex parts

    CN121918502A

  • Visual acceleration method for machining simulation of complex workpiece with large material removal amount

    CN122284517A