A free-form surface slicing method and device based on an implicit model
By obtaining contour lines through the intersection of the implicit model and the mesh model, the problems of memory exhaustion and low slicing accuracy in existing technologies are solved, and efficient surface layering and accurate slicing of complex models are achieved.
Patent Information
- Application Number
- CN202310815663.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-04
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2043-07-04
AI Technical Summary
Existing technologies suffer from problems such as exhausting computer memory, large file sizes, and low slicing accuracy when processing complex 3D models, especially for models with internally filled lattice structures, making it difficult to generate accurate layered surfaces.
A free-form surface slicing method based on implicit models is adopted. Contour lines are obtained by intersecting the implicit model and the mesh model. The coordinates of the intersection points are calculated by interpolation, and the topological relationship between the point set and the line segment is established to generate an ordered slice profile.
It achieves efficient surface layering for complex models, reduces computer memory consumption, generates accurate slice contours, and is suitable for printing large and complex models.
Smart Images

Figure CN117002010B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of 3D printing and computer graphics, and more particularly relates to a free-form surface slicing method and device based on an implicit model. BACKGROUND
[0002] Additive manufacturing uses a layer-by-layer accumulation method to form parts, which has attracted widespread attention due to its high degree of freedom, low price and flexible design. One of the key technologies of additive manufacturing is the layering technology of three-dimensional solid models. The current mainstream layering method is planar layering, which is based on the use of a slicing plane in the Z direction to slice three-dimensional models. This method is simple and efficient, but it can only slice three-dimensional models with simple shapes and small sizes. For parts with complex shapes, additional support is required, which can easily accumulate energy, cause uneven heat dissipation, make it difficult to remove the support, and have a significant step effect, increasing the printing time and cost and reducing the forming quality. In the existing slicing technology of additive manufacturing, the STL (Standard Triangulation Language) file, i.e. the triangular mesh model, is usually used for slicing. This method is mature, versatile and flexible, but when expressing models with complex structures, it is limited by the accuracy and expression of triangles. The number of triangular meshes increases sharply, and the file size increases significantly, which can exhaust the computer's memory when reading. At the same time, problems such as triangle overlap, void defects, triangle degeneration, and self-intersection affect the accuracy and robustness of slicing based on STL models, increase additional steps, and even cause the file to be unreadable.
[0003] To solve the problems of planar layered slicing, some solutions are proposed by people in the field. A curved surface layering slicing method is disclosed in Chinese invention patent CN202211214101.X. The patent first establishes the topological relationship between the triangular facets in STL, obtains the triangular facets with the included angle between the normal vector and the Z-axis within 0-90° as the base surface, and separates the curved surface from the model of the part to be printed to obtain the curved surface contour. Then, the base surface is continuously offset to generate a series of curved surface contours. However, this method also has some problems. First, this method needs to establish the topological structure in the STL model. When the internal structure of the STL model is complex, such as a dot matrix structure, a large number of triangular meshes are needed to express the surface information. The computer cannot read such a large STL file, which will consume the computer memory, and the probability of internal holes, triangular overlap and other errors will also increase, which requires additional steps to process it. In addition, the initial separated curved surface obtained in this patent only obtains triangular meshes with the included angle between the normal vector and the Z-axis within 0-90°. There may be curved surfaces with holes in the middle, or they may not be formed on this initial curved surface layer. These problems are not discussed in this patent, and the problem of free curved surface layering cannot be effectively solved. Patent CN202010719380.X proposes a curved surface layering slicing method based on point cloud. First, the bounding box of the point cloud model is established, the bounding box is divided into 3mm grid points, the coordinates of the grid points in the point cloud model are determined, the nearest neighbor points of the grid points are searched using k-dimensional number, local least squares plane fitting is performed, and local normal vector is obtained. Then, the depth value of the grid point is calculated, and the Z-direction offset of the three-dimensional point cloud surface is performed to obtain the curved surface layering. However, this method simulates the model point cloud with a 3mm wide grid. For models with internal dot matrix structure, it is difficult to obtain accurate internal curved surface layering because the internal dot matrix structure is usually small in size and is represented by only one point or no point in point cloud. Therefore, for complex models, this method cannot generate accurate layered curved surfaces. Therefore, there is an urgent need in the field for a complex structure, low memory consumption, efficient and direct curved surface layering method. SUMMARY
[0004] In view of the above defects or improvement needs of the prior art, the present application provides a free curved surface slicing method and device based on an implicit model. The method directly slices based on an implicit model, so that the part to be processed does not need to rely on a conventional mesh model, does not need to establish a mesh topological relationship, does not need to store all facet information, does not need to process facet errors, does not need to establish a topological relationship between meshes, and does not need to store additional information. The method can directly slice the curved surface of the implicit model, especially for complex models with internal dot matrix structure. Direct curved surface slicing does not consume a large amount of computer memory, and achieves the requirements of curved surface layering for large and complex models.
[0005] To achieve the above object, according to one aspect of the present application, a free-form surface slicing method based on implicit model is provided, characterized in that the method comprises the following steps:
[0006] Step one, determining the implicit model of the part to be manufactured and the layered surface, the implicit model being a distance field;
[0007] Step two, intersecting the grid model of the layered surface with the implicit model of the part to be manufactured to obtain the contour line;
[0008] Step three, comparing the contour line with the intersection of the grid in the grid, and substituting the grid coordinates into the implicit model, and then comparing the intersection of the contour line and the grid according to the relationship between the obtained grid vertex and the model to obtain the position of the intersection point of the contour line in the corresponding grid;
[0009] Step four, based on the grid coordinates and the value calculated in the implicit model, the intersection point coordinates of the contour line and the grid boundary are calculated by using the interpolation method, and then the discrete line segment intersection points in the grid are stored; wherein the corresponding discrete line segment is given a direction attribute when storing the discrete line segment intersection points in the grid;
[0010] Step five, merging the unordered point set obtained in step four to establish the topological relationship between the point set and the discrete line segment, that is, each line segment corresponds to two end points, and each end point corresponds to two line segments, finding a line segment and positioning to the starting point and the ending point of the line segment based on the direction of the line segment, the ending point of the line segment is the same as the starting point of another line segment, that is, the next line segment adjacent to the line segment is found, and all points are traversed to connect into a complete and ordered contour, that is, the slicing contour.
[0011] Further, after step five, the input layered surface is offset in the printing direction according to the layer thickness, and steps two to five are repeated, that is, the step of generating all surface layer slices of the part to be manufactured model is completed.
[0012] Further, the layered surface includes a UV surface, an STL file surface, and a surface formula.
[0013] Further, the distance field takes the model surface as the distance field boundary, and defines the shortest distance between any point in space and the model boundary as the value of the point in the distance field; if the point in space is inside the model distance field, the distance field value of the point is negative; if it is outside the model, the distance field value is positive, and at the boundary, it is 0.
[0014] Further, if the layered surface is a formula surface, it needs to be divided according to the length and width directions, and the intersection of the line segments divides the quadrilateral grid.
[0015] Further, if the input layered surface is a surface formula, the grid size to be divided needs to be input; the grid size is input, and the surface formula is divided in the length and width directions to obtain a grid, and each grid is marked with an ID number, and the subsequent calculation of the grid vertex coordinates is calculated in real time according to the ID number.
[0016] Further, the calculated point set and the corresponding line segment are assigned a direction attribute, that is, the line segment direction always satisfies the counterclockwise direction of the enclosed internal vertex.
[0017] Further, if the layered surface is a surface formula, the grid vertex coordinates are calculated according to the ID number and the grid size, and if it is a UV surface or an STL file, the grid vertex coordinates in the file are directly read and substituted into the implicit model to calculate the corresponding value.
[0018] The application also provides a computer readable storage medium, which stores machine executable instructions, and when the machine executable instructions are called and executed by a processor, the machine executable instructions cause the processor to implement the free-form surface slicing method based on an implicit model.
[0019] The application also provides a free-form surface slicing system based on an implicit model, which comprises a memory and a processor, the memory stores a computer program, and the processor executes the computer program to execute the free-form surface slicing method based on an implicit model.
[0020] Overall, compared with the prior art, the free-form surface slicing method and device based on an implicit model provided by the application mainly have the following beneficial effects:
[0021] 1. The application directly slices based on an implicit model, so that the part to be processed does not need to rely on a conventional network model, does not need to establish a grid topology relationship, does not need to store all face information, does not need to additionally process face errors, and can directly slice the surface of the implicit model. In particular, for a complex model filled with a point array structure inside, direct surface slicing does not need to consume a large amount of memory of a computer, and the surface layering requirement of a large-size and complex model is achieved.
[0022] 2. The application assigns a direction attribute to the contour line segment, does not need to take a line segment as a starting line segment and gradually calculate downward, decouples the grid vertex calculation, the interpolation point coordinate calculation and the subsequent ordered contour processing, easily realizes the demand for multi-thread parallel calculation to improve efficiency, and efficiently calculates the line segment interpolation point coordinates.
[0023] 3. For the input surface formula, mesh partitioning is performed, and only mesh ID numbers are stored. Subsequent calculation of the results of mesh vertexes in the implicit model and linear interpolation of the mesh vertex coordinates can directly obtain the mesh vertex coordinates through the mesh ID numbers and mesh size. For UV surfaces, STL files and other mesh models, the mesh vertex coordinates in the file are directly read.
[0024] 4. In the process of sorting discrete line segments and obtaining an ordered contour, a method of establishing the topological relationship between the point set and the line segment is adopted. The key of this method is how to establish the topological relationship, which needs to rely on the repeated points in the point set. The repeated points are merged, and the line segment numbers on both sides of the point can be obtained. This method can also be applied to the scheme of the layered results obtained based on the conventional mesh model. BRIEF DESCRIPTION OF DRAWINGS
[0025] Figure 1 is a flowchart of a free surface slicing method based on an implicit model provided by the present application;
[0026] Figure 2 (a)-(p) in are 16 kinds of cases of interpolation points in a quadrilateral mesh, and the storage order of the interpolation points is the arrow direction;
[0027] Figure 3 (a)-(h) in are 8 kinds of cases of interpolation points in a triangular mesh, and the storage order of the interpolation points is the arrow direction;
[0028] Figure 4 is a schematic diagram of a single-layer slice discrete line segment;
[0029] Figure 5 is a schematic diagram of a cylindrical surface layering with an internal filling point array structure;
[0030] Figure 6 is a schematic diagram of a planar layering with an internal filling point array. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application, and are not used to limit the present application. In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.
[0032] Please refer to Figure 1 The present application provides a free surface slicing method based on an implicit model. The slicing method mainly comprises the following steps:
[0033] Step one, determine the implicit model of the part to be manufactured and the layered surface, the implicit model includes distance field, temperature field, gravitational field and other arbitrary mathematical space function.
[0034] Specifically, the layered surface includes UV surface, STL file surface, surface formula or other mesh file format data. The implicit model of the model is to express the entity model by means of the implicit model, and the expression method includes function form, discrete data information, array expression, etc. The data amount is small, and the entity mesh information is not required. Common implicit models include distance field, contour field, temperature field or other arbitrary mathematical space function. The distance field is used in the embodiment. The model surface is taken as the distance field boundary, and the shortest distance between any point in space and the model boundary is defined as the value of the point in the distance field. If the point in space is inside the model distance field, the distance field value of the point is negative; if it is outside the model, the distance field value is positive, and at the boundary, it is 0. Such scalar field can completely express the model information. At the same time, by means of the maximum and minimum formula, the intersection operation of merging and subtracting can be easily realized. The internal point array structure is generated without using mesh expression. The periodic point array structure can be directly generated in the model interior by using the surface formula, for example
[0035] In the embodiment, the implicit model of the part to be manufactured is input, and the distance field is adopted.
[0036] Step two, intersect the layered surface mesh model with the implicit model of the part to be manufactured to obtain the contour line.
[0037] The layered surface mesh model, such as the quadrilateral mesh on the UV surface, the triangular mesh on the STL model, or the mesh divided in the surface formula (such as the cylindrical formula), is intersected with the implicit model of the part to be manufactured to obtain the contour line.
[0038] The basic element of the UV surface, STL file or other mesh file is the quadrilateral or triangular mesh. If the mesh is large and does not meet the required accuracy of the surface contour, the subdivision algorithm can be used to redivide the relatively large mesh. For the input formula surface, such as the cylindrical surface, spherical surface, rectangular plane and other basic mathematical surfaces, the surface can be divided in the length and width directions of the surface. The line segments intersect to divide the quadrilateral mesh.
[0039] In this embodiment, if the input layered surface is a surface formula, the grid size to be divided also needs to be input; according to the input grid size, the surface formula is divided in the length and width directions to obtain a grid, and each grid is marked with an ID number, and the subsequent calculation of the grid vertex coordinates is calculated in real time according to the ID number. Therefore, only the ID number is stored, and the vertex coordinates of the grid are not stored, thereby avoiding the storage of adjacent grid vertexes multiple times and reducing memory consumption; if a grid file is input, for example, a UV surface or an STL file, some grids in these files are large and do not meet the defined contour accuracy, and a subdivision algorithm needs to be used for grid subdivision.
[0040] Step three, according to the rule of the intersection of the contour line and the grid, the grid coordinates are substituted into the implicit model, and then the intersection of the contour line and the grid is compared according to the relationship between the obtained grid vertex and the model to obtain the position of the intersection point of the contour line in the corresponding grid.
[0041] In this step, a variant of the Marching Squares algorithm is used. The Marching Squares algorithm is an algorithm for generating a contour line in a grid. There are multiple cases of the contour line passing through each grid. There are 16 cases in a quadrilateral and three cases in a triangle. These small line segments constitute the contour line.
[0042] Step four, based on the grid coordinates and the values calculated in the implicit model, the intersection coordinates of the contour line and the grid boundary are calculated by using an interpolation method, and then the discrete line segment intersection points in the grid are stored; wherein, the corresponding discrete line segment is assigned a direction attribute when the discrete line segment intersection points in the grid are stored.
[0043] The value calculated by substituting the grid vertex coordinates into the implicit model is used as the weight of interpolation, and the obtained contour line is smoother by using the interpolation method. Linear interpolation means that the linear change between two points is defaulted, and the linear interpolation formula is:
[0044] The value is substituted to obtain the interpolation point coordinates. The point set and the corresponding line segment obtained by calculation are assigned a direction attribute, that is, the line segment direction always meets the counterclockwise direction of the surrounding internal vertex.
[0045] In this embodiment, starting from any grid, if the layered surface is a surface formula, the grid vertex coordinates are calculated according to the ID number and the grid size, if it is a UV surface or an STL file, the grid vertex coordinates in the file are directly read, the grid vertex coordinates are substituted into the implicit model to calculate the corresponding value, and each vertex has two cases, inside or outside the implicit model. In a quadrilateral grid, there are 16 cases, such as Figure 2 ; in a triangular grid, there are 8 cases, such as Figure 3As shown. Furthermore, for larger grids in the original file, a subdivision algorithm can be used to further subdivide the grid, resulting in finer and smoother contour lines. Based on the relative positions of the intersecting lines within the grid and the grid boundaries, the values of the grid endpoints on the boundary intersecting the intersection points in the implicit model are used as weights. The coordinates of the intersection points are calculated using a linear interpolation formula, and then... Figure 2 The arrow direction of the line segments is stored by defining a data structure to store the start and end points of the line segments, assigning directional attributes to each segment, and conforming to the rule that the outer contour of the layered surface is counterclockwise and the inner contour is clockwise. Each line segment is also given an ID number. Ultimately, the computer stores the ID numbers of the line segments and the coordinates of their intersection points.
[0046] Step 5: Merge the unordered point set obtained in Step 4 to establish the topological relationship between the point set and the discrete line segments. That is, each line segment corresponds to two endpoints, and each endpoint corresponds to two line segments. Find a line segment and locate the start and end points of the line segment based on the line segment direction. The end point of this line segment has the same coordinates as the start point of another line segment. That is, find the next adjacent line segment of this line segment. After traversing all the points, a complete and ordered contour is formed, that is, the slice contour.
[0047] In step four, the calculated point set consists of unordered, discrete line segments. Only the line segments within the grid have direction, and each point is stored twice. To generate an ordered, closed, complete contour, the unordered point set is merged, establishing a topological relationship between the point set and the discrete line segments. At this point, identical points are located on two separate line segments that are spatially continuous. The ID numbers of the two line segments are stored in adjacent positions, and another point on this line segment is found, along with duplicate points. After traversing all points, a complete, ordered contour is formed.
[0048] In this embodiment, the previous step yielded a large number of discrete directed line segments and interpolation intersections. Since the line segments are not sequentially connected, they cannot be used as the surface layering result for subsequent path planning. Figure 4 As shown, each interpolation point is stored twice in the point set. The topological relationship between the point set and line segments can be established through repeated points. First, an endpoint of a line segment is randomly selected as the starting point. If this point is the starting point, the other endpoint of the same line segment is searched through the correspondence of line segments, and the line segment containing another repeated point is searched based on this endpoint. If this point is the ending point of a line segment, the repeated point of this point needs to be found to locate the next line segment, and then stored sequentially, avoiding the need to judge the order of the starting interpolation points. After traversing all line segments, an ordered and complete slice outline can be generated. This implementation uses a hash table method for illustration. Repeated points are stored in the same position in the hash table, so they can be stored at the point ID number with the same position in the hash table. The hash table method can reduce the complexity of merging repeated points. Other methods such as sorting and brute-force search can also merge repeated points and establish topological relationships.
[0049] The method further comprises offsetting the input layered curved surface in the printing direction according to the layer thickness, repeating steps two to five, and generating all the curved surface layering slices of the part model to be manufactured, as shown in steps 1 to 6. Figure 5 Figure 6
[0050] The application further provides a computer readable storage medium, which stores machine executable instructions, and the machine executable instructions, when called and executed by a processor, cause the processor to implement the free curved surface slicing method based on an implicit model.
[0051] The application further provides a free curved surface slicing system based on an implicit model, which comprises a memory and a processor, the memory stores a computer program, and the processor executes the computer program to execute the free curved surface slicing method based on an implicit model.
[0052] Those skilled in the art can easily understand that the above description is only the preferred embodiment of the application, and is not intended to limit the application, and any modification, equivalent replacement and improvement within the spirit and principle of the application shall be included in the protection scope of the application.
Claims
1. An implicit model based freeform surface slicing method, characterized in that, The method includes the following steps: Step 1: Determine the implicit model and layered surfaces of the part to be manufactured. The implicit model is either a distance field or a temperature field. Step 2: Intersect the layered surface mesh model with the implicit model of the part to be manufactured to obtain contour lines; Step 3: Refer to the rules for the intersection of contour lines and grids within the grid, and substitute the grid coordinates into the implicit model. Then, based on the obtained relationship between the grid vertices and the model, compare the intersection of contour lines and grids to obtain the position of the intersection point of the contour lines within the corresponding grid. Step 4: Based on the grid coordinates and the values of these coordinates calculated in the implicit model, the coordinates of the intersection points of the contour lines and the grid boundary are calculated using the interpolation method, and then the intersection points of discrete line segments within the grid are stored; wherein, when storing the intersection points of discrete line segments, the corresponding discrete line segments are assigned directional attributes. Step 5: Merge the unordered point set obtained in Step 4 to establish the topological relationship between the point set and the discrete line segments. That is, each line segment corresponds to two endpoints, and each endpoint corresponds to two line segments. Find a line segment and locate the start and end points of the line segment based on the line segment direction. The end point of this line segment has the same coordinates as the start point of another line segment. That is, find the next adjacent line segment of this line segment. After traversing all the points, a complete and ordered contour is formed, that is, the slice contour.
2. The implicit model based freeform surface slicing method of claim 1, wherein: Step five also includes offsetting the input layered surfaces in the printing direction according to the layer thickness, and repeating steps two through five to generate all the surface layer slices of the part model to be manufactured.
3. The implicit model based freeform surface slicing method of claim 1, wherein: Layered surfaces include UV surfaces, STL file surfaces, and surface formulas.
4. The freeform surface slicing method based on implicit models as described in claim 1, characterized in that: The implicit model is a distance field. The distance field takes the model surface as the boundary of the distance field. The shortest distance between any point in space and the model boundary is defined as the value of this point in the distance field. If the point in space is inside the model distance field, the distance field value of this point is negative; if it is outside the model, the distance field value is positive, and it is 0 at the boundary.
5. The freeform surface slicing method based on implicit models as described in claim 1, characterized in that: If the layered surface is a formulaic surface, it needs to be divided according to the length and width of the surface. The intersection of line segments will divide it into quadrilateral grids.
6. The freeform surface slicing method based on implicit models as described in claim 1, characterized in that: If the input layered surface is a surface formula, the size of the mesh to be divided also needs to be input. According to the input mesh size, the surface formula is evenly divided in the length and width directions, and the mesh is obtained by intersection. Each mesh is marked with an ID number, and the vertex coordinates of the mesh are calculated in real time according to the ID number.
7. The freeform surface slicing method based on implicit models as described in any one of claims 1-6, characterized in that: Assign directional attributes to the calculated set of points and the corresponding line segments, that is, stipulate that the direction of the line segment always satisfies the counterclockwise direction that surrounds the internal vertices.
8. The freeform surface slicing method based on an implicit model as described in any one of claims 1-6, characterized in that: If the layered surface is a surface formula, the mesh vertex coordinates are calculated based on the ID number and mesh size. If it is a UV surface or an STL file, the mesh vertex coordinates are read directly from the file and substituted into the implicit model to obtain the corresponding values.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the implicit model-based freeform surface slicing method according to any one of claims 1-8.
10. A freeform surface slicing system based on an implicit model, characterized in that: The system includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the freeform surface slicing method based on the implicit model as described in any one of claims 1-8.
Citation Information
Patent Citations
A method for in-situ 3D printing surface layering and path planning
CN112140552B
Metal additive manufacturing method based on curved surface layering
CN115635096A
3D printing filling path planning method based on level set
CN113650301A
Method for structure preserving topology optimization of lattice structures for additive manufacturing
US20150190971A1