If both triangles on an edge are coplanar, we can arbitrarily flip the interior edge to improve triangle quality. Similarly if one triangle on an edge is degenerate, we can flip the edge without affecting the shape to try to remove it. This code does one or more passes of such an optimization.