Target Outcome

Finite element mesh of a tissue of interest ready for model development:


Prerequisites

Infrastructure

  • SALOME. SALOME is an open-source software that provides a generic platform for pre- (cad, meshing) and post-processing for numerical simulation (LGPL license, see http://www.salome-platform.org/).

  • FreeCAD. FreeCAD is an open-source three-dimensional computer aided design software (GPL and LGPL licenses, see http://www.freecadweb.org/).

  • MeshLab. MeshLab is an open-source, portable, and extensible system for the processing and editing of unstructured 3D triangular meshes (GPL license, see http://meshlab.sourceforge.net/).

  • OpenFlipper. OpenFlipper is an open-source, multi-platform application and programming framework designed for processing, modeling and rendering of geometric data (LGPL license, see http://www.openflipper.org/).

  • PyGTS. PyGTS is a Python binding for the GNU Triangulated Surface (GTS) Library to construct, manipulate, and perform computations on 3D triangulated surfaces, including boolean operations (GPL license, see http://pygts.sourceforge.net/).

  • pyFormex. pyFormex provides a wide range of operations on surface meshes, such as STLs; the software can also be used as a pre- and post-processor for Finite Element analysis programs (GPL license, see http://www.nongnu.org/pyformex).

  • IA-FEMesh. IA-FEMesh is freely available, interactive, structured hexahedral mesh generation software relying on surface projection method (BSD style license, see http://www.ccad.uiowa.edu/MIMX/projects/IA-FEMesh).

  • Blender. Blender is the free and open source 3D creation suite, which supports the entirety of the 3D pipeline, including: modeling, rigging, animation, simulation, rendering, compositing, motion tracking, video editing, and game creation. (GPL license, see https://www.blender.org/).

Previous Protocols

For more details, see Specifications/GeometryGeneration.


Protocols

Input


Overview

There is a script which performs the following tasks:

  1. Import surface into mesh module of SALOME
  2. Define mesh generation parameters, e.g. NETGEN 3D Parameters. (this will dictate internal mesh density)
  3. Compute the mesh.
  4. Define groups, e.g. element, node, face sets.
  5. Export mesh using the .med extention

In order to run the script:

  1. Create an xml file with connectivity between components according to these directions
  2. Run the script StlToMed.py for tetrahedral meshing of the tissues of interest in Salome.

Creating the Connectivity File

To create the connectivity file the user should have the STLs for all the tissues that were created in the Geometry Generation step. Each part is referenced as an XML element. Within this element several child elements are needed: file, material, Tie, and Contact.

File

The path to the stl file

Material

The pre-defined materials are elastic, rigid

Tie and Contact

The Tie and Contact elements contain the parts that they are paired with as sub-elements

Definition of Tie and Contact Constraints:

The Tie and Contact constraints which will be used to create the node groups are defined by geometric principles relating the two tissues. The currently defined principles are:

Here is an excerpt from connectivity xml file for the knee model. It includes the Femur and Fibula elements.

<Assembly>

</Assembly>

Scripted Procedure for Tetrahedral Meshing

This python script will read the xml file with the connectivity of several stl files in the same coordinate system. It will then mesh them in 3D, and create groups of elements and nodes for applying boundary conditions. Currently it makes groups of all, outer surface, and a proximity based tie condition. The 3D meshes are saved in MED format.

Directions for running the script

  1. Save the script (StlToMed.py) in a Folder on your computer.

  2. Link the external python packages to Salome. Add a new text file with the extension .pth to Salome's python site-packages directory. The .pth file should contain the path to the site-packages of the other python installation you wish to use.
    • There are two possible locations for Salome's python site-packages directory depending on the Salome installation method:
      1. ROOT/appli_V7_7_1/lib/python2.7/site-packages/salome.
      2. ROOT/PREREQUISITES/INSTALL/Python-2.7.10/FROM_nothing/lib/python2.7/site-packages.
    • Example: If the path to the folder containing the python script StlToMed.py is: home/user/Documents/FolderContainingScript, you will type that in a text file, and save it in Salome's Python site-packages folder with .pth extension.

  3. Save the connectivity file (NameOfConnectivityFile.xml), and tissues surfaces (Tibia.stl, Femur.stl, etc.) all in the same folder on your computer

  4. Call the script from the terminal, giving the xml file as the argument. Be sure to include the paths to the script and xml file, if you are not already in the directory containing them (or if one is in a different directory). To do this, type in the terminal:

salome /path/to/script/!StlToMed.py args:/path/to/xml/!NameOfConnectivityFile.xml

Output

Template finite element mesh of all tissues of interest in MED format, including:

more information can be found in the Discussion page