Blank machining method and device based on directed distance field and storage medium
By constructing the directional distance field function between the blank and the tool, calculating the directional distance value of the voxel and performing Boolean difference, the problem of inaccurate determination of the intersection between the tool swept body and the blank in the existing technology is solved, and the efficiency of blank processing is improved. Precision and efficiency.
Patent Information
- Application Number
- CN202411356534.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-21
AI Technical Summary
The existing blank processing methods cannot accurately determine the intersection between the tool swept body and the blank, resulting in inaccurate material removal during cutting and affecting the accuracy of blank processing.
The blank processing method based on the directed distance field is adopted. By constructing the directed distance field function of the blank and the tool, the directional distance value of the voxel is calculated, Boolean difference is performed, and the intersection of the tool swept body and the blank is directly calculated to achieve high efficiency. material removal.
The accuracy of blank processing is improved, the problem of inaccurate material removal is avoided, and an efficient blank processing process is achieved.
Smart Images

Figure CN119335897A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of numerical control machining simulation, and in particular to a blank machining method, device and computer-readable storage medium based on a signed distance field. Background Art
[0002] Cutting simulation is to calculate the movement of the machining tool on the tool path designed by the user, and remove virtual material from the blank at the same time, and finally obtain the residual blank after machining. During the cutting simulation process, the tool needs to move along the designed path to perform Boolean difference operation on the blank material to simulate the actual material removal process. Before performing the Boolean difference operation between the blank and the tool, it is necessary to first generate a tool sweep volume for the tool movement within a certain period of time to ensure that no blank material is missed. Then, the blank is cut based on the generated tool sweep volume to complete the processing of the blank.
[0003] The existing blank processing method needs to first calculate the contour line of the tool during the movement based on the envelope theory, connect the adjacent contour lines to form the envelope surface of the sweep body, and finally generate a complete tool sweep body by combining the starting and ending tool positions, and then calculate the intersection of the tool path sweep body and the blank, so as to determine the part of the blank that is cut and removed; specifically, the patent with publication number CN102566509B discloses a general tool sweep body generation method in CNC machining simulation based on envelope theory. The method describes the tool geometry by analyzing the surface, describes the motion trajectory of the tool by using parameterized equations, and then constructs the tool sweep body equation by combining the tool geometry and the motion path. Finally, the above multivariate equations are solved to obtain the contour line equation of the tool during the movement, and then connect the adjacent contour lines to form the envelope surface of the sweep body. However, in the analytical process, multiple solutions or no solutions may appear, resulting in the inability to determine the accurate tool contour line. Not only can the accurate tool sweep body not be constructed, but the intersection of the tool sweep body and the blank cannot be accurately calculated, which affects the accuracy of blank cutting. The patent with publication number CN114115119A discloses a method, device and storage medium for generating a tool swept volume based on a triangular mesh. The method first discretizes the geometric model of the milling cutter into a triangular mesh, updates the position of the triangular mesh according to the motion trajectory of the tool, performs Boolean operations on the tool mesh and the blank mesh to obtain the contour lines during the processing, and finally obtains the tool swept volume based on the contour lines. However, when the tool path is more complicated, especially when there are sharp turns or overlapping movements, the contour lines will intersect in different mesh areas, resulting in self-intersection of the contour lines, and then the swept volume envelope surface cannot be constructed based on adjacent contour lines, resulting in failure to construct the tool swept volume, and the intersection of the tool swept volume and the blank cannot be determined, resulting in the inability to process the blank.
[0004] In summary, the existing blank machining methods cannot accurately determine the intersection of the tool sweep volume and the blank, resulting in inaccurate material removal during the cutting process, thus affecting the accuracy of blank machining. Summary of the invention
[0005] To this end, the technical problem to be solved by the present invention is to overcome the problem that the blank processing method in the prior art cannot accurately determine the intersection of the tool sweep volume and the blank, resulting in inaccurate material removal during the cutting process, thereby affecting the accuracy of blank processing.
[0006] In order to solve the above technical problems, the present invention provides a blank processing method based on a signed distance field, comprising:
[0007] Constructing the blank signed distance field function and the tool signed distance field function;
[0008] The blank is divided into voxels to obtain a voxel set; based on the blank signed distance field function, the signed distance values of each vertex of each voxel to the blank surface are calculated, and if the signed distance values of all vertices of the voxel to the blank surface are positive values, the voxel is removed from the voxel set to obtain a target voxel set;
[0009] Obtaining a tool path to be cut, and interpolating between every two adjacent tool position points in the tool path to be cut by using a linear interpolation method, and constructing a tool swept volume signed distance field function based on the interpolated tool path to be cut and the tool signed distance field function;
[0010] Based on the tool swept volume signed distance field function, the signed distance value from each vertex of each voxel in the target voxel set to the tool swept volume surface is calculated; the signed distance value from the vertex to the blank surface and the signed distance value from the vertex to the tool swept volume surface are Boolean-subtracted to obtain the target signed distance value of the vertex;
[0011] If the target directed distance values of all vertices of a voxel are positive, the voxel is removed from the target voxel set and the blank is meshed.
[0012] Preferably, the blank is divided into voxels to obtain a voxel set including:
[0013] Get the minimum bounding box of the blank;
[0014] The minimum bounding box is divided based on a preset voxel side length to obtain a voxel set and coordinates of each vertex of each voxel in the voxel set.
[0015] Preferably, if the blank / tool is a sphere, the signed distance field function of the blank or tool is expressed as:
[0016]
[0017] Where SDF represents the signed distance field function of the blank or tool; (P x ,P y ,P z ) represents the spatial coordinates of any point P in space; r1 represents the radius of the sphere;
[0018] If the blank / tool is a cube, the signed distance field function of the blank or tool is expressed as:
[0019]
[0020] Among them, a represents the side length of the cube;
[0021] If the blank / tool is a cylinder, the signed distance field function of the blank or tool is expressed as:
[0022]
[0023] Where r2 represents the radius of the cylinder.
[0024] Preferably, if the blank / tool is a solid of revolution, the process of constructing the signed distance field function of the blank / tool includes:
[0025] Define the blank / tool contour line, and project any point in space to the plane where the blank / tool contour line is located to obtain the projection point of the point on the blank / tool;
[0026] The shortest distance between the projection point and each contour line on the blank / tool is calculated respectively, and the minimum value among the shortest distances between the projection point and all contour lines on the blank / tool is taken as the goal to construct a signed distance field function of the blank / tool.
[0027] Preferably, the projection point of any point in space on the blank / tool is expressed as:
[0028]
[0029] P z ′ =P z ,
[0030] Among them, P x ′ Represents the projection point P of any point P in space on the blank / tool ′ The x-axis coordinate of z ′ Represents the projection point P of any point P in space on the blank / tool ′ The z-axis coordinate of (P x ,P y ,P z) represents the spatial coordinates of any point P in space.
[0031] Preferably, if the blank / tool is a geometric body other than a sphere, a cube, a cylinder, or a body of revolution, the process of constructing the signed distance field function of the blank / tool includes:
[0032] Meshing the blank / tool to obtain a blank / tool mesh;
[0033] Constructing a hierarchical bounding box data structure for the blank / tool mesh to spatially divide the blank / tool mesh to obtain an AABB tree of the blank / tool mesh;
[0034] For any point in space, the distance between the point and all grids on the AABB tree of the blank / tool grid is calculated, and the directed distance field function of the blank / tool is constructed with the goal of obtaining the minimum value of the distance between the point and all grids on the AABB tree of the blank / tool grid.
[0035] Preferably, the tool-swept volume signed distance field function is expressed as:
[0036] SDF SweptTool =min(SDF(T(t) -1 P)),
[0037] Among them, SDF SweptTool represents the signed distance field function of the tool swept volume; SDF represents the signed distance field function of the tool; T is a homogeneous matrix; T(t) represents the tool path motion time function on the tool path to be cut after interpolation; P represents any point in space.
[0038] Preferably, the blank is meshed using an isosurface algorithm to obtain a processed blank.
[0039] The present invention also provides a blank processing device based on a directed distance field, comprising:
[0040] A first signed distance field function construction module is used to construct a blank signed distance field function and a tool signed distance field function;
[0041] A voxel partitioning module is used to perform voxel partitioning on the blank to obtain a voxel set; based on the blank signed distance field function, the signed distance value from each vertex of each voxel to the blank surface is calculated; if the signed distance values from all vertices of the voxel to the blank surface are positive values, the voxel is removed from the voxel set to obtain a target voxel set;
[0042] A second signed distance field function construction module is used to obtain a tool path to be cut, and interpolate between every two adjacent tool positions in the tool path to be cut by using a linear interpolation method, and construct a tool swept volume signed distance field function based on the interpolated tool path to be cut and the tool signed distance field function;
[0043] A target directed distance value calculation module is used to calculate the directed distance value from each vertex of each voxel in the target voxel set to the surface of the tool swept volume based on the tool swept volume directed distance field function; perform Boolean subtraction between the directed distance value from the vertex to the blank surface and the directed distance value from the vertex to the surface of the tool swept volume to obtain the target directed distance value of the vertex;
[0044] The blank processing module is used for removing the voxel from the target voxel set if the target directed distance values of all vertices of the voxel are positive, and reconstructing the mesh of the blank.
[0045] 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 blank processing method based on the signed distance field are implemented.
[0046] The blank processing method based on the signed distance field provided in the present application constructs a signed distance field function of the blank and the tool, obtains the voxels located inside the blank or intersecting with the blank based on the signed distance field function of the blank to obtain a target voxel set; then uses the linear interpolation method to interpolate between every two adjacent tool position points of the tool path to be cut to discretize the tool path, and constructs a tool swept volume signed distance field function based on the discretized tool path to be cut and the tool has a signed distance field function; then directly calculates the signed distance value of each vertex of each voxel in the target voxel set to the surface of the tool swept volume based on the signed distance field function of the tool swept volume, and calculates the signed distance value of each vertex of each voxel in the target voxel set to the surface of the tool swept volume by calculating the signed distance field function of each vertex. The signed distance value from the point to the blank surface and the signed distance value from the vertex to the surface of the tool sweep volume are Boolean subtraction to obtain the target signed distance value of the vertex. If the target signed distance values of all vertices of a voxel are positive, it indicates that the voxel is completely removed during the machining process. Based on this, the blank is meshed and reconstructed to achieve efficient material removal and obtain the machined blank. The present application does not need to construct the contour line of the tool movement on the tool surface, and then construct the tool sweep volume based on the contour line, but directly calculates the voxels removed during the blank machining process based on the signed distance field function of the blank and the tool, thereby improving the blank machining accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] 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:
[0048] Figure 1 A flow chart of a blank processing method based on a directed distance field provided in this application;
[0049] Figure 2 A schematic diagram of the Boolean operation principle of the signed distance field function provided in this application;
[0050] Figure 3 Schematic diagram of the AABB tree space partition data structure provided for this application;
[0051] Figure 4 This is a schematic diagram of the structure of a blank processing device based on a signed distance field provided in this application. DETAILED DESCRIPTION
[0052] 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.
[0053] See also Figure 1 , Figure 1 The figure shows a flow chart of a blank processing method based on a directed distance field provided by the present application, and the method specifically comprises:
[0054] S10: constructing a blank signed distance field function and a tool signed distance field function;
[0055] S20: performing voxel division on the blank to obtain a voxel set; calculating the signed distance value from each vertex of each voxel to the blank surface based on the blank signed distance field function, if the signed distance values from all vertices of the voxel to the blank surface are positive values, then removing the voxel from the voxel set to obtain a target voxel set;
[0056] S30: obtaining a tool path to be cut, and interpolating between every two adjacent tool position points in the tool path to be cut by using a linear interpolation method, and constructing a tool swept volume signed distance field function based on the interpolated tool path to be cut and the tool signed distance field function;
[0057] S40: Based on the tool swept volume signed distance field function, calculate the signed distance value from each vertex of each voxel in the target voxel set to the tool swept volume surface; perform Boolean subtraction between the signed distance value from the vertex to the blank surface and the signed distance value from the vertex to the tool swept volume surface to obtain the target signed distance value of the vertex;
[0058] S50: If the target directed distance values of all vertices of the voxel are positive values, the voxel is removed from the target voxel set, and the blank is meshed.
[0059] The blank processing method based on the signed distance field provided in the present application constructs a signed distance field function of the blank and the tool, obtains the voxels located inside the blank or intersecting with the blank based on the signed distance field function of the blank to obtain a target voxel set; then uses the linear interpolation method to interpolate between every two adjacent tool position points of the tool path to be cut to discretize the tool path, and constructs a tool swept volume signed distance field function based on the discretized tool path to be cut and the tool has a signed distance field function; then directly calculates the signed distance value of each vertex of each voxel in the target voxel set to the surface of the tool swept volume based on the signed distance field function of the tool swept volume, and calculates the signed distance value of each vertex of each voxel in the target voxel set to the surface of the tool swept volume by calculating the signed distance field function of each vertex. The signed distance value from the point to the blank surface and the signed distance value from the vertex to the surface of the tool sweep volume are Boolean subtraction to obtain the target signed distance value of the vertex. If the target signed distance values of all vertices of a voxel are positive, it indicates that the voxel is completely removed during the machining process. Based on this, the blank is meshed and reconstructed to achieve efficient material removal and obtain the machined blank. The present application does not need to construct the contour line of the tool movement on the tool surface, and then construct the tool sweep volume based on the contour line, but directly calculates the voxels removed during the blank machining process based on the signed distance field function of the blank and the tool, thereby improving the blank machining accuracy.
[0060] Specifically, in the embodiment of the present application, voxel division is performed on the blank, which specifically includes:
[0061] Get the minimum bounding box of the blank;
[0062] The minimum bounding box is divided based on the preset voxel side length to obtain a voxel set and the coordinates of each vertex of each voxel in the voxel set.
[0063] Specifically, the Signed Distance Function (SDF) is a mathematical function that describes the geometric characteristics of an object surface. It defines the shortest signed distance from each point in space to the object surface. In SDF, the distance from the inside of the object to the object surface is negative, and the distance from the outside of the object to the object surface is positive. The signed distance field function of an object can not only effectively represent the shape of the object, but also support various Boolean operations, such as Figure 2 As shown, the signed distance field function of object A and object B is known, SDF A and SDF B , then the signed distance field function of A and B can be expressed as SDF A∪B =min(SDF A ,SDF B ), the signed distance field function of A minus B can be expressed as SDF A-B =max(SDF A ,-SDF B ), the signed distance field function of A intersecting B can be expressed as SDFA∩B =max(SDF A ,SDF B ), from the perspective of distance field, the tool sweep volume is the tool distance field combined on a section of the tool path.
[0064] In CNC machining, APT is the abbreviation of Automatically Programmed Tool, which is a symbolic language close to English used to define the geometric shape of workpieces and tools and the movement of tools relative to the workpieces. The process of inputting the part machining program written in APT language into the computer, compiling it through the APT language programming system of the computer to generate a tool location file (CLData file), and then performing CNC post-processing to generate the part CNC machining program that the CNC system can receive is called APT language automatic programming. Commonly used tools such as ball-end tools and flat-bottom tools are APT tools, which can be considered as simple geometric bodies (spheres, cubes, cylinders, etc.) or a combination of simple geometric bodies. In addition, some blanks / tools are solids of revolution, while some blanks / tools (such as boring and milling cutters, turning tools, etc.) are not simple geometric bodies or solids of revolution. The construction of signed distance field functions for blanks / tools of different shapes is also different. The embodiment of the present application provides a method for constructing a signed distance field function for blanks / tools of arbitrary shapes:
[0065] In the CAM software system, commonly used milling cutters usually use APT parameters to describe the geometry of a tool. Through different APT parameters, we can know which simple geometric bodies the tool is composed of. For example, a flat-bottomed cutter can be considered as a cylinder, and the signed distance field function of the tool is a distance field function of a cylinder; a ball-end cutter can be considered as a combination of a sphere and a cylinder. At this time, the signed distance field function of the ball-end cutter is the union of the distance field function of the sphere and the distance field function of the cylinder. Through the combination of simple geometric body signed distance field functions, we can quickly obtain the signed distance field expression of the APT tool. Compared with some tools expressed by parametric equations, this method is more arbitrary and has high computational efficiency.
[0066] Therefore, if the blank / tool is a sphere, the signed distance field function of the blank or tool is expressed as:
[0067]
[0068] Where SDF represents the signed distance field function of the blank or tool; (P x ,P y ,P z ) represents the spatial coordinates of any point P in space; r1 represents the radius of the sphere;
[0069] If the blank / tool is a cube, the signed distance field function of the blank or tool is expressed as:
[0070]
[0071] Among them, a represents the side length of the cube;
[0072] If the blank / tool is a cylinder, the signed distance field function of the blank or tool is expressed as:
[0073]
[0074] Where r2 represents the radius of the cylinder.
[0075] In addition to APT tools, CAM software systems usually also support user-defined milling cutter contours. Assume that the contour of this type of tool is defined on the xoz positive plane and is a closed contour. The z axis is the rotation axis of the tool. At this time, based on any point P (p x ,p y ,p z ) to the tool surface to construct the tool's directed distance field function.
[0076] Specifically, if the blank / tool is a solid of revolution, the process of constructing the signed distance field function of the blank / tool includes:
[0077] Define the blank / tool contour line, and project any point in space to the plane where the blank / tool contour line is located to obtain the projection point of the point on the blank / tool;
[0078] The shortest distance between the projection point and each contour line on the blank / tool is calculated respectively, and the minimum value among the shortest distances between the projection point and all contour lines on the blank / tool is taken as the goal to construct a signed distance field function of the blank / tool.
[0079] Specifically, the projection point of any point in space on the blank / tool is expressed as:
[0080]
[0081] Among them, P x ′ Represents the projection point P of any point P in space on the blank / tool ′ The x-axis coordinate of z ′ Represents the projection point P of any point P in space on the blank / tool ′ The z-axis coordinate of (P x ,P y ,P z ) represents the spatial coordinates of any point P in space.
[0082] In addition to milling cutters, some machining tools in actual machining are not rotating bodies, such as turning tools, boring and milling cutters, etc. This type of tool is more universal, and due to the complexity of the mesh model, the tool sweep volume generation method based on envelope theory is not applicable to this type of tool. For mesh tools, the simplest and crudest way to construct a signed distance field function is to traverse all triangles, search for the nearest triangle, and then determine whether the point is inside or outside the mesh. However, this approach has low computational efficiency. In order to improve the efficiency of constructing the distance field function for calculating the mesh tool, this application constructs a hierarchical bounding box data structure (AABB tree) for the tool mesh. AABB is a tree-like data structure, such as Figure 3 As shown in the figure, the tool grid is divided into spaces. When solving the shortest directed distance from a point in space to the tool grid, the AABB tree of the tool grid is traversed first to find the closest grid to the point, record the distance from the point to the grid, and then determine whether the point is above or below the grid to determine the sign of the distance value.
[0083] Specifically, if the blank / tool is a geometric body other than a sphere, a cube, a cylinder, or a body of revolution, the process of constructing the signed distance field function of the blank / tool includes:
[0084] Meshing the blank / tool to obtain a blank / tool mesh;
[0085] Constructing a hierarchical bounding box data structure for the blank / tool mesh to spatially divide the blank / tool mesh to obtain an AABB tree of the blank / tool mesh;
[0086] For any point in space, the distance between the point and all grids on the AABB tree of the blank / tool grid is calculated, and the directed distance field function of the blank / tool is constructed with the goal of obtaining the minimum value of the distance between the point and all grids on the AABB tree of the blank / tool grid.
[0087] Furthermore, when the tool moves along the tool path, assuming that the tool position at this time is represented by a homogeneous matrix T, the signed distance field function of the tool from any point P in space to position T can be expressed as SDF(T -1 P), the meaning of this expression is to transform the inverse motion of point P to the coordinate system where the tool model is located for query. When there is a section of tool path motion, the tool position is a function of time t T(t). The signed distance field function of the tool swept volume of this section of tool path can be obtained through the Boolean operation definition of the signed distance field function, so as to obtain the distance from any point in space to the surface of the tool swept volume on this section of tool path.
[0088] Specifically, the tool-sweep volume signed distance field function is expressed as:
[0089] SDFSweptTool =min(SDF(T(t) -1 P)),
[0090] Among them, SDF SweptTool represents the signed distance field function of the tool swept volume; SDF represents the signed distance field function of the tool; T is a homogeneous matrix; T(t) represents the tool path motion time function on the tool path to be cut after interpolation; P represents any point in space.
[0091] In some embodiments of the present application, in step S20, an isosurface algorithm may be used to reconstruct the mesh of the blank to obtain a processed blank.
[0092] Based on the blank processing method based on the directed distance field provided in the above embodiment, the embodiment of the present application also provides a blank processing device based on the directed distance field, such as Figure 4 As shown, the device specifically includes:
[0093] A first signed distance field function construction module is used to construct a blank signed distance field function and a tool signed distance field function;
[0094] A voxel partitioning module is used to perform voxel partitioning on the blank to obtain a voxel set; based on the blank signed distance field function, the signed distance value from each vertex of each voxel to the blank surface is calculated; if the signed distance values from all vertices of the voxel to the blank surface are positive values, the voxel is removed from the voxel set to obtain a target voxel set;
[0095] A second signed distance field function construction module is used to obtain a tool path to be cut, and interpolate between every two adjacent tool positions in the tool path to be cut by using a linear interpolation method, and construct a tool swept volume signed distance field function based on the interpolated tool path to be cut and the tool signed distance field function;
[0096] A target directed distance value calculation module is used to calculate the directed distance value from each vertex of each voxel in the target voxel set to the surface of the tool swept volume based on the tool swept volume directed distance field function; perform Boolean subtraction between the directed distance value from the vertex to the blank surface and the directed distance value from the vertex to the surface of the tool swept volume to obtain the target directed distance value of the vertex;
[0097] The blank processing module is used for removing the voxel from the target voxel set if the target directed distance values of all vertices of the voxel are positive, and reconstructing the mesh of the blank.
[0098] The 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 blank processing method based on the signed distance field are implemented.
[0099] 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 in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0100] 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.
[0101] 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 including 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.
[0102] 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. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0103] 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 blank processing method based on a signed distance field, characterized in that: include: Constructing the blank signed distance field function and the tool signed distance field function; Divide the blank into voxels to obtain a voxel set; Based on the blank signed distance field function, the signed distance values from each vertex of each voxel to the blank surface are calculated. If the signed distance values from all vertices of the voxel to the blank surface are positive values, the voxel is removed from the voxel set to obtain a target voxel set. Obtaining a tool path to be cut, and interpolating between every two adjacent tool position points in the tool path to be cut by using a linear interpolation method, and constructing a tool swept volume signed distance field function based on the interpolated tool path to be cut and the tool signed distance field function; Based on the tool swept volume signed distance field function, the signed distance value from each vertex of each voxel in the target voxel set to the tool swept volume surface is calculated; the signed distance value from the vertex to the blank surface and the signed distance value from the vertex to the tool swept volume surface are Boolean-subtracted to obtain the target signed distance value of the vertex; If the target directed distance values of all vertices of a voxel are positive, the voxel is removed from the target voxel set and the blank is meshed.
2. The blank processing method based on the directed distance field according to claim 1 is characterized in that: The blank is divided into voxels, and the voxel set obtained includes: Get the minimum bounding box of the blank; The minimum bounding box is divided based on a preset voxel side length to obtain a voxel set and coordinates of each vertex of each voxel in the voxel set.
3. The blank processing method based on the directed distance field according to claim 1, characterized in that: If the blank / tool is a sphere, the signed distance field function of the blank or tool is expressed as: Where SDF represents the signed distance field function of the blank or tool; (P x ,P y ,P z ) represents the spatial coordinates of any point P in space; r1 represents the radius of the sphere; If the blank / tool is a cube, the signed distance field function of the blank or tool is expressed as: Among them, a represents the side length of the cube; If the blank / tool is a cylinder, the signed distance field function of the blank or tool is expressed as: Where r2 represents the radius of the cylinder.
4. The blank processing method based on the directed distance field according to claim 1, characterized in that: If the blank / tool is a solid of revolution, the process of constructing the signed distance field function of the blank / tool includes: Define the blank / tool contour line, and project any point in space to the plane where the blank / tool contour line is located to obtain the projection point of the point on the blank / tool; The shortest distance between the projection point and each contour line on the blank / tool is calculated respectively, and the minimum value among the shortest distances between the projection point and all contour lines on the blank / tool is taken as the goal to construct a signed distance field function of the blank / tool.
5. The blank processing method based on the directed distance field according to claim 4 is characterized in that: The projection point of any point in space on the blank / tool is expressed as: P z ′ =P z , Among them, P x ′ Represents the projection point P of any point P in space on the blank / tool ′ The x-axis coordinate of z ′ Represents the projection point P of any point P in space on the blank / tool ′ The z-axis coordinate of x ,P y ,P z ) represents the spatial coordinates of any point P in space.
6. The blank processing method based on the directed distance field according to claim 1, characterized in that: If the blank / tool is a geometric body other than a sphere, cube, cylinder, or body of revolution, the process of constructing the signed distance field function of the blank / tool includes: Meshing the blank / tool to obtain a blank / tool mesh; Constructing a hierarchical bounding box data structure for the blank / tool mesh to spatially divide the blank / tool mesh to obtain an AABB tree of the blank / tool mesh; For any point in space, the distance between the point and all grids on the AABB tree of the blank / tool grid is calculated, and the directed distance field function of the blank / tool is constructed with the goal of obtaining the minimum value of the distance between the point and all grids on the AABB tree of the blank / tool grid.
7. The blank processing method based on the directed distance field according to claim 1, characterized in that: The signed distance field function of the tool-sweep volume is expressed as: SDF SweptTool =min(SDF(T(t) -1 P)), Among them, SDF SweptTool represents the signed distance field function of the tool swept volume; SDF represents the signed distance field function of the tool; T is a homogeneous matrix; T(t) represents the tool path motion time function on the tool path to be cut after interpolation; P represents any point in space.
8. The blank processing method based on the directed distance field according to claim 1, characterized in that: The blank is reconstructed by using the isosurface algorithm to obtain the processed blank.
9. A blank processing device based on a signed distance field, characterized in that: include: A first signed distance field function construction module is used to construct a blank signed distance field function and a tool signed distance field function; A voxel partitioning module is used to perform voxel partitioning on the blank to obtain a voxel set; based on the blank signed distance field function, the signed distance value from each vertex of each voxel to the blank surface is calculated; if the signed distance values from all vertices of the voxel to the blank surface are positive values, the voxel is removed from the voxel set to obtain a target voxel set; A second signed distance field function construction module is used to obtain a tool path to be cut, and interpolate between every two adjacent tool positions in the tool path to be cut by using a linear interpolation method, and construct a tool swept volume signed distance field function based on the interpolated tool path to be cut and the tool signed distance field function; A target directed distance value calculation module is used to calculate the directed distance value from each vertex of each voxel in the target voxel set to the surface of the tool swept volume based on the tool swept volume directed distance field function; perform Boolean subtraction between the directed distance value from the vertex to the blank surface and the directed distance value from the vertex to the surface of the tool swept volume to obtain the target directed distance value of the vertex; The blank processing module is used for removing the voxel from the target voxel set if the target directed distance values of all vertices of the voxel are positive, and reconstructing the mesh of the blank.
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 blank processing method based on a signed distance field according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Envelope theory-based universal cutter scanning body generating method
CN102566509B
Cutter swept volume generation method and device based on triangular mesh and storage medium
CN114115119A