Functions to read and repair polygon soups and polygon meshes.
template<typename PolygonMesh, typename NamedParameters = parameters::Default_named_parameters>
| bool CGAL::Polygon_mesh_processing::IO::read_polygon_mesh |
( |
const std::string & | fname, |
|
|
PolygonMesh & | g, |
|
|
const NamedParameters & | np = parameters::default_values() ) |
#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>
reads the file as a polygon soup, repairs (using repair_polygon_soup()), and orients it (using orient_polygon_soup()) as to obtain a polygon mesh.
Supported file formats are the following:
The format is detected from the filename extension (letter case is not important).
If repairing and orientation are known to not be required, one can use CGAL::IO::read_polygon_mesh() directly.
- Template Parameters
-
- Parameters
-
| fname | the name of the input file |
| g | the polygon mesh |
| np | sequence of Named Parameters among the ones listed below |
- Optional Named Parameters
-
a property map associating points to the vertices of g
-
Type: a class model of WritablePropertyMap with boost::graph_traits<PolygonMesh>::vertex_descriptor as key type and Point_3 as value type
-
Default: boost::get(CGAL::vertex_point, g)
-
Extra: If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in PolygonMesh.
| |
| | |
-
whether extra information is printed when an incident occurs during reading
-
Type: Boolean
-
Default: false
| |
- Returns
- true if the reading, repairing, and orientation operations were successful, false otherwise.
- See also
- CGAL::IO::read_polygon_mesh()
- Examples
- PMP_Mesh_repair/hole_filling_example.cpp, PMP_Mesh_repair/hole_filling_example_SM.cpp, PMP_Mesh_repair/hole_filling_visitor_example.cpp, PMP_Mesh_repair/manifoldness_repair_example.cpp, PMP_Mesh_repair/orientation_pipeline_example.cpp, and PMP_Mesh_repair/stitch_borders_example.cpp.