[Gmsh] Gmsh as library - merge stl

Simone GREMMO [531257] Simone.GREMMO at umons.ac.be
Tue May 6 13:51:39 CEST 2014


Dear all,
I am trying to add Gmsh as a library to my C++code in order to get a tetrahedral mesh of a given volume; this volume is bounded by an STL triangulation.
I have compiled the source code to get a library, but the problem comes when I try to read this stl file from my program because I get a SEGFAULT error.

I have created a .geo file:
Merge "CUBIC.stl";
Merge "CUBIC_SPHERE.stl";
Surface Loop(3) = {1};
Surface Loop(4) = {2};
Volume(5) = {3, 4};

If I try to read a different format for the surface mesh (.wrl), the mesh generation succeeds. And the problem is happening with all stl files I have tested so far.
If I run the same .geo file from the gmsh GUI (precompiled for Linux) the mesh generation succeeds as well (even with stl file, so I guess that the file is not corrupted)


My C++ code is the same as mainSIMPLE.cpp given in the api_demos except that I change the name of the .geo file to be read.
I have tried to debug the problem but I cannot figure out the origin of the problem; the last function called is compare (MVertex* v0, MVertex* v1), called during the generation of the face (MFace::MFace and sortVertices) while reading the stl file (GModel::readSTL)

To build the library I have tried different options:
the minimal -DDEFAULT=0 -DENABLE_BUILD_LIB=1 -DENABLE_BUILD_SHARED=1 (as suggested in README.txt)
and to include these packages:
ENABLE_BLAS_LAPACK
ENABLE_BUILD_LIB
ENABLE_BUILD_SHARED
ENABLE_MATHEX
ENABLE_MESH
ENABLE_NETGEN
ENABLE_NUMPY
ENABLE_OCC
ENABLE_PARSER
ENABLE_SGEOM
ENABLE_TETGEN

Has anyone already encountered a similar problem or a suggestion on what is going wrong ? I suppose that I am missing a dependency but I cannot find a solution to read the STL files.

Thanks for your help,
Simone

UMONS
____________________________________
Simone GREMMO
Université de Mons
Service Fluides-Machines
___________________________________

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20140506/f9d4d981/attachment.html>