def parse_facet(facet_int):
    """Convert an integer representing a facet into a tuple of its elements.

    Polyhedron facets in the MCNP input are represented as integers. Each digit
    represents the index of a vertex. For instance, the integer 1256
    represents the facet bounded by vertices 1, 2, 5 and 6.

    This function converts the integer representation into a tuple of indices,
    which is more convenient to work with. For example:

    >>> parse_facet(1256)
    (0, 1, 4, 5)

    Note that the resulting indices are zero-based, which is more suitable for
    Python.

    Zeros are ignored:

    >>> parse_facet(5230)
    (4, 1, 2)
    >>> parse_facet(7024)
    (6, 1, 3)

    :param int facet_int: the integer representing the facets
    :returns: a tuple of indices
    :rtype: tuple(int)
    """
    indices = []
    while facet_int != 0:
        facet_int, digit = divmod(facet_int, 10)
        facet_int, digit = int(facet_int), int(digit)
        if digit != 0:
            indices.append(digit - 1)
    return tuple(reversed(indices))
