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

Namespaces

namespace  detail
 

Functions

void write_gltf (const std::string &path, const Scene &scene, const Camera *camera=nullptr)
 Write a scene as glTF 2.0 (JSON document + external .bin file).
 
void write_glb (const std::string &path, const Scene &scene, const Camera *camera=nullptr)
 Write a scene as a single binary glTF file (.glb).
 
void write (const std::string &path, const Scene &scene, const Camera *camera=nullptr)
 Write a scene as glTF, choosing the format from the file extension.
 

Function Documentation

◆ write()

void scimesh::gltf_io::write ( const std::string &  path,
const Scene scene,
const Camera camera = nullptr 
)
inline

Write a scene as glTF, choosing the format from the file extension.

A path ending in .glb writes binary glTF; any other path writes a .gltf JSON document (+ sibling .bin).

Definition at line 488 of file gltf_io.h.

◆ write_glb()

void scimesh::gltf_io::write_glb ( const std::string &  path,
const Scene scene,
const Camera camera = nullptr 
)
inline

Write a scene as a single binary glTF file (.glb).

Parameters
pathOutput path for the .glb file (self-contained, no .bin).
sceneThe scene to export.
cameraOptional camera (see write_gltf()).
Exceptions
std::runtime_errorif the file cannot be written.

Definition at line 446 of file gltf_io.h.

◆ write_gltf()

void scimesh::gltf_io::write_gltf ( const std::string &  path,
const Scene scene,
const Camera camera = nullptr 
)
inline

Write a scene as glTF 2.0 (JSON document + external .bin file).

Parameters
pathOutput path for the .gltf JSON document. The binary buffer is written next to it as <stem>.bin.
sceneThe scene to export (meshes, transforms, names).
cameraOptional camera; when non-null and perspective, exported as a glTF perspective camera node.
Exceptions
std::runtime_errorif the output files cannot be written.

Definition at line 416 of file gltf_io.h.