A method and system for real-time cutting simulation with staged processing
Patent Information
- Application Number
- CN202511568520.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2045-10-30
AI Technical Summary
[0016]针对上述问题,本发明的目的在于提供一种分阶段处理的实时切削仿真方法及系统,具体适用于数控加工过程模拟、虚拟制造、刀具路径验证等场景下的实时切削过程可视化与最终工件精度验证,尤其针对“仿真实时性”与“结果精度”难以兼顾的问题,根据切削仿真的不同阶段需求,提供分阶段求解的策略
(1)高效兼顾仿真实时性与结果精度
Smart Images

Figure CN121328138B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer-aided manufacturing technology, and in particular to a real-time cutting simulation method and system with phased processing. Background Technology
[0002] The core requirements of solid machining simulation are real-time performance (synchronous simulation of tool movement and material removal process to meet human-computer interaction or online verification needs) and accuracy (the final simulation results must accurately reflect the workpiece geometry to support subsequent machining parameter optimization or process verification). Existing technologies mainly achieve material removal and collision detection through a "single discrete model." Although trade-offs have been made between efficiency and accuracy in different dimensions, they have never been able to simultaneously meet both requirements. Specifically, there are four typical technical solutions: voxel, triangular mesh, dexel, and tri-dexel. Among them, dexel and tri-dexel are improved solutions proposed in recent years to address the "contradiction between voxels and triangular meshes," and are the closest existing technologies to this invention.
[0003] Existing technologies mainly rely on a single mesh model, and the following solutions are available: I. Voxel Mesh Core principle: Discretize the three-dimensional space of the workpiece into regular cubic units (voxels). By recording the binary state of each voxel as "whether it belongs to the material" (keep or delete), the geometric representation of the workpiece is realized. Collision detection and material removal are transformed into "spatial overlap judgment between tool voxels and blank voxels", which can be completed by traversing the voxel units.
[0004] Advantages: The computational logic is extremely simple, requiring no complex topology maintenance, and the efficiency is extremely high (the frame rate for simulation of conventional workpieces can reach 30~60fps), easily meeting the real-time cutting simulation requirements of the roughing stage; the hardware resource consumption is low, and it can run smoothly on ordinary computers.
[0005] Defects: There is an inherent "staircase effect" - the regularity of voxel units causes the workpiece boundary to be jagged, and the accuracy depends entirely on the voxel resolution; if the accuracy needs to be improved (such as reducing the voxel side length from 0.2mm to 0.05mm), the number of voxels will increase cubically with the resolution (when the volume remains unchanged, the number increases to 64 times), and the amount of computation increases exponentially. In the end, it is still impossible to achieve "high resolution + real-time performance", and 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: By fitting the workpiece surface with irregular triangular facets, a continuous three-dimensional geometric model is constructed; collision detection requires calculating the intersection relationship between the tool triangular facets and the workpiece triangular facets (such as the intersection of line segments and facets, and facets with facets); material removal requires updating the workpiece model through topology reconstruction (facet segmentation, fragment merging, and redundant facet deletion).
[0007] Advantages: The geometric expression is continuous and precise, and the triangular facets can be flexibly adapted to complex curved surfaces (such as free-form surfaces, thin walls, and sharp corners). The accuracy is extremely high (the boundary error can be controlled within 0.001~0.01mm, and the surface roughness simulation error is no greater than 0.1μm), which can meet the requirements of accurate verification of workpiece shape in the finishing stage.
[0008] Defects: The computational complexity is positively correlated with the number of triangular faces. Complex workpieces (such as aero-engine blades and precision molds) can have millions to tens of millions of triangular faces. Collision detection requires traversing a massive number of face pairs, and material removal requires frequent updates to the topology. The computational efficiency is extremely low (the normal frame rate is less than 5fps, and for complex workpieces it is even less than 1fps), which cannot meet the interactive requirements of real-time simulation.
[0009] III. Dexel The dexel (Depth Element) method is a compromise between "regular voxel discretization" and "complex triangular mesh topology," and has been widely used in medium-precision cutting simulation scenarios in recent years.
[0010] Core principles: (1) Based on the idea of two-dimensional depth buffer, the three-dimensional workpiece is discretized into parallel "dexel rays" (one-dimensional line segments) along a fixed direction (such as the Z-axis). The intersection of each ray with the workpiece surface constitutes a "depth interval" (recording the starting and ending depths of the ray passing through the workpiece). The geometric expression of the workpiece is realized by storing the depth intervals of all rays. (2) Material removal: Update the dexel depth intervals corresponding to the overlapping areas (such as shortening the depth interval or splitting the interval), without maintaining the three-dimensional topological relationship. (3) Collision detection: Calculate the projection range of the tool along the dexel ray direction, determine the overlapping part with the workpiece depth interval, and determine the area to be removed; Advantages: (1) Reduced discrete dimension (from three-dimensional voxels to one-dimensional rays), better computational efficiency than triangular mesh (frame rate of 10~20fps for complex workpieces), and the accuracy along the ray direction can be flexibly adjusted (e.g., increasing ray density); (2) Avoids the "staircase effect" of voxels, the workpiece boundary has a continuous linear feature along the ray direction, and the accuracy is better than voxel mesh (boundary error can be controlled within 0.05~0.1mm); (3) The data storage is less than that of voxel mesh (only the ray depth range is stored, and there is no need to record empty voxels), and the hardware resource consumption is moderate.
[0011] Defects: (1) Strong direction dependence: The direction of the dexel ray is fixed (e.g., only along the Z-axis). If the angle between the workpiece surface and the ray direction is too small (e.g., inclined plane, complex free surface), a "striped effect" will occur (the boundary is in the form of discrete stripes), and the accuracy will decrease significantly. If multi-directional rays are used to improve accuracy (e.g., X / Y / Z axes are discrete at the same time), the amount of data redundancy will increase, the complexity of Boolean operation will increase, and the real-time advantage will disappear. (2) Poor adaptation to complex features: For fine features such as thin walls (thickness < 0.5 mm) and sharp corners (radius < 0.1 mm), the ray density needs to be greatly increased to accurately capture them. At this time, the amount of calculation is close to that of voxel mesh, and the real-time performance cannot be guaranteed. (3) Insufficient final accuracy: Even if multi-directional rays are used, the dexel method still relies on one-dimensional discrete intervals to express three-dimensional geometry. The boundary smoothness is essentially different from that of triangular mesh (the error is usually ≥ 0.05 mm), which cannot meet the final simulation requirements of high-precision workpieces (e.g., medical equipment parts, precision instrument core components).
[0012] IV. tri-dexel Tri-Dexel is an advanced improvement of the Dexel method, aiming to combine the "geometric precision" of triangular meshes with the "computational efficiency" of the Dexel method. It is currently the mainstream research direction in the field of medium- and high-precision cutting simulation, and it is also the closest existing technology of its kind to this invention.
[0013] Core principles: (1) Using triangular mesh as the "surface geometric reference" of the workpiece, dexel rays are emitted from each vertex or facet center of the triangular mesh along a preset direction (such as the normal vector direction or the coordinate axis direction). The rays penetrate the interior of the workpiece and record the depth information. Through the hybrid model of "surface triangular mesh + internal dexel rays", the "surface continuous + internal discrete" expression of the workpiece geometry is realized. (2) Material removal: The surface area is updated through the topology of the triangular facets (to ensure the accuracy of fine features), and the internal area is updated through the dexel depth range (to reduce the amount of computation). (3) Collision detection: Surface collisions are judged by the intersection of triangular facets (to ensure surface accuracy), and internal collisions are judged by the depth range of the dexel rays (to improve efficiency). Advantages: (1) Better accuracy than traditional dexel method: The surface is fitted with triangular mesh to avoid "stripes effect". The expression accuracy of fine features (such as sharp corners and curved surfaces) is close to that of pure triangular mesh (the boundary error can be controlled within 0.02~0.05mm); (2) Better efficiency than pure triangular mesh: The internal dexel discretization is used, and there is no need to update the topology of all triangular facets. The frame rate of complex workpieces can reach 15~25fps, which takes into account both medium accuracy and medium real-time requirements.
[0014] Defects: (1) The balance between "efficiency and accuracy" still has bottlenecks: If the high precision requirement of the final workpiece (error not greater than 0.01mm) needs to be met, the density of surface triangular patches and internal dexel rays needs to be increased. At this time, the amount of calculation is close to that of pure triangular mesh, and the real-time performance is significantly reduced (frame rate < 10fps); if real-time performance is prioritized (frame rate ≥ 20fps), the internal dexel ray density is insufficient, and simulation errors such as "internal voids" or "material residues" are likely to occur; (2) The model consistency maintenance is complicated: The hybrid model of "surface triangular 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 and multi-tool collaborative cutting), “surface and internal geometry mismatch” is likely to occur (such as surface patches being deleted but internal dexel not being updated), resulting in distortion of simulation results; (3) Limited scene adaptability: For the roughing stage (large amount of material removal and low precision requirements), the surface triangular mesh of the tri-dexel method still needs to participate in the calculation, and the efficiency is lower than that of the voxel mesh (voxel frame rate ≥ 30fps); For the finishing stage (extremely high precision requirements), the internal dexel discretization will still introduce errors, and the precision is lower than that of the pure triangular mesh.
[0015] In summary, the field of solid machining simulation has long been limited by the inherent defects of "single discrete model". While voxel meshes can meet real-time requirements, they lack accuracy. Triangular meshes, while highly accurate, are inefficient. Dexel and tri-dexel, as targeted improvement solutions, have achieved a certain compromise between efficiency and accuracy, but still suffer from problems such as strong directional dependence, poor adaptation to complex features, bottlenecks in balancing "efficiency and accuracy", and difficulty in maintaining model consistency. They cannot completely solve the core contradiction of the coexistence of real-time and high-precision requirements, and are particularly difficult to adapt to the entire cutting process from roughing to finishing. Therefore, there is an urgent need for an innovative simulation method that can dynamically adjust the model according to the needs of different stages and take into account both real-time interaction and final accuracy. Summary of the Invention
[0016] To address the aforementioned problems, the present invention aims to provide a phased real-time cutting simulation method and system. Specifically applicable to real-time cutting process visualization and final workpiece accuracy verification in scenarios such as CNC machining process simulation, virtual manufacturing, and toolpath verification, it particularly addresses the challenge of balancing "simulation real-time performance" and "result accuracy." Based on the different stages of the cutting simulation requirements, a phased solution strategy is provided. Voxel meshes are used in the intermediate stages where "accuracy requirements are low but speed requirements are high," while triangular meshes are used in the final stage where "accuracy requirements are high but speed requirements can be appropriately relaxed." This phased strategy overcomes the contradiction between "efficiency and accuracy," improving the accuracy of the final simulation results while ensuring real-time performance.
[0017] The above-mentioned objective of this invention is achieved through the following technical solutions: 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 determine the voxel area to be removed. The blank voxels in the overlapping area are deleted through Boolean operation and the retention or 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. 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. Voxel boundary extraction and patch fitting algorithms are 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, 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 retention or deletion 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 retention or deletion status of the blank voxel mesh to retention, and mark the tool voxel mesh as an active cutting unit 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 and 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 the 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 detection performance and the system's computational load; 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 or 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 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 voxels and triangular meshes in stages need to balance the adaptability to the machining scenario with the balance between accuracy and efficiency, avoiding the limitations of a single condition. This includes five types of flexibly combinable switching trigger conditions, covering dimensions including geometric features, machining stages, accuracy requirements, and time costs, adapting to different cutting scenarios including roughing to semi-finishing to finishing, and simple workpieces to 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 criterion. It is triggered when the ratio is not greater than a preset threshold. 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 to semi-finish milling to finish milling, and the switching triggered by the finish milling stage. 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 not greater than 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. Voxel boundary extraction and patch fitting algorithms are used to convert the final voxel mesh intermediate workpiece from 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: The transformation operation is performed using voxel boundary extraction and triangular patch fitting algorithms, including the Marching Cubes algorithm. 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 of 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. The model 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 requirements of high-precision machining scenarios.
[0025] The present invention also provides a real-time cutting simulation system for performing the staged processing real-time cutting simulation method 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 or 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 voxel boundary extraction and patch fitting algorithms 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 accuracy error of the final output workpiece triangular mesh model is no greater than 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 from roughing to semi-finishing to finishing, adapt to different complexity requirements from simple workpieces to complex workpieces, and take into account both 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 thresholds, 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 and 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 determine the voxel area to be removed. The blank voxels in the overlapping area are deleted through Boolean operation and the retention or 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.
[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 retention or deletion status of the blank voxel mesh to retention, and mark the tool voxel mesh as an active cutting unit 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 and 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 the 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 detection performance and the system's computational load; 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 or 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 and volume overlap determination." 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 feeds) ensures real-time collision detection while avoiding unnecessary computational resource consumption, achieving "on-demand computation." 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 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 voxels and triangular meshes in stages need to balance the adaptability to the machining scenario with the balance between accuracy and efficiency, avoiding the limitations of a single condition. These include five types of flexibly combinable switching trigger conditions, covering dimensions including geometric features, machining stages, accuracy requirements, and time costs, adapting to different cutting scenarios from roughing to semi-finishing to finishing, and from simple workpieces to 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 criterion. It is triggered when the ratio is not greater than a preset threshold. 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 to semi-finish milling to finish milling, and the switching triggered by the finish milling stage. 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 not greater than 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
[0047] Note: The above conditions can be used individually or in combination (e.g., "remaining volume not greater than 10% + thin-walled structure exists"), and the threshold can be dynamically adjusted according to specific simulation requirements.
[0048] 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 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 switch judgment: calling the switch 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 or 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 S32 design 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 switching flexibility and stability through "composite logic + smooth connection": it adopts the judgment method of "OR logic and AND logic", which allows "triggering when any condition is met" (such as fast switching when only the remaining cutting time is not greater than the threshold, adapting to real-time priority scenarios) and also supports "multi-condition combination triggering" (such as "remaining material volume is not greater than the threshold + the 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 (pre-loading 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 "from roughing to finishing" and "from simple workpieces to 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.
[0049] S4: The second simulation stage of high-precision real-time cutting, dominated by triangular meshes, is carried out. Voxel boundary extraction and patch fitting algorithms are 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, 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.
[0050] In this embodiment, step S4 specifically includes: Mesh transformation: The transformation operation is performed using voxel boundary extraction and triangular patch fitting algorithms, including the Marching Cubes algorithm. 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.
[0051] 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 of 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 is no greater than 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.
[0052] 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 using algorithms such as Marching Cubes to perform "boundary recognition - isosurface extraction - dynamic sampling": First, boundary voxels in the voxel mesh that are in a "keep or 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 achieves seamless fitting between voxel boundaries and triangular patches, and 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 (with tool geometric accuracy 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, "fine material removal," determines the contact type (face-to-face, edge-to-face, etc.). This "coarse-to-fine" detection logic accurately locates the boundaries, area, and depth of cutting contacts while avoiding the efficiency loss of full-scale surface calculation. The third step, "fine material removal," achieves "micron-level" precision control through topological updates: surface 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 sub-surfaces after segmentation (ensuring surface smoothness); and redundant surface deletion removes invalid surfaces 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 no greater than 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.
[0053] 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.
[0054] 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 be no more than 0.3°, so as to avoid sawtooth errors during spherical cutting simulation and adapt to the high-precision calculation requirements of the second stage.
[0055] Basic parameters and switching conditions settings: According to 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: "the proportion of remaining material volume is not greater than 12% + the thin-walled structure of the blade is detected in real time (thickness not greater than 0.8mm)". This condition covers the two dimensions of "remaining volume" and "geometric features", which is adapted to the scenario requirements of high-precision machining of the thin-walled area of the blade. All parameters are stored in the simulation system database.
[0056] (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 and 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 element and the blank body element are matched unit by unit. After determining the overlapping area, it is added to the "list of voxels to be removed". Overlapping voxels are removed using Boolean difference operations, the "keep or 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.
[0057] (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—"the remaining material volume ratio is no more than 12%" and "a thin-walled structure with a thickness of no more than 0.8 mm is 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.
[0058] (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 voxel mesh is selected in the "keep or delete" state, and the spatial isosurface reflecting the blade surface contour is extracted. 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 surface 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 "sawtooth effect" of voxels in the rough milling stage.
[0059] 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-to-surface contact" (the 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 (merging area not exceeding 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.
[0060] 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 no more than 0.01 mm and a surface roughness of 0.8 μm. It fully meets the stringent requirements of aero-engine blades for the accuracy and surface quality of complex curved surfaces and can be directly used for subsequent blade processing technology verification (such as 3D comparison with the design model) and cutting parameter optimization.
[0061] 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 or 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 voxel boundary extraction and patch fitting algorithms 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.
[0062] 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.
[0063] 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.
[0064] 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.
[0065] 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 determine the voxel area to be removed. The blank voxels in the overlapping area are deleted through Boolean operation and the retention or 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. 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. In step S3, the multi-dimensional switching triggering conditions for voxels and triangular meshes in stages include five categories, specifically including: Remaining material volume ratio condition: The ratio of the remaining workpiece volume to the original blank volume is used as the judgment basis. It is triggered when the ratio is not greater than the preset threshold. Cutting stage type condition: The criterion is whether the cutting process has entered the finishing stage; Workpiece geometric feature complexity condition: The criterion is whether the workpiece has high-precision sensitive features; Preset accuracy threshold conditions: The judgment is based on whether the surface roughness and dimensional error required by the simulation meet the high-precision standard. Remaining cutting time threshold condition: Based on the remaining cutting time estimated based on toolpath length and feed rate, it is triggered when the remaining cutting time is not greater than a preset value; S4: The second simulation stage of high-precision real-time cutting, dominated by triangular meshes, is carried out. The Marching Cubes algorithm is used as the voxel boundary extraction and patch fitting algorithm 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 retention or deletion 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 retention or deletion status of the blank voxel mesh to retention, and mark the tool voxel mesh as an active cutting unit 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 and 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 the 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 detection performance and the system's computational load; 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 retention or deletion state matrix of the blank voxel mesh, update the corresponding matrix position of the deleted voxels to delete, 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; 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 are ignored, and the high-precision correction process in the subsequent second simulation stage is not affected.
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 composite judgment mechanism of OR logic and 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 S4, the second simulation stage of high-precision real-time cutting, dominated by triangular meshes, is performed. Voxel boundary extraction and patch fitting algorithms are used to convert the final voxel mesh intermediate workpiece from 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: The transformation operation is performed using voxel boundary extraction and triangular patch fitting algorithms, including the Marching Cubes algorithm. 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.
6. The real-time cutting simulation method with phased processing according to claim 5, 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 without 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 of 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, 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.
7. A real-time cutting simulation system for performing a staged processing real-time cutting simulation method as described in any one of claims 1-6, 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 or 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 voxel boundary extraction and patch fitting algorithms 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.
8. 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 6.
9. A computer-readable storage medium storing computer code that, when executed by a processor, implements the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Numerical control machining milling real-time display method
CN115047825A