[Gmsh] Doubt about meshing closed STL shell
MA Ariza-Gracia
miguel.ariza at artorg.unibe.ch
Fri Nov 1 11:30:49 CET 2019
Dear Dr Geuzaine, Dr Remacle, and the Gmsh community,
first of all, thank you for sharing the software with us! I'm a postdoc
working (mostly) in optics and I need to reconstruct some free-shape
surfaces.
My final goal is to create a volume mesh enclosed by two discrete STL
surfaces (given by a point cloud). The pipeline to do so is as follows:
1) Read point clouds and triangulate using Delaunay (scipy.spatial)
2) Create a 2 discrete surfaces giving the node coordinates and the
connectivity of the triangles
3) Create a volume using a surface loop on both surfaces
4) Mesh the volume
5) Exporting the mesh to Abaqus/LS-Dyna (whatever software)
After reading the manual, tutorials and mailing list, the only
approached that worked was the next one: having a single closed shell
joining 'manually' the nodes in the boundary. I say manually because I
needed to implement the substitution of the nodes myself and I couldn't
do it using Gmsh using removeDuplicate and so on (i.e., I didn't know
how to do it). After having a single closed shell without duplicate
nodes and with the normals pointing outwards, I manage to mesh the
volume inside the models (see manually-merged-thick.msh and
manually-merged-thin.msh).
However, as this is my first approach to Gmsh, this is not efficient and
I would like to know if:
1) *There is a more efficient procedure to, given two different STLs,
mesh the volume enclosed by the two of them* (as I said, I tried may
approaches including the ones regarding Earth topology reconstruction in
the mail list, but I couldn't find a proper solution).
2) *There is a way of both remeshing the STLs AND meshing the volume at
the same time*. In one of the approaches, I parameterized the discrete
STL surfaces with /classifySurfaces/ and /createGeometry/ (see the
Jupyter notebook, three first attempts). This allowed me to re-mesh the
STL surfaces but, unfortunately, I could not mesh the volume after
(complaining about 0 elements in the volume). As my Delaunay
triangulation is quite ugly, this would be my preferred option if you
could give me a hint on how to proceed.
3) In the end, I will have two surfaces: one main surface with one
inclusion inside itself. From what I've read, I know I cannot do Boolean
operations (as I'm using meshes and discrete elements), so I would
appreciate any hint on how to proceed in this regard.
_Files enclosed in compressed folder 'inquiry-gmsh.zip':_
* try-inquiry.ipynb: Jupyter notebook with the API code to create the
surfaces
* {anterior-lenticle-surface.txt, posterior-lenticle-surface.txt}:
files containing the Cartesian point cloud
* After running the code, it will generate:
o thin-1.stl, thin-2.stl: surfaces used to generate the
convex-convex thin lens
o surface-1.stl, surface-2.stl: surfaces used to generate the
concave-convex thick lens
o shell-thin-lens.msh: attempt to mesh the volume of the thin mesh
using: i) Two different STL surfaces (gmsh.merge); ii) remove
duplicate coincident nodes (gmsh.removeDuplicateNodes); and iii)
re-parameterizing
o shell-concave2convex.msh: attempt to do the same as the previous
one but with the thick lens (-> discard problems with sharp
edges in the periphery)
o merged-shell-concave2convex.msh: attempt to mesh the volume of
the thick lens using: i) One single STL surface with duplicated
nodes in the boundary; ii) Remove duplicated nodes using
removeDuplicateNodes; iii) and classify surfaces + creating geometry
o manually-merged-thick.msh and manually-merged-thin.msh: success
BUT: i) I needed to remove myself the duplicated nodes; ii) If I
try to parameterize the surface, I cannot mesh the volume inside
but only the surfaces.
_Versions used:_
- Ubuntu 18.04
- Gmsh 4.4.1 through the implementation in conda-forge
- Python 3.7 with Anaconda
Best regards,
MA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20191101/ecf730d2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inquiry-gmsh.zip
Type: application/zip
Size: 10072358 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20191101/ecf730d2/attachment-0001.zip>
More information about the gmsh
mailing list