[Gmsh] Boolean operations

Behzad Samadi behzad.samadi at gmail.com
Tue Apr 30 08:36:10 CEST 2019


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()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20190429/1ab45b47/attachment.html>


More information about the gmsh mailing list