# Error Compensation by Input File Modification

An STL file format is a discrete representation of a CAD model which uses planar triangular facets to tessellate the surface of part. Due to this planar tessellation, the STL format does not retain the complete geometric information of a CAD model which leads to approximation errors. The higher the curvature of a design surface, the larger is the approximation error of the STL file.

Some novel methods developed at AMSL to reduce part error by Input File Modification are detailed here:

- Surface Based Modification Algorithm
- Vertex Translation Algorithm
- Steiner patch based file format for Additive Manufacturing processes
- Additive Manufacturing File Format using Bezier Patches
- Slice Contour Modification

Additive Manufacturing (AM) machines use the Stereo lithography (STL) file as standard input file format to build parts. STL model is a triangular faceted approximation of a CAD model which represents a part with less accuracy than the CAD model.

**Figure: Division of a STL Facet in SMA**

The Surface-based Modification Algorithm (SMA) can adaptively and locally increase the facet density of an STL model. SMA is an error minimization approach to modify the STL facets locally based on chordal error, cusp height and cylindricity error for cylindrical features.

Final results show a distinct improvement in the part error of the STL model using SMA when compared to the original STL file.

**Figure: Facetization in SMA**

This is a novel approach to reduce the CAD to STL translation error. This approach, referred to as Vertex Translation Algorithm (VTA), compares an STL facet to its corresponding CAD surface, computes the chordal error at multiple points on the STL surface, and translates the point with the maximum chordal error until it lies on the design surface.

This translation results in the reduction of the chordal error locally without unnecessarily increasing the size of the STL file. In addition, a facet isolation algorithm (FIA) has also been developed. This isolation algorithm extracts the STL facets corresponding to the surfaces and features of the part that have to be modified by the translation algorithm.

**Figure: STL File Modification using VTA**

The Steiner representation has been used to approximate the surfaces of two test parts and the chordal errors in the surfaces are calculated. The chordal errors in the Steiner format are compared with the STL and AMF formats of the test surfaces and the results have been presented.

Further, an error based adaptive tessellation algorithm is developed for generating the Steiner representation which reduces the number of curved facets while still improving the accuracy of the Steiner format.

The test parts are virtually manufactured using the adaptive Steiner, STL and AMF format representations and the GD&T errors of the manufactured parts are calculated and compared.

The results demonstrate that the modified Steiner format is able to significantly reduce the chordal and profile errors as compared to the STL and AMF formats.

**Figure: CAD part approximated by Steiner Patch and STL**

In this research, a methodology for developing a new file format using curved bi-quadratic Bezier patches which can approximate a CAD model with higher accuracy as compared to the STL file is proposed.

Two new Bezier based formats are developed in this research: the first format uses curved Bezier patches with linear edges and the second format uses curved Bezier patches with curved edges. In the first format named as the linear edge format, the patches are modeled such that the edges remain coincident with those of the original STL facets. In the second format called the curved edge format, the Bezier patch edges are modeled as quadratic Bezier curves.

**Figure: Bezier Patch File Format for AM**

This research attempts to minimize STL approximation error by modifying each 2D slice of the STL file such that the new modified slice satisfies a chordal error criteria.

First, the STL file is sliced at different levels. Using STL triangle chord points obtained after slicing, new points are found on the NURBS surface corresponding to the chord points and a new contour is generated. This new contour is formed by recursively modifying the original STL contour until the chordal error in each contour is below a specified threshold. This is performed for all slices and the part is then virtually manufactured using both the original and the modified contours.

**Figure: Slice Contour Modification**

Back to AMSL