[Gmsh] Python API volume adding + mesh creation problem

Saima Safdar saima.safdar at research.uwa.edu.au
Fri Aug 23 04:35:31 CEST 2019


Hi All,
I am using gmsh-api. Installed it into anconda enviornment using pip
install gmsh-api.
I have an .ply file. When I create a 3D mesh usign GMSH manually it creates
the mesh. The steps I am using are: merge>add volume from elementry
entities>mesh 3D

But when I am using python api. its not giving me the results. The program
haults for long time. I am attaching the script here with. please help.

import math
import gmsh_api
import gmsh_api.gmsh as gmsh

gmsh.initialize()
gmsh.option.setNumber("General.Terminal", 1)
gmsh.option.setNumber("Mesh.Algorithm3D", 1);
gmsh.option.setNumber("Mesh.CharacteristicLengthMin", 1);
gmsh.option.setNumber("Mesh.CharacteristicLengthMax", 1);


gmsh.merge("C:/2_FuzzyClassification/brainmodel/newBrainModelS.ply")

n = gmsh.model.getDimension()
s = gmsh.model.getEntities(n)

l = gmsh.model.geo.addSurfaceLoop([s[i][1] for i in range(len(s))])
gmsh.model.geo.addVolume([l])

print("Volume added")
gmsh.model.geo.synchronize()

gmsh.model.mesh.generate(3)

gmsh.write("C:/2_FuzzyClassification/brainmodel/simplification_2.msh")

gmsh.finalize()

regards,
Saima Safdar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20190823/cac23e64/attachment.html>


More information about the gmsh mailing list