O RPLY? is a C/C++ library for PLY file format load and store. You might ask O RLY? YA RLY. It is built over RPly 1.1.4 by Diego Nehab with three improvements: 1) CMake build 2) in-memory load and store; and 3) implementation of a simple loader for PLY files. NO WAI!!
This petite library exists only due to the immense work of Diego Nehab. Thank you!
- CMake-based build makes the library easy to build and reuse
- Two new functions for in-memory load and store:
// Starts reading the PLY file from memory (const char[] buffer) p_ply ply_open_from_memory(const char *buffer, p_ply_error_cb error_cb, long idata, void *pdata); // Starts writing the PLY file to memory (pre-allocated char[] buffer) p_ply ply_create_to_memory(char *buffer, size_t buffer_size, size_t *ply_size, e_ply_storage_mode storage_mode, p_ply_error_cb error_cb, long idata, void *pdata);
- An implementation of a simple PLYLoader class.
On Linux-based systems:
- Clone this repository:
git clone https://github.com/quepas/O-RPLY.git
- Pull dependencies (e.g. Catch2)
cd O-RPLY/ git submodule update --init --recursive
- Prepare build scripts and build the project!
cmake CMakeLists.txt make
Let's imagine your project contains only one source file main.cpp and O RPLY? is in the third-party/ directory. Now, all you have to do is this:
cmake_minimum_required( VERSION 3.0 )
project( name-of-your-project VERSION 1.0 )
add_subdirectory( third-party/O-RPLY )
add_executable( your-app src/main.cpp)
target_link_libraries( your-app o-rply-lib ) # Include the O-RPLY? library