scimesh 0.3.2
Headless CPU-only 3D software renderer for scientific mesh visualization
Loading...
Searching...
No Matches
obj_io.cpp
Go to the documentation of this file.
1#include <scimesh/obj_io.h>
3#include "libfs.h"
4
5namespace scimesh {
6namespace obj_io {
7
8Mesh read_obj(const std::string &path) {
9 fs::Mesh fs_mesh;
10 fs::Mesh::from_obj(&fs_mesh, path);
11
12 // Convert to scimesh Mesh. Normals are not loaded from OBJ — call
13 // compute_vertex_normals() on the result if lighting is needed.
14 // Texture coordinates (vt) and materials (mtllib) are not loaded.
15 return convert_fs_mesh(fs_mesh);
16}
17
18} // namespace obj_io
19} // namespace scimesh
Convert FreeSurfer meshes (libfs) to scimesh Mesh objects.
Mesh read_obj(const std::string &path)
Load a mesh from a Wavefront OBJ file.
Definition obj_io.cpp:8
Mesh convert_fs_mesh(const fs::Mesh &fs_mesh)
Convert a FreeSurfer mesh to a scimesh Mesh (no colors).
Read Wavefront OBJ files (.obj).
A 3D triangle mesh using an indexed face set representation.
Definition mesh.h:76