Tetrahedral mesh in solid body from water tight STL file

Hello everyone,

I have STL files which are water tight and created and exported with MESHLAB. I have also successfully used these STL files before to generate tetra meshes with TETGEN (but am not entirely happy with the product).

What is the best way to create a tetra mesh of the solid body, to export this in ABAQUS or EXODUS format? This is to be used for a mechanical FEM simulation of solid body deformation.

Below are some approaches I used in the GUI.

(1)
I have imported them into TRELIS (with merge geometry, make elements and stitch all set to ON). Then
“mesh -> volumes -> specifying meshing schemes and attributes -> tetmesh”
Seems like a silly issue, but I can not visualize the created tetras. All I see is the surface. If I select the surface mesh with “Select 3D elements”, I can visualize individual tetras. I never had a problem with this when simply importing tetra meshes from TETGEN. Besides visualizing the tetra mesh, this will also yield a result that depends on the imported STL mesh. Therefore I’d like to be able to just re-mesh the surface and then the solid.

(2)
The mesh I used for experimenting is quite coarse. If I want to re-mesh that, I do
“mesh -> volumes -> specifying meshing schemes and attributes -> Trimesh”
I select all surfaces (4) and re-mesh a more uniform surface mesh without problems.
I then
“mesh -> volumes -> specifying meshing schemes and attributes -> tetmesh”
and obtain
"
TetMeshGems mesher found!
WARNING: (1005200): WAR 5200 : 4 7 6
ERROR:
Unable to generate empty mesh
ERROR:
Volume 1 (Volume 1) meshing unsuccessful.

Meshing time: 0.037889
ERROR:
1 volume(s) did not mesh.
Volume(s) 1 did not mesh.
Although some volumes failed to mesh, Cubit will log
the command in the journal file anyway, for future use.
Journaled Command: mesh volume 1
"

I have uploaded a simple and a cleaner STL geometry here
https://polybox.ethz.ch/index.php/s/RPk96mggzFFQjqf
for reference.

Any help would be much appreciated.

Best,
Dan

You might try not selecting ‘make elements’ and just bring in the geometry. Then, you can specify the size of the mesh and get more uniform tri elements.

import stl “trelis_coarse.stl” feature_angle 135.00 merge
vol all scheme tet
mesh vol all
graphics clip on
graphics clip manipulation on
draw tet all

The ‘draw tet all’ allows you to see the inner elements.

To change the size you can use the Mesh-Volume-Intervals panel to change the size or use commmands like ‘vol all size auto factor 2’ or ‘vol 4 size 3.75’.

Although I didn’t get the error, you might try deleting the mesh before surface meshing. Also, no need to surface mesh prior to volume meshing. Trelis will automatically surface mesh first before volume meshing.

Thanks for the reply. However, the proposed work flow does not seem to work for my geometries.

(1) When importing trelis.stl

"
Trelis>import stl “PATH/trelis/trelis.stl” feature_angle 135 merge
Reading facets…
174840 facets read.
Building facet-based geometry from 174840 facets…
Body successfully created.
Number of new vertices = 0
Number of new curves = 0
Number of new surfaces = 1
Number of new shells = 1
Number of new volumes = 1
Number of new bodies = 1
Geometry engine set to: Facet Geometry Engine version 10.0.0
Journaled Command: import stl “PATH/trelis/trelis.stl” feature_angle 135 merge

Trelis>vol all scheme tet
Journaled Command: volume all scheme tet

Trelis>mesh vol all
ERROR:
Surface must have bounding curves in order to mesh surface.
Error occured in Surface 1 (Surface 1)
WARNING: No boundary loops to mesh on surface 1 (Surface 1).
If this is a spheroid, webcut it and then mesh both halves.
WARNING: TriAdvanced failed on surface 1 (Surface 1)
WARNING: TriAdvanced failed on surface 1 (Surface 1)
WARNING: No boundary loops to mesh on surface 1 (Surface 1).
If this is a spheroid, webcut it and then mesh both halves.
ERROR:
Can’t create quad mesh. Impossible to mesh with QTri
WARNING: QTri:TriPave failed on surface 1 (Surface 1)
WARNING: Unable to mesh Surface 1 (Surface 1)
WARNING: Unable to mesh Surface 1 (Surface 1)
ERROR:
Volume 1 (Volume 1) meshing unsuccessful.

Meshing time: 0.061559
ERROR:
1 volume(s) did not mesh.
Volume(s) 1 did not mesh.
Although some volumes failed to mesh, Cubit will log
the command in the journal file anyway, for future use.
Journaled Command: mesh volume all
"

(2) When importing trelis_coarse.stl
"
Trelis>import stl “PATH/trelis/trelis_coarse.stl” feature_angle 135.00 merge stitch
Trelis>vol all scheme tet
Journaled Command: volume all scheme tet

Trelis>mesh vol all
Matching intervals successful.
Generated 11 tris for Surface 1 (Surface 1).
Generated 21190 tris for Surface 2 (Surface 2).
Generated 8 tris for Surface 3 (Surface 3).
Generated 9 tris for Surface 4 (Surface 4).
TetMeshGems mesher found!
WARNING: (1005200): WAR 5200 : 21 25 24
ERROR:
Unable to generate empty mesh
ERROR:
Volume 1 (Volume 1) meshing unsuccessful.

Meshing time: 0.727261
ERROR:
1 volume(s) did not mesh.
Volume(s) 1 did not mesh.
Although some volumes failed to mesh, Cubit will log
the command in the journal file anyway, for future use.
Journaled Command: mesh volume all
"

Once I get “Surface must have bounding curves in order to mesh surface.”
and the other time I get the error: “Unable to generate empty mesh”.

Were you able to mesh the meshes I had shared with the work flow you proposed? Any ideas why this is not working?

Best,
Dan

Yes, both files tet meshed. I’ll send you the two meshes in Exodus II format by email.

What version of Trelis and operating system are you using?

You help is much appreciated. I did receive the files you sent.

However, I need to be able to produce a large number of such files with varying degrees of fineness of the mesh, and would therefore really need to be able to mesh such geometries myself.

I am running
OS:
Ubuntu 16.04 LTS

TRELIS:
TRELIS Pro 16.3
Software Build 012225b
Revised Fri May 26 13:21:54 2017 -0700

Also, what do the two different errors mean?
(1)
"ERROR: Surface must have bounding curves in order to mesh surface.
Error occured in Surface 1 (Surface 1)
WARNING: No boundary loops to mesh on surface 1 (Surface 1).
If this is a spheroid, webcut it and then mesh both halves.
"

(2)
"TetMeshGems mesher found!
WARNING: (1005200): WAR 5200 : 21 25 24
ERROR:
Unable to generate empty mesh
"

When I use the trelis,e which you sent me, and I just delete the mesh again, I am not able to reproduce that mesh gain:
"
Trelis>delete mesh volume 1 propagate
Journaled Command: delete mesh volume 1 propagate

Trelis>vol all scheme tet
Journaled Command: volume all scheme tet

Trelis>mesh vol all
ERROR:
Surface must have bounding curves in order to mesh surface.
Error occured in Surface 1 (Surface 1)
WARNING: No boundary loops to mesh on surface 1 (Surface 1).
If this is a spheroid, webcut it and then mesh both halves.
WARNING: TriAdvanced failed on surface 1 (Surface 1)
WARNING: TriAdvanced failed on surface 1 (Surface 1)
WARNING: No boundary loops to mesh on surface 1 (Surface 1).
If this is a spheroid, webcut it and then mesh both halves.
ERROR:
Can’t create quad mesh. Impossible to mesh with QTri
WARNING: QTri:TriPave failed on surface 1 (Surface 1)
WARNING: Unable to mesh Surface 1 (Surface 1)
WARNING: Unable to mesh Surface 1 (Surface 1)
ERROR:
Volume 1 (Volume 1) meshing unsuccessful.

Meshing time: 0.045578
ERROR:
1 volume(s) did not mesh.
Volume(s) 1 did not mesh.
Although some volumes failed to mesh, Cubit will log
the command in the journal file anyway, for future use.
Journaled Command: mesh volume all
"

Thanks again and Best,
Daniel

The problem has now been resolved by upgrading to TRELIS 16.4. This seems to have been a bug in TRELIS 16.3(.6) (as suggested by the TRELIS team). The exact same work flow employed earlier works now with the new version.

Best,
Dan