<html><body><div style="font-family: sans serif; font-size: 12pt; color: #000000"><div><br></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>De: </b>"Frederic Dubois" <frederic.dubois@umontpellier.fr><br><b>À: </b>"Behzad Samadi" <behzad.samadi@gmail.com><br><b>Envoyé: </b>Mardi 30 Avril 2019 06:40:09<br><b>Objet: </b>Re: [Gmsh] Boolean operations<br></div><br><div data-marker="__QUOTED_TEXT__"><div style="font-family: sans serif; font-size: 12pt; color: #000000"><div>Hi,</div><br><div>Boolean is a feature provided by occ and it only work with objects created by occ (stl are "discrete" objects not occ objects).</div><div>This is explained in the documentation in the part related to the API.</div><br><div>Regards</div><br><hr id="zwchr"><div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>De: </b>"Behzad Samadi" <behzad.samadi@gmail.com><br><b>À: </b>"gmsh" <gmsh@onelab.info><br><b>Envoyé: </b>Lundi 29 Avril 2019 23:36:10<br><b>Objet: </b>[Gmsh] Boolean operations<br></blockquote></div><div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">I am a new user of Gmsh. I wanted to use the Julia API to compute the Boolean difference between two models given in two STL files.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">I wasn't able to figure out the commands from the documentation and the api demos. I also tried to use getMass and getCenterOfMass commands but I don't know what the tag of my model is. This is my code. I had to comment out the line with getCenterOfMass. I was wondering if someone can help me.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Thank you!</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;line-height:18px;white-space:pre"><div><span style="color:rgb(106,153,85)">#!/usr/bin/julia</span></div><br><div><span style="color:rgb(220,220,170)">include</span>(<span style="color:rgb(206,145,120)">"/Apps/gmsh-4.3.0-MacOSX-sdk/lib/gmsh.jl"</span>)</div><br><div><span style="color:rgb(197,134,192)">import</span> .gmsh</div><br><div><span style="color:rgb(106,153,85)"># nice shortcuts</span></div><div>model = gmsh.model</div><div>factory = model.geo</div><br><div><span style="color:rgb(106,153,85)"># initialize Gmsh</span></div><div>gmsh.<span style="color:rgb(220,220,170)">initialize</span>(ARGS)</div><br><div><span style="color:rgb(106,153,85)"># Print messages in terminal</span></div><div>gmsh.option.<span style="color:rgb(220,220,170)">setNumber</span>(<span style="color:rgb(206,145,120)">"General.Terminal"</span>, <span style="color:rgb(181,206,168)">1</span>)</div><br><div>model.<span style="color:rgb(220,220,170)">add</span>(<span style="color:rgb(206,145,120)">"top"</span>)</div><br><div>gmsh.<span style="color:rgb(220,220,170)">merge</span>(<span style="color:rgb(206,145,120)">"../models/top.stl"</span>)</div><br><div><span style="color:rgb(106,153,85)"># model.occ.getCenterOfMass(3, 1)</span></div><br><div><span style="color:rgb(106,153,85)"># export the mesh ; use explore.py to read and examine the mesh</span></div><div>gmsh.<span style="color:rgb(220,220,170)">write</span>(<span style="color:rgb(206,145,120)">"test01.stl"</span>)</div><br><div>gmsh.<span style="color:rgb(220,220,170)">finalize</span>()</div></div></div></div>
<br>_______________________________________________<br>gmsh mailing list<br>gmsh@onelab.info<br>http://onelab.info/mailman/listinfo/gmsh<br></blockquote></div><br><div>-- <br></div><div>Frédéric Dubois, PhD, Eng.<br>---<br>SRK Consulting, <br>Oceanic Plaza, 22nd Floor, 1066 West Hastings Street<br>Vancouver, BC, Canada V6E 3X2 <br>Mobile: +12368650766<br>---<br>Directeur adjoint du LMGC, responsable du service ReMICS.<br>Laboratoire de Mécanique et Génie Civil - CNRS/UM<br>cc 048, 163 rue Auguste Broussonnet, 34090 Montpellier<br>http://www.lmgc.univ-montp2.fr/~dubois<br>Tel: 33/0 467144984<br>Mobile: 33/0 635490843</div></div><br></div><br><div data-marker="__SIG_POST__">-- <br></div><div>Frédéric Dubois, PhD, Eng.<br>---<br>SRK Consulting, <br>Oceanic Plaza, 22nd Floor, 1066 West Hastings Street<br>Vancouver, BC, Canada V6E 3X2 <br>Mobile: +12368650766<br>---<br>Directeur adjoint du LMGC, responsable du service ReMICS.<br>Laboratoire de Mécanique et Génie Civil - CNRS/UM<br>cc 048, 163 rue Auguste Broussonnet, 34090 Montpellier<br>http://www.lmgc.univ-montp2.fr/~dubois<br>Tel: 33/0 467144984<br>Mobile: 33/0 635490843<br></div></div></body></html>