CGAL 5.6.1 - Polygon Mesh Processing

Functions

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())
 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. More...
 

Function Documentation

◆ read_polygon_mesh()

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
PolygonMesha model of MutableFaceGraph
NamedParametersa sequence of Named Parameters
Parameters
fnamethe name of the input file
gthe polygon mesh
npsequence 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()