Automated Scripting Procedure
The script to automate the model assembly process can be found here.
The simulation specific output scripts are Febio, SOFA, and Abaqus.
Running the Script
- First create the Connectivity File xml document. (see below)
Them from the terminal type salome StlToMed.py args:ConnectivityFile.
When that script finishes, use the simulation specific script from the terminal to produce the desired output file with salome MedToXXX.py args:ConnectivityFile.
Creating the Connectivity File
To create the connectivity file the user should already have all of the stls that will be used as the starting geometry. Each part is added to the assembly as an XML element. Within this part element several child element are needed: file, material, Tie, and Contact.
The Tie and Contact elements should have the elements that they are paired with as subelements.
The Tie and Contact constraints which will be used to create the defined groups are defined by geometric principles relating the two tissues. The currently defined principles are:
- Proximity – find all nodes on the paired surface within a distance related to the size of the element size. This is the default for Tie constraints.
- Normals – select faces that have normal vectors that point toward the barycenter of the other tissue. This can also be limited by the proximity if desired.
- Contains – one mesh contains the other, select faces that have normal vectors that point inward or outward.
- All – all the surfaces. This is the default for contact.
These should allow you to create any surface that is necessary, but may take some adjustment. Here is an example xml.
<Assembly> <Bone> <file>Multis/Bone.stl</file> <material>rigid</material> <Contact> </Contact> <Tie> <Muscle type="proximity" multiplier="1.5"/>/> </Tie> </Bone> <Muscle> <file>Multis/Muscle.stl</file> <material>elastic</material> <Tie> <Fat type="contains" contains="outer" multiplier="1"/> <Bone multiplier="0.75"/> </Tie> </Muscle> <Fat> <file>Multis/Fat.stl</file> <material>elastic</material> <Tie> <Muscle type="contains" contains="inner"/> <Skin type="contains" contains="outer" multiplier="1"/> </Tie> </Fat> <Skin> <file>Multis/Skin.stl</file> <material>elastic</material> <Contact> <Probe type="normals" multiplier="15"/> </Contact> <Tie> <Fat type="contains" contains="inner"/> </Tie> </Skin> <Probe> <file>Multis/Probe.stl</file> <material>rigid</material> <Contact> <Skin type="normals" multiplier="15"/> </Contact> </Probe> </Assembly>