<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR-BE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Dear all,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I have created a .geo file:<o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">Merge "CUBIC.stl";<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US">Merge "CUBIC_SPHERE.stl";<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US">Surface Loop(3) = {1};<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US">Surface Loop(4) = {2};<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US">Volume(5) = {3, 4};<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I have tried to debug the problem but I cannot figure out the origin of the problem; the last function called is
<b>compare (MVertex* v0, MVertex* v1)</b>, called during the generation of the face (<b>MFace::MFace
</b>and<b> sortVertices</b>) while reading the stl file (<b>GModel::readSTL</b>)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">To build the library I have tried different options:
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">the minimal -DDEFAULT=0 -DENABLE_BUILD_LIB=1 -DENABLE_BUILD_SHARED=1 (as suggested in README.txt)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">and to include these packages:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">ENABLE_BLAS_LAPACK<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">ENABLE_BUILD_LIB<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">ENABLE_BUILD_SHARED<o:p></o:p></span></p>
<p class="MsoNormal">ENABLE_MATHEX<o:p></o:p></p>
<p class="MsoNormal">ENABLE_MESH<o:p></o:p></p>
<p class="MsoNormal">ENABLE_NETGEN<o:p></o:p></p>
<p class="MsoNormal">ENABLE_NUMPY<o:p></o:p></p>
<p class="MsoNormal">ENABLE_OCC<o:p></o:p></p>
<p class="MsoNormal">ENABLE_PARSER<o:p></o:p></p>
<p class="MsoNormal">ENABLE_SGEOM<o:p></o:p></p>
<p class="MsoNormal">ENABLE_TETGEN<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks for your help,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Simone<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><u><span style="font-size:22.0pt;font-family:"Helvetica","sans-serif";color:gray;mso-fareast-language:EN-GB">U</span></u><span style="font-size:22.0pt;font-family:"Helvetica","sans-serif";color:#A80039;mso-fareast-language:EN-GB">MONS</span><span style="font-size:22.0pt;color:#A80039;mso-fareast-language:EN-GB"><br>
</span><u><span style="font-size:8.0pt;color:gray;mso-fareast-language:EN-GB">____________________________________<br>
</span></u><b><span style="font-size:10.0pt;color:#969696;mso-fareast-language:EN-GB">Simone GREMMO<br>
</span></b><b><span style="font-size:10.0pt;color:gray;mso-fareast-language:EN-GB">Université de Mons<br>
</span></b><span style="font-size:10.0pt;color:#A80039;mso-fareast-language:EN-GB">Service Fluides-Machines<o:p></o:p></span></p>
<p class="MsoNormal"><u><span style="font-size:8.0pt;color:gray;mso-fareast-language:EN-GB">___________________________________</span></u><span style="font-family:"Helvetica","sans-serif";color:gray;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>