GitHub link
Polygon Mesh Processing Library
io

Readers and writers for common mesh formats. More...

Classes

struct  IOFlags
 Flags to control reading and writing. More...
 

Functions

void read (SurfaceMesh &mesh, const std::filesystem::path &file)
 Read into mesh from file. More...
 
void write (const SurfaceMesh &mesh, const std::filesystem::path &file, const IOFlags &flags=IOFlags())
 Write mesh to file controlled by flags. More...
 

Detailed Description

Function Documentation

◆ read()

void read ( SurfaceMesh mesh,
const std::filesystem::path &  file 
)

File extension determines file type. Supported formats and vertex attributes (a=ASCII, b=binary):

Format ASCII Binary Normals Colors Texcoords
OBJ yes no a no no
OFF yes yes a / b a a / b
PMP no yes no no no
STL yes yes no no no

In addition, the OBJ and PMP formats support reading per-halfedge texture coordinates.

◆ write()

void write ( const SurfaceMesh mesh,
const std::filesystem::path &  file,
const IOFlags flags = IOFlags() 
)

File extension determines file type. Supported formats and vertex attributes (a=ASCII, b=binary):

Format ASCII Binary Normals Colors Texcoords
OBJ yes no a no no
OFF yes yes a a a
PMP no yes no no no
STL yes no no no no

In addition, the OBJ and PMP formats support writing per-halfedge texture coordinates.