def uv_to_xyz(x_2d, u_axis, v_axis):
    """Map 2D coordinates in (u,v) coordinate system into 3D space.

    Parameters:
        x_2d: ndarray, shape (...,2)
            Coordinates in 2D to map.
        u_axis: array, shape (3,)
        v_axis: array, shape (3,)
            Unit-norm vectors defining the 2D U-V plane.
            Vectors are orthogonal.

    Returns:
        x_3d: ndarray, shape (...,3)
    """

    return x_2d[...,[0]] * u_axis + x_2d[...,[1]] * v_axis