scimesh 0.3.4
Headless CPU-only 3D software renderer for scientific mesh visualization
Loading...
Searching...
No Matches
scimesh::ply_io Namespace Reference

Functions for reading PLY files. More...

Functions

Mesh read_ply (const std::string &path)
 Load a mesh from a Stanford PLY file.
 

Detailed Description

Functions for reading PLY files.

Function Documentation

◆ read_ply()

Mesh scimesh::ply_io::read_ply ( const std::string &  path)

Load a mesh from a Stanford PLY file.

Reads vertex positions, face indices, and optionally per-vertex colors and normals. Both ASCII and binary (little-endian) PLY files are supported.

Parameters
pathFilesystem path to the .ply file.
Returns
A Mesh populated with the file's geometry.
Exceptions
std::runtime_errorif the file cannot be opened or parsed.
Example
std::cout << "Loaded " << scan.vertices.size() << " vertices\n";
Mesh read_ply(const std::string &path)
Load a mesh from a Stanford PLY file.
Definition ply_io.cpp:48
A 3D triangle mesh using an indexed face set representation.
Definition mesh.h:76
int x
Left edge of the bitmap, in image pixels.
Definition text.cpp:223
Color support
If the PLY file contains per-vertex RGB colors, they are automatically loaded into Mesh::colors. Use mesh.has_colors() to check.
Unsupported
  • Texture coordinates — PLY files with texture coordinates lose them; assign Mesh::uvs yourself if you need textured rendering.
See also
read_obj(), read_stl(), Mesh::has_colors()

Definition at line 48 of file ply_io.cpp.