extracts the surface mesh from an input stream in the Polygon File Format (PLY) and appends it to the surface mesh sm.
Attention
When reading a binary file, the flag std::ios::binary flag must be set during the creation of the ifstream.
the operator reads the vertex point property and the face vertex_index (or vertex_indices) property;
if three PLY properties nx, ny and nz with type float or double are found for vertices, a "v:normal" vertex property map is added;
if three PLY properties red, green and blue with type uchar are found for vertices, a "v:color" vertex property map is added;
if three PLY properties red, green and blue with type uchar are found for faces, a "f:color" face property map is added;
if any other PLY property is found, a "[s]:[name]" property map is added, where [s] is v for vertex and f for face, and [name] is the name of the PLY property.
Template Parameters
Point
The type of the point property of a vertex. There is no requirement on P, besides being default constructible and assignable. In typical use cases it will be a 2D or 3D point type.
Parameters
is
the input stream
sm
the surface mesh to be constructed
comments
a string used to store the potential comments found in the PLY header. Each line starting by "comment " in the header is appended to the comments string (without the "comment " word).
verbose
whether extra information is printed when an incident occurs during reading
Precondition
The data in the stream must represent a two-manifold. If this is not the case the failbit of is is set and the mesh cleared.
If found, internal property maps with names "v:normal", "v:color" and "f:color" are inserted in the stream.
All other vertex and face properties with simple types are inserted in the stream. Edges are only inserted in the stream if they have at least one property with simple type: if they do, all edge properties with simple types are inserted in the stream. The halfedges follow the same behavior.
Attention
When writing a binary file, the flag std::ios::binary flag must be set during the creation of the ofstream.
Template Parameters
Point
The type of the point property of a vertex. There is no requirement on P, besides being default constructible and assignable. In typical use cases it will be a 2D or 3D point type.