Free-form curved surface slicing method and device based on implicit model
Disclosed are free-form curved surface slicing method and device based on implicit model, includes following: (1) Using mesh model of layered curved surface to intersect with implicit model of a part to be manufactured to obtain contour lines; (2) Comparing rules for intersecting contour lines and meshes within mesh, mesh coordinates are substituted into implicit model, obtaining a position of an intersection point of contour lines in corresponding mesh; (3) Using interpolation method to calculate intersection coordinates of contour lines and mesh boundary, specifying storing sequence of interpolation points, storing intersection points of discrete line segments in mesh; (4) Merging unordered point sets obtained to establish topological relationship between point sets and discrete line segments, each line segment corresponds to two endpoints, each endpoint corresponds to two line segments, based on above, all points traversed will be connected into complete and ordered profile, that is sliced profile.
1 . A free-form curved surface slicing method based on an implicit model, comprising:
step 1, determining the implicit model and a layered curved surface of a part to be manufactured, the implicit model is a distance field or a temperature field;
step 2, using a mesh model of the layered curved surface to intersect with the implicit model of the part to be manufactured to obtain contour lines;
step 3, comparing rules for intersecting the contour lines and meshes, and mesh coordinates are substituted into the implicit model, then an intersection of the contour lines and the mesh is compared based on an obtained relationship between mesh vertices and the implicit model, thereby obtaining a position of an intersection point of the contour lines in a corresponding mesh;
step 4, based on the mesh coordinates and values corresponding to the mesh coordinates, using an interpolation method to calculate intersection coordinates of the contour lines and a mesh boundary, and then storing intersection points of discrete line segments in the mesh, wherein the values are calculated in the implicit model, wherein direction attributes are assigned to corresponding discrete line segments when storing the intersection points of the discrete line segments in the mesh;
step 5, merging unordered point sets including the intersection points obtained in step 4 to establish a topological relationship between the point sets and the discrete line segments, that is, each line segment corresponds to two endpoints, and each of the endpoints corresponds to two line segments, by finding one of the line segments and locating a starting point and an endpoint of the line segment based on a direction of the line segment, and the end point of the line segment has the same coordinates as a starting point of another line segment, that is, by finding the next line segment adjacent to the line segment, after traversing all the points, a complete and ordered profile is connected, which is referred as an sliced profile.
2 . The free-form curved surface slicing method is based on the implicit model according to claim 1 , wherein after step 5, the method further comprises shifting an input layered curved surface in a printing direction according to a layer thickness, and step 2 to step 5 are repeated to generate all layered curved surface slices of the part model to be manufactured.
3 . The free-form curved surface slicing method is based on the implicit model according to claim 1 , wherein the layered curved surfaces comprise UV curved surfaces, STL file curved surfaces, and formula curved surface.
4 . The free-form curved surface slicing method is based on the implicit model according to claim 1 , wherein the implicit model is the distance field, the distance field utilizes a model surface as a distance field boundary, and a shortest distance between any point in a space and a model boundary is defined as a value of the point in the distance field; if a midpoint of the space is inside a model distance field, a value of the distance field of the point is negative; if the midpoint of the space is outside the model distance field, the value of the distance field is positive; if the midpoint of the space is at the model boundary, the value of the distance field is 0.
5 . The free-form curved surface slicing method is based on the implicit model according to claim 1 , wherein if the layered curved surface is a formula curved surface, performing division according to a length direction and a width direction of the curved surface, when the line segments are intersected with each other, a quadrilateral mesh is divided.
6 . The free-form curved surface slicing method is based on the implicit model according to claim 1 , wherein if an input layered curved surface is a curved surface formula, entering a mesh size to be divided; according to the input mesh size, the division is performed evenly in a length direction and a width direction of the curved surface formula, the mesh is obtained through intersection, the mesh is marked with an ID number, and coordinates of subsequent mesh vertices are calculated in real time based on the ID number.
7 . The free-form curved surface slicing method is based on the implicit model according to claim 1 , wherein a direction attribute is assigned to calculated point sets and corresponding line segments, that is, it is specified that a direction of the line segment always satisfies a counterclockwise direction surrounding internal vertices.
8 . The free-form curved surface slicing method is based on the implicit model according to claim 1 , wherein if the layered curved surface is the curved surface formula, mesh vertex coordinates are calculated based on ID number and mesh size, if the layered curved surface is an UV curved surface or an STL file, the mesh vertex coordinates in the file are directly read and the mesh vertex coordinates are substituted in the implicit model to get a corresponding value.
9 . A non-transitory computer-readable storage medium, which stores machine-executable instructions, wherein when the machine-executable instructions are provoked and executed by a processor, the machine-executable instructions cause the processor to implement the free-form curved surface slicing method based on the implicit model according to claim 1 .
10 . A free-form curved surface slicing system based on an implicit model, wherein the system comprises a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the free-form curved surface slicing method based on the implicit model according to claim 1 is executed.