  Purpose: The class of models that can be represented by STL files is larger
than the class of models that can be printed using additive manufacturing
technologies. Stated differently, there exist well-formed STL files that cannot
be printed. In this paper such a gap is formalized and a fully automatic
procedure is described to turn any such file into a printable model.
  Approach: Based on well-established concepts from combinatorial topology, we
provide an unambiguous description of all the mathematical entities involved in
the modeling-printing pipeline. Specifically, we formally define the conditions
that an STL file must satisfy to be printable and, based on these, we design an
as-exact-as-possible repairing algorithm.
  Findings: We have found that, in order to cope with all the possible triangle
configurations, the algorithm must distinguish between triangles that bound
solid parts and triangles that constitute zero-thickness sheets. Only the
former set can be fixed without distortion.
  Originality: Previous methods that are guaranteed to fix all the possible
configurations provide only approximate solutions with an unnecessary
distortion. Conversely, our procedure is as exact as possible, meaning that no
visible distortion is introduced unless it is strictly imposed by limitations
of the printing device. Thanks to such an unprecedented flexibility and
accuracy, this algorithm is expected to significantly simplify the
modeling-printing process, in particular within the continuously emerging
non-professional "maker" communities.
