def write_obj(filename, points=None, mesh=None):
    """
    Parameters
    ----------
    filename:   str
        The created file will be named with this
    points:     pd.DataFrame
    mesh:       pd.DataFrame

    Returns
    -------
    boolean
        True if no problems

    """
    if not filename.endswith('obj'):
        filename += '.obj'

    if points is not None:
        points = points.copy()
        points = points[["x", "y", "z"]]
        points.insert(loc=0, column="obj_v", value="v")
        points.to_csv(
            filename,
            sep=" ",
            index=False,
            header=False,
            mode='a',
            encoding='ascii')

    if mesh is not None:
        mesh = mesh.copy()
        mesh = mesh[["v1", "v2", "v3"]]
        mesh += 1  # index starts with 1 in obj file
        mesh.insert(loc=0, column="obj_f", value="f")
        mesh.to_csv(
            filename,
            sep=" ",
            index=False,
            header=False,
            mode='a',
            encoding='ascii')

    return True