Five-axis real-time cutting simulation method based on voxels
By dynamically calculating voxel dimensions and segmenting the workpiece voxel mesh model, combined with multi-threaded parallel computing, the problem of low efficiency in processing large-scale voxel data was solved, and efficient rendering and simulation of five-axis real-time cutting simulation were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI TOPNC NUMERICAL CONTROL TECH CO LTD
- Filing Date
- 2026-01-09
- Publication Date
- 2026-05-08
AI Technical Summary
Existing technologies are computationally inefficient when processing large-scale voxel data, especially in five-axis machining scenarios where tool postures are complex and variable, increasing the difficulty of simulation.
By dynamically calculating and rendering voxel dimensions and performing voxelization, combined with the block-based processing of the workpiece voxel mesh model, only specific blocks that come into contact with the tool are locally updated, reducing the number of voxels that need to be re-simulated and rendered. Multi-threaded parallel computing is used to improve processing efficiency.
It maintains good rendering efficiency under different hardware systems, improves the processing efficiency of five-axis real-time cutting simulation, reduces unnecessary calculations, and improves simulation accuracy.
Smart Images

Figure CN121997492A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machining simulation technology, specifically to a voxel-based five-axis real-time cutting simulation method. Background Technology
[0002] In the field of CNC machining, cutting process simulation is of great significance for verifying machining processes, avoiding collisions and interference, and optimizing toolpaths. Cutting simulation typically involves establishing tool and workpiece models in a digital simulation environment, then simulating the machining path to determine the points where the tool will contact and cut. The rationality of the machining program is then verified based on the points of contact and the cutting conditions. Voxelization, which discretizes a 3D object into a regular voxel mesh, represents the object's shape through the existence state of voxels. It offers advantages such as simple algorithms and ease of parallel computation, making it an important technological direction for real-time cutting simulation.
[0003] For example, patent application CN202411875692.4 discloses a cutting simulation method based on voxel partitioning algorithm and kerf sampling optimization. This method includes acquiring the topological information of the object to be cut and partitioning it into triangular facets; partitioning the outer surface of the model into voxels using an outer surface voxelization algorithm and the interior of the model into voxels using a scanline algorithm to obtain the three-dimensional voxel information of the object to be cut; constructing a BVH tree based on the three-dimensional voxel information and establishing drawing units; acquiring the real-time position of the tool and performing collision detection with the BVH tree to obtain the voxel to be cut; recording the drawing unit to which the voxel to be cut belongs in an updated drawing list; customizing several sampling optimizations for the voxel to be cut; traversing each drawing unit in the updated drawing list and redrawing. This method exhibits excellent performance and reliability in the simulation field, providing users with comprehensive and accurate simulation services.
[0004] For example, patent application CN202110740089.5 discloses a voxel interference detection method and system for machine tool machining process simulation, belonging to the field of computer-aided manufacturing. The method includes: establishing a blank as a voxel model composed of multiple voxel nodes; traversing the voxel nodes in the voxel model; deleting voxel nodes that interfere with the target workpiece's interior to obtain the model to be cut; and performing collision detection between the voxel nodes in the model to be cut and the cutting tool to determine the target nodes that interfere with the tool. A disadvantage of using voxel modeling is that the number of voxel nodes increases significantly with increasing simulation accuracy. Deleting voxel nodes that interfere with the target workpiece's interior to obtain the model to be cut only requires interference detection between the voxel nodes of the blank's cutting portion and the cutting tool, thereby reducing the number of voxel nodes involved in interference detection and accelerating the simulation calculation speed.
[0005] However, in actual implementation, the inventors found that this type of technical solution still faces challenges such as low computational efficiency and slow rendering speed when processing large-scale voxel data. Especially in five-axis machining scenarios, the tool posture is complex and variable, which further increases the simulation difficulty. Summary of the Invention
[0006] To address the aforementioned problems in the existing technology, a voxel-based five-axis real-time cutting simulation method is provided.
[0007] The specific technical solution is as follows: A voxel-based five-axis real-time cutting simulation method includes: Step S1: Extract the workpiece model of the workpiece to be processed, determine the voxel size according to the number of rendering voxels, and perform voxelization processing on the workpiece model according to the voxel size to obtain the workpiece voxel mesh model, and generate the tool voxel mesh model. Step S2: The workpiece voxel mesh model is divided into multiple voxel blocks; Step S3: When executing the cutting trajectory, determine the voxel blocks and model voxels that coincide with the tool voxel mesh model according to the tool pose information; Step S4: In the voxel block, update the model voxels and then render.
[0008] On the other hand, in step S1, the method for calculating the voxel size includes: ; In the formula, For the voxel size, The length, width, and height dimensions of the workpiece are modeled. The number of rendering voxels.
[0009] On the other hand, in step S1, the first generation process for generating the workpiece voxel mesh model includes: Step A11: Model the workpiece and determine the voxel size according to the number of rendering voxels; Step A12: Based on the voxel dimensions, model the workpiece and perform voxelization to obtain a workpiece voxel mesh model; Step A13: Store each of the model voxels in the workpiece voxel mesh model in a bit array; The bit array is a three-dimensional array, constructed according to the number of voxels in the length, width, and height directions of the workpiece voxel mesh model.
[0010] On the other hand, in the bit array, identifiers are also added for each model voxel, including processing identifiers and visual identifiers; The processing identifier is used to mark whether the model voxel exists during the processing; The visual identifier is used to mark whether the model voxels are visible in the current rendering view; During the execution of the five-axis real-time cutting simulation method, the rendering and display control of the workpiece voxel mesh model is performed based on the bit array.
[0011] On the other hand, in step S1, the second generation process for generating the knife-shaped pixel mesh model includes: Step B11: Extract a 3D model of the cutting tool; Step B12: Perform voxelization on the 3D model of the cutting tool to obtain the voxel mesh model of the cutting tool; Step B13: Use a rotation matrix to mark the coordinates of the knife-shaped element mesh model.
[0012] On the other hand, the block division method in step S2 includes: ; In the formula, The length, width, height, and dimension of the workpiece voxel mesh model; The preset block size in the length, width, and height directions; This represents the number of blocks in the length, width, and height directions.
[0013] On the other hand, step S3 includes: Step S31: Acquire the pose information of the tool, and calculate the spatial position of each point in the tool's elemental mesh model in the workpiece coordinate system based on the pose information; Step S32: Generate the coordinates of the affected voxels according to the spatial location, and extract the corresponding model voxels; Step S33: Based on the affected voxel coordinates, search for the corresponding voxels to determine the directly related voxel blocks and the adjacent voxel blocks.
[0014] On the other hand, step S32 includes: Step S321: Generate the coordinates of the affected voxels according to the spatial location; Step S322: Search the bit array according to the coordinates of the affected voxels to determine the actual existing model voxels.
[0015] On the other hand, in step S3, after receiving the pose information, a cutting task is generated and allocated to multiple threads for parallel computation, and QtConcurrent is used to implement multi-threaded task scheduling.
[0016] On the other hand, step S4 includes: Step S41: Traverse each model voxel in the voxel block to re-mark the visibility of the model voxel and configure the corresponding vertex attributes; Step S42: Update and render the updated voxel block.
[0017] On the other hand, step S4 further includes the following before performing step S42: Step C41: Traverse the model voxels, and merge the rendering information when adjacent voxels are all visible.
[0018] The above technical solution has the following advantages or beneficial effects: To address the issues of low efficiency or insufficient accuracy in cutting simulation processes when handling large-scale voxels in existing technologies, this paper proposes a method that dynamically calculates and renders voxel dimensions by modeling the workpiece and performing voxelization. This achieves good rendering efficiency across hardware systems of different scales. Furthermore, by dividing the workpiece voxel mesh model into blocks, local updates are performed only on specific blocks that come into contact with the tool during cutting simulation, reducing the number of voxels that need to be re-simulated and rendered, and improving processing efficiency. Attached Figure Description
[0019] Embodiments of the invention will be described more fully with reference to the accompanying drawings. However, the drawings are for illustration and explanation only and do not constitute a limitation on the scope of the invention.
[0020] Figure 1 This is an overall schematic diagram of an embodiment of the present invention; Figure 2 This is a schematic diagram of the first generation process in an embodiment of the present invention; Figure 3 This is a schematic diagram of the second generation process in an embodiment of the present invention; Figure 4 This is a schematic diagram of step S3 in an embodiment of the present invention; Figure 5 This is a schematic diagram of step S32 in an embodiment of the present invention; Figure 6 This is a schematic diagram of step S4 in an embodiment of the present invention; Figure 7 This is a schematic diagram of step C41 in an embodiment of the present invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.
[0023] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but this is not intended to limit the scope of the invention.
[0024] This invention includes: A voxel-based five-axis real-time cutting simulation method, such as Figure 1 As shown, it includes: Step S1: Extract the workpiece model of the workpiece to be processed, determine the voxel size according to the number of rendering voxels, and perform voxelization processing on the workpiece model according to the voxel size to obtain the workpiece voxel mesh model, and generate the tool voxel mesh model. Step S2: Divide the workpiece voxel mesh model into multiple voxel blocks; Step S3: When executing the cutting trajectory, determine the voxel blocks and model voxels that coincide with the tool voxel mesh model according to the tool pose information; Step S4: Render the model voxels after updating them in the voxel block.
[0025] Specifically, addressing the issues of low efficiency or insufficient accuracy in cutting simulation processes when handling large-scale voxels in existing technologies, this paper achieves good rendering efficiency across hardware systems of different scales by dynamically calculating and rendering voxel dimensions based on workpiece modeling and performing voxelization. Furthermore, by segmenting the workpiece voxel mesh model into blocks, local updates are performed only on specific blocks that come into contact with the tool during cutting simulation, reducing the number of voxels that need to be re-simulated and rendered, thus improving processing efficiency.
[0026] In actual implementation, the above-mentioned five-axis real-time cutting simulation method is mainly configured as a software implementation in a specific computer system, such as the workstation computer of a machining center, to receive pre-programmed toolpaths and workpiece models before machining and to perform simulation in order to determine whether the machining process meets expectations.
[0027] Before the simulation begins, a workpiece model is pre-built, which can characterize various physical properties of the actual workpiece to be processed, including length, width, height, surface shape, curved surface, material, splicing material, coating, hardness, thermal conductivity and other physical properties that will affect the processing performance. It can be used to simulate surface cutting, material softening or creep at high temperatures and other conditions during the finite element simulation processing.
[0028] Similarly, to facilitate the determination of actual machining points, a completely identical tool model is created for the tool used in the current machining trajectory before the simulation begins. During the simulation, the tool model moves according to the pre-programmed machining trajectory, including moving at specific pose angles and colliding with the corresponding position on the workpiece model to simulate cutting. The simulated cutting includes finite element simulation of stress and deformation at the cutting point, simulation of heat at the cutting point, etc., and verification of whether the cutting situation and the actual cutting position meet expectations. Finally, the cutting process is rendered and displayed through a graphical interface.
[0029] In the above simulation process, in order to improve processing efficiency and facilitate finite element simulation, this scheme requires voxelization of both the workpiece model and the tool model, forming a workpiece voxel mesh model and a tool voxel mesh model. This type of model has been voxelized relative to the original model. Each voxel corresponds to the smallest unit for stress and thermodynamic simulation during cutting simulation. All voxels are spliced together in a matrix mesh manner to form a complete model.
[0030] Considering the low efficiency of calculating a large number of voxels, this embodiment determines a suitable performance overhead configuration based on the computing power available in the actual simulation environment during the generation of the workpiece voxel mesh model. Then, it dynamically calculates the voxel dimensions of the workpiece voxel mesh model under the current configuration. Based on these dynamically generated voxel dimensions, the workpiece model is voxelized to obtain a workpiece voxel mesh model with a better balance between accuracy and performance. Since the simulation process typically does not require consideration of issues such as tool stress, the tool voxel mesh model only needs to use a fixed configuration and accurately reflect the cutting points.
[0031] During simulation and rendering, since stress and heat are concentrated only near the cutting point, the workpiece voxel mesh model is also divided into multiple voxel blocks. When simulating the cutting trajectory, the voxel blocks and model voxels that coincide with the tool voxel mesh model are determined according to the tool pose information. Then, only the voxel information in the voxel blocks is updated and re-rendered to reduce the amount of computation.
[0032] In one embodiment, the method for calculating the voxel size in step S1 includes: ; In the formula, For voxel size, The length, width, and height dimensions for modeling the workpiece. For rendering voxels.
[0033] Specifically, to achieve better rendering efficiency, this embodiment uses dynamic calculation of voxel dimensions to balance simulation accuracy and performance. For modeling the workpiece to be simulated, the length, width, and height dimensions (corresponding to the X, Y, and Z axes in the tool coordinate system) are easily determined by establishing an external bounding box. Then, based on the computing power available in the actual simulation environment, the appropriate number of rendering voxels for the current simulation process is determined. This part involves establishing a performance-rendering number lookup table through pre-experimental calibration, and then collecting hardware information of the modeling environment in the actual scene. The number of rendering voxels is determined by looking up the table based on the hardware information. The voxel dimension of a single voxel is calculated based on the above formula.
[0034] In one embodiment, such as Figure 2 As shown, in step S1, the first generation process for generating the workpiece voxel mesh model includes: Step A11: Model the workpiece and determine the voxel size according to the number of rendering voxels; Step A12: Based on the voxel dimensions, model the workpiece and perform voxelization to obtain the workpiece voxel mesh model; Step A13: Store each model voxel in the workpiece voxel mesh model in a bit array; Specifically, to achieve better rendering efficiency, this embodiment uses dynamic calculation of voxel dimensions to balance simulation accuracy and performance. For modeling the workpiece to be simulated, the length, width, and height dimensions (corresponding to the X, Y, and Z axes in the tool coordinate system) are easily determined by establishing an external bounding box. Then, based on the computing power available in the actual simulation environment, the appropriate number of rendering voxels for the current simulation process is determined. This part involves establishing a performance-rendering number lookup table through pre-experimental calibration, and then collecting hardware information of the modeling environment in the actual scene. The number of rendering voxels is determined by looking up the table based on the hardware information. The voxel dimension of a single voxel is calculated based on the above formula.
[0035] Subsequently, the workpiece model is voxelized based on the voxel dimensions to obtain a voxel mesh model of the workpiece. This process includes, based on the voxel dimensions, further determining the number of voxels in the X, Y, and Z directions of the voxel mesh, calculated as follows: ; In the formula, The number of voxels in the length, width, and height directions of the workpiece voxel mesh model; The length, width, and height dimensions for modeling the workpiece. Voxel size.
[0036] Finally, each model voxel in the workpiece voxel mesh model is stored in a bit array for subsequent management.
[0037] In one embodiment, the bit array is a three-dimensional array, constructed according to the number of voxels in the length, width, and height directions of the workpiece voxel mesh model.
[0038] In the bit array, identifiers are also added for each model voxel, including manufacturing identifiers and visual identifiers; Processing identifiers are used to mark the presence of model voxels during the processing; The visibility flag is used to indicate whether the model voxels are visible in the current rendering view; During the execution of the five-axis real-time cutting simulation method, the rendering and display control of the workpiece voxel mesh model is performed based on the bit array.
[0039] Specifically, to efficiently record voxel states, after voxelization, the generated model voxels are managed using a bit array (QLargeBitArray). The processing identifier cube_data_manager is used to indicate whether a voxel exists, and the visibility identifier cube_visible_manager is used to indicate whether a voxel is visible.
[0040] In actual simulation, by modifying the machining markers according to the cutting path of the tool, the voxels that are cut off can be "removed" to achieve the correct rendering process. In addition, the visual markers can be modified in combination with the changes in the simulation perspective to reduce the amount of rendering.
[0041] This lightweight data structure design reduces the storage footprint of large-scale voxel data, laying the foundation for efficient computation in the future.
[0042] In one embodiment, such as Figure 3 As shown, in step S1, the second generation process for generating the knife-shaped elemental mesh model includes: Step B11: Extract the tool and create a 3D model; Step B12: Perform voxelization on the 3D model of the tool to obtain a voxel mesh model of the tool; Step B13: Use a rotation matrix to mark the coordinates of the tool's elemental mesh model.
[0043] Specifically, to achieve better simulation results for the cutting tool, this embodiment first extracts a 3D model of the tool, and then performs voxelization processing on the 3D model of the tool according to a preset voxel size to obtain a voxel mesh model of the tool. Based on the core geometric parameters of the five-axis tool (such as radius and length), the tool is discretized into a voxel mesh to form a voxel mesh model of the tool that is compatible with the workpiece voxel mesh, ensuring that the cutting interaction calculation between the tool and the workpiece can be carried out based on a unified voxel dimension. At the same time, a rotation matrix (ToolM) is used to describe the posture of the tool in space. The rotation matrix can accurately transform the position of each point on the tool in the workpiece coordinate system, providing key support for subsequently determining the cutting influence range of the tool, effectively solving the problem of high simulation difficulty caused by the variable tool posture in five-axis machining.
[0044] In one embodiment, the block division method in step S2 includes: ; In the formula, The number of voxels in the length, width, and height directions of the workpiece voxel mesh model; The block size is the preset length, width, and height, in units of voxels; This represents the number of blocks in the length, width, and height directions.
[0045] Specifically, in the simulation and rendering process, since stress and heat are concentrated only near the cutting point, the workpiece voxel mesh model is also divided into multiple voxel blocks. Through block-level state management and update control, invalid calculations and rendering operations are reduced, and the overall processing efficiency is improved.
[0046] During the block segmentation process, the number of blocks is first determined based on the number of voxels and the preset block size. The block size is determined according to the typical dimensions of the workpiece and the rendering environment. The number of blocks determines the number of blocks to be divided in the length, width, and height directions; the length, width, and height dimensions of each block are easily determined by combining the bounding box of the workpiece model. Based on the number of blocks, several blocks are obtained by equally dividing the model along the three axes. The voxels are then assigned to corresponding blocks by matching the coordinate positions of the blocks with the coordinate positions of the model voxels.
[0047] Each block uses a specific data structure to store key information, as defined below: struct Block { QVector <qvector3d>positions; / / voxel positions QVector <qvector3d>scales; / / Voxel scaling QVector <qvector3d>colors; / / Voxel colors int state = 0; / / Block state int isneedUpdate = 1; / / Update flag }; The isneedUpdate flag is used to record whether a block needs to be updated. When the voxel state within a block changes, the flag is set to 1 or 2, thereby triggering subsequent calculations and rendering updates. At the same time, only blocks marked as needing to be updated are processed, avoiding a full traversal of the entire voxel mesh and significantly improving processing efficiency.
[0048] In one embodiment, such as Figure 4 As shown, step S3 includes: Step S31: Acquire the tool's pose information and calculate the spatial position of each point in the tool's elemental mesh model in the workpiece coordinate system based on the pose information; Step S32: Generate the coordinates of the affected voxels according to their spatial location, and extract the corresponding model voxels; Step S33: Based on the coordinates of the affected voxels, search for the corresponding voxels to determine the directly related voxel blocks and the adjacent voxel blocks.
[0049] Specifically, in the actual simulation process, the simulation program first loads the corresponding machining trajectory and the tool performs simulated machining. Then, during machining, the simulated pose information of the tool is acquired, and the spatial position of each point in the tool's specific pixel mesh model in the workpiece coordinate system is calculated based on the pose information, including: ; In the formula, This refers to the spatial location of the knife-shaped element points in the knife-shaped element mesh model; It is a rotation matrix; This refers to pose information.
[0050] Subsequently, the coordinates of the affected voxels are generated according to their spatial location, and the corresponding model voxels are extracted. Specifically, for example... Figure 5 As shown, step S32 includes: Step S321: Generate the coordinates of the affected voxels according to their spatial location; Step S322: Search the bit array based on the coordinates of the affected voxels to determine the actual model voxels.
[0051] The calculation process includes: ; In the formula, For the coordinates of the affected voxels, For voxel size, For spatial location, This represents the spatial offset range of the tool.
[0052] After extracting the coordinates of the affected voxels, the system returns to the pre-established bit array to locate the voxels' reference positions within the array. ; At the same time, the presence of voxels can be determined by combining the processing labels in the bit array. If they exist, they are marked as pending processing and the processing labels are modified uniformly after traversing all voxels. If they do not exist, they remain in the non-existent state.
[0053] Finally, determine the block to which the voxel belongs: ; In the formula, The block number is determined by the number of digits in its length, width, and height directions. For the coordinates of the affected voxels, The length, width, and height dimensions of the block.
[0054] Set the isneedUpdate property of the block to 1 and simultaneously mark its adjacent blocks as pending updates to ensure that the voxel state update at the cutting boundary is complete and to guarantee the accuracy of the cutting simulation.
[0055] In one embodiment, in step S3, after receiving the pose information, a cutting task is generated and allocated to multiple threads for parallel computation, and QtConcurrent is used to implement multi-threaded task scheduling.
[0056] Specifically, to improve computational efficiency, after determining the tool's pose information and the corresponding voxels, a block management mechanism is used, and multi-threading technology is employed to process the voxel blocks within the tool's cutting influence range in parallel. This includes cutting the affected voxels, finite element simulation, thermodynamic simulation, and more. In terms of implementation, QtConcurrent is used to implement multi-threaded task scheduling. Cutting tasks (CutTasks) are generated based on the tool's motion parameters and allocated to multiple threads for parallel execution, thereby improving processing efficiency.
[0057] In one embodiment, such as Figure 6 As shown, step S4 includes: Step S41: Traverse each model voxel in the voxel block to re-mark the visibility of the model voxels and configure the corresponding vertex attributes. Step S42: Update and render the updated voxel blocks.
[0058] Specifically, after determining the voxels and voxel blocks that need to be updated, the system first iterates through each model voxel in the voxel block to re-mark the visibility of the model voxels and configure the corresponding vertex attributes. This includes storing the voxel's position (vbo_cp) and scaling (vbo_cs) information through a vertex buffer object (VBO), configuring the vertex attributes for instantiated rendering, i.e., after binding vbo_cp, setting the storage format of the position attribute through m_shaderProgram.setAttributeBuffer, enabling the attribute, and setting the position to be updated once per instance through glVertexAttribDivisor(posLoc, 1); similarly, the vertex buffer for scaling attributes is configured.
[0059] After completing the above configuration, via glDrawElementsInstanced(GL_TRIANGLE_STRIP, indices.size(), GL_UNSIGNED_INT, nullptr, block.positions.size()) This system enables the rendering of multiple voxels in a single draw call, significantly reducing the number of draw calls and improving rendering speed. Simultaneously, it supports multiple visualization modes, including voxel model display, tool display, and section display, allowing users to switch between displayed content according to their needs and providing realistic visualizations of the cutting process.
[0060] In one embodiment, such as Figure 7 As shown, step S4 includes the following steps before step S42: Step C41: Traverse the model voxels and merge the rendering information when adjacent voxels are all visible.
[0061] Specifically, to achieve better rendering efficiency, VoxelTask is designed to update the visibility status of voxels and the voxel data within blocks. By merging adjacent visible voxels, the number of rendering operations is reduced, further improving the overall processing efficiency. Its core logic is to traverse the voxels within the block and update their visibility. When it is detected that adjacent voxels are both visible, the rendering information of these voxels is merged. For example, when bK >= VLen_Z-1 or k >= BLOCK_SIZE_Z-1, the position and scaling information of the merged voxels are added to the corresponding list of the block.
[0062] Those skilled in the art will understand that various aspects of the present invention, or possible implementations thereof, can be embodied as systems, methods, or computer program products. Therefore, various aspects of the present invention, or possible implementations thereof, can take the form of entirely hardware embodiments, entirely software embodiments (including firmware, resident software, etc.), or embodiments combining software and hardware aspects, all collectively referred to herein as "circuit," "module," or "system." Furthermore, various aspects of the present invention, or possible implementations thereof, can take the form of computer program products, which are computer instructions stored in memory.
[0063] The memory can be a computer-readable signal medium or a computer-readable storage medium. Computer-readable storage media include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or apparatuses, or any suitable combination thereof, such as random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, and portable read-only memory (CD-ROM).
[0064] A processor in a computer reads computer instructions stored in memory, enabling the processor to execute the functional actions specified in each step or combination of steps in a flowchart; and to generate means for implementing the functional actions specified in each block or combination of blocks in a flowchart.
[0065] It should be understood that a processor in a computer can be understood as one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components used to execute the aforementioned computer instructions.
[0066] Computer instructions may be executed entirely on the user's local computer, partially on the user's local computer, as a separate software package, partially on the user's local computer and partially on a remote computer, or entirely on a remote computer or server. It should also be noted that in some alternative implementations, the functions indicated by the steps in the flowchart or the blocks in the block diagram may not occur in the order shown in the diagram. For example, depending on the functions involved, two consecutive steps or blocks may actually be executed approximately simultaneously, or these blocks may sometimes be executed in reverse order.
[0067] Of course, in practical applications, the various components of a computer system are coupled together through a bus system. The bus system is used to enable communication and connection between these components. In addition to the data bus, the bus system also includes a power bus, a control bus, and a status signal bus.
[0068] The above are merely preferred embodiments of the present invention and are not intended to limit the implementation methods and protection scope of the present invention. Those skilled in the art should recognize that any equivalent substitutions and obvious changes made based on the description and illustrations of the present invention should be included within the protection scope of the present invention.
Claims
1. A voxel-based five-axis real-time cutting simulation method, characterized in that, include: Step S1: Extract the workpiece model of the workpiece to be processed, determine the voxel size according to the number of rendering voxels, and perform voxelization processing on the workpiece model according to the voxel size to obtain the workpiece voxel mesh model, and generate the tool voxel mesh model. Step S2: The workpiece voxel mesh model is divided into multiple voxel blocks; Step S3: When executing the cutting trajectory, determine the voxel blocks and model voxels that coincide with the tool voxel mesh model according to the tool pose information; Step S4: In the voxel block, update the model voxels and then render.
2. The five-axis real-time cutting simulation method according to claim 1, characterized in that, In step S1, the method for calculating the voxel size includes: ; In the formula, For the voxel size, The length, width, and height dimensions of the workpiece are modeled. The number of rendering voxels.
3. The five-axis real-time cutting simulation method according to claim 1, characterized in that, In step S1, the first generation process for generating the workpiece voxel mesh model includes: Step A11: Model the workpiece and determine the voxel size according to the number of rendering voxels; Step A12: Based on the voxel dimensions, model the workpiece and perform voxelization to obtain a workpiece voxel mesh model; Step A13: Store each of the model voxels in the workpiece voxel mesh model in a bit array; The bit array is a three-dimensional array, constructed according to the number of voxels in the length, width, and height directions of the workpiece voxel mesh model.
4. The five-axis real-time cutting simulation method according to claim 3, characterized in that, In the bit array, identifiers are also added for each model voxel, including processing identifiers and visual identifiers; The processing identifier is used to mark whether the model voxel exists during the processing; The visual identifier is used to mark whether the model voxels are visible in the current rendering view; During the execution of the five-axis real-time cutting simulation method, the rendering and display control of the workpiece voxel mesh model is performed based on the bit array.
5. The five-axis real-time cutting simulation method according to claim 3, characterized in that, In step S1, the second generation process for generating the knife-shaped elemental mesh model includes: Step B11: Extract a 3D model of the cutting tool; Step B12: Perform voxelization on the 3D model of the cutting tool to obtain the voxel mesh model of the cutting tool; Step B13: Use a rotation matrix to mark the coordinates of the knife-shaped element mesh model.
6. The five-axis real-time cutting simulation method according to claim 1, characterized in that, The block division method in step S2 includes: ; In the formula, The number of voxels in the length, width, and height directions of the workpiece voxel mesh model; The preset block size in the length, width, and height directions; This represents the number of blocks in the length, width, and height directions.
7. The five-axis real-time cutting simulation method according to claim 3, characterized in that, Step S3 includes: Step S31: Acquire the pose information of the tool, and calculate the spatial position of each point in the tool's elemental mesh model in the workpiece coordinate system based on the pose information; Step S32: Generate the coordinates of the affected voxels according to the spatial location, and extract the corresponding model voxels; Step S33: Based on the affected voxel coordinates, search for the corresponding voxels to determine the directly related voxel blocks and the adjacent voxel blocks.
8. The five-axis real-time cutting simulation method according to claim 7, characterized in that, Step S32 includes: Step S321: Generate the coordinates of the affected voxels according to the spatial location; Step S322: Search the bit array according to the coordinates of the affected voxels to determine the actual existing model voxels.
9. The five-axis real-time cutting simulation method according to claim 1, characterized in that, Step S4 includes: Step S41: Traverse each model voxel in the voxel block to re-mark the visibility of the model voxel and configure the corresponding vertex attributes; Step S42: Update and render the updated voxel block.
10. The five-axis real-time cutting simulation method according to claim 9, characterized in that, Step S4 further includes the following steps before performing step S42: Step C41: Traverse the model voxels, and merge the rendering information when adjacent voxels are all visible.
Citation Information
Patent Citations
Voxel interference detection method and system for machine tool processing process simulation
CN113359608A
Cutting simulation method based on voxel division algorithm and incision sampling optimization
CN119442369A