Cutting simulation blank surface reconstruction method and device and readable storage medium
By using the Tri-Dexel model to discretize and boolean operations on the tool and blank, the problems of low efficiency and insufficient accuracy of blank surface reconstruction in the prior art are solved, and more efficient and accurate blank surface reconstruction is achieved.
Patent Information
- Application Number
- CN202411515672.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-03-07
AI Technical Summary
In the prior art, the blank surface reconstruction method has the problems of complex Boolean operations, low reconstruction efficiency, and the surface of the blank obtained by reconstruction is relatively rough, and the surface reconstruction accuracy of the blank surface is low.
The tool and blank are discretized using the Tri-Dexel model, the Dexel chain set of the tool and blank is extracted, and the Boolean operation is performed to obtain the target voxel intersecting the tool in the blank surface voxel model. The vertex coordinates and normal vectors of the triangle mesh are calculated by linear interpolation method, and the blank is finally surface reconstruction based on this information.
The Boolean calculation volume is reduced, the efficiency of surface reconstruction of blanks is improved, the generated surface mesh is smoother, and the accuracy of surface reconstruction of blanks is significantly improved.
Smart Images

Figure CN119578030A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cutting processing technology, and in particular to a cutting simulation blank surface reconstruction method, device and computer-readable storage medium. Background Art
[0002] CNC machining simulation combines CNC machining technology with computer graphics technology to simulate the CNC machining process. Before the actual machining of the blank, it is usually necessary to verify the feasibility of the cutting plan through cutting simulation, so as to timely discover the defects and loopholes of the cutting plan, improve the machining efficiency and quality, and save production costs. Blank surface reconstruction is a crucial step in the cutting simulation process, which directly affects the accuracy of subsequent cutting process analysis and results.
[0003] The blank surface reconstruction method in the prior art usually constructs a tool octree and a blank octree based on the tool three-dimensional mesh model and the blank three-dimensional mesh model respectively, performs Boolean operations on the bounding boxes of nodes at the same level in the tool octree and the blank octree, and determines whether each node of the blank intersects with the tool, thereby obtaining the cut node information in the blank, and finally generates a surface mesh based on all the cut node information on the blank using surface fitting technology, and reconstructs the surface of the blank based on the generated surface mesh. This method requires Boolean operations on the nodes at the same level in the tool and blank octree in sequence to determine whether each node on the blank is cut by the tool. Due to the large number of octree nodes, the Boolean operations are complicated and the calculation time is long, which reduces the efficiency of blank surface reconstruction. At the same time, if the cut nodes are unevenly distributed, or the cut nodes in some areas are too sparse, the details between adjacent cut nodes cannot be captured when the surface mesh is generated based on the cut node information, resulting in the generated surface mesh being not smooth enough and unable to accurately reflect the true characteristics of the cut surface of the blank, resulting in the reconstructed blank surface being rough and the blank surface reconstruction accuracy being low, which makes the cutting strategy and parameters selected when the simulation is used in the actual cutting process not accurate enough, affecting the actual processing accuracy and cutting efficiency.
[0004] In summary, the existing blank surface reconstruction methods have the problems of complex Boolean operations, low reconstruction efficiency, rough blank surface obtained by reconstruction, and low blank surface reconstruction accuracy. Summary of the invention
[0005] To this end, the technical problem to be solved by the present invention is to overcome the problems of complex Boolean operations, low reconstruction efficiency, rough reconstructed blank surface and low blank surface reconstruction accuracy in the prior art blank surface reconstruction method.
[0006] In order to solve the above technical problems, the present invention provides a method for reconstructing the surface of a cutting simulation blank, comprising: The tool and the blank are discretized respectively by using the Tri-Dexel model to obtain the tool Tri-Dexel model and the blank Tri-Dexel model; the tool Dexel chain set and the blank Dexel chain set are extracted based on the tool Tri-Dexel model and the blank Tri-Dexel model; A blank surface voxel model is obtained based on the blank Tri-Dexel model, and Boolean operations are performed on the tool Dexel chain in the tool Dexel chain set and the blank Dexel chain in the blank Dexel chain set to obtain the target voxel in the blank surface voxel model that intersects with the tool; For each target voxel, the state value of each corner point is obtained based on the positional relationship between each corner point of the target voxel and the tool, and based on the state values of all corner points of the target voxel, whether the target voxel is a boundary voxel containing an isosurface is determined, and if so, the target voxel is used as a voxel to be cut; Obtaining a triangular mesh formed by the intersection of each voxel to be cut and the isosurface, and calculating the vertex coordinates and normal vector of the triangular mesh using a linear interpolation method; A surface mesh is obtained based on the vertex coordinates and normal vectors of all triangular meshes, so that the surface of the blank is reconstructed based on the surface mesh.
[0007] Preferably, extracting a tool Dexel chain set and a blank Dexel chain set based on the tool Tri-Dexel model and the blank Tri-Dexel model comprises: Taking any point on the XOY plane as a first starting point, sampling along the X-axis and the Y-axis based on a first preset interval to obtain a plurality of first light emission points; respectively emitting light rays in the Z-axis direction at the first starting point and the plurality of first light emitting points, and obtaining the intersection points and coordinates of each light ray and the Tri-Dexel model / blank Tri-Dexel model; Arrange all the intersection points on each ray from large to small according to the coordinates to obtain the tool / blank Dexel chain corresponding to the ray, and obtain the tool Dexel chain subset / blank Dexel chain subset in the Z-axis direction based on the tool / blank Dexel chain corresponding to all the rays; Taking any point on the XOZ plane as a second starting point, sampling along the X axis and the Z axis based on a second preset interval to obtain a plurality of second light emission points; respectively emitting light rays in the Y-axis direction at the second starting point and the plurality of second light emitting points, and obtaining the intersection points and coordinates of each light ray and the Tri-Dexel model / blank Tri-Dexel model; Arrange all the intersection points on each ray from large to small according to the coordinates to obtain the tool / blank Dexel chain corresponding to the ray, and obtain the tool Dexel chain subset / blank Dexel chain subset in the Y-axis direction based on the tool / blank Dexel chain corresponding to all rays; Taking any point on the YOZ plane as a third starting point, sampling along the Y axis and the Z axis based on a second preset interval to obtain a plurality of third light emission points; respectively emitting light rays in the X-axis direction at the third starting point and the plurality of third light emitting points, and obtaining the intersection points and coordinates of each light ray with the Tri-Dexel model / blank Tri-Dexel model; Arrange all the intersection points on each ray from large to small according to the coordinates to obtain the tool / blank Dexel chain corresponding to the ray, and obtain the tool Dexel chain subset / blank Dexel chain subset in the X-axis direction based on the tool / blank Dexel chains corresponding to all the rays; Based on the tool Dexel chain subset / blank Dexel chain subset in the Z-axis direction, the tool Dexel chain subset / blank Dexel chain subset in the Y-axis direction, and the tool Dexel chain subset / blank Dexel chain subset in the X-axis direction, a tool Dexel chain set / blank Dexel chain set is obtained.
[0008] Preferably, a Boolean operation is performed on the tool Dexel chain in the tool Dexel chain set and the blank Dexel chain in the blank Dexel chain set, and the target voxels intersecting with the tool in the blank surface voxel model are obtained, including: For each blank Dexel chain in the blank Dexel chain set, a Boolean difference operation is performed between each tool Dexel chain in the tool Dexel chain set and the blank Dexel chain to generate a target Dexel chain; It is determined whether the target Dexel chain is the same as the blank Dexel chain. If the target Dexel chain is different from the blank Dexel chain, the voxels corresponding to the blank Dexel chain are all target voxels that intersect with the tool in the blank surface voxel model.
[0009] Preferably, the formula for Boolean difference calculation between the tool Dexel chain and the blank Dexel chain is: , in, Indicates the target Dexel chain; Represents the blank Dexel chain; Represents the tool Dexel chain; Represents the corresponding voxel in the blank Dexel chain.
[0010] Preferably, acquiring the state value of each corner point based on the positional relationship between each corner point of the target voxel and the tool comprises: Obtaining the coordinates of each corner point of the target voxel, and determining the position of each corner point and the knife body voxel model based on the coordinates of each corner point; If the coordinates of the corner point are located inside the knife body pixel model, the state value of the corner point is 1; If the coordinates of the corner point are outside the knife body pixel model, the state value of the corner point is 0; If the coordinates of the corner point are located on the knife body pixel model, the state value of the corner point is -1.
[0011] Preferably, judging whether the target voxel is a boundary voxel containing an isosurface based on the state values of all corner points of the target voxel comprises: If the state values of all corner points of the target voxel are 0, it is determined that the target voxel does not contain an isosurface; If the state value of at least one corner point among all corner points of the target voxel is 1, it is determined that the target voxel contains an isosurface, and the target voxel is a boundary voxel containing an isosurface.
[0012] Preferably, the calculation formula for the vertex coordinates of the triangle mesh is: , , , in, , , Respectively represent the vertex coordinates of the triangle mesh; , , Represents the coordinates of the first intersection point between the voxel to be cut and the isosurface; , , Represents the coordinates of the second intersection point between the voxel to be cut and the isosurface; , , Represents the coordinates of the third intersection point between the voxel to be cut and the isosurface; , Indicates the preset interpolation parameters; .
[0013] Preferably, the calculation formula of the normal vector of the triangle mesh is: , in, Represents the normal vector of a triangle mesh.
[0014] The present invention also provides a cutting simulation blank surface reconstruction device, comprising: A Dexel chain set acquisition module is used to discretize the tool and the blank respectively using the Tri-Dexel model to obtain the tool Tri-Dexel model and the blank Tri-Dexel model; based on the tool Tri-Dexel model and the blank Tri-Dexel model, a tool Dexel chain set and a blank Dexel chain set are extracted; A Boolean operation module is used to obtain a blank surface voxel model based on the blank Tri-Dexel model, and to perform Boolean operations on the tool Dexel chain in the tool Dexel chain set and the blank Dexel chain in the blank Dexel chain set to obtain a target voxel in the blank surface voxel model that intersects with the tool; An isosurface judgment module is used to obtain the state value of each corner point of each target voxel based on the positional relationship between each corner point of the target voxel and the tool, and judge whether the target voxel is a boundary voxel containing an isosurface based on the state values of all corner points of the target voxel. If so, the target voxel is used as a voxel to be cut; A triangle mesh acquisition module is used to acquire a triangle mesh formed by the intersection of each voxel to be cut and the isosurface, and calculate the vertex coordinates and normal vector of the triangle mesh using a linear interpolation method; The surface reconstruction module is used to obtain a surface mesh based on the vertex coordinates and normal vectors of all triangular meshes, thereby reconstructing the surface of the blank based on the surface mesh.
[0015] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned cutting simulation blank surface reconstruction method are implemented.
[0016] The cutting simulation blank surface reconstruction method provided in the present application utilizes the Tri-Dexel model to discretely express the tool and the blank, and after obtaining the tool Tri-Dexel model and the blank Tri-Dexel model, the tool Dexel chain set and the blank Dexel chain set are extracted. Since the Dexel chain directly represents the discrete voxel information of the tool and the blank surface, Boolean operations are directly performed on the tool Dexel chain and the blank Dexel chain to obtain the target voxels intersecting with the tool in the blank surface voxel model, that is, the voxels cut by the tool in the blank surface voxel model are obtained, thereby reducing the data structure and the granularity of operations. Compared with the octree traversing multiple levels of nodes and performing Boolean operations in sequence, the amount of Boolean operations is greatly reduced, and the efficiency of blank surface reconstruction is improved. After obtaining the target voxel, each corner point of the target voxel is obtained based on the positional relationship between the corner points of the target voxel and the tool. The state value of the corner point is used to determine whether the target voxel is a boundary voxel containing an isosurface based on the state values of all the corner points of the target voxel, that is, by determining whether each corner point in the target voxel is cut by the tool, it is determined whether the target voxel contains an isosurface cut by the tool; finally, the target voxel containing the isosurface is used as the voxel to be cut, and the triangular mesh formed by the intersection of each voxel to be cut and the isosurface is obtained, and the vertex coordinates and normal vector of each triangular mesh are calculated using linear interpolation; the surface mesh is obtained based on the vertex coordinates and normal vectors of all triangular meshes, so as to reconstruct the surface of the blank; the triangular mesh is generated based on the local information of the voxel, which can better capture the continuity of the triangular meshes between adjacent voxels, and reduce the problem of the rough surface mesh obtained based on the fitting of discrete point data, so that the reconstructed blank surface is smoother and the accuracy of blank surface reconstruction is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below according to specific embodiments of the present invention in conjunction with the accompanying drawings, wherein: Figure 1 A flow chart of the surface reconstruction method of a cutting simulation blank provided in this application; Figure 2 Schematic diagram of the Dexel model provided for this application; Figure 3 The Dexel position relationship diagram of the tool and the blank provided in this application; wherein, Figure 3 (a) is a schematic diagram of the initial position relationship between the tool Dexel and the blank Dexel. Figure 3 (b) is a schematic diagram of the position relationship between the tool Dexl and the blank Dexe during the cutting process; Figure 4 The corresponding relationship between the blank bounding box and the Marching Cube provided in this application; wherein, Figure 4(a) is a schematic diagram of the blank bounding box. Figure 4 (b) is a schematic diagram of Marching Cube; Figure 5 Schematic diagram of the distribution of isosurfaces in the Cube provided for this application; Figure 6 A schematic diagram of the cutting simulation parameter settings provided for this application; Figure 7 Schematic diagram of the cutting simulation window provided for this application; Figure 8 A schematic diagram of starting the cutting simulation provided for this application; Fig. 9 Schematic diagram of the milling strategy cutting simulation process provided for this application; Fig.10 Schematic diagram of the cutting simulation results of the milling strategy provided for this application; Fig.11 Schematic diagram of the car strategy cutting simulation process provided for this application; Fig.12 Schematic diagram of the car strategy cutting simulation results provided for this application; Fig.13 This is a schematic diagram of the structure of the cutting simulation blank surface reconstruction device provided in this application. DETAILED DESCRIPTION
[0018] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.
[0019] See also Figure 1 , Figure 1 The present invention provides a flow chart of a method for surface reconstruction of a cutting simulation blank, which specifically includes: S10: using the Tri-Dexel model to discretize the tool and the blank respectively, to obtain the tool Tri-Dexel model and the blank Tri-Dexel model; extracting the tool Dexel chain set and the blank Dexel chain set based on the tool Tri-Dexel model and the blank Tri-Dexel model; S20: obtaining a blank surface voxel model based on the blank Tri-Dexel model, and performing Boolean operations on the tool Dexel chain in the tool Dexel chain set and the blank Dexel chain in the blank Dexel chain set to obtain a target voxel intersecting with the tool in the blank surface voxel model; S30: for each target voxel, obtaining the state value of each corner point based on the positional relationship between each corner point of the target voxel and the tool, judging whether the target voxel is a boundary voxel containing an isosurface based on the state values of all corner points of the target voxel, and if so, taking the target voxel as a voxel to be cut; S40: obtaining a triangular mesh formed by the intersection of each voxel to be cut and the isosurface, and calculating the vertex coordinates and normal vector of the triangular mesh by using a linear interpolation method; S50: Obtaining a surface mesh based on the vertex coordinates and normal vectors of all triangular meshes, thereby reconstructing the surface of the blank based on the surface mesh.
[0020] The cutting simulation blank surface reconstruction method provided in the present application utilizes the Tri-Dexel model to discretely express the tool and the blank, and after obtaining the tool Tri-Dexel model and the blank Tri-Dexel model, the tool Dexel chain set and the blank Dexel chain set are extracted. Since the Dexel chain directly represents the discrete voxel information of the tool and the blank surface, Boolean operations are directly performed on the tool Dexel chain and the blank Dexel chain to obtain the target voxels intersecting with the tool in the blank surface voxel model, that is, the voxels cut by the tool in the blank surface voxel model are obtained, thereby reducing the data structure and the granularity of operations. Compared with the octree traversing multiple levels of nodes and performing Boolean operations in sequence, the amount of Boolean operations is greatly reduced, and the efficiency of blank surface reconstruction is improved. After obtaining the target voxel, each corner point of the target voxel is obtained based on the positional relationship between the corner points of the target voxel and the tool. The state value of the corner point is used to determine whether the target voxel is a boundary voxel containing an isosurface based on the state values of all the corner points of the target voxel, that is, by determining whether each corner point in the target voxel is cut by the tool, it is determined whether the target voxel contains an isosurface cut by the tool; finally, the target voxel containing the isosurface is used as the voxel to be cut, and the triangular mesh formed by the intersection of each voxel to be cut and the isosurface is obtained, and the vertex coordinates and normal vector of each triangular mesh are calculated using linear interpolation; the surface mesh is obtained based on the vertex coordinates and normal vectors of all triangular meshes, so as to reconstruct the surface of the blank; the triangular mesh is generated based on the local information of the voxel, which can better capture the continuity of the triangular meshes between adjacent voxels, and reduce the problem of the rough surface mesh obtained based on the fitting of discrete point data, so that the reconstructed blank surface is smoother and the accuracy of blank surface reconstruction is improved.
[0021] Tri-Dexel is composed of three mutually perpendicular unidirectional Dexels, namely Dexels parallel to the X, Y, and Z axes. The Dexel parallel to the Z axis is the class. The Dexel model is distributed along the positive direction of the X and Y axes on the XOY plane with a simulation accuracy of P, and the light emitted toward the positive direction of the Z axis. The intersection of each ray and the entity is saved, and the line segment between each two intersections represents the part of the light that passes through the model, which is called a DexelSegment, such as Figure 2 As shown. The two intersection points that constitute DexelSegment are farther from the XOY plane than the upper endpoint VertexMax of DexelSegment, and the closer one is the lower endpoint VertexMin. The chain structure formed by the DexelSegment endpoints on the same ray arranged in ascending order according to the distance from the emission point is called a Dexel chain. These Dexel chains can form a two-dimensional grid structure.
[0022] In order to compress the storage space required by the Dexel model, only the distance from the endpoint to the XOY plane is recorded when recording the endpoint position information; when the exact coordinates of the endpoint need to be obtained, it can be calculated based on the position of the current Dexel chain in the two-dimensional grid. The coordinates are The coordinates of the endpoints on the Dexel chain for: ,in, is the origin, P is the precision, and dz is the distance from power off to the XOY plane.
[0023] Specifically, in some embodiments of the present application, extracting a tool Dexel chain set and a blank Dexel chain set based on a tool Tri-Dexel model and a blank Tri-Dexel model includes: Taking any point on the XOY plane as a first starting point, sampling along the X-axis and the Y-axis based on a first preset interval to obtain a plurality of first light emission points; Light rays are emitted in the Z-axis direction at the first starting point and multiple first light emitting points respectively, and the intersection points and coordinates of each light ray and the Tri-Dexel model / blank Tri-Dexel model are obtained; Arrange all the intersection points on each ray from large to small according to the coordinates to obtain the tool / blank Dexel chain corresponding to the ray, and obtain the tool Dexel chain subset / blank Dexel chain subset in the Z-axis direction based on the tool / blank Dexel chain corresponding to all the rays; Taking any point on the XOZ plane as a second starting point, sampling along the X axis and the Z axis based on a second preset interval to obtain a plurality of second light emission points; respectively emitting light rays in the Y-axis direction at the second starting point and the plurality of second light emitting points, and obtaining the intersection points and coordinates of each light ray and the Tri-Dexel model / blank Tri-Dexel model; Arrange all the intersection points on each ray from large to small according to the coordinates to obtain the tool / blank Dexel chain corresponding to the ray, and obtain the tool Dexel chain subset / blank Dexel chain subset in the Y-axis direction based on the tool / blank Dexel chain corresponding to all rays; Taking any point on the YOZ plane as a third starting point, sampling along the Y axis and the Z axis based on a second preset interval to obtain a plurality of third light emission points; Light rays are emitted in the X-axis direction at the third starting point and multiple third light emitting points respectively, and the intersection points and coordinates of each light ray and the Tri-Dexel model / blank Tri-Dexel model are obtained; Arrange all the intersection points on each ray from large to small according to the coordinates to obtain the tool / blank Dexel chain corresponding to the ray, and obtain the tool Dexel chain subset / blank Dexel chain subset in the X-axis direction based on the tool / blank Dexel chains corresponding to all the rays; Based on the tool Dexel chain subset / blank Dexel chain subset in the Z-axis direction, the tool Dexel chain subset / blank Dexel chain subset in the Y-axis direction, and the tool Dexel chain subset / blank Dexel chain subset in the X-axis direction, a tool Dexel chain set / blank Dexel chain set is obtained.
[0024] Furthermore, Boolean operations are performed on the tool Dexel chains in the tool Dexel chain set and the blank Dexel chains in the blank Dexel chain set, and the target voxels intersecting with the tool in the blank surface voxel model are obtained, including: For each blank Dexel chain in the blank Dexel chain set, perform Boolean difference operation on each tool Dexel chain in the tool Dexel chain set and the blank Dexel chain to generate a target Dexel chain; Specifically, the formula for Boolean difference operation between tool Dexel chain and blank Dexel chain is: , in, Indicates the target Dexel chain; Represents the blank Dexel chain; Represents the tool Dexel chain; Represents the corresponding voxel in the blank Dexel chain; Determine whether the target Dexel chain is the same as the blank Dexel chain. If the target Dexel chain is different from the blank Dexel chain, the voxels corresponding to the blank Dexel chain are all target voxels that intersect with the tool in the blank surface voxel model.
[0025] The Boolean operation of three-dimensional Dexel can be regarded as a Boolean subtraction operation of the Dexel of the blank and the tool in the three directions of X, Y, and Z. According to the position relationship between the Dexel of the blank and the tool, Figure 3 As shown, there are six possible situations: 1. The blank and the tool do not intersect, so they are not cut, and the blank DexelSegment remains in its original state; 2. Same as 1, the blank DexelSegment is not cut and remains in its original state; 3. The upper endpoint of the blank is smaller than the lower endpoint of the tool, so cut off the part from the upper endpoint of the blank to the lower endpoint of the tool, take the original lower endpoint of the blank DexelSegment as the lower endpoint, take the lower endpoint of the tool DexelSegment as the upper endpoint, and create a new blank DexelSegment to replace the original one; 4. The lower endpoint of the blank is larger than the upper endpoint of the tool, so cut off the blank from the lower endpoint to the upper endpoint of the tool, take the original upper endpoint of the blank DexelSegment as the upper endpoint, take the upper endpoint of the tool DexelSegment as the lower endpoint, and create a new blank DexelSegment to replace the original one; 5. The upper and lower endpoints of the blank are between the upper and lower endpoints of the tool, so the blank is completely cut off and the DexelSegment of the blank is deleted; 6. The upper and lower endpoints of the tool are between the upper and lower endpoints of the blank. The blank is cut into two sections, and the cut part is the tool part. Two blank DexelSegments are generated to replace the original one. One section uses the original upper endpoint of the blank DexelSegment as the upper endpoint and the upper endpoint of the tool DexelSegment as the lower endpoint to create the blank DexelSegment. The other section uses the original lower end of the blank DexelSegment as the lower endpoint and the lower endpoint of the tool DexelSegment as the upper endpoint to create the blank DexelSegment.
[0026] Furthermore, the present application uses the Marching Cubes method to reconstruct the surface mesh of the Cube in the blank Tri-Dexel model; according to the data structure of Tri-Dexel, we can get the Cube on the blank surface and know which specific edges will intersect with the workpiece surface, such as Figure 4 As shown. Based on this information, we can reconstruct the surface triangles of each Cube and finally output the mesh model of the remaining blank.
[0027] The eight corner points of the Cube are represented as Vi (i=0,1,...7). When the tool Dexel collides with an edge of the blank Cube, the states of the two corner points on the edge are opposite, namely "0" and "1" respectively; when the tool Dexel does not collide with the edge or is completely cut off, the states of the two corner points on any edge of the blank Cube are the same, namely "0" or "1" at the same time.
[0028] Use 8-bit binary to encode and combine the two different marking states of each corner point of the corresponding Cube. According to the different coding combinations of the eight corner points of the Cube, the specific distribution of the isosurface is determined, and the intersection of the processing surface and the boundary surfaces of the Cube is divided into 28,256 types. Since the hexahedron is symmetrical, we can simplify these states to 15 states through symmetry, such as Figure 5 shown.
[0029] Specifically, in some embodiments of the present application, obtaining the state value of each corner point based on the positional relationship between each corner point of the target voxel and the tool includes: Obtaining the coordinates of each corner point of the target voxel, and determining the position of each corner point and the knife body voxel model based on the coordinates of each corner point; If the coordinates of the corner point are located inside the knife body pixel model, the state value of the corner point is 1; If the coordinates of the corner point are outside the knife body pixel model, the state value of the corner point is 0; If the coordinates of the corner point are located on the knife body pixel model, the state value of the corner point is -1.
[0030] Further, judging whether the target voxel is a boundary voxel containing an isosurface based on the state values of all corner points of the target voxel includes: If the state values of all corner points of the target voxel are 0, it is determined that the target voxel does not contain an isosurface; If the state value of at least one corner point among all corner points of the target voxel is 1, it is determined that the target voxel contains an isosurface, and the target voxel is a boundary voxel containing an isosurface.
[0031] Specifically, the calculation formula for the vertex coordinates of the triangle mesh is: , , , in, , , Respectively represent the vertex coordinates of the triangle mesh; , , Represents the coordinates of the first intersection point between the voxel to be cut and the isosurface; , , Represents the coordinates of the second intersection point between the voxel to be cut and the isosurface; , , Represents the coordinates of the third intersection point between the voxel to be cut and the isosurface; , Indicates the preset interpolation parameters; .
[0032] The normal vector of a triangle mesh is calculated as: , in, Represents the normal vector of a triangle mesh.
[0033] The corresponding corner point status setting and Cube edge information storage are performed for the Dexels parallel to the Z axis, Y axis, and X axis in the effective cutting area, which are used as input data for the next simulation display. Since the calculations between the three coordinate plane systems are independent of each other, the parallel mode of the GPU can be used for cutting calculations. In addition, the judgment of the cutting position distribution and the triangle patch fitting in the surface reconstruction algorithm based on Marching Cubes can be processed in parallel in the GPU. In summary, the parallel performance of the GPU is utilized, and the Tri-Dexel surface reconstruction algorithm is implemented in the GPU geometry shader, so that it can meet the real-time requirements of the simulation.
[0034] The effectiveness of the surface reconstruction method for cutting simulation blank provided by this application is verified by a specific example below: Right-click "Solid Simulation" at the selected strategy, a pop-up window will appear to select the blank model and tool model, click "OK", a simulation window, tool path statement list window, simulation message window will pop up, click the play button to start the simulation, such as Figure 6~Figure 8 As shown; like Figure 9~Figure 10 The figure shows the schematic diagram of milling strategy cutting simulation. Figure 11~Figure 12 The figure shows a schematic diagram of the turning strategy cutting simulation, which includes the blank and tool display during the cutting process and the blank after cutting.
[0035] Based on the cutting simulation blank surface reconstruction method provided in the above embodiment, the present application embodiment also provides a cutting simulation blank surface reconstruction device, such as Fig.13 As shown, the device comprises: The Dexel chain set acquisition module 10 is used to discretize the tool and the blank respectively by using the Tri-Dexel model to obtain the tool Tri-Dexel model and the blank Tri-Dexel model; extract the tool Dexel chain set and the blank Dexel chain set based on the tool Tri-Dexel model and the blank Tri-Dexel model; A Boolean operation module 20 is used to obtain a blank surface voxel model based on the blank Tri-Dexel model, and to perform Boolean operations on the tool Dexel chain in the tool Dexel chain set and the blank Dexel chain in the blank Dexel chain set to obtain a target voxel in the blank surface voxel model that intersects with the tool; The isosurface judgment module 30 is used to obtain the state value of each corner point of each target voxel based on the positional relationship between each corner point of the target voxel and the tool, and judge whether the target voxel is a boundary voxel containing an isosurface based on the state values of all corner points of the target voxel. If so, the target voxel is used as a voxel to be cut; A triangle mesh acquisition module 40 is used to acquire a triangle mesh formed by the intersection of each voxel to be cut and the isosurface, and calculate the vertex coordinates and normal vector of the triangle mesh using a linear interpolation method; The surface reconstruction module 50 is used to obtain a surface mesh based on the vertex coordinates and normal vectors of all triangular meshes, thereby reconstructing the surface of the blank based on the surface mesh.
[0036] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned cutting simulation blank surface reconstruction method are implemented.
[0037] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0038] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0039] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0040] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0041] Obviously, the above embodiments are merely examples for the purpose of clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the present invention.
Claims
1. A method for reconstructing the surface of a cutting simulation blank, characterized in that: include: The tool and the blank are discretized respectively by using the Tri-Dexel model to obtain the tool Tri-Dexel model and the blank Tri-Dexel model; the tool Dexel chain set and the blank Dexel chain set are extracted based on the tool Tri-Dexel model and the blank Tri-Dexel model; A blank surface voxel model is obtained based on the blank Tri-Dexel model, and Boolean operations are performed on the tool Dexel chain in the tool Dexel chain set and the blank Dexel chain in the blank Dexel chain set to obtain the target voxel in the blank surface voxel model that intersects with the tool; For each target voxel, the state value of each corner point is obtained based on the positional relationship between each corner point of the target voxel and the tool, and based on the state values of all corner points of the target voxel, whether the target voxel is a boundary voxel containing an isosurface is determined, and if so, the target voxel is used as a voxel to be cut; Obtaining a triangular mesh formed by the intersection of each voxel to be cut and the isosurface, and calculating the vertex coordinates and normal vector of the triangular mesh using a linear interpolation method; A surface mesh is obtained based on the vertex coordinates and normal vectors of all triangular meshes, so that the surface of the blank is reconstructed based on the surface mesh.
2. The method for reconstructing the surface of a cutting simulation blank according to claim 1, characterized in that: Extracting a tool Dexel chain set and a blank Dexel chain set based on the tool Tri-Dexel model and the blank Tri-Dexel model includes: Taking any point on the XOY plane as a first starting point, sampling along the X-axis and the Y-axis based on a first preset interval to obtain a plurality of first light emission points; respectively emitting light rays in the Z-axis direction at the first starting point and the plurality of first light emitting points, and obtaining the intersection points and coordinates of each light ray and the Tri-Dexel model / blank Tri-Dexel model; Arrange all the intersection points on each ray from large to small according to the coordinates to obtain the tool / blank Dexel chain corresponding to the ray, and obtain the tool Dexel chain subset / blank Dexel chain subset in the Z-axis direction based on the tool / blank Dexel chain corresponding to all the rays; Taking any point on the XOZ plane as a second starting point, sampling along the X axis and the Z axis based on a second preset interval to obtain a plurality of second light emission points; respectively emitting light rays in the Y-axis direction at the second starting point and the plurality of second light emitting points, and obtaining the intersection points and coordinates of each light ray and the Tri-Dexel model / blank Tri-Dexel model; Arrange all the intersection points on each ray from large to small according to the coordinates to obtain the tool / blank Dexel chain corresponding to the ray, and obtain the tool Dexel chain subset / blank Dexel chain subset in the Y-axis direction based on the tool / blank Dexel chain corresponding to all rays; Taking any point on the YOZ plane as a third starting point, sampling along the Y axis and the Z axis based on a second preset interval to obtain a plurality of third light emission points; respectively emitting light rays in the X-axis direction at the third starting point and the plurality of third light emitting points, and obtaining the intersection points and coordinates of each light ray with the Tri-Dexel model / blank Tri-Dexel model; Arrange all the intersection points on each ray from large to small according to the coordinates to obtain the tool / blank Dexel chain corresponding to the ray, and obtain the tool Dexel chain subset / blank Dexel chain subset in the X-axis direction based on the tool / blank Dexel chains corresponding to all the rays; Based on the tool Dexel chain subset / blank Dexel chain subset in the Z-axis direction, the tool Dexel chain subset / blank Dexel chain subset in the Y-axis direction, and the tool Dexel chain subset / blank Dexel chain subset in the X-axis direction, a tool Dexel chain set / blank Dexel chain set is obtained.
3. The method for reconstructing the surface of a cutting simulation blank according to claim 2, characterized in that: Boolean operations are performed on the tool Dexel chain in the tool Dexel chain set and the blank Dexel chain in the blank Dexel chain set, and the target voxels intersecting with the tool in the blank surface voxel model are obtained, including: For each blank Dexel chain in the blank Dexel chain set, a Boolean difference operation is performed between each tool Dexel chain in the tool Dexel chain set and the blank Dexel chain to generate a target Dexel chain; It is determined whether the target Dexel chain is the same as the blank Dexel chain. If the target Dexel chain is different from the blank Dexel chain, the voxels corresponding to the blank Dexel chain are all target voxels that intersect with the tool in the blank surface voxel model.
4. The method for reconstructing the surface of a cutting simulation blank according to claim 3, characterized in that: The formula for Boolean difference calculation between tool Dexel chain and blank Dexel chain is: , in, Indicates the target Dexel chain; Represents the blank Dexel chain; Represents the tool Dexel chain; Represents the corresponding voxel in the blank Dexel chain.
5. The method for reconstructing the surface of a cutting simulation blank according to claim 1, characterized in that: Acquiring the state value of each corner point based on the positional relationship between each corner point of the target voxel and the tool includes: Obtaining the coordinates of each corner point of the target voxel, and determining the position of each corner point and the knife body voxel model based on the coordinates of each corner point; If the coordinates of the corner point are located inside the knife body pixel model, the state value of the corner point is 1; If the coordinates of the corner point are outside the knife body pixel model, the state value of the corner point is 0; If the coordinates of the corner point are located on the knife body pixel model, the state value of the corner point is -1.
6. The method for reconstructing the surface of a cutting simulation blank according to claim 1, characterized in that: Judging whether the target voxel is a boundary voxel containing an isosurface based on the state values of all corner points of the target voxel includes: If the state values of all corner points of the target voxel are 0, it is determined that the target voxel does not contain an isosurface; If the state value of at least one corner point among all corner points of the target voxel is 1, it is determined that the target voxel contains an isosurface, and the target voxel is a boundary voxel containing an isosurface.
7. The method for reconstructing the surface of a cutting simulation blank according to claim 1, characterized in that: The calculation formula for the vertex coordinates of a triangle mesh is: , , , in, , , Respectively represent the vertex coordinates of the triangle mesh; , , Represents the coordinates of the first intersection point between the voxel to be cut and the isosurface; , , Represents the coordinates of the second intersection point between the voxel to be cut and the isosurface; , , Represents the coordinates of the third intersection point between the voxel to be cut and the isosurface; , Indicates the preset interpolation parameters; .
8. The method for reconstructing the surface of a cutting simulation blank according to claim 7, characterized in that: The normal vector of a triangle mesh is calculated as: , in, Represents the normal vector of a triangle mesh.
9. A device for reconstructing the surface of a cutting simulation blank, characterized in that: include: A Dexel chain set acquisition module is used to discretize the tool and the blank respectively using the Tri-Dexel model to obtain the tool Tri-Dexel model and the blank Tri-Dexel model; based on the tool Tri-Dexel model and the blank Tri-Dexel model, a tool Dexel chain set and a blank Dexel chain set are extracted; A Boolean operation module is used to obtain a blank surface voxel model based on the blank Tri-Dexel model, and to perform Boolean operations on the tool Dexel chain in the tool Dexel chain set and the blank Dexel chain in the blank Dexel chain set to obtain a target voxel in the blank surface voxel model that intersects with the tool; An isosurface judgment module is used to obtain the state value of each corner point of each target voxel based on the positional relationship between each corner point of the target voxel and the tool, and judge whether the target voxel is a boundary voxel containing an isosurface based on the state values of all corner points of the target voxel. If so, the target voxel is used as a voxel to be cut; A triangle mesh acquisition module is used to acquire a triangle mesh formed by the intersection of each voxel to be cut and the isosurface, and calculate the vertex coordinates and normal vector of the triangle mesh using a linear interpolation method; The surface reconstruction module is used to obtain a surface mesh based on the vertex coordinates and normal vectors of all triangular meshes, thereby reconstructing the surface of the blank based on the surface mesh.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the cutting simulation blank surface reconstruction method according to any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Real-time cutting simulation method and system for staged processing
CN121328138A