Signed distance field-based digital twin cutting simulation method and system
Patent Information
- Application Number
- CN202611228321.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-13
- Publication Date
- 2026-10-27
AI Technical Summary
[0010]针对现有数控加工实时仿真存在的体素全局重建算力开销大、高分辨率仿真延迟高、异形刀具建模适配性差、多轴联动相对位置计算不准以及虚实仿真联动割裂等技术缺陷,本发明通过构建基于有符号距离场的工件表示模型、建立参数化刀具模型、采用GPU并行更新机制以及局部网格重建策略,提出了一种基于有符号距离场的数字孪生切削仿真方法及系统,旨在有效规避全局数据遍历与整体模型重建带来的性能损耗,大幅提升仿真实时性与渲染稳定性,满足高分辨率实时仿真的应用需求
相较于现有数控加工实时仿真技术,本发明通过架构优化、模型改进、运动求解革新与全流程体系搭建,有效解决了传统仿真方案实时性差、刀具适配性弱、多轴仿真精度低、流程碎片化等核心技术问题,具备显著的技术进步与工程应用价值,具体有益效果如下:
Smart Images

Figure CN122987376A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of CNC machining simulation, digital twins and 3D visualization, and in particular to a digital twin cutting simulation method and system based on a signed distance field. Background Technology
[0002] Numerical control (CNC) machining simulation is a core and critical technology in the process of intelligent manufacturing and digital transformation of the manufacturing industry. It is also an important technical means to ensure the accuracy of CNC machining, improve machining efficiency, and reduce machining losses. This technology relies on a virtual simulation environment to complete the pre-running and simulation analysis of the entire CNC machining process. Before trial cutting and batch processing of physical workpieces, it can accurately verify the movement trajectory of the machining tool and the distribution of machining allowance on the workpiece, and proactively identify potential collisions and interferences between machine tools, tools, workpieces, and fixtures. It can effectively identify process defects such as overcutting and undercutting during the machining process, thereby significantly reducing the material and time costs of physical trial cutting and avoiding production risks such as machining scrap and equipment damage. This has significant engineering implications for improving the stability and reliability of CNC machining.
[0003] In recent years, with the iterative upgrading and integrated application of cutting-edge technologies such as real-time machine tool data acquisition, high-precision 3D modeling, parallel high-performance computing, and digital twins, CNC machining simulation technology has achieved breakthrough development. Its technical form has been gradually iterated and upgraded, completely breaking away from the traditional single offline toolpath verification mode, and gradually evolving towards high-precision online simulation and dynamic simulation that can be synchronized in real time with the actual machine tool operating status, machining parameters, and working condition information. This has put forward higher technical requirements for the real-time performance, accuracy, realism, and dynamic adaptability of the simulation.
[0004] Digital twin technology, as a core enabling technology for the deep integration of the physical and information worlds, has shown broad application prospects in the field of CNC machining. In a CNC machining digital twin scenario, the virtual simulation model needs to maintain real-time data synchronization with the real machine tool, accurately reflecting the workpiece geometry, tool status, and machining conditions at any given moment. At every moment during the machining process, the workpiece geometry in the virtual space should be highly consistent with the physical workpiece entity after cutting. Simultaneously, the actual spatial pose, motion trajectory, and machining parameters of the tool should be mapped and dynamically synchronized in real time, thus providing a reliable data foundation and decision-making basis for machining quality monitoring, process optimization, and anomaly warning.
[0005] Currently, existing CNC machining real-time simulation technologies mostly employ core algorithms such as voxel modeling, symbolic distance field (SDF), and MarchingCubes isosurface extraction to complete the discretization and reconstruction of the workpiece's three-dimensional geometric model. They also simulate material removal behavior during the machining process by updating voxel states in real time and performing dynamic Boolean operations, thereby achieving simulation of the CNC cutting process.
[0006] However, existing mainstream CNC machining simulation technologies still have many technical shortcomings, making it difficult to adapt to the high-precision, high-real-time, and multi-condition requirements of five-axis CNC machining simulation. The specific technical defects are as follows: First, existing simulation architectures suffer from inefficient computing power scheduling and low data processing efficiency. Most current simulation solutions concentrate core computational tasks such as isosurface extraction and 3D mesh updates on the CPU. Furthermore, after the cutting simulation is completed, a global reconstruction and update of a large range of voxel data is often required. When the simulation scene increases voxel resolution and the machining cutting frequency is high, the computational load for model data traversal and isosurface extraction surges dramatically. This also generates massive CPU and GPU data exchange and transmission overhead, easily leading to a sharp drop in simulation rendering frame rate and increased system response latency. The simulation's real-time performance is significantly degraded, failing to meet the application requirements of high-resolution CNC real-time simulation.
[0007] Secondly, existing tool modeling methods suffer from poor versatility and limited simulation cutting accuracy. Current simulation technologies generally use standard, regular geometric shapes such as cylinders and spheres to approximate the tool's shape. This simplified modeling method can only adapt to general-purpose tools with regular shapes, such as flat-end mills, and cannot achieve accurate and unified modeling representation of irregularly shaped tools with dynamically changing axial radii, such as ball end mills, tapered cutters, chamfering cutters, reverse chamfering cutters, and T-cuts. The adaptability and scalability of tool models are severely insufficient, failing to realistically reproduce the actual cutting contours of irregularly shaped tools. This directly leads to deviations in the calculation of simulated cutting boundaries and cutting allowances, significantly reducing the accuracy and realism of CNC cutting simulation.
[0008] Furthermore, the relative motion calculations in multi-axis linkage machining scenarios suffer from biases, resulting in insufficient simulation reliability. For five-axis linkage machine tools and composite machine tools equipped with rotary tables / swivel heads / moving worktables, the tool and workpiece typically exhibit bidirectional coordinated motion during machining, with the workpiece posture continuously changing with the translation and rotation of the worktable. However, existing simulation solutions mostly rely solely on the world coordinate system or the tool's own coordinate system for cutting calculations, failing to incorporate the workpiece's real-time posture and dynamic motion parameters into a unified relative motion calculation system. This makes it impossible to accurately match the actual machine tool motion conditions, easily leading to inaccurate calculations of the relative spatial position between the tool and workpiece. Ultimately, this results in incorrect judgments of the material removal area, causing problems such as simulated overcutting, undercutting, and cutting area offset, resulting in significant deviations between simulation results and actual machining conditions.
[0009] Finally, existing technologies lack an integrated, end-to-end real-time simulation system. Traditional CNC simulation solutions fragment core functional modules such as model import, model voxelization, simulated cutting calculations, machine tool data integration, and tool change parameter updates. Data is processed independently at each stage without interconnection, failing to form a closed-loop, end-to-end simulation architecture that integrates industrial CAD model preprocessing, refined voxel management, GPU parallel high-speed computing, dynamic local mesh reconstruction, real-time data synchronization with the CNC system, and dynamic tool parameter updates. The lack of smooth data flow and poor coordination among stages makes it impossible to achieve dynamic real-time adaptation to machining conditions, and thus fails to meet the high-precision, fully dynamic, and real-time synchronized CNC machining simulation requirements of intelligent manufacturing scenarios. Summary of the Invention
[0010] To address the shortcomings of existing real-time CNC machining simulation methods, such as high computational cost of global voxel reconstruction, high latency in high-resolution simulation, poor adaptability to irregular tool modeling, inaccurate calculation of relative positions in multi-axis linkage, and disconnect between virtual and real simulation, this invention proposes a digital twin cutting simulation method and system based on a signed distance field. This method constructs a workpiece representation model based on a signed distance field, establishes a parameterized tool model, adopts a GPU parallel update mechanism, and employs a local mesh reconstruction strategy. The aim is to effectively avoid the performance loss caused by global data traversal and overall model reconstruction, significantly improve the real-time performance and rendering stability of the simulation, and meet the application requirements of high-resolution real-time simulation.
[0011] On the one hand, this invention proposes a digital twin cutting simulation method based on a signed distance field, which includes the following process: The workpiece 3D model is adapted in terms of format and coordinate system, and a voxel data file is generated based on the adapted workpiece mesh model. Read and parse the voxel data file to obtain the signed distance field voxel data of the workpiece, and divide the three-dimensional voxel space where the signed distance field voxel data of the workpiece is located into several voxel block units according to the preset block size. Establish a parameterized mathematical model for the cutting tool; During each round of cutting simulation, perform the following operations: The tool pose at adjacent sampling times in the world coordinate system is obtained and transformed to the workpiece local coordinate system to construct the continuous motion trajectory of the tool. The axial and radial distances from each voxel point in the three-dimensional voxel space to the tool axis are calculated. Construct a tool sweep bounding box, and based on the axial and radial distances of each voxel point to the tool axis, combined with the tool parameterized mathematical model, construct a signed distance field of the tool sweep volume. Perform Boolean update on the workpiece signed distance field voxel data to generate the workpiece signed distance field after material removal. Based on the tool sweep bounding box, the set of affected voxel blocks is determined. Using the signed distance field of the workpiece after material removal, local mesh reconstruction is performed on the set of affected voxel blocks to obtain the workpiece mesh model at the current moment. Maintain the tool parameter set and generate the tool mesh model for the current moment based on the current tool parameters; Repeat the above steps until the simulation ends.
[0012] Furthermore, the step of performing format and coordinate system adaptation on the workpiece 3D model, and generating a voxel data file based on the adapted workpiece mesh model, includes: Obtain a 3D model of a workpiece that contains at least one of a mesh model file and an industrial CAD model file; When the workpiece 3D model is a mesh model file, the mesh model file is used as the initial mesh model; when the workpiece 3D model contains an industrial CAD model file, the industrial CAD model file is converted into the initial mesh model through CAD format conversion. Based on the coordinate mapping relationship between the target rendering coordinate system and the model coordinate system, coordinate system adaptation processing is performed on the initial mesh model to obtain the adapted workpiece mesh model; wherein, the coordinate system adaptation processing includes at least one of axial mirror transformation, rotation transformation, scaling transformation, translation transformation and patch winding correction; Based on the adapted workpiece mesh model, the signed distance field voxel data of the workpiece is constructed, and the metadata of the signed distance field voxel data of the workpiece is determined. The signed distance field voxel data of the workpiece is stored in the form of a three-dimensional array to form a signed distance field array. The metadata of the signed distance field array and the signed distance field voxel data of the workpiece is serialized to generate a binary voxel data file.
[0013] Furthermore, based on the adapted workpiece mesh model, the construction of signed distance field voxel data for the workpiece and the determination of the metadata of the signed distance field voxel data for the workpiece include: According to the preset voxel resolution, the adapted workpiece mesh model is discretized to obtain a three-dimensional voxel space; Extract the bounding box dimensions of the mesh model file in the model coordinate system, and calculate the voxel grid dimensions based on the bounding box dimensions and the preset voxel resolution; Traverse the discrete sampling positions in the three-dimensional voxel space, and calculate the signed distance value corresponding to each discrete sampling position based on the voxel lattice size; The signed distance values corresponding to all discrete sampling positions in the three-dimensional voxel space are summarized to generate signed distance field voxel data of the workpiece, and the metadata of the signed distance field voxel data of the workpiece is determined.
[0014] Furthermore, the establishment of the tool parameterized mathematical model includes: Obtain the geometric features of the cutting tool; the geometric features are several sets of cross-sectional profile arrays arranged along the cutting tool axis; the first The group of cross-sectional profile arrays contains: the first The height position of each cross section along the tool axial direction and height position Corresponding tool cross-sectional radius ; Based on the geometric characteristics of the tool, a continuous geometric function of the tool is constructed to characterize the mapping relationship between the height position along the tool axis and the radius of the tool section. A parameterized mathematical model of the tool is established based on the continuous geometric function of the tool.
[0015] Furthermore, the construction of the tool's continuous geometric function based on the tool's geometric features includes: When the profiles between adjacent sections change linearly, for any axial height of the tool The axial height is determined by linear interpolation. The radius of the cutter section And construct the tool's continuous geometry function; When the profile between adjacent sections changes non-linearly, a preset analytical function is used to construct the tool's continuous geometry function; The analytic function is an arc function, a polynomial function, or a piecewise function.
[0016] Furthermore, the step of acquiring the tool pose at adjacent sampling moments in the world coordinate system and transforming it to the workpiece local coordinate system, constructing the continuous tool motion trajectory, and calculating the axial and radial distances from each voxel point in the three-dimensional voxel space to the tool axis includes: Obtain the tool pose at adjacent sampling times in the world coordinate system; Obtain the inverse pose transformation matrix of the workpiece relative to the world coordinate system at the current sampling time; Based on the inverse pose transformation matrix, the tool pose at adjacent sampling times in the world coordinate system is transformed to the workpiece local coordinate system to obtain the tool pose at adjacent sampling times in the workpiece local coordinate system. Based on the tool pose at adjacent sampling times in the workpiece local coordinate system, a continuous tool motion model is constructed using linear interpolation. Based on the continuous motion model of the tool, calculate the interpolated tool tip position and interpolated tool axis direction corresponding to each voxel point in the three-dimensional voxel space; Establish the tool axis based on the position of the interpolation tool tip and the direction of the interpolation tool axis, and calculate the axial and radial distances from the voxel point to the tool axis.
[0017] Furthermore, the method of constructing a continuous tool motion model based on the tool pose at adjacent sampling times in the workpiece's local coordinate system using linear interpolation includes: For any voxel point in the three-dimensional voxel space, the projection parameters of the voxel point on the tool tip motion trajectory are calculated based on the tool tip position at adjacent sampling times in the local coordinate system of the workpiece. Based on the tool tip position at adjacent sampling times in the local coordinate system of the workpiece, the interpolated tool tip position is calculated using projection parameters; Based on the tool axis direction at adjacent sampling times in the workpiece's local coordinate system, the interpolated tool axis direction is calculated using projection parameters.
[0018] Further, the construction of the tool sweep bounding box, and the construction of a signed distance field of the tool sweep body based on the axial and radial distances of each voxel point to the tool axis, combined with the tool parameterized mathematical model, and the Boolean update of the workpiece signed distance field voxel data, to generate the workpiece signed distance field after material removal, includes: Calculate the axis-aligned bounding box of the tool motion trajectory based on the tool tip position at adjacent sampling times in the workpiece local coordinate system; Obtain the maximum radius and effective cutting length of the tool, and based on the maximum radius and effective cutting length of the tool, expand the axis-aligned bounding box of the tool motion trajectory along the three coordinate axes of the workpiece local coordinate system to obtain the tool sweep bounding box; Determine the intersection region between the tool sweep bounding box and the three-dimensional voxel space; For any voxel point in the intersecting region According to voxel points The axial and radial distances to the tool axis are combined with the tool's continuous geometric functions and effective cutting length to construct a signed distance field for the tool. Using all voxel points with signed distance values less than or equal to 0, generate a signed distance field for the workpiece after material removal.
[0019] Further, the step of determining the affected voxel block unit set based on the tool sweep bounding box, and using the signed distance field of the workpiece after material removal to perform local mesh reconstruction on the affected voxel block unit set to obtain the workpiece mesh model at the current moment includes: The voxel regions in the 3D voxel space that intersect with the tool sweep bounding box are considered as affected regions, and vice versa, they are considered as unaffected regions. All voxel blocks within the affected area are combined together to form the affected voxel block set; Extract local voxel data of each affected voxel block unit from the signed distance field of the workpiece after material removal; Perform isosurface reconstruction on the local voxel data of each affected voxel block to generate updated mesh data for each affected voxel block. The updated mesh data of each affected voxel block is merged with the existing mesh data of the unaffected regions to obtain the workpiece mesh model at the current moment.
[0020] On the other hand, this invention proposes a digital twin cutting simulation system based on a signed distance field, the system comprising: The model preprocessing module is used to adapt the format and coordinate system of the workpiece 3D model, and generate voxel data files based on the adapted workpiece mesh model. The voxel segmentation management module is used to read and parse voxel data files, obtain signed distance field voxel data of the workpiece, and divide the three-dimensional voxel space composed of the signed distance field voxel data of the workpiece into several voxel segmentation units according to the preset segmentation size. The tool parameterization module is used to establish a mathematical model for tool parameterization. The relative motion calculation module is used to acquire the tool pose at adjacent sampling times in the world coordinate system and transform it to the workpiece local coordinate system to construct the continuous motion trajectory of the tool, and calculate the axial and radial distances from each voxel point in the three-dimensional voxel space to the tool axis. The material removal calculation module is used to construct the tool sweep bounding box and, based on the axial and radial distances of each voxel point to the tool axis, combined with the tool parameterized mathematical model, construct the signed distance field of the tool sweep body. Boolean update is performed on the workpiece signed distance field voxel data to generate the workpiece signed distance field after material removal. The block mesh reconstruction module is used to determine the set of affected voxel block cells based on the tool sweep bounding box, and to perform local mesh reconstruction on the set of affected voxel block cells using the signed distance field of the workpiece after material removal, so as to obtain the workpiece mesh model at the current moment. The tool mesh update module is used to maintain the tool parameter set and generate the tool mesh model at the current moment based on the current tool parameters; The rendering module is used to merge and visualize the current workpiece mesh model and tool mesh model in the same virtual scene, generating a real-time display of the cutting simulation.
[0021] The beneficial effects of adopting the above technical solution are as follows: Compared to existing real-time simulation technologies for CNC machining, this invention effectively solves core technical problems of traditional simulation schemes, such as poor real-time performance, weak tool adaptability, low accuracy in multi-axis simulation, and fragmented processes, through architecture optimization, model improvement, innovative motion solution, and the construction of a complete process system. It has significant technological advancements and engineering application value, with the following specific benefits: (1) Improve the dynamic response capability and rendering stability of high-resolution real-time simulation: The method of this invention relies on the signed distance field to complete the voxel preprocessing of the workpiece 3D model. Through the block voxel management mechanism combined with the parallel computing capability of the GPU, only local voxels within the tool sweep range are dynamically corrected, and incremental mesh reconstruction is completed for the affected voxels, effectively avoiding the performance loss caused by global data traversal and overall model reconstruction. This invention relies on the GPU computing center to complete the voxel modification, block data extraction and Marching Cubes isosurface reconstruction, and keeps the voxel data resident in the GPU memory for a long time. The mesh data of the affected blocks is output through the asynchronous readback mechanism, effectively avoiding the high overhead of CPU-side synchronous waiting and large-scale voxel overall reconstruction in traditional solutions. Compared to traditional simulation methods that only perform full mesh reconstruction on the CPU side, this invention abandons the global voxel data traversal and full mesh update mode, which greatly reduces the redundant computational overhead caused by massive data traversal operations and frequent CPU-GPU data synchronization readback, effectively reduces system operation latency, significantly improves the dynamic response capability and screen rendering stability of CNC cutting simulation under high-resolution voxel models, and can be adapted to high-precision, high-frequency real-time simulation conditions.
[0022] (2) Improving the scalability and cutting accuracy of the tool model: The method of this invention constructs a parametric rotary tool model based on a circular cross-section contour array. That is, the axial height-radius array is used to represent the rotary tool structure with a circular cross-section. The radius parameter at any height position of the tool is solved by interpolation and piecewise fitting algorithms. It can realize accurate modeling and GPU synchronous computation of various rotary tools such as flat end mills, ball end mills, tapered end mills, chamfering end mills, reverse chamfering end mills, and T-shaped end mills under a unified data structure. It breaks through the limitations of traditional approximate modeling of regular geometric bodies and effectively solves the problems of poor scalability and low cutting accuracy. This parametric model framework is not only compatible with various irregular tool structures, improving the versatility and scalability of the tool model, but also facilitates online tool changing control and standardized tool library management in the simulation system. It is adapted to parallel high-speed cutting calculation on the GPU, realistically restores the actual cutting contour, and significantly improves simulation efficiency and the range of applicable scenarios.
[0023] (3) Improve the accuracy and consistency of material removal area judgment in complex machining scenarios: This invention unifies the tool tip position, tool axis direction, and voxel sampling points to the workpiece local coordinate system to complete the cutting calculation, establishes a solution mechanism for the relative motion between the tool and the workpiece in the workpiece local coordinate system, and fully incorporates the changes in workpiece translation and rotation attitude brought about by five-axis linkage, rotary table tilting, and moving worktable, accurately solving the real-time relative position between the tool and the workpiece. Compared with the traditional cutting simulation method based on a single coordinate system or static workpiece model, this invention fully adapts to the complex machining conditions of worktable translation, rotation, and multi-axis linkage, effectively eliminates the calculation deviation of the relative position between the tool and the workpiece during the dynamic change of workpiece attitude, avoids simulation distortion problems such as cutting area offset, overcutting, and undercutting, and significantly improves the accuracy and consistency of material removal area judgment in complex machining scenarios with multi-axis linkage.
[0024] (4) Improve the completeness and accuracy of material removal simulation: The method of the present invention dynamically constructs the tool sweep body based on the tool tip position and tool axis direction of adjacent frames, and uses SDF Boolean subtraction to update the signed distance field of the workpiece in real time, which fully covers the tool motion trajectory between frames, makes up for the defects of traditional point-by-point cutting calculation, effectively avoids the risk of missing cutting under the conditions of high-speed feed and low sampling frequency of machine tool, and improves the completeness and accuracy of material removal simulation.
[0025] (5) Establish real-time synchronous linkage of machine tool data: This invention collects machine tool coordinates, spindle status, feed parameters, tool number, program name and equipment operating status in real time through a configurable industrial communication interface. It drives the virtual machine tool axis movement, cutting status update and online tool change matching in a thread-safe manner, so as to realize the real-time accurate mapping and synchronous linkage between the physical machine tool operating status and the virtual cutting simulation, forming a complete closed-loop simulation process from model preprocessing, voxel management, parallel computing, local reconstruction to machine tool data linkage.
[0026] (6) Ensure the standardization, reusability and accuracy of simulation model data: The method of this invention constructs a complete preprocessing link from CAD model, mesh model, SDF voxel to binary voxel file, and sequentially completes the general CAD format conversion, coordinate system correction, SDF generation and persistent storage of binary voxel file, and performs loading verification through version number, resolution and model unique identifier to ensure the standardization, reusability and accuracy of simulation model data.
[0027] In addition, this invention integrates core components such as CAD model preprocessing, standardized SDF voxelization, block-based incremental dynamic updates, CNC instruction parsing, real-time machine tool data access, and automatic tool switching to construct a closed-loop, integrated complete CNC real-time cutting simulation process, breaking through the technical bottleneck of traditional simulation modules being independent and data fragmentation. In application scenarios with matching GPU computing resources and machine tool communication conditions, this invention can flexibly configure parameters according to actual simulation accuracy and real-time requirements. The voxel resolution can be configured as needed to different levels such as 128³, 256³, 512³, and 800³, and the machine tool data acquisition cycle can be configured to 100ms or other custom cycles, which can flexibly adapt to the simulation needs of different industrial processing scenarios and has extremely strong engineering adaptability and scalability. Attached Figure Description
[0028] Figure 1 This is a flowchart of a digital twin cutting simulation method based on a signed distance field in this embodiment; Figure 2 This is a diagram of the GPU computing pipeline architecture in this embodiment; Figure 3 This is a structural diagram of a digital twin cutting simulation system based on a signed distance field in this embodiment. Detailed Implementation
[0029] To facilitate understanding of this application, specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and embodiments. The following embodiments are illustrative of the invention but are not intended to limit its scope. Rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure of this application.
[0030] Example 1: This embodiment presents a digital twin cutting simulation method based on a signed distance field, such as... Figure 1 As shown, the method includes the following steps: The workpiece's 3D model undergoes format and coordinate system adaptation, and voxel data files are generated based on the adapted workpiece mesh model, including: Obtain a 3D model of a workpiece that includes at least one of a mesh model file and an industrial CAD model file.
[0031] When the workpiece 3D model is a mesh model file, the mesh model file is used as the initial mesh model; when the workpiece 3D model contains an industrial CAD model file, the industrial CAD model file is converted into a mesh model that can be used for rendering and voxelization through CAD format conversion, and used as the initial mesh model.
[0032] In this embodiment, the 3D model of the workpiece is obtained by importing a 3D model file. The imported model file can be a triangular mesh model or an industrial CAD format such as STEP / STP. When importing a triangular mesh model, it can be directly read and proceeded to subsequent processing. When importing a STEP / STP format file, the CAD model conversion module performs format parsing and surface discretization processing on the input industrial CAD model, converting the parametric CAD model into a triangular mesh model. The CAD format conversion module can be implemented using an open-source CAD kernel, a commercial CAD converter, or a self-developed format parsing module. In this embodiment, tools such as FreeCAD can be used to complete the format conversion, but this tool is not a necessary limitation of the present invention.
[0033]
[0034] in, Industrial CAD models in STEP / STP format; This describes the process of parsing and meshing a CAD model. This is the converted triangular mesh model.
[0035] Based on the coordinate mapping relationship between the target rendering coordinate system and the model coordinate system, coordinate system adaptation processing is performed on the mesh model file to obtain the adapted workpiece mesh model; wherein, the coordinate system adaptation processing includes at least one of axial mirror transformation, rotation transformation, scaling transformation, translation transformation and patch winding correction.
[0036] In this embodiment, the model coordinate system refers to the local Cartesian space coordinate system to which the workpiece is attached when the workpiece's 3D model is generated, used to characterize the workpiece's own geometric features; the target rendering coordinate system refers to the global reference coordinate system used to uniformly characterize the spatial positions of all geometric elements (including workpieces, tools, and machine tool moving parts) in the virtual machining scene. Based on the coordinate relationship difference between the target rendering coordinate system and the model coordinate system, coordinate system adaptation processing is performed on the mesh model. The coordinate system adaptation processing includes one or more of axial mirror transformation, rotation transformation, scaling transformation, translation transformation, and patch rotation correction. Specifically, in this embodiment, based on the coordinate definitions of the 3D rendering engine and the CNC machine tool coordinate system, X-axis mirror correction is performed on the initial mesh model, or mirror correction and combined coordinate transformations in the Y and Z axes are performed according to actual application requirements. The workpiece mesh model after coordinate system adaptation is denoted as... .
[0037] Based on the adapted workpiece mesh model, signed distance field voxel data of the workpiece is constructed, and the metadata of the signed distance field voxel data of the workpiece is determined, including: According to the preset voxel resolution, the adapted workpiece mesh model is discretized to obtain a three-dimensional voxel space.
[0038] Extract the bounding box dimensions of the mesh model file in the model coordinate system, and calculate the voxel grid dimensions based on the bounding box dimensions and the preset voxel resolution.
[0039] In this embodiment, the coordinates of all vertices of the mesh model file in the model coordinate system are obtained, along with the maximum and minimum values in the X, Y, and Z coordinate directions. Based on the difference between the maximum and minimum values in each direction, the bounding box size of the mesh model file in the model coordinate system is calculated. The voxel grid size is determined based on the bounding box size of the workpiece model and the preset voxel resolution.
[0040] in, Indicates the size of the voxel lattice element; This represents the preset voxel resolution parameter, used to determine the model space discretization accuracy. It can be configured according to simulation accuracy requirements and real-time computing performance needs. Represents the workpiece mesh model The bounding box size, since it represents the inherent geometric dimensions of the workpiece, is the basis for the workpiece mesh model after coordinate system adaptation. The bounding box size is numerically the same as the bounding box size of the mesh model file in the model coordinate system.
[0041] Traverse the discrete sampling positions in the three-dimensional voxel space, and calculate the signed distance value corresponding to each discrete sampling position based on the voxel lattice size.
[0042]
[0043] in, Represents the adapted workpiece mesh model At discrete sampling locations The corresponding signed distance value; This represents the signed distance field transformation process based on a triangular mesh model.
[0044] The signed distance value is used to represent the spatial distance relationship between the discrete sampling position and the workpiece surface: when the discrete sampling position When located in the external space of the workpiece, When discrete sampling position When located on the workpiece surface, When discrete sampling position When located in the internal region of the workpiece, Therefore, by traversing the discrete sampling positions in the voxel space, three-dimensional signed distance field data describing the geometry of the workpiece can be obtained.
[0045] The signed distance values corresponding to all discrete sampling positions in the three-dimensional voxel space are summarized to generate signed distance field voxel data of the workpiece, and the metadata of the signed distance field voxel data of the workpiece is determined.
[0046] In this embodiment, the metadata includes: voxel grid dimension, grid origin coordinates, voxel grid size, bounding box size, model unique identifier, voxel resolution parameters, file version number, and data verification field.
[0047] The signed distance field voxel data of the workpiece is stored in the form of a three-dimensional array to form a signed distance field array. The metadata of the signed distance field array and the signed distance field voxel data of the workpiece is serialized to generate a binary voxel data file.
[0048] In this embodiment, the generated signed distance field data is stored in the form of a three-dimensional array, and the stored SDF array and corresponding metadata are serialized to generate a binary voxel data file. When loading the binary voxel data file, the model identifier, voxel resolution, and voxel data integrity are checked for consistency based on one or more pieces of information in the metadata to ensure the consistency between the voxel data and the workpiece model during the simulation.
[0049] The voxel data file is read and parsed to obtain the signed distance field voxel data of the workpiece. The three-dimensional voxel space where the signed distance field voxel data of the workpiece is located is divided into several voxel block units according to the preset block size.
[0050] In this embodiment, a binary voxel data file is read, and the signed distance field voxel data of the workpiece is uploaded to the full voxel buffer in the GPU memory. Based on a preset block size, such as 8³ to 32³, the three-dimensional voxel space is divided into multiple voxel block units, each corresponding to an independently updatable block mesh object. The parallel computing process executed by the GPU is as follows: Figure 2 As shown, the GPU thread group size can be set according to hardware conditions, for example, using an 8×8×8 thread group.
[0051] In the target rendering coordinate system, the three-dimensional voxel space The dimensions in the three coordinate directions are respectively The number of voxel blocks divided is:
[0052] in, This indicates the number of voxels in a single voxel block unit in any coordinate direction.
[0053] Each voxel block unit corresponds to an independent 3D mesh display object, which includes at least one of the following: mesh data cache, material parameters, and rendering components. After the simulation system completes the loading of voxel data, it enters the initialization phase. Based on the spatial position, visibility, distance information, or loading priority of each voxel block unit, the corresponding initial mesh is generated step by step through an asynchronous task queue to avoid blocking the main thread by building all voxel meshes at once.
[0054] Establish a parameterized mathematical model for the cutting tool.
[0055] In this embodiment, the tool parameterization mathematical model uses a sequence of circular cross-sectional radii arranged along the tool axis to describe the geometric characteristics of the rotating tool, and establishes a continuous tool geometric function based on the cross-sectional radius corresponding to the axial height, which is used for subsequent tool signed distance field calculation and material removal determination.
[0056] The establishment of the tool parameterized mathematical model includes: Obtain the geometric features of the cutting tool; the geometric features are several sets of cross-sectional profile arrays arranged along the cutting tool axis; the first The group of cross-sectional profile arrays contains: the first The height position of each cross section along the tool axial direction and height position Corresponding tool cross-section radius .
[0057] Based on the geometric characteristics of the cutting tool, a continuous geometric function of the cutting tool is constructed to characterize the mapping relationship between the height position along the cutting tool axis and the radius of the cutting tool cross section.
[0058] A parameterized mathematical model of the tool is established based on the continuous geometric function of the tool.
[0059] In this embodiment, the tool parameterization model is represented as:
[0060] in, Represents the parameterized model of the tool; This refers to the axial position of the starting end of the tool; The radius of the cross-section at the starting end of the tool; The height position of the first section along the tool axial direction; For the height position The radius of the tool section at that location; For the first The height position of each cross section along the axial direction of the tool; For the height position The radius of the tool section at that location.
[0061] The construction of a continuous geometric function for the tool based on its geometric features includes: When the profiles between adjacent sections change linearly, for any axial height of the tool The axial height is determined by linear interpolation. The radius of the cutter section And construct the tool's continuous geometry function.
[0062] In this embodiment, for any axial height position ,when At that time, the height position is obtained by linear interpolation based on the variation relationship between two adjacent sets of cross-sectional profile arrays. The corresponding tool section radius is used to construct the tool's continuous geometric function, expressed as:
[0063] in, Indicates altitude position The radius of the corresponding tool section at that location; For the first The height position of each cross section along the axial direction of the tool; For the height position The radius of the tool section at that location; For the first The height position of each cross section along the axial direction of the tool; For the height position The radius of the tool section at that location.
[0064] The above method is used to obtain a continuously varying radius profile of the tool along the axial direction.
[0065] When the profile between adjacent sections changes non-linearly, a preset analytical function is used to construct the tool's continuous geometry function; The analytic function includes: circular arc function, polynomial function, or piecewise function.
[0066] In this embodiment, for tools with complex end surfaces or continuously changing profiles, the continuous geometric function of the tool can be established based on the theoretical geometry of the tool as follows:
[0067] in, Indicates the axial height position of the tool With cross-sectional radius A continuous function relating the two axes is used to calculate the tool section radius at different axial positions. The tool profile can be constructed using linear functions, circular arc functions, polynomial functions, or piecewise functions based on the theoretical profile of the tool.
[0068] The above parameterized description method can uniformly represent rotary cutting tools with circular cross-section features, such as flat end mills, ball end mills, tapered cutters, chamfering cutters, reverse chamfering cutters, and T-cutters.
[0069] When a tool change occurs or tool parameters change, the updated tool profile parameters are synchronized to the GPU for subsequent tool space occupancy calculations and tool-workpiece interaction calculations. The established parameterized mathematical model of the tool serves as input for subsequent tool sign distance field calculations and material removal determinations.
[0070] The tool pose at adjacent sampling times in the world coordinate system is obtained and transformed to the workpiece local coordinate system to construct the continuous motion trajectory of the tool. The axial and radial distances from each voxel point in the three-dimensional voxel space to the tool axis are calculated.
[0071] The process of acquiring the tool pose at adjacent sampling moments in the world coordinate system and transforming it to the workpiece local coordinate system, constructing the continuous tool motion trajectory, and calculating the axial and radial distances from each voxel point in the three-dimensional voxel space to the tool axis includes: Obtain the tool pose at adjacent sampling times in the world coordinate system; where the tool pose includes: tool tip position and tool axis direction.
[0072] Obtain the inverse pose transformation matrix of the workpiece relative to the world coordinate system at the current sampling time.
[0073] In this embodiment, the tool tip position represents the three-dimensional coordinates of the tool tip in the world coordinate system, and the tool axis direction represents the unit direction vector of the tool axis. The workpiece pose is used to determine the position and orientation of the workpiece's local coordinate system relative to the world coordinate system. Since the workpiece can translate or rotate with the worktable during five-axis linkage machining, to ensure that all cutting calculations are performed with the workpiece as a reference, this embodiment uniformly transforms the tool pose obtained in the world coordinate system to the workpiece's local coordinate system.
[0074] Based on the inverse pose transformation matrix, the tool pose at adjacent sampling times in the world coordinate system is transformed to the workpiece local coordinate system, thus obtaining the tool pose at adjacent sampling times in the workpiece local coordinate system.
[0075] In this embodiment, let the pose transformation matrix of the workpiece relative to the world coordinate system at the current moment be... The position of the knife tip in the world coordinate system is The tool tip position in the workpiece's local coordinate system satisfy:
[0076] Since the tool axis direction is only affected by the rotation of the coordinate system, the inverse transformation of the rotation part of the pose transformation matrix is used to synchronously transform the tool axis direction in the world coordinate system to the local coordinate system of the workpiece, so as to obtain the corresponding local tool axis direction.
[0077] Based on the tool pose at adjacent sampling times in the workpiece's local coordinate system, a continuous tool motion model is constructed using linear interpolation.
[0078] Since the tool moves continuously between adjacent sampling times, in order to accurately describe the tool's motion trajectory within the sampling interval, this embodiment uses linear interpolation to construct a continuous motion model of the tool.
[0079] The tool pose based on adjacent sampling times in the workpiece's local coordinate system is used to construct a continuous tool motion model using linear interpolation, including: For any voxel point Based on the tool tip position at adjacent sampling times in the workpiece's local coordinate system, voxel points are calculated. Projection parameters on the trajectory of the blade tip .
[0080]
[0081] in, The `clamp` function is used to apply projection parameters. Limited to the range Inside; This indicates the tool tip position at the current sampling moment in the workpiece's local coordinate system; This indicates the tool tip position at the previous sampling time in the workpiece's local coordinate system.
[0082] Based on the tool tip position at adjacent sampling times in the workpiece's local coordinate system, using projection parameters Calculate the position of the interpolation tool tip. .
[0083]
[0084] Based on the tool axis direction at adjacent sampling times in the workpiece's local coordinate system, using projection parameters Calculate the interpolation tool axis direction .
[0085] In this embodiment, since the tool posture may change during the movement, the interpolated tool axis direction at the corresponding moment is further calculated. .
[0086]
[0087] in, This represents the vector normalization operation; The direction of the tool axis at the current sampling moment in the local coordinate system of the workpiece; This indicates the tool axis direction at the previous sampling moment in the workpiece's local coordinate system.
[0088] Based on the continuous motion model of the tool, the interpolated tool tip position and interpolated tool axis direction corresponding to each voxel point in the three-dimensional voxel space are calculated.
[0089] Establish the tool axis based on the position of the interpolation tool tip and the direction of the interpolation tool axis, and calculate the axial and radial distances from the voxel point to the tool axis.
[0090] In this embodiment, voxel points The axial distance to the tool axis is:
[0091] The radial distance is:
[0092] in, Representing voxel points Projected distance along the tool axis direction; Representing voxel points The shortest radial distance to the centerline of the tool axis. These axial and radial distances serve as the basis for subsequent calculations of the signed distance field of the tool and for determining material removal.
[0093] Construct a tool sweep bounding box, and based on the axial and radial distances of each voxel point to the tool axis, combined with the tool parameterized mathematical model, construct a signed distance field of the tool sweep volume. Perform Boolean update on the workpiece signed distance field voxel data to generate the workpiece signed distance field after material removal.
[0094] In this embodiment, the signed distance field is updated using Boolean algorithm. Based on the relative pose of the tool at adjacent sampling times, a signed distance field corresponding to the tool sweep body is constructed in the local coordinate system of the workpiece, and the signed distance field of the workpiece is updated accordingly.
[0095] The process involves constructing a tool sweep bounding box and, based on the axial and radial distances from each voxel point to the tool axis, combining this with a parameterized mathematical model of the tool, constructing a signed distance field of the tool sweep volume. Boolean updates are then performed on the workpiece signed distance field voxel data to generate the workpiece signed distance field after material removal, including: The axis-aligned bounding box of the tool motion trajectory is calculated based on the tool tip position at adjacent sampling times in the workpiece's local coordinate system.
[0096] In this embodiment, based on the tool pose at adjacent sampling times, the continuous motion trajectory of the tool within the sampling time interval is determined in the local coordinate system of the workpiece, and the tool sweep volume is constructed by interpolation.
[0097] Obtain the maximum radius and effective cutting length of the tool, and based on the maximum radius and effective cutting length, expand the axis-aligned bounding box of the tool motion trajectory along the three coordinate axes of the workpiece local coordinate system to obtain the tool sweep bounding box.
[0098] To reduce the number of voxels that do not require calculation, this embodiment first determines the spatial bounding range of the tool sweep body and performs distance field calculations only on voxels within this bounding range. Specifically, this is based on the tool tip position at the current sampling moment in the workpiece's local coordinate system. The tool tip position at the previous sampling time in the workpiece local coordinate system Calculate the axis-aligned bounding box corresponding to the tool movement trajectory. ,in, This represents the calculation of the axis-aligned bounding box. Further considering the maximum tool radius and effective cutting length, the axis-aligned bounding box is expanded by the corresponding distance along the three coordinate axes to obtain the tool sweep bounding box. .
[0099]
[0100] in, This indicates an expansion operation of the axis-aligned bounding box according to the tool geometry. This represents the expansion scale determined by the maximum tool radius and effective cutting length; for example, expanding the maximum radius radially and extending the effective cutting length at both ends axially. Subsequently, only the region where the sweep bounding box intersects with the voxel mesh (i.e., 3D voxel space) is considered. Signed distance field updates are performed on the voxel points within the range. This represents the minimum index of the intersecting region in the three coordinate directions of the voxel grid; This represents the maximum index of the intersecting region in the three coordinate directions of the voxel grid.
[0101] Determine the intersection region between the tool sweep bounding box and the three-dimensional voxel space.
[0102] For any voxel point in the intersecting region According to voxel points The axial and radial distances to the tool axis are combined with the tool's continuous geometric functions and effective cutting length to construct a signed distance field for the tool.
[0103] In this embodiment, for any voxel point According to axial distance and radial distance A signed distance field for the tool is established by combining the tool's geometric parameters. Specifically, let the tool's continuous geometric function... Used to indicate the axial position of the tool The corresponding outer contour radius of the tool at that location.
[0104] For different tool types, the radius function uses the corresponding geometric expression. For example: flat end mill: Ball-head blade: The bullnose blade can be described using a corresponding fillet radius function; among which, This refers to the nominal radius parameter corresponding to the tool type.
[0105] For an effective cutting length of The cutting tool has a signed distance field that satisfies:
[0106] in, Representing voxel points The corresponding knife has a signed distance value; This indicates taking the maximum value; when When, it represents a voxel point. Located inside the cutting tool; when When, it represents a voxel point. Located on the tool surface; when When, it represents a voxel point. Located outside the cutting tool.
[0107] Using all voxel points with signed distance values less than or equal to 0, generate a signed distance field for the workpiece after material removal.
[0108] In this embodiment, only when The signed distance field of the workpiece after material removal is:
[0109] in, Representing voxel points The updated workpiece has a signed distance value; Representing voxel points The workpiece signed distance value before the update was taken from the workpiece signed distance field voxel data. The updated value will be... As input for the cutting calculation at the next moment.
[0110] The aforementioned signed distance field update process can be executed in parallel by the GPU, such as... Figure 2 As shown, each GPU thread is responsible for calculating the distance values of one or more voxel points and updating the results, thereby improving the computational efficiency of large-scale voxel models.
[0111] Based on the tool sweep bounding box, the set of affected voxel blocks is determined. Using the signed distance field of the workpiece after material removal, local mesh reconstruction is performed on the set of affected voxel blocks to obtain the workpiece mesh model at the current moment.
[0112] In this embodiment, the set of affected blocks is determined based on the tool sweep range. Local voxel extraction, isosurface reconstruction, and corresponding block rendering mesh are only performed on the affected blocks. The unaffected blocks retain their original mesh data, enabling real-time cutting display of the workpiece model to reduce redundant calculations and improve real-time simulation efficiency. The process involves determining the affected voxel block set based on the tool sweep bounding box, and then using the signed distance field of the workpiece after material removal to perform local mesh reconstruction on the affected voxel block set to obtain the workpiece mesh model at the current moment, including: The voxel regions in the 3D voxel space that intersect with the tool sweep bounding box are considered as affected regions, and vice versa.
[0113] All voxel blocks within the affected area are combined together to form the affected voxel block set.
[0114] Extract local voxel data of each affected voxel block unit from the signed distance field of the workpiece after material removal.
[0115] Isosurface reconstruction is performed on the local voxel data of each affected voxel block to generate updated mesh data for each affected voxel block.
[0116] The updated mesh data of each affected voxel block is merged with the existing mesh data of the unaffected regions to obtain the workpiece mesh model at the current moment.
[0117] In this embodiment, subsequent mesh reconstruction is performed only on the affected voxel blocks, while the original mesh data of the remaining unaffected voxel blocks remains unchanged. Specifically, local voxel data of each affected voxel block in the affected voxel block set is extracted from the signed distance field of the workpiece after material removal.
[0118]
[0119] in, It serves as a full-volume voxel buffer, used to store the signed distance field of the workpiece after material removal; This is the starting offset of the block; For the local voxel buffer corresponding to the affected block; This is for extracting operation functions.
[0120] After extraction, isosurface reconstruction is performed on the local voxel data. The isosurface threshold is taken as the zero surface of the signed distance field of the workpiece to generate the corresponding block mesh.
[0121] The reconstructed block mesh includes vertex data, normal data, and index data, and the rendering mesh of the corresponding block is updated. Since mesh reconstruction is performed only on the affected blocks, the computational cost of mesh generation can be reduced, thus improving the efficiency of real-time simulation cutting on CNC machine tools.
[0122] Maintain the tool parameter set and generate the tool mesh model at the current moment based on the current tool parameters for three-dimensional visualization of the tool.
[0123] In this embodiment, a set of tool parameters is maintained, with each tool corresponding to a set of parameterized description information. Tool parameters of the physical CNC machine tool or its host system are acquired through an industrial communication interface, and the virtual machine spindle movement, cutting status updates, and tool parameter switching are driven based on these tool parameters.
[0124] The tool parameters include: tool number, tool type, cutting edge diameter, shank diameter, cutting edge length, overhang length, radius (R angle), and tool length; When a change in the current tool number is detected or a tool change command is executed, the corresponding tool parameters are retrieved based on the tool number, and the current tool parameters are updated.
[0125] In this embodiment, the tool triangular mesh model is used for the visualization of the tool and is independent of the tool parametric mathematical model. The tool parametric mathematical model is used for calculating the signed distance field of the tool and determining material removal, while the generated tool triangular mesh model is used for real-time rendering and display.
[0126] This invention eliminates the need for pre-storing triangular mesh models corresponding to different cutting tools; instead, it generates tool triangular meshes in real-time based on the current tool parameters. Specifically, for different types of cutting tools, different geometric combinations can be used to construct the corresponding tool meshes, including: flat-end cutting tools using a combination of cylindrical sidewalls and end faces; rounded-corner cutting tools using a combination of cylindrical sidewalls, rounded transition surfaces, and end faces; ball-end cutting tools using a combination of cylindrical sidewalls and spherical surfaces; and other rotating cutting tools using a parametric method based on their corresponding contour parameters. Specifically, the cylindrical sidewalls are generated based on the tool diameter, effective cutting length, and axial discretization accuracy; the rounded transition region generates multiple cross-sections based on the tool tip radius, rounded corner discretization accuracy, and circumferential discretization accuracy, and these are connected to form a continuous transition surface; and the end face generates a closed surface based on the corresponding cross-sectional contour.
[0127] During the process of generating the tool mesh, the vertex normals are calculated based on the analytical normals of each geometric surface, and the corresponding vertex data, normal data, and index data are generated to ensure the continuity and geometric accuracy of the tool model display.
[0128] After the tool mesh is updated, the generated mesh data is submitted to the rendering module to replace the current tool display model, realizing real-time visual updates of the tool after tool change. At the same time, the tool tip position, tool axis direction and tool pose in the workpiece local coordinate system are recalculated based on the updated tool parameters, and the tool display status is updated synchronously to keep the virtual tool consistent with the actual machining status.
[0129] Repeat the above steps until the simulation ends. In this embodiment, the simulation end time is determined according to user instructions.
[0130] Example 2: This embodiment presents a real-time simulation cutting system for CNC machine tools based on a signed distance field, such as... Figure 3 As shown, the system includes: The model preprocessing module is used to adapt the format and coordinate system of the workpiece 3D model, and generate voxel data files based on the adapted workpiece mesh model.
[0131] The voxel segmentation management module is used to read and parse voxel data files, obtain signed distance field voxel data of the workpiece, and divide the three-dimensional voxel space composed of the signed distance field voxel data of the workpiece into several voxel segmentation units according to the preset segmentation size.
[0132] The tool parameterization module is used to establish a parameterized mathematical model for the tool.
[0133] The relative motion calculation module is used to acquire the tool pose at adjacent sampling times in the world coordinate system and transform it to the workpiece local coordinate system to construct the continuous motion trajectory of the tool, and calculate the axial and radial distances from each voxel point in the three-dimensional voxel space to the tool axis.
[0134] The material removal calculation module is used to construct the tool sweep bounding box and, based on the axial and radial distances of each voxel point to the tool axis, combined with the tool parameterized mathematical model, construct the signed distance field of the tool sweep body. Boolean updates are performed on the workpiece signed distance field voxel data to generate the workpiece signed distance field after material removal.
[0135] The block mesh reconstruction module is used to determine the set of affected voxel block elements based on the tool sweep bounding box, and to perform local mesh reconstruction on the set of affected voxel block elements using the signed distance field of the workpiece after material removal, so as to obtain the workpiece mesh model at the current moment.
[0136] The tool mesh update module is used to maintain the tool parameter set and generate the tool mesh model at the current moment based on the current tool parameters.
[0137] The rendering module is used to merge and visualize the current workpiece mesh model and tool mesh model in the same virtual scene, generating a real-time display of the cutting simulation.
[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the present invention.
Claims
1. A digital twin cutting simulation method based on signed distance fields, characterized in that, The method includes: The workpiece 3D model is adapted in terms of format and coordinate system, and a voxel data file is generated based on the adapted workpiece mesh model. Read and parse the voxel data file to obtain the signed distance field voxel data of the workpiece, and divide the three-dimensional voxel space where the signed distance field voxel data of the workpiece is located into several voxel block units according to the preset block size. Establish a parameterized mathematical model for the cutting tool; During each round of cutting simulation, perform the following operations: The tool pose at adjacent sampling times in the world coordinate system is obtained and transformed to the workpiece local coordinate system to construct the continuous motion trajectory of the tool. The axial and radial distances from each voxel point in the three-dimensional voxel space to the tool axis are calculated. Construct a tool sweep bounding box, and based on the axial and radial distances of each voxel point to the tool axis, combined with the tool parameterized mathematical model, construct a signed distance field of the tool sweep volume. Perform Boolean update on the workpiece signed distance field voxel data to generate the workpiece signed distance field after material removal. Based on the tool sweep bounding box, the set of affected voxel blocks is determined. Using the signed distance field of the workpiece after material removal, local mesh reconstruction is performed on the set of affected voxel blocks to obtain the workpiece mesh model at the current moment. Maintain the tool parameter set and generate the tool mesh model for the current moment based on the current tool parameters; Repeat the above steps until the simulation ends.
2. The digital twin cutting simulation method based on signed distance field according to claim 1, characterized in that, The process of adapting the workpiece's 3D model to a specific format and coordinate system, and generating a voxel data file based on the adapted workpiece mesh model, includes: Obtain a 3D model of a workpiece that contains at least one of a mesh model file and an industrial CAD model file; When the workpiece 3D model is a mesh model file, the mesh model file is used as the initial mesh model; when the workpiece 3D model contains an industrial CAD model file, the industrial CAD model file is converted into the initial mesh model through CAD format conversion. Based on the coordinate mapping relationship between the target rendering coordinate system and the model coordinate system, coordinate system adaptation processing is performed on the initial mesh model to obtain the adapted workpiece mesh model; wherein, the coordinate system adaptation processing includes at least one of axial mirror transformation, rotation transformation, scaling transformation, translation transformation and patch winding correction; Based on the adapted workpiece mesh model, the signed distance field voxel data of the workpiece is constructed, and the metadata of the signed distance field voxel data of the workpiece is determined. The signed distance field voxel data of the workpiece is stored in the form of a three-dimensional array to form a signed distance field array. The metadata of the signed distance field array and the signed distance field voxel data of the workpiece is serialized to generate a binary voxel data file.
3. The digital twin cutting simulation method based on signed distance field according to claim 2, characterized in that, Based on the adapted workpiece mesh model, the signed distance field voxel data of the workpiece is constructed, and the metadata of the signed distance field voxel data of the workpiece is determined, including: According to the preset voxel resolution, the adapted workpiece mesh model is discretized to obtain a three-dimensional voxel space; Extract the bounding box dimensions of the mesh model file in the model coordinate system, and calculate the voxel grid dimensions based on the bounding box dimensions and the preset voxel resolution; Traverse the discrete sampling positions in the three-dimensional voxel space, and calculate the signed distance value corresponding to each discrete sampling position based on the voxel lattice size; The signed distance values corresponding to all discrete sampling positions in the three-dimensional voxel space are summarized to generate signed distance field voxel data of the workpiece, and the metadata of the signed distance field voxel data of the workpiece is determined.
4. The digital twin cutting simulation method based on signed distance field according to claim 3, characterized in that, The establishment of the tool parameterized mathematical model includes: Obtain the geometric features of the cutting tool; the geometric features are several sets of cross-sectional profile arrays arranged along the cutting tool axis; the first The group of cross-sectional profile arrays contains: the first The height position of each cross section along the tool axial direction and height position Corresponding tool cross-sectional radius ; Based on the geometric characteristics of the tool, a continuous geometric function of the tool is constructed to characterize the mapping relationship between the height position along the tool axis and the radius of the tool section. A parameterized mathematical model of the tool is established based on the continuous geometric function of the tool.
5. The digital twin cutting simulation method based on a signed distance field according to claim 4, characterized in that, The construction of a continuous geometric function for the tool based on its geometric features includes: When the profiles between adjacent sections change linearly, for any axial height of the tool The axial height is determined by linear interpolation. The radius of the cutter section And construct the tool's continuous geometry function; When the profile between adjacent sections changes non-linearly, a preset analytical function is used to construct the tool's continuous geometry function; The analytic function is an arc function, a polynomial function, or a piecewise function.
6. The digital twin cutting simulation method based on a signed distance field according to claim 5, characterized in that, The process of acquiring the tool pose at adjacent sampling moments in the world coordinate system and transforming it to the workpiece local coordinate system, constructing the continuous tool motion trajectory, and calculating the axial and radial distances from each voxel point in the three-dimensional voxel space to the tool axis includes: Obtain the tool pose at adjacent sampling times in the world coordinate system; Obtain the inverse pose transformation matrix of the workpiece relative to the world coordinate system at the current sampling time; Based on the inverse pose transformation matrix, the tool pose at adjacent sampling times in the world coordinate system is transformed to the workpiece local coordinate system to obtain the tool pose at adjacent sampling times in the workpiece local coordinate system. Based on the tool pose at adjacent sampling times in the workpiece local coordinate system, a continuous tool motion model is constructed using linear interpolation. Based on the continuous motion model of the tool, calculate the interpolated tool tip position and interpolated tool axis direction corresponding to each voxel point in the three-dimensional voxel space; Establish the tool axis based on the position of the interpolation tool tip and the direction of the interpolation tool axis, and calculate the axial and radial distances from the voxel point to the tool axis.
7. The digital twin cutting simulation method based on a signed distance field according to claim 6, characterized in that, The tool pose based on adjacent sampling times in the workpiece's local coordinate system is used to construct a continuous tool motion model using linear interpolation, including: For any voxel point in the three-dimensional voxel space, the projection parameters of the voxel point on the tool tip motion trajectory are calculated based on the tool tip position at adjacent sampling times in the local coordinate system of the workpiece. Based on the tool tip position at adjacent sampling times in the local coordinate system of the workpiece, the interpolated tool tip position is calculated using projection parameters; Based on the tool axis direction at adjacent sampling times in the workpiece's local coordinate system, the interpolated tool axis direction is calculated using projection parameters.
8. The digital twin cutting simulation method based on a signed distance field according to claim 7, characterized in that, The process involves constructing a tool sweep bounding box and, based on the axial and radial distances from each voxel point to the tool axis, combining this with a parameterized mathematical model of the tool, constructing a signed distance field of the tool sweep volume. Boolean updates are then performed on the workpiece signed distance field voxel data to generate the workpiece signed distance field after material removal, including: Calculate the axis-aligned bounding box of the tool motion trajectory based on the tool tip position at adjacent sampling times in the workpiece local coordinate system; Obtain the maximum radius and effective cutting length of the tool, and based on the maximum radius and effective cutting length of the tool, expand the axis-aligned bounding box of the tool motion trajectory along the three coordinate axes of the workpiece local coordinate system to obtain the tool sweep bounding box; Determine the intersection region between the tool sweep bounding box and the three-dimensional voxel space; For any voxel point in the intersecting region According to voxel points The axial and radial distances to the tool axis are combined with the tool's continuous geometric functions and effective cutting length to construct a signed distance field for the tool. Using all voxel points with signed distance values less than or equal to 0, generate a signed distance field for the workpiece after material removal.
9. The digital twin cutting simulation method based on a signed distance field according to claim 8, characterized in that, The process involves determining the affected voxel block set based on the tool sweep bounding box, and then using the signed distance field of the workpiece after material removal to perform local mesh reconstruction on the affected voxel block set to obtain the workpiece mesh model at the current moment, including: The voxel regions in the 3D voxel space that intersect with the tool sweep bounding box are considered as affected regions, and vice versa, they are considered as unaffected regions. All voxel blocks within the affected area are combined together to form the affected voxel block set; Extract local voxel data of each affected voxel block unit from the signed distance field of the workpiece after material removal; Isosurface reconstruction is performed on the local voxel data of each affected voxel block to generate updated mesh data for each affected voxel block. The updated mesh data of each affected voxel block is merged with the existing mesh data of the unaffected regions to obtain the workpiece mesh model at the current moment.
10. A digital twin cutting simulation system based on a signed distance field, characterized in that, The system includes: The model preprocessing module is used to adapt the format and coordinate system of the workpiece 3D model, and generate voxel data files based on the adapted workpiece mesh model. The voxel segmentation management module is used to read and parse voxel data files, obtain signed distance field voxel data of the workpiece, and divide the three-dimensional voxel space composed of the signed distance field voxel data of the workpiece into several voxel segmentation units according to the preset segmentation size. The tool parameterization module is used to establish a mathematical model for tool parameterization. The relative motion calculation module is used to obtain the tool pose at adjacent sampling times in the world coordinate system and transform it to the workpiece local coordinate system to construct the continuous motion trajectory of the tool, and calculate the axial and radial distances from each voxel point in the three-dimensional voxel space to the tool axis. The material removal calculation module is used to construct the tool sweep bounding box and, based on the axial and radial distances of each voxel point to the tool axis, combined with the tool parameterized mathematical model, construct the signed distance field of the tool sweep body. Boolean update is performed on the workpiece signed distance field voxel data to generate the workpiece signed distance field after material removal. The block mesh reconstruction module is used to determine the set of affected voxel block cells based on the tool sweep bounding box, and to perform local mesh reconstruction on the set of affected voxel block cells using the signed distance field of the workpiece after material removal, so as to obtain the workpiece mesh model at the current moment. The tool mesh update module is used to maintain the tool parameter set and generate the tool mesh model at the current moment based on the current tool parameters; The rendering module is used to merge and visualize the current workpiece mesh model and tool mesh model in the same virtual scene, generating a real-time display of the cutting simulation.