Problems with STL Files
Although the STL format is quite simple, there may still be errors in the files resulting from the conversion to CAD. Typical problems that may occur in bad STL files are as follows:
Unit changing: This is not strictly the result of a bad STL file. Since US machines still use imperial measurements and most of the rest of the world uses metric, some files may appear scaled because there is no explicit reference to the units used in the STL format. If the person constructing the model is unaware of the purpose of the part, they may construct it approximately 25 times too large or too small in one direction. In addition, the units must correspond to the position of the origin of the system to be used. This typically means that the physical origin of the system is in the bottom left-hand corner, so that all triangle coordinates inside the STL file must be positive. However, this may not be the case for a particular part of the CAD system and therefore some adjustment of the STL file may be required.
Vertex-to-vertex rule: Each triangle must share two of its vertices with each triangle adjacent to it. This means that the vertex cannot intersect the other side, as shown in Figure 2.9. This is not something explicitly stated in the description of the STL file and therefore the generation of the STL file may not comply with this rule. However, a variety of tests can be carried out in the file to determine if this rule has been violated. For example, the number of faces of the proper solid identified using the STL must be the even number. In addition, the number of edges must be divisible by three and the equation must be followed:

Leaking STL files: As mentioned earlier, the STL files should describe fully enclosed surfaces that represent the solids generated by the originating CAD system. In other words, STL data files should build one or more multiple entities according to Euler’s solids rule.
No. of faces - No. of edges + No. of vertices = 2 x No. of bodies
If this rule does not hold, the STL file is said to leak and the file slices will not represent the actual model. There may be too few or too many vectors for a particular piece of paper. Slicing software may add additional vectors to close the outline, or it may just ignore additional vectors. Small defects may be ignored in this way. Large leaks may lead to unacceptable final models. Leaks can be created by facets that cross each other in 3D space as shown in Figure 2.10. This can result from poorly
FIGURE 2.9 A case that violates the vertex-to-vertex rule.
FIGURE 2.10 Two triangles intersecting each other in 3D space.
FIGURE 2.11 Two surface patches that do not match up with each other, resulting in holes.
generated CAD models, especially those that do not use Boolean operations to generate solids. A CAD model can also be created using a method that stitches surface patches together. If the triangular edges of the two surface patches do not suit each other, then the holes, like in Figure 2.11, may occur.
Degenerated facets: These facets are usually the result of a numerical truncation. The triangle may be so small that all three points are practically the same as each other.
After truncation, these points lay on top of each other, causing a triangle with no area. This can also occur when the truncated triangle does not return to any height and all three vertices of the triangle lie on a single straight line. While the resulting slicing algorithm will not cause incorrect slices, there may be some difficulty in checking algorithms and such triangles should actually be removed from the STL file. It is worth mentioning that while a few errors may occur in some STL files, most professional 3D CAD systems today produce high-quality, error-free results.
In the past, more common problems have arisen from surface modeling systems, which are now becoming scarcer, even in areas outside CAD engineering, such as computer graphics and 3D gaming software. Also, in earlier systems, STL generation was not properly tested and faults were not found in the CAD system. Potential problems are now well understood, and there are well-known algorithms for identifying and resolving these problems. However, the recent boom in home-use 3D printers has resulted in a wide range of software routines that are readily available but not thoroughly tested and may suffer from the problems mentioned in this chapter.