[Gmsh] Remeshing of STL file fails

Bruno bruno.agostini at gmail.com
Sun Mar 8 20:30:58 CET 2020


Dear Gmsh users,

I am trying to remesh the STL file here attached, but after many trials 
I did not manage to make a working python script.

I used this base script:

"""

import math
import gmsh

gmsh.initialize()
gmsh.option.setNumber("General.Terminal", 1)
gmsh.option.setNumber("Mesh.Algorithm", 6)
gmsh.option.setNumber("Mesh.Algorithm3D", 1)
gmsh.option.setNumber("Mesh.CharacteristicLengthMin", 0.15/4)
gmsh.option.setNumber("Mesh.CharacteristicLengthMax", 0.5*4)

gmsh.merge("test0.stl")

model = gmsh.model
model.mesh.createTopology()
model.mesh.classifySurfaces(0*math.pi/180, True, True, curveAngle = math.pi)
model.mesh.createGeometry()

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

model.mesh.reclassifyNodes()

model.mesh.generate(3)

gmsh.write("test0.msh")
gmsh.fltk.run()
gmsh.finalize()

"""

with various combinations of LengthMin and LengthMax values, refine(), 
reclassifyNodes(), but I always get a "Could not recover boundary mesh: 
error 2" error (log attached).

Does that mean:

1- my STL file if of insufficient quality (I this case, what should be 
improved?)

2- I am not using the right gmsh options?

3- gmsh is not the right tool to mesh this kind of model?

I would be grateful if somebody can point me to right direction.


Best regards

Bruno


-------------- next part --------------
A non-text attachment was scrubbed...
Name: test0.zip
Type: application/zip
Size: 603177 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20200308/2c31ab85/attachment-0002.zip>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: log.zip
Type: application/zip
Size: 296865 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20200308/2c31ab85/attachment-0003.zip>


More information about the gmsh mailing list