How to use direct "tetgen.h" and the functions to generate meshes without using "tetgen.exe"?

406 Views Asked by At

Our team is working on a project in which we are using tetgen file for generation of 3D meshes and right now we are using you tetgen.exe file to get results.

Now what we want to do is to use direct tetgen.h and the functions to generate meshes without using tetgen.exe.

2

There are 2 best solutions below

0
BrunoLevy On

As an example of how to integrate and call tetgen's API from another program, you can take a look at my GEOGRAM library [1], in particular the following file:

src/lib/geogram/delaunay/delaunay_tetgen.cpp. 

There are a couple of gotchas, concerning the way constraints are represented, and the way memory should be released to avoid a memory leak. The file includes some comments.

[1] http://alice.loria.fr/software/geogram/doc/html/index.html

0
Pranav On

You can uncomment:

#define TETLIBRARY

in tetgen.h and then you can use tetgen like any C++ library. For more information: refer.