def _DegreeDict(tris):
    """Return a dictionary mapping vertices in tris to the number of triangles
    that they are touch."""

    ans = dict()
    for t in tris:
        for v in t:
            if v in ans:
                ans[v] = ans[v] + 1
            else:
                ans[v] = 1
    return ans