def invert_line(line, point, eps=1e-4):
    """
    assumes point is on line = (p, v)
    returns t st `p + v * t = point`
    """

    if line[0] is None or line[1] is None:
        raise ValueError()

    div = np.array(point - line[0]) / np.array(line[1])
    div = div[~np.isnan(div)]
    return div.mean()

    assumes point is on line = (p, v)
    returns t st `p + v * t = point`
    
infinigen/assets/objects/creatures/util/join_smoothing.py