Mesh and Image library extracted from VertexNova core, structured like vneevents / vnelogging / vnemath. It provides:
- Mesh – Load 3D meshes (Assimp), with vertex attributes, materials, submeshes, optional normalization and barycentrics.
- Image – Load/save images (stb_image), resize, flip, raw pixel access.
- Volume – Load 3D volumes (NRRD, MHD), with spacing, origin, direction matrix. NRRD loading uses Teem nrrdio (required; supports compressed and advanced formats).
Namespaces: vne::Mesh, vne::Image. Includes live under vertexnova/io/.
- C++20
- CMake 3.16+
- Mesh: Assimp (optional; add under
3rd_party/assimpor usefind_package(assimp)) - Image: stb (fetched automatically if
3rd_party/stb_imageis not present) - Volume (NRRD): Teem nrrdio (required for image component; add under
deps/external/nrrdio/or3rd_party/nrrdio/or usefind_package(nrrdio)). - Logging (optional): vnelogging and vnecommon under
deps/internal/for mesh load logging
Clone with submodules (for vnecmake, deps/internal, deps/external/assimp, deps/external/googletest):
git clone --recursive https://github.com/vertexnova/vneio.git
cd vneio
# Or, if already cloned: git submodule update --init --recursiveTest data (for VNEIO_BUILD_TESTS=ON): Minimal assets live in testdata/ (e.g. meshes/minimal.stl, textures/sample.png). No LFS or extra submodules required. If you had the old testdata/vneresources submodule, run git submodule deinit testdata/vneresources and remove the folder if desired.
Then build:
mkdir build && cd build
cmake .. -DVNEIO_BUILD_MESH=ON -DVNEIO_BUILD_IMAGE=ON
cmake --build .
# With tests (requires deps/external/googletest; testdata/ is in repo):
# cmake .. -DVNEIO_BUILD_MESH=ON -DVNEIO_BUILD_IMAGE=ON -DVNEIO_BUILD_TESTS=ON
# cmake --build . && ctest --output-on-failure- VNEIO_BUILD_MESH – build mesh component (default ON; needs Assimp).
- VNEIO_BUILD_IMAGE – build image component (default ON; stb fetched if needed).
- VNEIO_BUILD_TESTS – build tests (default OFF). Enable with
-DVNEIO_BUILD_TESTS=ON. - VNEIO_BUILD_EXAMPLES – build examples (default OFF). Enable with
-DVNEIO_BUILD_EXAMPLES=ON. - ENABLE_COVERAGE – enable code coverage (default OFF). Use with Debug + GCC/Clang and lcov for reports.
To use a local Assimp or stb_image, place them under 3rd_party/assimp and 3rd_party/stb_image with their own CMakeLists.txt so that add_subdirectory(3rd_party/...) works.
Link against vne::io (or vne::io::mesh / vne::io::image). Include:
#include <vertexnova/io/vneio.h>
// or
#include <vertexnova/io/mesh/mesh.h>
#include <vertexnova/io/mesh/assimp_loader.h>
#include <vertexnova/io/image/image.h>#include <vertexnova/io/mesh/assimp_loader.h>
vne::Mesh::AssimpLoader loader;
vne::Mesh::Mesh mesh;
if (loader.loadFile("model.obj", mesh)) {
// mesh.vertices, mesh.indices, mesh.parts, mesh.materials
}#include <vertexnova/io/image/image.h>
vne::Image::Image img("texture.png");
if (!img.isEmpty()) {
int w = img.getWidth(), h = img.getHeight();
const uint8_t* data = img.getData();
}include/vertexnova/io/– public headers (mesh/, image/, vneio.h)src/vertexnova/io/– implementation (mesh/, image/)cmake/vnecmake/– shared CMake modules (submodule)deps/internal/vnecommon/,deps/internal/vnelogging/– submodules used for logging (when present)deps/external/assimp,deps/external/stb_image– mesh/image dependencies (assimp is submodule, stb_image is a copy)tests/,examples/– optional
Apache-2.0. Same as the original VertexNova core code.