Add convenience overloads for 3MF writing

This commit is contained in:
Mael Rouxel-Labbé 2020-05-29 12:03:40 +02:00
parent 71413eb8e8
commit da60d28624
1 changed files with 23 additions and 1 deletions

View File

@ -471,7 +471,29 @@ bool write_triangle_soups_to_3mf(const std::string& fname,
IO::write_mesh_to_model(all_points[id], all_polygons[id], colors, name, &pMeshObject, pModel);
}
return IO::export_model_to_file(file_name, pModel);
return IO::export_model_to_file(fname, pModel);
}
// convenience
template<typename PointRanges, typename PolygonRanges>
bool write_triangle_soup_to_3mf(const std::string& fname,
const PointRange& points,
const PolygonRange& polygons,
const std::string& name)
{
std::vector<PointRange> all_points(1, points);
std::vector<PointRange> all_polygons(1, polygons);
std::vector<std::string> names(1, name);
return write_triangle_soups_to_3mf(fname, all_points, all_polygons, names);
}
template<typename PointRanges, typename PolygonRanges>
bool write_3MF(const std::string& fname,
const PointRange& points,
const PolygonRange& polygons)
{
return write_triangle_soup_to_3mf(fname, points, polygons, "anonymous");
}
} // namespace CGAL