CN109934923B - Model layering and track filling method suitable for 3D printing of biological material - Google Patents

Model layering and track filling method suitable for 3D printing of biological material Download PDF

Info

Publication number
CN109934923B
CN109934923B CN201711344975.6A CN201711344975A CN109934923B CN 109934923 B CN109934923 B CN 109934923B CN 201711344975 A CN201711344975 A CN 201711344975A CN 109934923 B CN109934923 B CN 109934923B
Authority
CN
China
Prior art keywords
triangle
index
points
edge
scatter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711344975.6A
Other languages
Chinese (zh)
Other versions
CN109934923A (en
Inventor
胡延旭
王赫然
郑雄飞
李松
朱慧轩
王强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenyang Institute of Automation of CAS
Original Assignee
Shenyang Institute of Automation of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenyang Institute of Automation of CAS filed Critical Shenyang Institute of Automation of CAS
Priority to CN201711344975.6A priority Critical patent/CN109934923B/en
Publication of CN109934923A publication Critical patent/CN109934923A/en
Application granted granted Critical
Publication of CN109934923B publication Critical patent/CN109934923B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to a model layering and track filling method suitable for 3D printing of biological materials, which comprises the following steps of: and (3) establishing three index data structures for stl data according to a geometric logic structure: point, edge, triangle; establishing adjacent relations among points, edges and surface patches according to the topological relation of the index data structure to obtain continuous slicing track data; the slice trajectory is filled. The invention establishes the triangle index of the starting point, the edge and the face based on the searching of the adjacent edge table. The known triangle index table can traverse indexes of three adjacent triangles, indexes of three edges and indexes of three points; knowing the edge index table, one can traverse to two adjacent triangle indices, and to indices of two points. Meanwhile, the invention carries out compensation processing on special conditions of data scatter and provides a simple compensation method with low model precision loss.

Description

Model layering and track filling method suitable for 3D printing of biological material
Technical Field
The invention relates to a reading, slicing and track generating method of a stl file format 3D model for 3D printing of biological materials.
Background
The most common 3D printing model file is STL format, which can be directly generated by common software such as CAD, solidWorks, etc. Stl file is a file format used to represent triangular meshes in computer graphics applications. The file format of the method is very simple and the method is widely applied. STL is the standard file type most applied by rapid prototyping systems. STL is the representation of 3D CAD models with triangular meshes. The rapid prototyping, i.e. 3D printing, is to fill the planar pattern, superimpose it layer by layer along the height direction, and finally form a physical model.
Triangular patch meshes are distributed in a scattered manner in an STL file, and only by organizing the meshes in a certain relation and then solving the intersection point of a section plane and the edge of the triangular mesh to form an ordered point set can the triangular patch meshes become meaningful plane boundaries. Common STL file slicing methods are typically slice-by-slice at Z-height, which then requires a large number of iterative computations. The general optimization algorithm is to create a triangular patch table, so that after a triangular mesh is cut, the next triangular mesh to be cut can be found by using adjacent data and finally returned to the starting point, and an ordered cutting point row is obtained. However, the method does not consider the situation when the vertex of the triangular mesh is cut by the cutting plane, and in this situation, the next mesh to be cut cannot be searched, which will cause the failure of the slicing algorithm.
Disclosure of Invention
In view of the technical shortcomings, the invention aims to provide a model layering and track filling method suitable for 3D printing of biological materials. The method can quickly provide the shortest moving route for the crown block in a complex track environment.
The technical scheme adopted by the invention for solving the technical problems is as follows: a model layering and track filling method suitable for 3D printing of biological materials comprises the following steps:
1) And (3) establishing three index data structures for stl data according to a geometric logic structure: point, edge, triangle;
2) Establishing adjacent relations among points, edges and surface patches according to the topological relation of the index data structure to obtain continuous slicing track data;
3) The slice trajectory is filled.
The step 1) comprises the following steps:
performing data preprocessing on the read stl scattered point data by utilizing a redundancy removing algorithm;
sequentially extracting a pair of scatter points from the read three scatter points according to the clockwise sequence, storing the smaller of the two scatter points into a scatter point index L [ k ]. Xyindex [0] of an Edge type Edge L [ k ], storing the larger of the two scatter points into an L [ k ]. Xyindex [1], and assigning the faceindex [0] of the three edges to be a triangle v [ j ]. Index; k represents an edge cache array index;
circularly storing the L [ k ] to a set type container SetEdge, judging whether the edge exists in the SetEdge through a find function, and assigning the L [ k ]. Faceindex [1] as faceindex [0] of a find return iterator pointing element;
assigning three edges L [ k ] to three adjacent edge indexes v [ j ] of a TRIANGLE data structure v [ j ] of a TRIANGLE type according to a clockwise sequence; finally, storing the edges in the SetEdge container into a vector container VecEdge for waiting use; i represents a scatter cache array subscript; j represents a triangle cache array index;
and generating an adjacent triangle index of the triangle according to the three edges of the triangle and the adjacent relation of the edges, and finally generating an index dictionary table of the vertex, the edge and the triangle.
The data preprocessing by utilizing the redundancy removing algorithm specifically comprises the following steps:
sequentially reading three scatter point coordinates of a triangle to three XYZ type variables P [3], storing a scatter point P [ i ] into a set container SetTri before storing the scatter point P [ i ] into a vector container VecTri, judging that the same element exists in the SetTri through a find function, setting the position P [ i ] index in the index container as an index mark of the element pointed by an iterator returned by the find function, if the P [ i ] is a new point, inserting the tail of the VecTri container and giving a new index number, and setting P [ i ] index = SetTri. Sequentially storing the three scatter points into an xyz [ i ] of a TRIANGLE v [ j ] of a TRIANGLE type; when a new triangle is read, assigning the index v [ j ] of the triangle to be j, and then increasing j by one; j denotes the triangle cache array index.
Modifying the boundary conditions of the redundancy removal algorithm: if the straight-line distance between any two points is calculated to be less than a fixed value, the two points are considered to be the same point.
The three index data structure forms are as follows:
scatter data structure XYZ: the method comprises the steps that three float type members x, y and z represent three scatter point coordinates of a triangle, and an int type member index represents a triangle index value;
EDGE data structure EDGE: the method comprises the steps that an int type member array xyIndex [2] containing two elements represents three scattered point indexes of an edge, and two edge indexes of the int type member array faceIndex [2] containing two elements represent two edges of the edge, contain an int type member index and represent edge index values;
TRIANGLE data structure TRIANGLE: the int type member array containing three elements, xyz index [3], represents three scatter indexes of a triangle; the int type member array LineIndex [3] containing three elements represents three-edge index of triangle; int type member array faceIndex [3] containing three elements represents three adjacent triangle indexes of the triangle; contains an int-type member index representing the triangle index value.
In the step 2), when the height of a certain scatter point in the index data structure is equal to the height of a slice in a layer, a fixed height is uniformly added to the scatter point with the height higher than the certain layer of the slice, and the height is less than half of the layer height.
The step 3) is as follows:
(1) Intersection points are obtained at equal intervals for each layer of contour line in one direction, namely the Y direction, and the even number of the intersection points of each scanning line and the contour is ensured;
(2) Obtaining one or more filling lines of each layer by using a snake-shaped search algorithm; the method specifically comprises the following steps:
(2.1) firstly, selecting a layer height z, obtaining all scanning intersection points according to the layer, determining the translation direction of a scanning line, and fixing the scanning direction in the step (1) as the y direction;
(2.2) preserving the serpentine trajectory is as follows:
firstly, defining X as an X coordinate of an intersection point, and Y as a Y coordinate of the intersection point, wherein one scanning line is intersected with the outline, and all the intersection points generated by the scanning line have the same Y value;
when the operation times are even, two unused intersection points with the minimum subscript in the intersection result cache of one scanning line are extracted and stored in a cache container of the current snake-shaped track, and then the two points are marked as used;
when the operation times are odd, along the increasing direction of Y, if the intersection point of the next scanning line exists, two intersection points which have the smallest subscript and are not used in the intersection result cache of one scanning line are extracted and stored in a cache container of the current snake-shaped track, and then the two points are marked as used; if the next scanning line does not exist, the serpentine line is considered to be terminated, the intersection point of the scanning lines is traversed along the increasing direction of Y, and two unused points with the minimum Y and the minimum X are searched as the starting points of the next serpentine line;
all scan line intersections in a layer are traversed until all serpentine paths for that layer are obtained.
And (2.3) gradually increasing the Z coordinate direction, traversing the intersection points of the scanning lines of all the layers and obtaining the serpentine line tracks of all the layers.
If the distance between a certain two points in the snake-shaped continuous filling track is smaller than the set length, judging that the part of the filling track is a short side; if the short side is longer than the scanning line interval of multiple times, immediately cutting off the continuous snake-shaped filling line, jumping out the cycle and searching new unused intercept points again until all the intercept points are traversed to obtain all the snake-shaped filling lines; the short edge refers to the transition trajectory between two fill lines when switching scan lines.
The invention has the following beneficial effects and advantages:
1. the invention establishes the triangle index of the starting point, the edge and the face based on the searching of the adjacent edge table. The known triangle index table can traverse indexes of three adjacent triangles, indexes of three edges and indexes of three points; knowing the edge index table, it is possible to traverse to both the adjacent triangle indices, and the indices of both points.
2. Meanwhile, the invention carries out compensation processing on special conditions of data scatter and provides a simple compensation method with low model precision loss. The invention also provides a high-transmittance filling method specially suitable for 3D printing of biological materials and a track G code generation method, thereby greatly improving the application value of biomedicine.
Drawings
FIG. 1 is a class diagram of the present invention;
FIG. 2 is a flow chart of a process for rotating a point about an axis V by an angle A;
FIG. 3 is a serpentine method flow diagram.
FIG. 4a is a schematic illustration of an improper transition line for a trace.
FIG. 4b is a schematic illustration of a method of resolving an improper transition line.
Detailed Description
The present invention will be described in further detail with reference to examples.
A model layering and track filling method suitable for 3D printing of biological materials is suitable for high-molecular biological materials such as gelatin, collagen and the like. The method comprises the steps of data topology reconstruction of a model, a slicing algorithm, a filling algorithm and a machine language G code generation algorithm.
The data topology reconstruction algorithm is based on strict adjacency relation of points, edges and triangles. The data topology reconstruction algorithm provides a model fault tolerance method for providing robustness of a program. The data topology reconstruction algorithm provides a redundancy removal method for simplifying the calculation amount.
The slicing algorithm is based on data provided by a data topology reconstruction algorithm and performs equal-height slicing on the z-height. The slicing algorithm is compensated with data preprocessing.
The filling algorithm comprises a serpentine track filling method. The method for solving the improper transition line by the filling algorithm is to judge that the angle between the short side and the filling line is not less than 45 degrees when the short side of the serpentine line is judged, namely the length of the short side is not longer than 1.414 times of the distance between scanning lines. The rotation method of the filling algorithm is to sequentially perform quaternion rotation processing on all points of a certain layer.
And a machine language G code generation algorithm, wherein the movement speed of the machine is changed according to the movement distance.
The program structure of the method is realized by four classes and the corresponding method.
The method is a program realized by C + +, and the class structure diagram of the method is shown in figure 1.
STL data topology reconstruction (CTRiangulate class implementation)
Firstly, reading an stl file into a file, and extracting scattered point data of a text type by searching and reading a vertex character string; and if the text type reading fails, reading the scattered point data according to the data storage position of the binary stl file. The method for judging whether the text file is read successfully is to judge whether the length of the scattered point data cache is 0, and if the length of the scattered point data cache is 0, the method fails. And (3) establishing three index data structures for stl data according to a geometric logic structure: point, edge, triangle;
three data structure requirements:
1. the known triangle index table can traverse indexes of three adjacent triangles, indexes of three edges and indexes of three points;
2. knowing the edge index table, two adjacent triangle indexes and indexes of two points can be traversed; the three data structures are in the form of:
scatter data structure XYZ: three float type members x, y, z represent the three scatter coordinates of the triangle. Contains an int-type member index representing the triangle index value.
EDGE data structure EDGE: the int-type member array, xyIndex [2], containing two elements represents three scatter indices of the edge. The int type member array faceIndex [2] containing two elements represents the two edge indices of the edge. Contains an int-type member index representing the edge index value.
TRIANGLE data structure TRIANGLE: the int-type member array containing three elements, xyzIndex [3], represents the three scatter indices of the triangle. The int type member array LineIndex [3], which contains three elements, represents the three-edge index of the triangle. The int type member array faceIndex [3], which contains three elements, represents the three contiguous triangle indices of the triangle. Contains an int-type member index representing the triangle index value.
One process of data topology reconstruction is:
the method comprises the steps of sequentially reading three scatter coordinates of a triangle to three XYZ type variables P [3], storing a scatter P [ i ] into a set container SetTri before storing the scatter P [ i ] into a vector container VecTri, judging whether the same element exists in the SetTri through a find function, only indexing the position in the container, setting P [ i ] index as an index mark of a find function return iter pointing to the element, if the P [ i ] is a new point, adding the P [ i ] index into a container tail and giving a new index number, and enabling the P [ i ] index = SetTri. Three scatters are stored in sequence in an xyz [ i ] of TRIANGLE v [ j ] of the TRIANGLE type. Each time a new triangle is read, the index v [ j ]. Index of the triangle is assigned to j.
Sequentially extracting a pair of scatter points from the read three scatter points according to the clockwise sequence, storing the smaller of the two scatter points into a scatter point index L [ k ]. Xyindex [0] of an Edge type Edge L [ k ], storing the larger of the two scatter points into an L [ k ]. Xyindex [1], and assigning the faceindex [0] of the three edges to be a triangle v [ j ]. Index;
circularly storing the L [ k ] to a set type container SetEdge, judging whether the edge exists in the SetEdge through a find function, and assigning the L [ k ]. Faceindex [1] as faceindex [0] of a find return iterator pointing element;
and assigning the three edges L [ k ] to TRIANGLE data v [ j ] of the TRIANGLE type in a clockwise sequence. And finally, storing the edges in the SetEdge container into a vector container VecEdge for waiting use.
And generating an adjacent triangle index of the triangle according to the three edges of the triangle and the adjacent relation of the edges, and finally generating an index dictionary table of the vertex, the edge and the triangle.
Wherein i represents the scatter point cache array subscript, k represents the edge cache array subscript, and j represents the triangle cache array subscript.
The topology reconstruction algorithm in the invention provides a model fault tolerance method. Due to the imprecise generation of the stl file, it is likely that the model file is not closed, i.e., no adjacent triangle exists on a certain edge of a certain triangle. The invention achieves the purpose of fault tolerance by modifying the boundary condition of the redundancy removing algorithm. The boundary condition of fault tolerance is that in the process of redundancy removal, if the straight line distance between any two points is calculated to be smaller than an adjustable fixed value, such as 0.001mm, the two points are considered to be the same point. The specific method is to reload the smaller than symbol of the set container. The description of the heavy load is less than the number: firstly, defining the existing scatter point P1 and the scatter point P2 to be judged in a set container: a given value tolerance (which may be equal to 0.0001) is defined. Then, calculating:
if P1.Z < (P2. Z-tolerance), returning true;
if P1.Z > (P2. Z + tolerance), return false;
if P1.y < (P2.y-tolerance), returning to true;
if P1.y > (P2.y + tolerance), returning false;
if P1.X < (P2. X-tolerance), returning to true;
if P1.X > (P2. X + tolerance), returning false;
otherwise, false is returned.
STEP2 slicing algorithm (CAllCoutour type realization)
And according to the geometric topological relation generated in the first step, obtaining the topological relation with an ordered stl file data structure. According to the topological relation, the adjacent connection relations between the starting points and the points, between the edges and between the surface patches can be conveniently established. Successive slice trajectory data may then be obtained according to some method.
The method comprises the following steps of sequentially intersecting according to the height increment in the Z direction:
take a one-height single slice algorithm as an example (cenecoutour-like implementation):
1. declare a pool array, indicating that all edges have not been cut;
2. assuming that the height of the current tangent plane is zValue, finding an edge which is intersected with the current tangent plane, intersecting and marking the edge which is intersected with the current tangent plane; the intersecting edge is denoted LINE, the method for judging whether the intersecting is performed is two scatter points Pt1 and Pt2 with judgment indexes LINE. Xyindex [0] and LINE. Xyindex [1], if the z value of the LINE satisfies pt1.Z < zValue < pt2. Or pt1.Z > zValue > Pt2, the edge is considered to intersect with the tangent plane, and the intersection point is the geometric intersection point of the straight LINE belonging to the two points of the edge and the plane.
Some scatter in the STL model may exist that are highly consistent with the slice height, which is usually ignored by the algorithm, however, this may result in some geometric features being sacrificed by the model. The invention is used for uniformly preprocessing scattered points of stl files. The preprocessing is a numerical compensation method, namely, a fixed height (the height is less than half of the layer height) is uniformly added to a scattered point with a certain layer height of the slice.
3. By establishing the geometric topological relation of edges, angles and triangles, contained vertexes and two adjacent triangular patches can be quickly found according to one edge through the predictable time complexity O (n); quickly finding out contained edges and all adjacent triangles of the contained edges according to a triangular patch; traversing 5 non-self edges of all 2 adjacent triangles of the edge by topological relation, selecting a first effective edge as a next edge according to a fixed sequence (such as clockwise), and repeating the steps until a closed contour curve is obtained. The non-hex edge refers to the remaining five edges of the two adjacent triangles for a certain in-use edge Lc excluding Lc. The judgment basis of the effective edge is that the effective edge is not operated and meets the intersection condition;
4. because some structures have cavities, whether unused edges exist needs to be judged until all the edges of the layer are completely submitted;
the slicing algorithm for a model, i.e. using the four steps described above, progressively increases the height z until one or more continuous closed contours are obtained for each layer;
step3 filling algorithm (CPointPath type implementation)
Defining:
1. filling a line: the closed line segments are generated by connecting points generated after the contour is cut along the same scanning line in pairs.
2. Short side: refers to the transition between two fill lines when switching scan lines.
The filling process is as follows:
1. the scanning intersection of each layer is ensured that the intercept points of each scanning line and the outline are even numbers. The method adopts a pretreatment method. The method of the preprocessing method is that all the contour points of the layer which are collinear with the scanning line are uniformly translated by a fixed distance. (this distance is less than half the scan line pitch).
The scanning process of the first layer is that an xyz coordinate system is selected, the x direction or the y direction is selected as a scanning starting direction, a straight LINE SCAN _ LINE parallel to the scanning starting direction is defined, then the scanning LINE SCAN _ LINE is translated according to a fixed scanning LINE interval gap (technological parameters can be selected to be 0.16 mm), the intersection point of the SCAN _ LINE and the contour LINE of the scanning layer is calculated once per translation, and the contour intersection point obtained by each scanning LINE is stored from small to large according to the x value of the coordinate.
Meanwhile, the biological material, especially the biological scaffold, is required to have certain pores, and the pores are permeable. This is because the pore structure directly affects the growth of cells and the diffusion rate of growth factors. The filled traces thus require tight alignment between layers, which can result in complete porosity. In this case, it is necessary to perform alignment processing on the scan intersection result of each layer. The algorithm of the alignment process is to approximate each scan line result to an integer multiple of the scan line interval.
The intersection may be at any angle. The method of achieving arbitrary angle filling is to perform a rotation operation for all contour points of each layer. The rotating operation method is to improve the speed of rotating the lattice by a quaternion method.
The process of rotating a scatter point w = (wx, wy, wz) around an axis V by an angle a is shown in fig. 2.
2. One or more fill lines for each layer are obtained using a serpentine lookup algorithm. The algorithm is specifically described as follows: firstly, selecting a layer height z, obtaining all points after scanning intersection processing according to the layer, and determining the translation direction of a scanning line, wherein the scanning direction in the previous part is assumed to be fixed in the y direction.
The preservation of the snakelike locus is divided into two operations according to the extraction sequence:
first, X is defined as the X coordinate of the intersection point, and Y is defined as the Y coordinate of the intersection point. Then one scan line intersects the profile and all intersections produced by that scan line have the same Y value.
When the operation times are even, two intersection points which have the smallest subscript and are not used in the intersection result cache of one scanning line are extracted and stored in a cache container of the current snake-shaped track, and then the two points are marked as used.
When the operation times are odd, along the increasing direction of Y, if the intersection point of the next scanning line exists, two intersection points which have the smallest subscript and are not used in the intersection result cache of one scanning line are extracted and stored in the cache container of the current snake-shaped track, and then the two points are marked as used. If the next scanning line does not exist, the serpentine line is considered to be terminated, the intersection points of the scanning lines are traversed along the increasing direction of Y, and two unused points with the minimum Y and the minimum X are searched as the starting points of the next serpentine line.
All scan line intersections in a layer are traversed until all serpentine paths for that layer are obtained.
And the Z coordinate direction is increased progressively, and the intersection points of the scanning lines of all the layers are traversed to obtain the snake-shaped line tracks of all the layers.
The serpentine approach is illustrated in fig. 3.
Because the model structure may have a cavity, truncation inevitably occurs in the process of filling at equal intervals according to the sequence of the scanning lines, and a plurality of serpentine lines are obtained; also due to the presence of the chamber, there may be an inappropriate transition line of the trajectory, as shown in fig. 4 a. The method of resolving the improper transition line is shown in fig. 4 b. When the short side of the serpentine line is judged, the angle between the short side and the filling line is judged to be not less than 45 degrees, namely the length of the short side is not longer than 1.414 times of gap. And if the short edge is longer than 1.414 times of the distance between the scanning lines, immediately cutting off the continuous snakelike filling line, jumping out the loop and searching new unused intercept points again until all the intercept points are traversed to obtain all the snakelike filling lines.
Notation gap: distance between scanning lines
Step4 machine language G code generating algorithm (CGcode class)
Sequentially fetching a continuous filling line cache, and converting two continuous points P1 and P2 in the cache into a G1 point positioning instruction, wherein the G1 instruction is in the form of: f%.4f G1X%.4F Y%.4F Z%.4F E%.4F.
F represents the motion speed, G1 represents the linear interpolation operation of a standard G code, and X, Y and Z respectively represent the target position of the three-dimensional coordinate of the motion. E represents the material feed.
Due to the presence of the short edges in the filling algorithm, the short edges should not move too slowly, which is experienced in a large number of experiments and leads to material accumulation. The movement speed F thus varies according to the movement distance dis in the following specific manner:
f = vs (if dis is greater than 1.414 × gap)
F = a vs (if dis is less than or equal to 1.414 gap)
Wherein vs is a preset speed, and the speed is set by the speed setting unit,
where a is empirical data greater than 1.
The formula for calculating the distance between two points is as follows:
dis=sqrt((P1.x-P2.x)*(P1.x-P2.x)+(P1.y-P2.y)*(P1.y-P2.y))
for different track joining modes: firstly, the z direction is lifted by 1cm, and then the movement is directly carried out to the initial point of the next track.
P1.X and p2.X are x coordinates of two points, respectively, and p1.Y and p2.Y are y coordinates of two points, respectively.

Claims (7)

1. A model layering and track filling method suitable for 3D printing of biological materials is characterized by comprising the following steps:
1) And (3) establishing three index data structures for stl data according to a geometric logic structure: point, edge, triangle;
2) Establishing adjacent relations among points, edges and surface patches according to the topological relation of the index data structure to obtain continuous slicing track data;
3) Filling the slicing track;
the step 3) is specifically as follows:
(1) Intersection points are obtained at equal intervals for each layer of contour line in one direction, namely the Y direction, and the even number of the intersection points of each scanning line and the contour is ensured;
(2) Obtaining one or more filling lines of each layer by using a snake-shaped searching algorithm; the method specifically comprises the following steps:
(2.1) firstly, selecting a layer height z, obtaining all scanning intersection points according to the layer, determining the translation direction of a scanning line, and fixing the scanning direction in the step (1) as the y direction;
(2.2) preserving the serpentine trajectory is as follows:
firstly, defining X as an X coordinate of an intersection point, and Y as a Y coordinate of the intersection point, wherein one scanning line is intersected with the outline, and all the intersection points generated by the scanning line have the same Y value;
when the operation times are even, two unused intersection points with the minimum subscript in the intersection result cache of one scanning line are extracted and stored in a cache container of the current snake-shaped track, and then the two points are marked as used;
when the operation times are odd, along the increasing direction of Y, if the intersection point of the next scanning line exists, two intersection points which have the smallest subscript and are not used in the intersection result cache of one scanning line are extracted and stored in a cache container of the current snake-shaped track, and then the two points are marked as used; if the next scanning line does not exist, the serpentine line is considered to be terminated, the intersection point of the scanning lines is traversed along the increasing direction of Y, and two unused points with the minimum Y and the minimum X are searched to serve as the starting points of the next serpentine line;
traversing all the scanning line intersections in one layer until all the serpentine line tracks of the layer are obtained;
and (2.3) increasing the Z coordinate direction progressively, traversing the intersection points of the scanning lines of all the layers and obtaining the serpentine tracks of all the layers.
2. The model layering and trajectory filling method suitable for 3D printing of biological materials according to claim 1, wherein the step 1) comprises:
performing data preprocessing on the read stl scattered point data by using a redundancy removing algorithm;
sequentially extracting a pair of scatter points from the read three scatter points according to the clockwise sequence, storing the smaller of the two scatter points into a scatter point index L [ k ]. Xyindex [0] of an Edge type Edge L [ k ], storing the larger of the two scatter points into an L [ k ]. Xyindex [1], and assigning the faceindex [0] of the three edges to be a triangle v [ j ]. Index; k represents an edge cache array index;
circularly storing the L [ k ] to a set type container SetEdge, judging whether the edge exists in the SetEdge through a find function, and assigning the L [ k ]. Faceindex [1] as faceindex [0] of a find return iterator pointing element;
assigning three edges L [ k ] to three adjacent edge indexes v [ j ] of a TRIANGLE data structure v [ j ] of a TRIANGLE type according to a clockwise sequence; finally, storing the edges in the SetEdge container into a vector container VecEdge for waiting use; i represents a scatter cache array subscript; j represents a triangle cache array index;
and generating an adjacent triangle index of the triangle according to the three edges of the triangle and the adjacent relation of the edges, and finally generating an index dictionary table of the vertex, the edge and the triangle.
3. The model layering and trajectory filling method suitable for 3D printing of biological materials according to claim 2, wherein the data preprocessing by the redundancy elimination algorithm specifically comprises:
sequentially reading three scatter point coordinates of a triangle to three XYZ type variables P [3], storing a scatter point P [ i ] into a set container SetTri before storing the scatter point P [ i ] into a vector container VecTri, judging that the same element exists in the SetTri through a find function, setting the position P [ i ] index in the index container as an index mark of the element pointed by an iterator returned by the find function, if the P [ i ] is a new point, inserting the tail of the VecTri container and giving a new index number, and setting P [ i ] index = SetTri. Sequentially storing the three scattered points into an xyz [ i ] of a TRIANGLE v [ j ] of a TRIANGLE type; when a new triangle is read, assigning the index v [ j ] of the triangle to be j, and then increasing j by one; j represents a triangle cache array index.
4. The model layering and trajectory filling method suitable for 3D printing of biological materials according to claim 2, characterized in that the boundary conditions of the de-redundancy algorithm are modified: if the straight-line distance between any two points is calculated to be less than a fixed value, the two points are considered to be the same point.
5. The model layering and trajectory filling method suitable for 3D printing of biological materials according to claim 1, wherein the three index data structures are in the form of:
scatter data structure XYZ: the method comprises the steps that three float type members x, y and z represent three scatter point coordinates of a triangle, and an int type member index represents a triangle index value;
EDGE data structure EDGE: the method comprises the steps that an int type member array xyIndex [2] containing two elements represents three scattered point indexes of an edge, and an int type member array faceIndex [2] containing two elements represents two edge indexes of the edge, contains an int type member index and represents an edge index value;
TRIANGLE data structure TRIANGLE: the int type member array containing three elements, xyz index [3], represents three scatter indexes of a triangle; int type member array LineIndex [3] containing three elements represents three-edge index of triangle; int type member array faceIndex [3] containing three elements represents three adjacent triangle indexes of the triangle; contains an int-type member index representing the triangle index value.
6. The method as claimed in claim 1, wherein in step 2), when the height of a certain scatter in the index data structure is equal to the slice height of the layer, the height of the scatter is uniformly increased by a fixed height, and the height is less than half of the slice height.
7. The model layering and track filling method suitable for 3D printing of biological materials according to claim 1, wherein if the distance between a certain two points in the snake-shaped continuous filling track is less than a set length, the part of the filling track is judged to be a short edge; if the short edge is longer than the scanning line interval of a plurality of times, immediately cutting off the continuous snake-shaped filling line, jumping out the current cycle and searching new unused intercept points again until all the intercept points are traversed to obtain all the snake-shaped filling lines; the short edge refers to the transition trajectory between two fill lines when switching scan lines.
CN201711344975.6A 2017-12-15 2017-12-15 Model layering and track filling method suitable for 3D printing of biological material Active CN109934923B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711344975.6A CN109934923B (en) 2017-12-15 2017-12-15 Model layering and track filling method suitable for 3D printing of biological material

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711344975.6A CN109934923B (en) 2017-12-15 2017-12-15 Model layering and track filling method suitable for 3D printing of biological material

Publications (2)

Publication Number Publication Date
CN109934923A CN109934923A (en) 2019-06-25
CN109934923B true CN109934923B (en) 2022-10-11

Family

ID=66979338

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711344975.6A Active CN109934923B (en) 2017-12-15 2017-12-15 Model layering and track filling method suitable for 3D printing of biological material

Country Status (1)

Country Link
CN (1) CN109934923B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110544255B (en) * 2019-07-26 2020-05-19 山东大学 Method and system for segmenting triangular mesh holes for 3D printing
CN112846232B (en) * 2020-12-31 2023-03-03 南京英尼格玛工业自动化技术有限公司 Multi-layer and multi-channel arc additive automatic trajectory planning method and system for metal structure
AT525686A1 (en) * 2021-12-09 2023-06-15 Mehmet Bugra Akin Process for the additive manufacturing of a workpiece
CN114693869B (en) * 2022-03-08 2024-06-25 北京航空航天大学 3D printing entity model generation method based on half-side data structure
CN115157655A (en) * 2022-07-04 2022-10-11 上海酷鹰机器人科技有限公司 Design method of 3D printing overall scheme of large-size special-shaped curved surface sample

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004102834A (en) * 2002-09-11 2004-04-02 Ricoh Co Ltd Structure of triangular mesh data, method of compressing and expanding triangular mesh data, program, recording medium, and system
CN103838907A (en) * 2013-09-13 2014-06-04 上海大学 Curved surface cutting trajectory obtaining method based on STL model
CN104331555A (en) * 2014-10-31 2015-02-04 河海大学常州校区 Slicing processing method aiming at non-closed STL model with boundaries

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004102834A (en) * 2002-09-11 2004-04-02 Ricoh Co Ltd Structure of triangular mesh data, method of compressing and expanding triangular mesh data, program, recording medium, and system
CN103838907A (en) * 2013-09-13 2014-06-04 上海大学 Curved surface cutting trajectory obtaining method based on STL model
CN104331555A (en) * 2014-10-31 2015-02-04 河海大学常州校区 Slicing processing method aiming at non-closed STL model with boundaries

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
3D打印中一种快速分层处理算法的研究;刘大伟等;《组合机床与自动化加工技术》;20170920(第09期);全文 *
STL文件拓扑关系的建立与新型三角片搜索算法研究;石振凌等;《新技术新工艺》;20060725(第07期);全文 *

Also Published As

Publication number Publication date
CN109934923A (en) 2019-06-25

Similar Documents

Publication Publication Date Title
CN109934923B (en) Model layering and track filling method suitable for 3D printing of biological material
Zhang et al. An improved slicing algorithm with efficient contour construction using STL files
US10723079B2 (en) Fast, efficient direct slicing method for lattice structures
CN107464223B (en) Point cloud hole repairing method based on slices
CN102682103A (en) Three-dimensional space index method aiming at massive laser radar point cloud models
CN110956699B (en) GPU (graphics processing unit) parallel slicing method for triangular mesh model
US20150294500A1 (en) Hybrid Dynamic Tree Data Structure and Accessibility Mapping for Computer Numerical Controlled Machining Path Planning
CN109325316B (en) STL model efficient parallel layer cutting method based on concurrent welding sequencing
CN110033519A (en) Three-dimensional modeling method, device, system and storage medium based on Implicitly function
EP2590144A1 (en) Designing a modeled volume represented by dexels
CN108389263A (en) The IGES surface grids rapid generations calculated are solved towards Element BEM
Liu et al. A new insertion sequence for incremental Delaunay triangulation
CN105785919B (en) Point five axis of cloud is without global interference generating tool axis vector feasible zone computational methods
Brown et al. Development of a stereolithography (STL) input and computer numerical control (CNC) output algorithm for an entry-level 3-D printer
CN115564925B (en) Grid generation method based on B-rep model and Cartesian grid slice
CN114556437A (en) Method of generating a grid of parts, method of using a grid of parts, computer program and computer readable medium
CN108280292B (en) BIM technology-based single-side wall pit guiding method for tunnel excavation
CN107251099A (en) The cell of N-dimensional object is indexed
CN108338848B (en) Stripping type laser tooth preparation method, apparatus, equipment and medium
CN104345686B (en) The two-way dexel blank modeling method of two dimension and machining simulation method thereof
Zhang et al. Machining Simulation Application Based on Improved Marching Cubes Algorithm
CN108170988B (en) Three-step seven-step method for tunnel excavation based on BIM technology
CN114834043B (en) Laser three-dimensional processing model slice data processing method
CN110868325B (en) Uniform grid division method capable of reducing rigidity matrix construction difficulty
CN110282073A (en) Ship hydrodynamics prediction technique and system based on hull Wet surface grid in wave

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant