**2. Unidirection slicing**

Unidirection slicing algorithm slices the STL model into a variety of 2.5D layers parallel to the build direction. **Figure 2a** shows an STL model and various cutting planes for unidirection slicing; and **Figure 2b** shows the resulting slicing layers which are polygons.

**Figure 2.** (a) STL model with slicing layers in unidirection; (b) Resulting layer boundary polygons.

Uniform slicing method slices CAD model with a constant thickness. The accuracy of the additively manufactured parts could be controlled by altering the layer thickness. The smaller the layer thickness, the higher the accuracy will be obtained. Also, the deposition rate or productivity is highly relevant to the sliced layer thickness. Adaptive slicing approach slices a model with a variable thickness. Based on the surface geometry of the model, this approach adjusts automatically the layer thickness to improve the accuracy or to improve the build time.

With the increasing size of the STL file, a major challenge of slicing algorithms is the computing efficiency. An efficient and fault-tolerant slicing algorithm was proposed by Choi et al. [2]. The detailed slicing algorithm is presented as follows.

**Figure 3** shows the flowchart of the tolerant slicing algorithm [2]. Two stages are included, namely, preprocessing stage regarding the optimum orientation of the part, and slicing stage generating slices from STL model. The orientation of the STL model is usually user defined or obtained with respect to the optimal build time, the surface quality, support structures required, or other criteria. Algorithms regarding the orientation of CAD models are beyond the scope of this chapter.

**Figure 3.** Flowchart of the tolerance slicing algorithm [2].

triangular facets, which is described by the x-, y-, and z-coordinates of the three vertices and a unit vector to indicate the normal direction that point outside of the facet [1]. Redundant informationforindicatingmodelname,facetnormal,andvertexisalsoincluded.Inthefollowing

Unidirection slicing algorithm slices the STL model into a variety of 2.5D layers parallel to the build direction. **Figure 2a** shows an STL model and various cutting planes for unidirection

slicing; and **Figure 2b** shows the resulting slicing layers which are polygons.

**Figure 2.** (a) STL model with slicing layers in unidirection; (b) Resulting layer boundary polygons.

Uniform slicing method slices CAD model with a constant thickness. The accuracy of the additively manufactured parts could be controlled by altering the layer thickness. The smaller the layer thickness, the higher the accuracy will be obtained. Also, the deposition rate or productivity is highly relevant to the sliced layer thickness. Adaptive slicing approach slices

sections, unidirection slicing and multidirection slicing of STL models are described.

**Figure 1.** Example of an STL file format and its model.

**2. Unidirection slicing**

4 New Trends in 3D Printing

For each layer construction in slicing, the method scans the STL file to extract one facet at a time sequentially and compares the z-coordinates of its three vertices to the z-height of the slicing (cutting) plane. Through setting a small value bound tolerance, the possibilities of intersection of a facet with a cutting plane can be divided into the following four classes, as shown in **Figure 4** [2]. Four classes could be found as following.

**Figure 4.** Possible cases of facet-plane slicing [2].

Class 1 is shown in case 1 in **Figure 4**, where a facet intersects with the cutting plane without one vertex lies on the plane. Two intersecting points are calculated by the intersection of the plane and the triangular facet in this case. A line segment is generated by connecting the intersection points and stored for constructing the slice layer contour [2].

Class 2 is shown in case 2 in **Figure 4**, where one vertex lies in the cutting plane while the two remaining vertices lie in different sides of the cutting plane. Case 3 and case 4 also show that one vertex lies in the cutting plane while other vertices lie in the same side of the cutting plane. In this case, there will be no intersection line segments calculated [2].

Class 3 is shown in case 5 and case 6 in **Figure 4**, where two vertices of the facet lie in the cutting plane. The remaining vertex can be either above or below the cutting plane. This is a concurrent case in a valid STL model that results in one duplicated line segment and either one should be ignored [2].

Class 4 is shown in case 7 in **Figure 4**, where all three vertices lie in the cutting plane. In this case, the whole triangular facet lies in the cutting plane and will not contribute any line segments to the contour of the slice layer. Therefore, this case can be directly ignored without any ambiguity [2].

After all the possible intersection line segments have been calculated and stored, the contour of the slice layer is constructed through head-to-tail connecting of the line segments.

The algorithm has been implemented in MATLAB program. The slicing algorithm was able to slice complex STL models with good performance. Three case studies are provided as shown in **Figure 5**–**7**. The number of facets of three models is provided in **Table 1**. The algorithm is verified to be efficient with the computing time less than half second for all cases.

**Figure 5.** Case I. (a) An engineering STL model; (b) Resulting slices.

intersection of a facet with a cutting plane can be divided into the following four classes, as

Class 1 is shown in case 1 in **Figure 4**, where a facet intersects with the cutting plane without one vertex lies on the plane. Two intersecting points are calculated by the intersection of the plane and the triangular facet in this case. A line segment is generated by connecting the

Class 2 is shown in case 2 in **Figure 4**, where one vertex lies in the cutting plane while the two remaining vertices lie in different sides of the cutting plane. Case 3 and case 4 also show that

intersection points and stored for constructing the slice layer contour [2].

shown in **Figure 4** [2]. Four classes could be found as following.

6 New Trends in 3D Printing

**Figure 4.** Possible cases of facet-plane slicing [2].

**Figure 6.** Case II. (a) A Great Wall STL model; (b) Resulting slices.

**Figure 7.** Case III. (a) A Triceratops STL model; (b) Resulting slices.


**Table 1.** The computing time of the program.
