[Gmsh] Fwd: Boolean operations

Frederic Dubois frederic.dubois at umontpellier.fr
Tue Apr 30 15:40:31 CEST 2019




De: "Frederic Dubois" <frederic.dubois at umontpellier.fr> 
À: "Behzad Samadi" <behzad.samadi at gmail.com> 
Envoyé: Mardi 30 Avril 2019 06:40:09 
Objet: Re: [Gmsh] Boolean operations 

Hi, 

Boolean is a feature provided by occ and it only work with objects created by occ (stl are "discrete" objects not occ objects). 
This is explained in the documentation in the part related to the API. 

Regards 




De: "Behzad Samadi" <behzad.samadi at gmail.com> 
À: "gmsh" <gmsh at onelab.info> 
Envoyé: Lundi 29 Avril 2019 23:36:10 
Objet: [Gmsh] Boolean operations 




BQ_BEGIN

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. 

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. 

Thank you! 

#!/usr/bin/julia 

include ( "/Apps/gmsh-4.3.0-MacOSX-sdk/lib/gmsh.jl" ) 

import .gmsh 

# nice shortcuts 
model = gmsh.model 
factory = model.geo 

# initialize Gmsh 
gmsh. initialize (ARGS) 

# Print messages in terminal 
gmsh.option. setNumber ( "General.Terminal" , 1 ) 

model. add ( "top" ) 

gmsh. merge ( "../models/top.stl" ) 

# model.occ.getCenterOfMass(3, 1) 

# export the mesh ; use explore.py to read and examine the mesh 
gmsh. write ( "test01.stl" ) 

gmsh. finalize () 

_______________________________________________ 
gmsh mailing list 
gmsh at onelab.info 
http://onelab.info/mailman/listinfo/gmsh 

BQ_END


-- 
Frédéric Dubois, PhD, Eng. 
--- 
SRK Consulting, 
Oceanic Plaza, 22nd Floor, 1066 West Hastings Street 
Vancouver, BC, Canada V6E 3X2 
Mobile: +12368650766 
--- 
Directeur adjoint du LMGC, responsable du service ReMICS. 
Laboratoire de Mécanique et Génie Civil - CNRS/UM 
cc 048, 163 rue Auguste Broussonnet, 34090 Montpellier 
http://www.lmgc.univ-montp2.fr/~dubois 
Tel: 33/0 467144984 
Mobile: 33/0 635490843 


-- 
Frédéric Dubois, PhD, Eng. 
--- 
SRK Consulting, 
Oceanic Plaza, 22nd Floor, 1066 West Hastings Street 
Vancouver, BC, Canada V6E 3X2 
Mobile: +12368650766 
--- 
Directeur adjoint du LMGC, responsable du service ReMICS. 
Laboratoire de Mécanique et Génie Civil - CNRS/UM 
cc 048, 163 rue Auguste Broussonnet, 34090 Montpellier 
http://www.lmgc.univ-montp2.fr/~dubois 
Tel: 33/0 467144984 
Mobile: 33/0 635490843 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20190430/9692aece/attachment.html>


More information about the gmsh mailing list