Best route to mesh CT segmented datasets? Large .STLs are proving unwieldy

Hi all,

I have been attempting to mesh segmented CT data for use in Elmer, and am wondering at the best route to take. I am currently segmenting the CT data and exporting the segments to large .STL files, and then post-processing for intersections and smoothness in a mesh modelling package.

My ultimate goal is to use those surfaces as boundary surfaces against which a mesher will generate tet meshes for electrostatics simulations, but the problem I’m running into is that both GMSH and NETGEN are using the topology of the .STLs, which with the number of elements they have is destroying my available compute resources.

I’ve used OpenFOAM a bit, and the snappyHexMesh routine of generating a box mesh, and refining by snapping to .STL surfaces is more what I’m looking for.

I’ve done a literature and tutorial search for both GMSH and Salome workflows to accomplish meshing complex surfaces, and haven’t been able to find anything that shows how to mesh large, arbitrary geometries.

Does anyone have advice for a workflow that would help me generate volume meshes that conform to organic, arbitrary shapes for use in Elmer? I’ve seen some work done on expanded metal foams, so I know it has to be possible.

For Salome, I’ve tried decimating my .STLs down to the minimum acceptable resolution, importing, and generating a solid using the “Build Solid” tool. But when I try to mesh using the 1D-2D-3D NETGEN algorithm and an appropriate hypothesis, it hangs.

Hello, I am pretty sure that this is not the best way to go, but one could do this:

  1. build a solid
  2. use 3D algo: NETGEN 3D
  3. use 2D algo: polygon per face
  4. use 1D algo; wire discretization 1 element per edge.
    this will use as surface mesh the triangulates mesh that was from the original stl.

Hi,

you can import your stl directly in SMESH. If all the faces define a closed domain, with their normals towards the outside domain, you can right-click edit mesh to mesh the volume with NETGEN 3D.

You can also coarsen or refine the faces with:

  • Netgen 2D (also with right-click edit mesh).
  • or MMGS (menu Tools> SMESH plugins> Remesh with MMG).

Christophe

Hi,

I have the watertight region as a single .stl file, as well as farfield, symmetry plane, and body surfaces. I’ve already tried both approaches, but unfortunately, I don’t have the original geometry/CAD files.

In this situation, is there a way to import the STL surfaces individually and directly generate a tetrahedral volume mesh from them? I was able to do this in Gmsh, but I couldn’t generate/extrude prism layers from the imported STL surfaces there.

I was able to import the STL surfaces into SMESH, but I could not find an option to generate the volume mesh directly from the imported surface STL files. Could you elaborate a bit more on the workflow you used?

From my understanding, mesh generation in SMESH usually requires an underlying geometry/solid. In my case, I only have the triangulated STL surfaces (farfield, symmetry, and body) and no CAD geometry files.

Hi,

you can follow these steps in SMESH:

  • import the stl file
  • in the object browser, right-click on the mesh name, then select Edit.
  • in the 3D tab, select Netgen 3D. Press Apply and Close.
  • right-click on the mesh, then select Compute.

If your surface mesh has no holes and no self-intersecting triangles, it should work.

You can check the inside of the mesh by calling Clipping (right-click in the 3D view).

If you need to get a coarser or finer volume mesh, edit the mesh again, then in the 3D tab, add a Netgen 3D hypothesis (by clicking on the gear), and set the size you want.

Christophe

2 Likes

Thank you for the response.

I was able to generate volume from an .stl mesh that had symmetry, farfield and body combined in a single mesh following your steps. Is there a way to combine multiple .stl files and get the same result?

Also, when a single .stl file containing symmetry, farfield and body are used, I am not able to generate viscous layers as the option to choose areas to be included or avoided is not available.

Regards,
N469

You can combine your two stl files using boolean mesh operation:

  • menu Mesh> SMESH plugins> Boolean mesh operations
  • select your two files from the hard drive or from the object browser
  • select Union
  • press Compute

About Viscous Layers, it is not yet available on meshes without geometry. But you can try to use Extrusion by normal:

  • menu Modification> Extrusion
  • select 3rd radio button Extrusion by Normal
  • select your mesh, the distance and the number of steps

Christophe

a really ugly workaround this, is to import the stl in geom. this will create an shell object. one creates a solid from it and then continues to mesh this:
mesh it with the following hypothesis:
1D: wire discretization number of elements per wire==1
2D: polygon per face
3D: netgen 3D

normally this way one could use the viscouls layer algortihm over it. (it is skeatch and hacky but it should work.)

Thank you for your suggestions! @cbourcier @franco.ota
I’ll try these out and let you know.

Regards,
N469

Hi,

I was able to follow your steps to create the solid for meshing. But when I try to create a group from the solid, the whole thing hangs up. Any suggestions to fix that?

N469

you could do it in a python script, when doing it on the gui it is more resource hungry and i have had salome hanging up quite often when doing things on the gui. neverhteless as i mentioned it is quite hacky way to do it so i dont promise the result.

I did try that!

I am importing 3 STL files: SYMM, FF, and BODY. But when I try to group them after creating a solid, how do I get all the elements’ IDs in a 1.5 million mesh? Any feature I’m missing?

N469