Local coordinate system of a segment


When I define a segment (please see the attachment), it is always at a certain offset to the reference frame that it is attached to. According to the reference manual, when a segment is created, its position is based on the reference frame that is related to. Can anyone tell me why this segment’s center of mass is not positioned at the center of the global coordinate system?

My purpose is to create some nodes using the local coordinate system of this segment.



All spinal segments are defined in the same coordinate system and, thus, do not individually coincide with the global reference frame or some other local one. But as you just said yourself - it is better to define everything in the local anatomical ref. frame.

So you need to orient the STL that it is in the global reference frame - there is no unique way of how this can be done. So you will need to figure out this part yourself.


Hi Pavel,

Thank you for your information. I think I understood what you have meant.
I also want to ask you about the definition of a segment using AnyDrawSurf class. Why the below code does not accept the T3Seg (coming from .stl file) as T3Segment? When I compile the source, it is like that there are two seperate segments, i.e. one (yellow disk, please see the attachment) associated with the mass and Jii, and the surface from .stl file. Is something wrong here, when defining my segment which I want to associate it with the vertebra here?

Main = {
    AnyFixedRefFrame GlobalRef = {
      AnyDrawRefFrame DrwGlobalRef = { RGB = {0,0,1}; 
      ScaleXYZ = {0.1, 0.1, 0.1};
    }; // DrwGlobalRef
    };  // GlobalRef
AnySeg T3Segment = {
   Mass  = 1.7;
   r0      = {0,0.2,0};
   Jii     = {0.01,0.01,0.01};
   sCoM = {0,0.3,0};
      AnyDrawSurf DrwSTL = {
      FileName = ".\T3Seg";
      RGB = {0,0,1};
AnyDrawSeg DrwSeg = {};     

}; // T3  
};  // main

Kind regards,

Yes, basically they are misaligned.

If you think of the STL’s centre of mass it is {x_stl,y_stl,z_strl}, which is not the same as your yellow potato {0,0.3,0}. The bounding box of the vertebra will be somewhere around {0,0.4,0}.

You can try picking a vertex of the STL file (say in Mimics or Meshlab) that will give you a rough location of the centre of mass - further you need to improve your guess. I think some packages may compute CoM and Jii if you provide the density value or it can be computed from the medical image. But it looks like you are using our old surfaces - they are very coarse and you would need to find the density values somewhere.


Let’s say that the center position of the vertebra is at (0,0.4,0), and make sCoM exactly the same as that (0,0.4,0). What does that mean? Did you mean that if they would be coincide, I would not see the yellow potato, but only the vertebra as my segment?

Is the segment definition code true, because it seems to me that I have two seperate segments at the end, and this will lead to error in the inverse dynamics calculations?

By the way, it would be great if you can provide me the new thoracic vertebrae parts as I will be using them in the big model.


I meant that our surfaces are quite old. It may be a good idea to find some subject-specific geometries.

Yes, if you align them together - then visual and mechanical model will match (to some extent). The visual does not affect your simulation, it is more for your convenience rather than for actual mechanics. But the match between mechanical system and the STL will be needed, for example, if you model facet joints or other contact. And then it needs to be precise.


It is clear now. I thank you for your explanations and recommendations.