v0.2.1
Fast, portable C library for geometry input/output
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules
/examples/occstl_write_file.cpp
/* -----------------------------------------------------------------------------
*
* Example: write a STL file
*
* Just give the filepath and an initialized gmio_stl_mesh object to
* gmio_stl_write_file().
* The gmio_stl_mesh object defines the interface to access the underlying user
* mesh.
*
* Note if you want to have control over the stream to be used, call
* gmio_stl_write() instead.
*
* -------------------------------------------------------------------------- */
#include <StlMesh_Mesh.hxx>
#include <iostream>
int main(int argc, char** argv)
{
int error = 0;
if (argc > 1) {
const char* filepath = argv[1];
Handle_StlMesh_Mesh occmesh = new StlMesh_Mesh;
// Initialize the OpenCascade StlMesh_Mesh here
// ...
const gmio_stl_mesh_occmesh mesh(occmesh);
// Write binary STL(little-endian), using default options(NULL)
GMIO_STL_FORMAT_BINARY_LE, filepath, &mesh, NULL);
if (error != GMIO_ERROR_OK)
std::cerr << "gmio error: 0x" << std::hex << error << std::endl;
}
return error;
}
Fougue © 2016