'Finds, if possible, a triangle and an edge in the fringe to
which the triangle could be attached.  Returns the tuple
containing the triangle and the index of the corresponding
edge in the fringe.
This function relies on the fact that objects are unique in
the diagram.'

@staticmethod
def _find_triangle_to_weld(triangles, fringe, grid):

    for triangle in triangles:
        for (a, b) in fringe:
            if (frozenset([grid[a], grid[b]]) in triangle):
                return (triangle, (a, b))
    return None
