CGAL 5.3 - Polygon Mesh Processing

Functions

template<typename PolygonMesh , typename NamedParameters >
bool CGAL::Polygon_mesh_processing::IO::read_polygon_mesh (const std::string &fname, PolygonMesh &g, const NamedParameters &np)
 reads the file as a polygon soup, repairs, and orients it as to obtain a polygon mesh. More...
 

Function Documentation

◆ read_polygon_mesh()

template<typename PolygonMesh , typename NamedParameters >
bool CGAL::Polygon_mesh_processing::IO::read_polygon_mesh ( const std::string &  fname,
PolygonMesh &  g,
const NamedParameters &  np 
)

#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>

reads the file as a polygon soup, repairs, and orients it 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).

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::write_polygon_mesh()