export_ply function