the science behind the sneak previews part 2

Dieser Beitrag auf Deutsch.

Last time, I got as far as explaining what a segment and a joint do in a SIMM model, and how you can create them in the JNT file. That’s the only way you can set them up; within SIMM you can’t add either segments or joints. On the other hand, Gencoords can be created in SIMM, Bones and Muscles can be added, and much more. Because much of the editing that can be done in SIMM is much easier there the user ends up constantly changing between text editing and SIMM model editing, with a high risk of errors. Today, I’ll run through the way I add Bones, and how else you can do it. One method works within SIMM, the other outside. (btw: I’ll use capital letters for SIMM terms, thus a”bone” is a piece of an animal, whereas a “Bone” is a 3D file you add to SIMM.)

As you surely remember, SIMM applies translations and rotations to Segments, and thus the Bone files they contain, in an additive manner, first applying those for the first Segment, then those for the second, and so on. This means that each Bone must be placed so that translating and rotating it for the sum of the values given in the JNT file for its Segment and all Segments higher up in the hierarchy moves the Bone to the right place in SIMM. When preparing Bones in your CAD program, you thus need to move them from the correct articulation so that the intended proximal joint location is moved to the origin of your CAD program’s coordinate system (proximal not in the sense anatomy, but SIMM model built; if you build ground-up, the proximal SIMM joint [or parent] is the distal one in anatomical terminology, whereas hip-down building has them identical).

SIMM_bones_01

Here, you can see how I prepare bones for SIMM import. You can find your own way by experimenting, but one thing is important: always do it the same way, once you have decided how you want to do it. That saves you from making mistakes, and enables easier comparison of models.

I always place the bones into correct articulation for a standing pose. That’s usually much easier to judge for accuracy than other poses. Then, I add spheres to the model in the places where the joints are. Obviously, the exact position can’t be guessed. Therefore, I make copies of the distal element (of the femur, when placing the hip joint sphere), and move them to see if the assumed joint center is OK. That’s why I use spheres: most CAD programs can ‘jump to’ the center of a body, which makes sure I use the same center of rotation for all test motions. If it is off (i.e., the moving bone does something that’s wrong) I delete the copies, shift the joint center sphere a bit, and try again, until I am satisfied.

Now, I use the snap-to-center tool again, and sort the segments so that in lateral view, all joint center spheres are aligned vertically. That’s just a convention I use, you could also do horizontal, or whatever. Or keep the standing pose. Doesn’t really matter.

Now, I export the files including the spheres, as STLs. Those bones that are to go into one Segment can all go into one STL together, or they can be kept separate. Then I convert them into OBJs in Geomagic Studio. I could save them out of Rhinoceros as OBJs directly, but for some reason SIMM doesn’t like Rhinoceros OBJs. SIGH!

The next step is one that you can’t easily copy: I write an EXCEL table that defines the segments, what parent joint they ‘hang’ from, what ‘daughter’  joint the segment ‘ends’ with (e.g., for the thigh, the hip is the ‘parent’ and the knee is the ‘daughter’ joint if you build hip-down), what name the ‘daughter’ joint should have, and how that name should be abbreviated, what order the axes of the ‘daughter’ joint are supposed to be dealt with, and which auxiliary body (my joint center spheres) define the joint, and which bones files go with it. That, plus the OBJs, gets zipped and sent to my very esteemed colleague Dr. Vivian Allen (Royal Veterinary College London and Friedrich-Schiller-Universität Jena), who puts them through a very neat Matlab script. That script does a lot of stuff that I could do manually, but it does one thing that is really important and not that easily done otherwise: it makes sure that the normal of each polygon points outward! That’s important, because in the past I have had very bad experiences with inside-out triangles in SIMM. Additionally, the script turns the OBJs into the special STL-derivate files in ASCII format that SIMM likes. Best of all worlds!

So, you can’t easily do this, unless you happen to know Viv, the Matlab wizard. What else can you do?

With SIMM there comes a little file called norm.exe. You can use it outside SIMM to preprocess your bones, or you can norm bones from inside SIMM’s Bone Editor. In either case you can use norm.exe to translate or rotate a bone, and write it into a SIMM-conformal file. There are some differences between the stand-alone norm and norming from within SIMM, but to be perfectly honest, the things norm does are all things you better handle in other programs, if you can. What remains is writing a bone into the SIMM-conformal ASCII format.

One option now is to move all your bones in your intended model so that the ‘proximal’ joint location is at the origin of the coordinate system, save them, then run them through norm.exe. Bothersome. Also, you additionally need to measure the offsets between them beforehand, and hack those values into the JNT file.  Or you can add them to the JNT file as they are, then use the SIMM Bone editor to move them to the correct place. AARGH!

Luckily, there is a smarter way! It’s really easy, too! Here’s what you do:

1) save your aligned bones one by one as OBJs (in contrast to me, don’t save joint auxiliaries)
2) prepare your JNT file with segments, but without bones. Measure the relative translations between joints in the CAD program, and type these values into the SIMM file (caution: make sure to get the order of axes right!)
3) start SIMM and load your JNT file
4) open the Bone Editor in SIMM

SIMM_bones_02

5) drag&drop an OBJ into SIMM’s Model Window.
6) click the “bone 1” box at the top; you’ll be met with a dropdown menu that lists all segments in your model. Find your bone (normally in the “ground” segment) and select it (in the picture, the bone pelvis.asc is selected as bone 1).
7) click the “move bone 1 to” box and find the correct segment for your bone in the list (in the pic, the checkmark shows the bone in segment “GRND”, where it should be in my model).
8) click the “norm bone 1” box at the top left. IMPORTANT: don’t do anything with your mouse after this click! If you do you will probably make SIMM crash.
9) once the text under the “bone 1” box changes to show the new segment for your bone, click the “write bone 1” box at the lower left. SIMM will give you a chance to enter a new name, which I recommend (in fact, I would name the bone differently to begin with, i.e. “pelvis_1”, then change that to “pelvis” in this step).
10) Add the name you just chose to the JNT file; remember to save.
11) Close the SIMM model once you have added all bones, remember NOT to save it.
12) Load the edited JNT and check if all bones are in the right place by moving all joints.

Nifty, hu? It beats the old version of moving bones to the origin so that the translations in the JNT bring them back to the right place by about a million miles. 🙂

Advertisements

About Heinrich Mallison

I'm a dinosaur biomech guy working at the Museum für Naturkunde Berlin.
This entry was posted in 3D modeling, SIMM. Bookmark the permalink.

2 Responses to the science behind the sneak previews part 2

  1. dobermunk says:

    Wow. That is serious workflow hazard. Amazing how many sidesteps can be necessary when you’re transferring between software.

    • well, it is not as bad as it used to be. But yes – text editing mixed with writing versions of the same file out of a program while the text editor may still be open is a receipt for disaster.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s