Milling simulation method and device based on parallel boolean operation, equipment and medium

By using parallel Boolean operations and KD-tree data structures, the problems of low computational efficiency and poor stability in complex scenarios in industrial manufacturing are solved, enabling efficient geometric model processing and real-time machining simulation.

CN117763822BActive Publication Date: 2026-06-16NORTHWESTERN POLYTECHNICAL UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NORTHWESTERN POLYTECHNICAL UNIV
Filing Date
2023-12-19
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

Existing Boolean operation methods in the industrial manufacturing field mainly suffer from low efficiency and poor stability. In particular, traditional serial algorithms are difficult to meet the needs of real-time processing simulation in complex scenarios.

Method used

We employ a parallel Boolean operation method, utilize the KD-tree data structure to spatially partition the geometry, and employ a parallel computing strategy. By optimizing the Boolean operation process through multithreading and TBB technology, we build a parallelism that adapts to hardware conditions, thereby improving computational efficiency and stability.

🎯Benefits of technology

It achieves efficient Boolean operations on multiple geometric objects, improves computational efficiency and stability, meets the needs of real-time machining simulation, and reduces memory usage and computation time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117763822B_ABST
    Figure CN117763822B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on parallel Boolean operation milling simulation method, device, equipment and medium, comprising: reading the geometry path under milling environment, geometry path is the point set with tool coordinate information and the posture information under this coordinate;Affine transformation matrix is calculated according to geometry path and the initial position of geometry, and the geometry after affine transformation is obtained to update the position after tool movement;According to the tool movement path of each frame, the swept volume of the corresponding tool is constructed;The space of geometry is divided based on the data structure of KD tree, and the KD tree of multiple geometries is constructed, and the constructed KD tree structure data is obtained;The intersection node between geometry is obtained by traversing the KD tree corresponding to two geometries, and after the corresponding Boolean operation of intersection node is executed, merging operation is carried out, and the final geometry corresponding to a series of frame data is obtained to simulate milling process, improve the operation efficiency of parallel Boolean operation, and achieve real-time machining simulation demand.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial manufacturing technology, and in particular to a milling simulation method, apparatus, equipment and medium based on parallel Boolean operations. Background Technology

[0002] In the field of industrial manufacturing, efficient machining simulation algorithms are crucial. Machining simulation algorithms require calculating results across multiple frames to simulate the machining process. Each frame can be divided into two sub-problems: first, constructing the swept body of the moving object; then, performing Boolean operations on the swept body and the workpiece. In this process, handling complex 3D geometric models is an unavoidable challenge. Boolean operations, as one of the core operations for processing geometric models, involve complex calculations such as combination, cutting, and merging. These operations are typically computationally intensive, especially when processing large geometric data, where traditional serial algorithms may be inefficient. With the development of computing hardware, the widespread application of multi-core processors, GPUs, and high-performance computing clusters has provided a platform for parallel computing, making it possible to accelerate Boolean operations. Parallel Boolean operations utilize multiple processing units to execute tasks simultaneously, achieving efficient processing of complex geometric models through distributed computing.

[0003] Currently, in the industrial manufacturing field, Boolean operations can be categorized into three types based on their data structures: traditional Boolean operations, space-partition-based Boolean operations, and entity Boolean operations. Traditional Boolean operations perform logical operations on the boundaries and interiors of geometric objects, with common data structures including boundary representation and half-edge representation. Space-partition-based Boolean operations use tree structures to perform Boolean operations on space, simplifying calculation and representation; common data structures include octrees, BSP trees, and KD trees. Entity Boolean operations are performed at the entity level, voxelizing the geometry and directly performing logical operations on the volume and surface of the entity. However, most existing methods use serial Boolean operations; parallel Boolean operations have not been widely adopted in the industrial manufacturing field.

[0004] In the field of Boolean operations, several open-source libraries focus on implementing efficient Boolean operations, such as CGAL, OCC, and libigl. These libraries aim for efficient and reliable geometric computation, supporting both 2D and 3D geometric operations. However, most of these libraries implement Boolean operations serially, without supporting parallel computing; users must manually integrate parallel computing libraries. While the open-source library Cork has implemented parallel Boolean operations, it is primarily used in the biomedical field, where input models have stringent requirements. Furthermore, parallelized Cork exhibits lower stability. Parallel Boolean operations hold great promise in industrial manufacturing and geometric processing. In complex scenarios, as geometric complexity increases, traditional serial Boolean operations may face performance bottlenecks. Parallel Boolean operations make complex scenario domains and real-time machining simulations more feasible.

[0005] In current industrial manufacturing and geometry processing fields, Boolean operations are mainly implemented in three ways: traditional Boolean operations, space-partitioned Boolean operations, and entity Boolean operations. Each of these three types of Boolean operations faces several bottlenecks: First, traditional Boolean operations have high time and space complexity, especially in complex geometric scenarios, where efficiency decreases significantly with the increase in the number and complexity of geometric objects. Second, while space-partitioned Boolean operations simplify computation and representation by partitioning the space, they may lead to spatial redundancy in complex scenarios, resulting in large tree structures and excessive memory consumption. In entity Boolean operations, due to the use of discrete representation, the voxel method may introduce precision loss. In applications with high precision requirements, higher resolution voxel meshes can be used, but this significantly increases computational and storage overhead.

[0006] In conclusion, with the continuous development of computing technology and the improvement of hardware performance, most existing Boolean operations have not made full use of the advantages of hardware to improve their computing efficiency and stability. In some scenarios with high real-time requirements, the shortcomings of current serial Boolean operations are even more apparent. Summary of the Invention

[0007] The purpose of this invention is to provide a milling simulation method and apparatus based on parallel Boolean operations.

[0008] This invention provides a milling simulation method based on parallel Boolean operations, comprising:

[0009] Read the geometric path in the milling environment, where the geometric path is a set of points with tool coordinate information and tool posture information at that coordinate.

[0010] Calculate the affine transformation matrix based on the geometry path and the initial position of the geometry to obtain the affine transformed geometry and update the position of the tool after movement;

[0011] The tool movement path is determined based on the geometry before and after the affine transformation, and the corresponding tool sweep body is constructed based on the tool movement path of each frame.

[0012] The geometry is spatially partitioned based on the KD tree data structure, and a KD tree is constructed for multiple geometries to obtain the constructed KD tree structure data. Each geometry includes at least the sweep body of the tool and the workpiece.

[0013] The KD tree corresponding to the two geometries is traversed to obtain the intersection nodes between the geometries. After performing the corresponding Boolean operation on the intersection nodes, a merging operation is performed to obtain the final geometries corresponding to a series of frame data to simulate the milling process.

[0014] Preferably, the process of reading the geometry path in the milling environment includes:

[0015] Read the geometric information and current hardware information in the milling environment. The geometric information includes the total number of points and the total number of faces. The current hardware information includes the number of CPU cores and the memory size.

[0016] Parallel computing strategies are constructed at the application layer and algorithm layer, and the optimal parallelism size n at the application layer and the parallelism size m at the algorithm layer are predicted based on the support vector machine regression model.

[0017] In the application layer, a thread pool with n threads is created to construct multiple KD trees simultaneously. Currently, the n threads are in a blocked state until a new task is added to the thread pool. When a new task is added to the thread pool, the n threads compete for the new task. The thread that wins the new task executes the corresponding task, while the thread that does not win the new task remains in a blocked state. The number of tasks is generated according to the number of frames calculated based on the simulation business requirements and is added to the thread pool in sequence until the load is balanced among the threads.

[0018] In the algorithm layer, Boolean operations are parallelized to split the threads corresponding to Boolean operations into multiple corresponding tasks. TBB parallelization is used to process the multiple tasks after splitting. The intersecting triangular faces of the geometry are obtained through the KD tree. After performing Boolean subtraction operations, the missing faces are retriangulated, and the triangulation results are added back to the KD tree.

[0019] The geometry includes at least the geometry of a workpiece and a cutting tool, and the above tasks are all tasks corresponding to the milling simulation logic.

[0020] Preferably, the step of calculating the affine transformation matrix based on the geometric path and the initial position of the geometric body to obtain the affine transformed geometry includes:

[0021] The differences in the x-axis, y-axis, and z-axis coordinates of every two points on the geometric path are obtained to construct the first affine transformation matrix to update the position information of the tool after movement.

[0022] When the affine transformation of the tool is translation, the x-axis, y-axis, and z-axis coordinates of the previous and next points between two points on the geometric path are obtained respectively. The coordinates of the next point are compared with those of the previous point to obtain the coordinate difference t in the x-axis direction between the two points. x The coordinate value t in the y-axis direction y The coordinate value t in the z-axis direction z After constructing the affine transformation matrix, multiplying each point of the original 3D object by the first affine transformation matrix yields the translated first affine transformation matrix as follows:

[0023]

[0024] Where P' is the transformed 3D object, and P is the original 3D object.

[0025] Preferably, the step of calculating the affine transformation matrix based on the geometric path and the initial position of the geometric body to obtain the affine transformed geometry further includes:

[0026] Obtain the tool's attitude information on the geometric path to construct a second affine transformation matrix to update the tool's attitude information;

[0027] When the affine transformation of the tool is rotation, the angles of rotation of the tool relative to the x-axis, y-axis, and z-axis in the geometric path are obtained. If the angle of rotation of the moved 3D geometry relative to the x-axis is θ, the constructed second affine transformation matrix is ​​as follows:

[0028]

[0029] If the rotated 3D geometry is θ relative to the y-axis, the constructed second affine transformation matrix is ​​as follows:

[0030]

[0031] If the rotated 3D geometry is θ relative to the z-axis, the constructed second affine transformation matrix is ​​as follows:

[0032]

[0033] Where P' is the transformed 3D object, and P is the original 3D object.

[0034] Preferably, the step of constructing the KD tree includes:

[0035] Boolean operations are performed on multiple geometries simultaneously, and a KD tree is constructed for each geometry. The KD tree refers to a series of geometries of preset shapes in three-dimensional space, and the geometries of preset shapes include at least a cube.

[0036] The target data of the geometry is obtained and inserted into the corresponding KD tree data structure. The target data of the geometry includes the vertices, edges and faces of the geometry.

[0037] Based on the KD tree, an arbitrary axis and an arbitrary point on that axis are recursively selected to determine the dividing surface, and the original space of the geometry is divided for the first time to obtain the two subspaces of the geometry of the preset shape.

[0038] For each subspace, repeat the above operation to confirm the segmentation surface and continue the second segmentation operation until the preset termination condition is reached;

[0039] Each corresponding segmentation operation corresponds to a node in the KD tree. The root node is the initial segmentation plane, each child node represents a subsequent segmentation plane, and each node stores information about the segmentation plane and a pointer to the subspace.

[0040] Preferably, the step of traversing the KD-trees corresponding to the two geometries to obtain the intersection nodes between the geometries, and performing the corresponding Boolean operation on the intersection nodes before merging the nodes further includes:

[0041] Traverse the KD trees corresponding to at least two geometries, and check the corresponding nodes in the two corresponding KD trees to determine whether there is spatial overlap. The checking method is as follows: if a node exists in the KD tree corresponding to the first geometries but does not exist in the KD tree corresponding to the second geometries, then the two geometries do not intersect in the corresponding space; if a node exists in the KD tree corresponding to the first geometries and exists in the KD tree corresponding to the second geometries, then the two geometries intersect in the corresponding space.

[0042] The intersection region of two geometric bodies is identified. When a node is identified where the two geometric bodies intersect in space, that node is the intersection region of the two geometric bodies.

[0043] A Boolean subtraction operation is performed on the region where the two identified geometric bodies intersect, removing the part where the first geometric body intersects with the second geometric body from the first geometric body, resulting in an updated first geometric body;

[0044] The updated first geometry is reconstructed to obtain the reconstructed first geometry. The reconstruction operation includes triangulation of the cut edges and faces, and retriangulation of the updated first geometry.

[0045] The reconstructed first geometry is merged with the non-intersecting parts of the original first geometry, i.e., the nodes of the KD tree are merged to generate the final composite. The non-intersecting parts of the original first geometry are the geometric parts of the first geometry that do not intersect with the second geometry.

[0046] Wherein, the first geometric shape is the workpiece, and the second geometric shape is the cutting tool.

[0047] Preferably, the Boolean subtraction operation on the intersecting region of the two identified geometric bodies further includes:

[0048] Determine whether the first geometric body and the second geometric body have intersecting triangular facets;

[0049] Find the child nodes of the KD trees corresponding to the first geometry and the second geometry, and determine whether the KD trees corresponding to the two geometries have child nodes in the same space;

[0050] If there are intersecting triangular faces in the child nodes, the intersecting triangular faces are identified and obtained, and corresponding processing is performed according to the different intersection situations of the intersecting triangular faces.

[0051] In addition to the corresponding processing of the intersecting triangular facets mentioned above, the faces of the first geometry and the second geometry that overlap are triangulated again to form new triangular mesh data.

[0052] This invention provides a milling simulation device based on parallel Boolean operations, comprising:

[0053] The path reading module is used to read the geometric path in the milling environment. The geometric path is a set of points with tool coordinate information and tool posture information at that coordinate.

[0054] The spatial transformation module is used to calculate the affine transformation matrix based on the geometry path and the initial position of the geometry, and obtain the affine transformed geometry to update the position of the tool after movement.

[0055] The sweep body construction module is used to determine the tool's movement path based on the geometry before and after the affine transformation, and to construct the corresponding tool's sweep body based on the tool's movement path in each frame.

[0056] The KD tree construction module is used to spatially partition geometry based on the KD tree data structure, and simultaneously construct KD trees for multiple geometries to obtain the constructed KD tree structure data. Each geometry includes at least the sweep body of the tool and the workpiece.

[0057] The Boolean operation module is used to traverse the KD tree corresponding to two geometries to obtain the intersection nodes between the geometries, perform the corresponding Boolean operation on the intersection nodes and then perform a merging operation to obtain the final geometries corresponding to a series of frame data to simulate the milling process.

[0058] This invention provides an electronic device, comprising:

[0059] The memory is used to store the processing program;

[0060] The processor, when executing the processing program, implements the milling simulation method based on parallel Boolean operations as described in the embodiments of the present invention.

[0061] The present invention provides a readable storage medium storing a processing program, which, when executed by a processor, implements the milling simulation method based on parallel Boolean operations as described in the embodiments of the present invention.

[0062] Compared with the prior art, the present invention has the following beneficial effects:

[0063] The present invention provides a milling simulation method based on parallel Boolean operations, which uses a KD-tree data structure to spatially partition the geometry. It can simultaneously construct KD-trees for multiple geometries. Compared with traditional Boolean operations, which can only perform Boolean operations on two geometries, this algorithm can perform Boolean operations on multiple geometries simultaneously. It constructs multiple swept bodies according to the moving body model and machining path, thereby improving the efficiency of parallel Boolean operations and meeting the requirements of real-time machining simulation.

[0064] This invention constructs a parallel computing strategy at the application layer and algorithm layer, and designs parallelism at both the application layer and algorithm layer. Compared with traditional serial Boolean operations, it has greatly improved time efficiency, and has high computing efficiency and high stability.

[0065] This invention designs parallel Boolean operations based on key information from the computer used, including parallelization design and selection of appropriate parallelism based on hardware conditions to achieve maximum efficiency. Specifically, it predicts the appropriate parallelism based on the environment: in scenarios with more complex geometry, constructing multiple KD-Trees simultaneously can cause excessive memory consumption, even leading to memory overruns. This invention establishes a regression prediction model that predicts the parallelism of the application layer and algorithm layer based on the geometric information read, such as the total number of points and faces, and the current hardware environment, such as the number of CPU cores and memory size, to ensure stable program operation. Attached Figure Description

[0066] Figure 1 , 2 This is a schematic diagram of the steps of the milling simulation method based on parallel Boolean operations in one embodiment of the present invention;

[0067] Figure 3 This is a schematic diagram of the overall algorithm flow in a milling simulation method based on parallel Boolean operations in one embodiment of the present invention;

[0068] Figure 4 This is an example diagram of the geometry read in one embodiment of the present invention;

[0069] Figure 5 This is a flowchart of the overall Boolean operation in one embodiment of the present invention;

[0070] Figure 6 This is an example diagram showing the workpiece and cutting head after being constructed into a KD-Tree according to one embodiment of the present invention;

[0071] Figure 7 This is an example diagram of a partitioned KD-Tree model in one embodiment of the present invention;

[0072] Figure 8 This is a flowchart of the Boolean operation algorithm in one embodiment of the present invention;

[0073] Figure 9 This is an example diagram illustrating different cases of intersecting triangular facets in one embodiment of the present invention;

[0074] Figure 10 This is an example diagram of the final geometric synthesis result in one embodiment of the present invention. Detailed Implementation

[0075] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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.

[0076] The term "comprising" and its variations as used herein are open-ended inclusion, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0077] It should be noted that the concepts of "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0078] It should be noted that the terms "a" and "a plurality of" used in this application disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0079] Example 1

[0080] like Figure 1 As shown, this invention provides a milling simulation method based on parallel Boolean operations, applicable to milling simulation systems based on parallel Boolean operations. The system includes a support vector machine model, an application layer, and an algorithm layer. This embodiment focuses on three-dimensional geometry and is suitable for machining simulation scenarios in the industrial manufacturing field, such as milling simulation. The specific simulation includes the following steps:

[0081] S1: Read the geometric path in the milling environment. The geometric path is a set of points with tool coordinate information and tool posture information in the coordinates. For example, in this embodiment, the geometric path consists of 1000 points, i.e. 1000 frames. The acquired path is interpolated. A path consists of multiple points. Then, the next step is to calculate an affine transformation for each point. The result is a frame of data, i.e., a geometric object.

[0082] S2: Calculate the affine transformation matrix based on the geometry path and the initial position of the geometry to obtain the geometry after the affine transformation and update the position of the tool after the movement;

[0083] S3: Determine the tool's movement path based on the geometry before and after the affine transformation, and construct the corresponding tool's sweep body based on the tool's movement path in each frame.

[0084] S4: The geometry is spatially partitioned based on the KD tree data structure, and KD trees are constructed for multiple geometries to obtain the constructed KD tree structure data. Each geometry includes at least the sweep body of the tool and the workpiece; the tool in this embodiment can be a cutting head, etc.

[0085] S5: Traverse the KD-trees corresponding to the two geometries to obtain the intersection nodes between them. Perform corresponding Boolean operations on the intersection nodes and then merge them to obtain the final geometries corresponding to a series of frame data to simulate the milling process. In this embodiment, one of the traversed geometries is the cutting tool, and the other is the workpiece. See also Figure 2As shown, the simulation steps in this implementation are as follows: 1. Read the geometry: Input data can be a 3D object file, such as .off or .obj files. The 3D object data consists of many triangular facets. Each triangular facet includes 3 points and 3 edges. First, this information needs to be saved into the corresponding data structure for later use. The output data is the data structure that saves the 3D object. 2. Read the geometry path: This is the tool's movement path. A single data entry includes the x, y, and z-axis coordinates of the tool contact point, as well as the tool's posture information at these coordinates, including the angles relative to the x, y, and z axes. The output data is the data structure that saves the path and other information. 3. Calculate the affine transformation matrix: Input the tool model and path saved in the previous step. The affine transformation matrix can be used to calculate the tool's movement path from the i-th position. The model is moved to the (i+1)th point, including the tool's position and orientation. After constructing an affine transformation matrix, the tool model is multiplied by the matrix to obtain the moved tool model. 4. Construct the sweep body: Input the tool model before and after the move, use existing algorithms to construct the sweep body, and output the tool's sweep body. 5. Divide the 3D object and construct a KD tree: Input the tool's sweep body and the workpiece, divide the tool's sweep body and construct a KD tree, and output the corresponding KD tree data structures respectively. 6. Perform Boolean operations: Input the two KD trees constructed in the previous step, perform Boolean operations, and output the calculated KD tree. 7. Generate results: Input the output data from the previous step, merge each node in the KD tree, and calculate to obtain the final 3D object file. The tool / workpiece models referred to in this implementation are all geometric structures. The machining simulation run in this implementation needs to calculate the results of multiple frames to simulate the machining process. For each frame, the machining simulation algorithm can be divided into two sub-problems: first, construct the sweep body of the moving object, and then perform Boolean operations on the sweep body and the workpiece. In this process, handling complex 3D geometric models is an unavoidable challenge. Boolean operations, as one of the core operations for processing geometric models, involve complex calculations such as combination, cutting, and merging. These operations are typically computationally intensive, especially when processing large geometric data, where traditional serial algorithms may be inefficient. With the development of computing hardware, the widespread application of multi-core processors, GPUs, and high-performance computing clusters has provided a platform for parallel computing, making it possible to accelerate Boolean operations. Parallel Boolean operations utilize multiple processing units to execute tasks simultaneously, achieving efficient processing of complex geometric models through distributed computing.

[0086] This embodiment introduces parallel computing technology to enable faster and more efficient Boolean operations on complex geometric models in the industrial manufacturing field. This provides more powerful computing capabilities for the design and manufacturing process, accelerates product development cycles, improves manufacturing efficiency, and supports more complex geometric designs. Specifically, before reading the geometric path in the milling environment, this embodiment constructs the overall flow of the milling simulation method based on parallel Boolean operations. (See attached diagram.) Figure 3 As shown, the specific steps include:

[0087] 1. Read the geometric information and current hardware information from the milling environment. The geometric information includes the total number of points and faces, and the current hardware information includes the number of CPU cores and memory size. Construct parallel computing strategies at the application and algorithm layers, and predict the optimal application layer parallelism *n* and algorithm layer parallelism *m* based on a support vector machine regression model. This embodiment can be understood as reading geometric information and current hardware information from industrial data, and using a support vector machine regression model to predict the most suitable application layer parallelism *n* and algorithm layer parallelism *m*. For application layer parallelism, when the parallelism is *n*, n threads will simultaneously construct multiple KD-Trees, which will consume a significant amount of memory. Theoretically, efficiency will be improved by *n* times. For the algorithm layer, when the parallelism is *m* and does not consume excessive memory, the overall efficiency is not significantly improved because only certain parts of the algorithm are parallelized. The model predicts the peak memory usage of the algorithm based on the geometric and hardware information, and then derives the parallelism of the application and algorithm layers. The support vector machine regression model used in this implementation is a mature model technology. The difference between this implementation and the existing technology is that this implementation is for a milling simulation scenario and the input features are different. The input to the model in this embodiment is geometric information and current hardware-related information. The result is the optimal application layer parallelism n and algorithm layer parallelism m in the milling simulation environment, thereby improving the parallel efficiency of the overall application layer and algorithm layer.

[0088] 2. In the application layer, a thread pool of n threads is created to construct multiple KD-trees simultaneously. Currently, the n threads are in a blocked state until a new task is added to the thread pool. When a new task is added to the thread pool, the n threads compete for it. The thread that successfully acquires the task executes it, while the threads that fail to acquire the task remain blocked. A corresponding number of tasks are generated based on the frame count calculated according to the simulation requirements and sequentially added to the thread pool until the load is balanced among the threads. In other words, in this embodiment, the n threads will be blocked until the program adds tasks to the pool. When a new task is added, the n threads compete for it; the thread that successfully acquires the task executes it, while the other threads remain blocked. The program then generates a corresponding number of tasks based on the calculated frame count and sequentially adds them to the pool. The task mainly consists of four parts: First, reading the geometry path, indicating which frame the current thread is responsible for calculating; second, calculating the affine transformation matrix, which is mainly done based on the path and the initial position of the geometry to obtain the new position of the geometry; next, constructing the corresponding sweep volume based on the geometry's movement path; finally, partitioning the calculated sweep volume spatially using a KD-Tree data structure; after a thread completes its task, it will re-enter a blocked state, waiting for new tasks to join. A thread pool is used at the application layer to prevent large differences in computation time between tasks, which could lead to some threads being idle while others are constantly performing calculations. Using a thread pool allows for load balancing among threads. Application layer computations are relatively memory-intensive because multiple KD-Trees are constructed simultaneously; therefore, strictly controlling the parallelism of the application layer is crucial in this embodiment of the invention.

[0089] 3. In the algorithm layer, Boolean operations are parallelized. The threads corresponding to Boolean operations are split into multiple corresponding tasks. TBB parallelization is used to process these tasks. KD-trees are used to obtain the intersecting triangular faces of the geometric objects. After performing Boolean subtraction, the missing faces are re-triangulated, and the triangulation results are added back to the KD-tree. The geometric objects include at least one workpiece and one tool geometry. All the above tasks correspond to the milling simulation logic. The approach differs from application-layer parallelization. It primarily involves splitting loops into multiple smaller tasks, such as for loops, while loops, and recursion. For example, if a for loop iterates 100 times and the application layer has 10 threads, the 100 iterations are divided into 10 smaller tasks, each containing 10 iterations. This way, each thread only needs to iterate 10 times, improving efficiency. If 100 iterations take 100 seconds, then each thread will also take 100 seconds to execute. If I break it down into 10 parts and execute them in 10 threads, it only takes 10 seconds to complete, thus improving efficiency tenfold. This makes the time difference in executing each small task almost negligible, naturally eliminating the need for a thread pool to control the load balancing of each thread. Therefore, TBB (Intel ThreadBuilding Blocks) is used at the algorithm layer for parallelization. TBB provides high-level abstractions and flexible task scheduling, making parallel programming easier. For Boolean operations, internally, a KD-Tree is used to find the intersecting triangular faces of the geometry, Boolean subtraction is performed, and the missing faces are re-triangulated. The triangulation results are then added back to the KD-Tree. From the perspective of parallel efficiency, loops that can be broken down into multiple tasks will see a significant increase in efficiency after parallelization; however, for the algorithm as a whole, the efficiency is not significantly improved because some parts of the algorithm cannot be parallelized.

[0090] 4. Finally, the results are saved for easy visualization. This invention operates in parallel at both the application and algorithm layers, which greatly improves efficiency and provides new solutions for some real-time processing simulation fields.

[0091] This invention proposes a parallel Boolean operation method. The parallel strategy mainly includes application-layer parallelism and algorithm-layer parallelism. Theoretically, application-layer parallelism can improve efficiency several times over, while algorithm-layer parallelism improves efficiency less than application-layer parallelism. Since the Boolean operation in this invention is based on spatial partitioning of geometry using a KD-Tree, the complexity of the geometric objects and the parallelism of the application layer will affect the memory usage of the KD-Tree in complex scenarios. Therefore, this invention also establishes a support vector machine regression model, which calculates the most suitable parallelism for the application layer and algorithm layer based on hardware conditions such as the number of CPU cores and memory size. This improvement allows the method to make the most suitable thread allocation strategy according to different hardware environments, enabling parallel Boolean operations to fully utilize hardware resources and achieve the highest computational efficiency under different conditions. Furthermore, this method solves the problem of excessive memory usage caused by spatial partitioning-based Boolean operations in complex scenarios. After parallelization, the time consumption of each Boolean operation is in the millisecond range, which is an order of magnitude faster than the second-level speed of traditional Boolean operations, making it more feasible in some real-time machining simulation fields.

[0092] See Figure 4 As shown in the figure, there are two geometric models: a cuboid representing the workpiece and a cylinder representing the model when the cutting head rotates. Their positional relationship is shown in the figure. The cutting head moves along the length of the workpiece, and a Boolean subtraction operation is performed on these two objects.

[0093] In this embodiment, there are many points in the geometric path, and the movement between any two points can be considered as an affine transformation matrix. First, based on the differences in the x, y, and z coordinates of the two points and the orientation of the cutting head, we can construct the affine transformation matrix. There are three cases for the affine transformation matrix: translation, rotation, and scaling. In the field of milling simulation, we only need to consider the first two cases.

[0094] The translation case is explained as follows: The differences in the x-axis, y-axis, and z-axis coordinates of every two points on the geometric path are obtained to construct the first affine transformation matrix to update the tool's position information after movement. When the tool's affine transformation is translation, the x-axis, y-axis, and z-axis coordinates of the preceding and following points on the geometric path are obtained respectively. The coordinates of the following point are compared with those of the preceding point to obtain the x-axis coordinate difference t between the two points. x The coordinate value t in the y-axis direction y The coordinate value t in the z-axis direction z After constructing the affine transformation matrix, multiplying each point of the original 3D object by the first affine transformation matrix yields the translated first affine transformation matrix as follows:

[0095]

[0096] The following explains the rotation case: The tool's orientation information along the geometric path is obtained to construct a second affine transformation matrix to update the tool's orientation information. When the tool's affine transformation is rotation, the angles of rotation of the tool relative to the x, y, and z axes along the geometric path are obtained. If the angle of rotation of the moved 3D geometry relative to the x-axis is θ, the constructed second affine transformation matrix is ​​as follows:

[0097]

[0098] If the rotated 3D geometry is θ relative to the y-axis, the constructed second affine transformation matrix is ​​as follows:

[0099]

[0100] If the rotated 3D geometry is θ relative to the z-axis, the constructed second affine transformation matrix is ​​as follows:

[0101]

[0102] Where P' is the transformed 3D object, and P is the original 3D object.

[0103] The above embodiment provides a detailed description of the specific movement of the object. This allows each affine transformation to be treated as a small task and placed in a thread pool, waiting for an idle thread to perform the computation. Furthermore, after completing the affine transformation, the thread constructs the corresponding swept volume based on the 3D object before and after the transformation, and then constructs the corresponding KD-Tree.

[0104] The overall flowchart of Boolean operations in this embodiment is shown in Figure 5, which includes the following steps:

[0105] 1. First, performing Boolean operations on multiple geometric objects simultaneously will construct a KD-Tree for each object. A KD-Tree is a data structure used to organize data in k-dimensional space, dividing the space into a series of cubic or cuboid units. During construction, geometric data such as vertices, edges, and faces are inserted into the tree. The KD-Tree recursively selects an axis such as the X, Y, or Z axis and a point on that axis to divide the space until the amount of geometric data contained in each unit reaches a certain threshold or the tree reaches its maximum depth.

[0106] 2. Reading and partitioning geometry: In a KD-Tree, each node represents a partition of space, making Boolean operations on 3D objects highly efficient. The tree structure allows for quick location of specific parts of an object and the performance of Boolean operations on those parts. For example, when performing Boolean subtraction, it's easy to quickly determine which parts of the object intersect, and only those parts are processed.

[0107] 3. After dividing the geometry, Boolean operations need to be performed. Boolean operations can be performed efficiently with the help of KD-Trees. The algorithm will traverse the KD-Trees of the two objects, find the intersecting nodes, and perform the corresponding Boolean operations on these nodes. For example, when calculating the intersection, the geometry will only be included in the final result if the corresponding nodes of both trees contain geometry.

[0108] 4. Finally, generate the result. After the Boolean operation is completed, the processed KD-Tree nodes need to be merged to generate the final composite. This includes connecting the boundaries of each part to ensure the integrity and continuity of the geometry, and finally extracting the new geometry from the merged KD-Tree. This is the result of the Boolean operation.

[0109] In various embodiments of this application, a KD-Tree refers to dividing an object into K dimensions, which is three-dimensional in this case. Constructing a KD-Tree for a three-dimensional object essentially involves dividing the three-dimensional object into multiple cubes. The specific steps for constructing the KD-Tree include the following:

[0110] Boolean operations are performed on multiple geometries simultaneously, and a KD tree is constructed for each geometry. The KD tree refers to a series of geometries of preset shapes in three-dimensional space, and the geometries of preset shapes include at least a cube.

[0111] The target data of the geometry is obtained and inserted into the corresponding KD tree data structure. The target data of the geometry includes the vertices, edges and faces of the geometry.

[0112] Based on the KD tree, an arbitrary axis and an arbitrary point on that axis are recursively selected to determine the dividing surface, and the original space of the geometry is divided for the first time to obtain the two subspaces of the geometry of the preset shape.

[0113] For each subspace, repeat the above operation to confirm the segmentation surface and continue the second segmentation operation until the preset termination condition is reached;

[0114] Each corresponding segmentation operation corresponds to a node in the KD-tree. The root node is the initial segmentation face, and each child node represents a subsequent segmentation face. Each node stores information about the segmentation face, such as its position and orientation, as well as a pointer to a subspace. An example of constructing a KD-tree for a cube is as follows: Assume a simple cube with a side length of 1, located at the origin (0,0,0). Step 1: Selecting a segmentation face: Initial segmentation. First, select a segmentation face. You can choose to segment along a principal axis, such as the midpoint of the X, Y, or Z axis. Let's assume the midpoint of the X-axis (0.5,0,0) is chosen for the first segmentation. The orientation of the segmentation face: The segmentation face is a plane perpendicular to the selected axis. Here, the segmentation face is a plane perpendicular to the X-axis, passing through the point (0.5, 0,0). Step 2: Recursive segmentation: Creating subspaces. The above segmentation face divides the cube into two subspaces: one subspace contains all points with X coordinates less than 0.5, and the other subspace contains all points with X coordinates greater than or equal to 0.5. This recursive application works as follows: for each subspace, the selection of a dividing plane is repeated to continue the division. For example, the midpoint of the Y-axis or Z-axis in each subspace can be used as the next dividing plane. The preset termination condition in this implementation means that the recursive process continues until a certain termination condition is met, such as the size of each subspace falling below a preset threshold, or reaching a predetermined recursion depth.

[0115] like Figure 6 The diagram shows the result after constructing a KD-Tree with the workpiece and cutting head. The diagonal of the rectangle represents the edges of the original 3D object, while the other lines (excluding the diagonal) represent the resulting KD-Tree. It can be seen that the space is first divided into multiple cubes, and then, based on the triangular faces of the two 3D objects, the corresponding triangular faces are added to the corresponding cubes. The model of the corresponding KD-Tree is shown below. Figure 7 As shown.

[0116] In several embodiments of this application, step S5, which involves traversing the KD-trees corresponding to two geometric objects to obtain the intersection nodes between the geometric objects, and performing a merging operation on the intersection nodes after performing the corresponding Boolean operation, further includes:

[0117] S51: Traverse the KD trees corresponding to at least two geometries, and check the corresponding nodes in the two corresponding KD trees to determine whether there is spatial overlap. The checking method is as follows: if the node exists in the KD tree corresponding to the first geometries but does not exist in the KD tree corresponding to the second geometries, then the two geometries do not intersect in the corresponding space; if the node exists in the KD tree corresponding to the first geometries and exists in the KD tree corresponding to the second geometries, then the two geometries intersect in the corresponding space.

[0118] S52: Identify the intersecting region of two geometric bodies. When a node is identified where two geometric bodies intersect in space, that node is the intersecting region of the two geometric bodies.

[0119] S53: Perform a Boolean subtraction operation on the region where the two identified geometric bodies intersect, remove the part where the first geometric body intersects with the second geometric body from the first geometric body, and obtain the updated first geometric body;

[0120] S54: Perform a reconstruction operation on the updated first geometry to obtain a reconstructed first geometry. The reconstruction operation includes triangulation of the cut edges and faces, and retriangulation of the updated first geometry.

[0121] S55: Merge the non-intersecting parts of the reconstructed first geometry with the original first geometry, i.e., merge the nodes of the KD tree to generate the final composite body. The non-intersecting parts of the original first geometry are the geometric parts of the first geometry that do not intersect with the second geometry. The first geometry is the workpiece, and the second geometry is the cutting tool.

[0122] The internal principle of the Boolean operation algorithm implemented in this practice is as follows: Figure 8As shown, taking Boolean subtraction as an example, the steps include: 1. If a Boolean operation is performed on two geometries, the algorithm first traverses the KD-Tree of both objects. During this process, the algorithm checks the corresponding nodes in the two trees to determine if they overlap spatially. If a node is stored in the KD-Tree of one geometry but not in the KD-Tree of the other, it means that this space belongs to only one geometry, indicating that the two geometries do not intersect in this space. 2. Next, the intersecting region needs to be identified. When the nodes where the two geometries intersect in space are found, these nodes represent the intersecting region of the two geometries. These regions need special handling, which is the most crucial part of the Boolean operation. 3. Then, the intersecting region needs to be processed. In the Boolean subtraction operation, the goal is to remove the part that intersects with the second object from the first object. Therefore, the algorithm calculates the geometric relationship between the two geometries at each intersecting node in detail. This usually involves geometric cutting and face trimming. At this point, the intersecting region needs to be calculated and these regions removed from the KD-Tree of the first geometry. 4. Finally, the geometry is reconstructed. After removing intersecting regions, the first geometry needs to be reconstructed to ensure its integrity. This includes triangulating the cut edges and faces, re-triangulating the new geometry, and ensuring its continuity and consistency. Finally, the non-intersecting parts are merged. The algorithm retains the portions of the first geometry that do not intersect with the second geometry; these portions become part of the final geometry. Finally, the nodes of the KD-Tree are merged to obtain the result after Boolean operations.

[0123] In summary, Boolean subtraction operations are achieved by identifying the regions where two geometries intersect and removing these regions from the first geometry. With KD-Tree, this process becomes both efficient and precise, especially when dealing with complex 3D geometries. This approach allows for fine-grained control over complex 3D models, enabling accurate geometric operations.

[0124] Specifically, step S53, which involves performing a Boolean subtraction operation on the intersecting region of the two identified geometric bodies, further includes:

[0125] S531: Determine whether there are intersecting triangular facets between the first geometric body and the second geometric body;

[0126] S532: Find the child nodes of the KD trees corresponding to the first geometry and the second geometry, and determine whether the KD trees corresponding to the two geometry have child nodes in the same space;

[0127] S533: If there are intersecting triangular faces in the child node, then identify and obtain the intersecting triangular faces, and perform corresponding processing according to the different intersection situations of the intersecting triangular faces.

[0128] S534: In addition to the corresponding processing of the intersecting triangular facets mentioned above, the faces of the first geometry and the second geometry that overlap are triangulated again to form new triangular mesh data.

[0129] In this embodiment, when performing Boolean operations, it is only necessary to check whether two 3D objects have intersecting triangular faces within each cube. There are various cases for intersecting triangular faces, such as... Figure 9 As shown. For case (a), one vertex is on the cutting surface, and the other two vertices are on the same side of the cutting surface, so the triangular facet is not triangulated. For case (b), one vertex is on the cutting surface, and the other two vertices are on opposite sides of the cutting surface, so triangle ABC needs to be divided into triangles ABD and BCD. For case (c), three vertices are on opposite sides of the cutting surface, so triangle ABC should be divided into triangles ADE, BCD, and CDE. For case (d), similar to case (c), no triangulation is performed. For case (e), this indicates that the triangular facet coincides with the cutting surface, so no triangulation is performed. In addition to processing intersecting triangular facets, the faces of two objects that coincide need to be triangulated again to form new triangular mesh data.

[0130] After processing the intersecting faces in each cube, we can reconstruct the 3D object. For Boolean subtraction, this means subtracting the part where the workpiece intersects with the cutting head from the workpiece, while ignoring the cutting head model during reconstruction.

[0131] Finally, the results are combined to output the final result. The merging process is relatively simple; it involves merging the triangular faces of the various cubes in the space. The final result is as follows. Figure 10 As shown.

[0132] Example 2

[0133] Based on the same concept, this invention provides a milling simulation device based on parallel Boolean operations, comprising:

[0134] The path reading module is used to read the geometric path in the milling environment. The geometric path is a set of points with tool coordinate information and tool posture information at that coordinate.

[0135] The spatial transformation module is used to calculate the affine transformation matrix based on the geometry path and the initial position of the geometry, and obtain the affine transformed geometry to update the position of the tool after movement.

[0136] The sweep body construction module is used to determine the tool's movement path based on the geometry before and after the affine transformation, and to construct the corresponding tool's sweep body based on the tool's movement path in each frame.

[0137] The KD tree construction module is used to spatially partition geometry based on the KD tree data structure, and simultaneously construct KD trees for multiple geometries to obtain the constructed KD tree structure data. Each geometry includes at least the sweep body of the tool and the workpiece.

[0138] The Boolean operation module is used to traverse the KD tree corresponding to two geometries to obtain the intersection nodes between the geometries, perform the corresponding Boolean operation on the intersection nodes and then perform a merging operation to obtain the final geometries corresponding to a series of frame data to simulate the milling process.

[0139] It should be noted that the division of the various modules in this device / system embodiment is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software through processing element calls; they can also be implemented entirely in hardware; or some units can be implemented by processing element calls to software, while others can be implemented in hardware.

[0140] The implementation principles of the path reading module, spatial transformation module, swept volume construction module, KD tree construction module, and Boolean operation module have been described in the foregoing embodiments, and therefore will not be repeated here.

[0141] Example 3

[0142] Based on the same concept, an electronic device is also provided in some embodiments of this application. This electronic device includes a memory and a processor, wherein the memory stores a processing program, and the processor executes the processing program according to instructions. When the processor executes the processing program, the milling simulation method based on parallel Boolean operations described in the foregoing embodiments is implemented.

[0143] In some embodiments of this application, a readable storage medium is also provided, which can be a non-volatile readable storage medium or a volatile readable storage medium. The readable storage medium stores instructions that, when executed on a computer, cause an electronic device containing such a readable storage medium to perform the aforementioned milling simulation method based on parallel Boolean operations.

[0144] It is understood that, for the aforementioned milling simulation methods based on parallel Boolean operations, if they are all implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.

[0145] Computer-readable storage media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0146] The program code for executing the technical solutions disclosed in this application can be written in any combination of one or more programming languages. These programming languages ​​include object-oriented programming languages—such as Java and C++—and conventional procedural programming languages—such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not 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 of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A milling simulation method based on parallel Boolean operations, characterized in that, include: Read the geometric path in the milling environment, where the geometric path is a set of points with tool coordinate information and tool posture information at that coordinate. The affine transformation matrix is ​​calculated based on the geometric path and the initial position of the geometric body to obtain the affine transformed geometry and update the tool's position after movement. This includes: obtaining the differences in the x-axis, y-axis, and z-axis coordinates of every two points on the geometric path to construct the first affine transformation matrix to update the tool's position information after movement; when the tool's affine transformation is translation, the x-axis, y-axis, and z-axis coordinates of the previous and next points between two points on the geometric path are obtained respectively, and the coordinates of the next point are compared with the coordinates of the previous point to obtain the coordinate difference t in the x-axis direction between the two points. x The coordinate value t in the y-axis direction y The coordinate value t in the z-axis direction z After constructing the affine transformation matrix, multiplying each point of the original 3D object by the first affine transformation matrix yields the translated first affine transformation matrix as follows: Where P' is the transformed 3D object and P is the original 3D object; The tool movement path is determined based on the geometry before and after the affine transformation, and the corresponding tool sweep body is constructed based on the tool movement path of each frame. The geometry is spatially partitioned based on the KD tree data structure, and a KD tree is constructed for multiple geometries to obtain the constructed KD tree structure data. Each geometry includes at least the sweep body of the tool and the workpiece. The KD tree corresponding to the two geometries is traversed to obtain the intersection nodes between the geometries. After performing the corresponding Boolean operation on the intersection nodes, a merging operation is performed to obtain the final geometries corresponding to a series of frame data to simulate the milling process.

2. The milling simulation method based on parallel Boolean operations according to claim 1, characterized in that, The process of reading the geometry path in the milling environment includes: Read the geometric information and current hardware information in the milling environment. The geometric information includes the total number of points and the total number of faces. The current hardware information includes the number of CPU cores and the memory size. Parallel computing strategies are constructed at the application layer and algorithm layer, and the optimal parallelism size n at the application layer and the parallelism size m at the algorithm layer are predicted based on the support vector machine regression model. In the application layer, a thread pool with n threads is created to construct multiple KD trees simultaneously. Currently, the n threads are in a blocked state until a new task is added to the thread pool. When a new task is added to the thread pool, the n threads compete for the new task. The thread that wins the new task executes the corresponding task, while the thread that does not win the new task remains in a blocked state. The number of tasks is generated according to the number of frames calculated based on the simulation business requirements and is added to the thread pool in sequence until the load is balanced among the threads. In the algorithm layer, Boolean operations are parallelized to split the threads corresponding to Boolean operations into multiple corresponding tasks. TBB parallelization is used to process the multiple tasks after splitting. The intersecting triangular faces of the geometry are obtained through the KD tree. After performing Boolean subtraction operations, the missing faces are retriangulated, and the triangulation results are added back to the KD tree. The geometry includes at least the geometry of a workpiece and a cutting tool, and the above tasks are all tasks corresponding to the milling simulation logic.

3. The milling simulation method based on parallel Boolean operations according to claim 1, characterized in that, The step of calculating the affine transformation matrix based on the geometric path and the initial position of the geometric body to obtain the affine transformed geometric body also includes: Obtain the tool's attitude information on the geometric path to construct a second affine transformation matrix to update the tool's attitude information; When the affine transformation of the tool is rotation, the angles of rotation of the tool relative to the x-axis, y-axis, and z-axis in the geometric path are obtained. If the angle of rotation of the moved 3D geometry relative to the x-axis is θ, the constructed second affine transformation matrix is ​​as follows: ; If the rotated 3D geometry is θ relative to the y-axis, the constructed second affine transformation matrix is ​​as follows: ; If the rotated 3D geometry is θ relative to the z-axis, the constructed second affine transformation matrix is ​​as follows: ; Where P' is the transformed 3D object, and P is the original 3D object.

4. The milling simulation method based on parallel Boolean operations according to claim 2, characterized in that, The steps for constructing a KD-tree include: Boolean operations are performed on multiple geometries simultaneously, and a KD tree is constructed for each geometry. The KD tree refers to a series of geometries of preset shapes in three-dimensional space, and the geometries of preset shapes include at least a cube. The target data of the geometry is obtained and inserted into the corresponding KD tree data structure. The target data of the geometry includes the vertices, edges and faces of the geometry. Based on the KD tree, an arbitrary axis and an arbitrary point on that axis are recursively selected to determine the dividing surface, and the original space of the geometry is divided for the first time to obtain the two subspaces of the geometry of the preset shape. For each subspace, repeat the above operation to confirm the segmentation surface and continue the second segmentation operation until the preset termination condition is reached; Each corresponding segmentation operation corresponds to a node in the KD tree. The root node is the initial segmentation plane, each child node represents a subsequent segmentation plane, and each node stores information about the segmentation plane and a pointer to the subspace.

5. The milling simulation method based on parallel Boolean operations according to claim 1, characterized in that, The step of traversing the KD-trees corresponding to the two geometries to obtain the intersection nodes between the geometries, and performing the corresponding Boolean operation on the intersection nodes before merging the nodes, further includes: Traverse the KD trees corresponding to at least two geometries, and check the corresponding nodes in the two corresponding KD trees to determine whether there is spatial overlap. The checking method is as follows: if a node exists in the KD tree corresponding to the first geometries but does not exist in the KD tree corresponding to the second geometries, then the two geometries do not intersect in the corresponding space; if a node exists in the KD tree corresponding to the first geometries and exists in the KD tree corresponding to the second geometries, then the two geometries intersect in the corresponding space. The intersection region of two geometric bodies is identified. When a node is identified where the two geometric bodies intersect in space, that node is the intersection region of the two geometric bodies. A Boolean subtraction operation is performed on the region where the two identified geometric bodies intersect, removing the part where the first geometric body intersects with the second geometric body from the first geometric body, resulting in an updated first geometric body; The updated first geometry is reconstructed to obtain the reconstructed first geometry. The reconstruction operation includes triangulation of the cut edges and faces, and retriangulation of the updated first geometry. The reconstructed first geometry is merged with the non-intersecting parts of the original first geometry, i.e., the nodes of the KD tree are merged to generate the final composite. The non-intersecting parts of the original first geometry are the geometric parts of the first geometry that do not intersect with the second geometry. Wherein, the first geometric shape is the workpiece, and the second geometric shape is the cutting tool.

6. The milling simulation method based on parallel Boolean operations according to claim 5, characterized in that, The Boolean subtraction operation on the intersecting region of the two identified geometric bodies further includes: Determine whether the first geometric body and the second geometric body have intersecting triangular facets; Find the child nodes of the KD trees corresponding to the first geometry and the second geometry, and determine whether the KD trees corresponding to the two geometries have child nodes in the same space; If there are intersecting triangular faces in the child nodes, the intersecting triangular faces are identified and obtained, and corresponding processing is performed according to the different intersection situations of the intersecting triangular faces. In addition to the corresponding processing of the intersecting triangular facets mentioned above, the faces of the first geometry and the second geometry that overlap are triangulated again to form new triangular mesh data.

7. A milling simulation device based on parallel Boolean operations, characterized in that, include: The path reading module is used to read the geometric path in the milling environment. The geometric path is a set of points with tool coordinate information and tool posture information at that coordinate. The spatial transformation module is used to calculate the affine transformation matrix based on the geometric path and the initial position of the geometry, obtaining the affine transformed geometry to update the tool's position after movement. This includes: obtaining the differences in the x-axis, y-axis, and z-axis coordinates of every two points on the geometric path to construct a first affine transformation matrix to update the tool's position information after movement; when the tool's affine transformation is translation, obtaining the x-axis, y-axis, and z-axis coordinates of the preceding and following points on the geometric path, comparing the coordinates of the following point with the coordinates of the preceding point, and obtaining the x-axis coordinate difference t between the two points. x The coordinate value t in the y-axis direction y The coordinate value t in the z-axis direction z After constructing the affine transformation matrix, multiplying each point of the original 3D object by the first affine transformation matrix yields the translated first affine transformation matrix as follows: Where P' is the transformed 3D object and P is the original 3D object; The sweep body construction module is used to determine the tool's movement path based on the geometry before and after the affine transformation, and to construct the corresponding tool's sweep body based on the tool's movement path in each frame. The KD tree construction module is used to spatially partition geometry based on the KD tree data structure, and simultaneously construct KD trees for multiple geometries to obtain the constructed KD tree structure data. Each geometry includes at least the sweep body of the tool and the workpiece. The Boolean operation module is used to traverse the KD tree corresponding to two geometries to obtain the intersection nodes between the geometries, perform the corresponding Boolean operation on the intersection nodes and then perform a merging operation to obtain the final geometries corresponding to a series of frame data to simulate the milling process.

8. An electronic device, characterized in that, include: The memory is used to store the processing program; A processor that, when executing the processing program, implements the milling simulation method based on parallel Boolean operations as described in any one of claims 1 to 6.

9. A readable storage medium, characterized in that, The readable storage medium stores a processing program, which, when executed by a processor, implements the milling simulation method based on parallel Boolean operations as described in any one of claims 1 to 6.