Switch to unified view

a b/Body/AAUHuman/Trunk/SegmentsThorax.any
1
/**
2
Definitions of Segments in the Thorax Part of the Spine.
3
4
Abbrevitations:
5
ALL = Anterior Longitudinal Ligament
6
PLL = Posterior Longitudinal Ligament
7
LS = Ligamentum Supraspinale
8
LI = Ligamentum Interspinalia
9
10
MF = Multifidi
11
ILpl = Iliocostalis Lumborum pars lumborum (part of Erector Spinae)
12
LTpl = Longissimus Thoracis pars lumborum (part of Erector Spinae)
13
ILpt = Iliocostalis Lumborum pars thoracis (part of Erector Spinae)
14
LTpt = Longissimus Thoracis pars thoracis (part of Erector Spinae)
15
PM = Psoas Major
16
QL = Quadratus Lumborum
17
RA = Rectus Abdominis
18
OE = Obliquus Externus
19
OI = Obliquus Internus
20
21
C = Costae
22
CI = Crista Iliaca
23
CP = Crista Pubica
24
SIPS = Spina iliaca posterior superior
25
SIPI = Spina iliaca Posterior inferior
26
T = Thoracal hvirvel
27
L = Lumbal hvirvel
28
S = Sacral segment
29
*/
30
AnyFolder SegmentsThorax = { 
31
  
32
33
  AnySeg ThoraxSeg = {
34
35
    AnyFolder &StdPar=..ModelParameters;
36
    
37
    r0=..SegmentsLumbar.L1Seg.T12L1JntNode.sRel*..SegmentsLumbar.L1Seg.Axes0'+..SegmentsLumbar.L1Seg.r0-T12L1JntNode.sRel*Axes0';
38
    
39
    // This file includes the trunk specifc scaling function
40
    // and anatomical reference system
41
    AnyFunTransform3D &GeomScale = ..Scaling.GeometricalScaling.ThoraxSeg.ScaleFunction;
42
    #include "TrunkScalingAndAnatomicalFrame.any"
43
    AnyVar MassS = ..Scaling.MassScaling.Thorax.MassScale;
44
        
45
    AnyVar MassStandard = ..StandardParameters.Trunk.Mass;
46
    Mass = MassS*MassStandard;
47
    
48
    AnyVar UBHeight =  StdPar.Thorax.UBHeight; //0.50; //Upperbody height
49
    AnyVar Radius = (Mass/(pi*UBHeight*1000))^0.5;
50
    AnyVar Ixx = 0.25*Mass*Radius^2 + 1/12*Mass*UBHeight^2;
51
    AnyVar Izz = Ixx;
52
    AnyVar Iyy = 0.5*Mass*Radius^2;
53
    
54
    AnyMat33 JMatRot = AnatomicalFrameTrunk.ARel*{{Ixx,0,0},{0,Iyy,0},{0,0,Izz}}*AnatomicalFrameTrunk.ARel';
55
    Jii = {JMatRot[0][0], JMatRot[1][1], JMatRot[2][2]};
56
    Jij = {JMatRot[1][0], JMatRot[2][1], JMatRot[2][0]};
57
58
    
59
    sCoM = Scale(StdPar.Thorax.sCoM_pos);
60
    JaboutCoMOnOff = On;
61
        
62
    AnyRefNode MoCapMarkerFrameAMMR24 = {}; ///< For backwards Compatibility with AMMR 2.4 MoCap Marker protocols    
63
    //Incisura jungularis right and left
64
    //the nodes are used for attachment of ShoulderArm block
65
    AnyRefNode ij = {
66
      AnyFloat Mirror = eye(3);
67
      //This is the standard value for the ij it must be used in order to scale the model
68
      //since nodes are inserted into this node.
69
      //If the position of ij are to be adjusted it should be done by changing sRelStd 
70
      AnyVec3 sRelStd = .StdPar.Thorax.ij_pos;  
71
      sRel = .Scale(sRelStd);
72
      // The rotation is adjusted to give same values as before the pelvic tilt adjust in AMMR 3.0.
73
      ARel = .AnatomicalFrameTrunk.ARel * RotMat(6.491948543235*pi/180,z) * {{0, 0, -1}, {0, 1, 0}, {1, 0, 0}};
74
    };
75
    
76
    AnyRefNode iji = {
77
      AnyFloat Mirror = {{-1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
78
      
79
      //This is the standard value for the ij it must be used in order to scale the model
80
      //since nodes are inserted into this node.
81
      //If the position of ij are to be adjusted it should be done by changing sRelS 
82
      AnyVec3 sRelStd = .StdPar.Thorax.iji_pos;    
83
      sRel = .Scale(sRelStd);      
84
      // The rotation is adjusted to give same values as before the pelvic tilt adjust in AMMR 3.0.
85
      ARel = .AnatomicalFrameTrunk.ARel*RotMat(6.491948543235*pi/180,z) * {{0, 0, -1}, {0, 1, 0}, {1, 0, 0}};
86
    };
87
        
88
    AnyRefNode T1C7JntNode = {sRel = .Scale(.StdPar.Thorax.T1C7JntNode_pos);};    
89
    AnyRefNode T1T2JntNode = {sRel = .Scale(.StdPar.Thorax.T1T2JntNode_pos);};    
90
    AnyRefNode T2T3JntNode = {sRel = .Scale(.StdPar.Thorax.T2T3JntNode_pos);};    
91
    AnyRefNode T3T4JntNode = {sRel = .Scale(.StdPar.Thorax.T3T4JntNode_pos);};    
92
    AnyRefNode T4T5JntNode = {sRel = .Scale(.StdPar.Thorax.T4T5JntNode_pos);};    
93
    AnyRefNode T5T6JntNode = {sRel = .Scale(.StdPar.Thorax.T5T6JntNode_pos);};    
94
    AnyRefNode T6T7JntNode = {sRel = .Scale(.StdPar.Thorax.T6T7JntNode_pos);};    
95
    AnyRefNode T7T8JntNode = {sRel = .Scale(.StdPar.Thorax.T7T8JntNode_pos);};    
96
    AnyRefNode T8T9JntNode = {sRel = .Scale(.StdPar.Thorax.T8T9JntNode_pos);};    
97
    AnyRefNode T9T10JntNode = {sRel = .Scale(.StdPar.Thorax.T9T10JntNode_pos);};    
98
    AnyRefNode T10T11JntNode = {sRel = .Scale(.StdPar.Thorax.T10T11JntNode_pos);};    
99
    AnyRefNode T11T12JntNode = {sRel = .Scale(.StdPar.Thorax.T11T12JntNode_pos);};    
100
    AnyRefNode T12L1JntNode = {sRel = .Scale(.StdPar.Thorax.T12L1JntNode_pos);};
101
102
    AnyRefNode CTCVJntNode = {}; ///<placeholder for the rigid thorax
103
    AnyRefNode CS          = {}; ///<placeholder for the rigid thorax
104
    AnyRefNode RibNodes = {
105
      AnyRefNode CTCVJntNodeR = {};    
106
      AnyRefNode CTCVJntNodeL = {};    
107
    };
108
    
109
    AnyRefNode ForceVectorNode = {sRel = .Scale(.StdPar.Thorax.ForceVectorNode_pos);};
110
    
111
112
    AnyRefNode T1C5Jnt = {sRel = .Scale(.StdPar.Thorax.T1C5Jnt_pos);};     
113
    
114
    AnyDrawSurf DrwSurf = {
115
      FileName = ...STL.FilenameThoraxSegWithoutNeck; 
116
      RGB = ...ColorRef.Segments;
117
      ScaleXYZ={1.0,1.0,1.0};
118
      Opacity = Main.DrawSettings.BonesOpacity.Thorax;
119
      AnyFunTransform3D &Scale =.Scale;
120
    };
121
122
    AnyRefNode Right ={
123
      AnyInt Sign = 1;
124
      #include "ThoraxScapulaContactRibPoints.any"
125
    };
126
    AnyRefNode Left ={
127
      AnyInt Sign = -1;
128
      #include "ThoraxScapulaContactRibPoints.any"
129
    };    
130
131
  }; // End of ThoraxSeg
132
  
133
  AnyFolder &T12Seg = ThoraxSeg;
134
  AnyFolder &T11Seg = ThoraxSeg;
135
  AnyFolder &T10Seg = ThoraxSeg;
136
  AnyFolder &T9Seg = ThoraxSeg;
137
  AnyFolder &T8Seg = ThoraxSeg;
138
  AnyFolder &T7Seg = ThoraxSeg;
139
  AnyFolder &T6Seg = ThoraxSeg;
140
  AnyFolder &T5Seg = ThoraxSeg;
141
  AnyFolder &T4Seg = ThoraxSeg;
142
  AnyFolder &T3Seg = ThoraxSeg;
143
  AnyFolder &T2Seg = ThoraxSeg;
144
  AnyFolder &T1Seg = ThoraxSeg;
145
  
146
  T1Seg = {
147
    T1C7JntNode = {
148
      // Rotated node with x axis parallel to the superior endplate surface
149
      AnyRefNode RotNode = {
150
        ARel = RotMat(0.5*(..T1SuperiorEndplateAnteriorNode.sRel + ..T1SuperiorEndplatePosteriorNode.sRel),
151
                      ..T1SuperiorEndplateAnteriorNode.sRel,
152
                      0.5*(..T1SuperiorEndplateAnteriorNode.sRel + ..T1SuperiorEndplatePosteriorNode.sRel) + (..T1SuperiorEndplateNodeL.sRel - ..T1SuperiorEndplateNodeR.sRel))*RotMat(pi/2,x);
153
      };
154
    };
155
    
156
    // Nodes at the anterior and posterior points on the superior endplate
157
    AnyRefNode T1SuperiorEndplateAnteriorNode = {sRel = .Scale(.StdPar.T1.SuperiorEndplateAnteriorNode_pos);};
158
    AnyRefNode T1SuperiorEndplatePosteriorNode = {sRel = .Scale(.StdPar.T1.SuperiorEndplatePosteriorNode_pos);};
159
    
160
    // Nodes at the right and left points on the superior endplate
161
    AnyRefNode T1SuperiorEndplateNodeR = {sRel = .Scale(.StdPar.T1.Right.SuperiorEndplateNode_pos);};
162
    AnyRefNode T1SuperiorEndplateNodeL = {sRel = .Scale(.StdPar.T1.Left.SuperiorEndplateNode_pos);};
163
  };
164
165
166
  #if BM_TRUNK_THORACIC_FUTURE == OFF
167
    AnyFolder &SkullSeg = .SegmentsCervicalSpine.SkullSeg;
168
  #endif
169
  
170
};
171
172
SegmentsRibCage = {
173
174
 RibsRight = {
175
 
176
  AnyFolder &R12Seg = ..SegmentsThorax.ThoraxSeg;
177
  AnyFolder &R11Seg = ..SegmentsThorax.ThoraxSeg;
178
  AnyFolder &R10Seg = ..SegmentsThorax.ThoraxSeg;
179
  AnyFolder &R9Seg = ..SegmentsThorax.ThoraxSeg;
180
  AnyFolder &R8Seg = ..SegmentsThorax.ThoraxSeg;
181
  AnyFolder &R7Seg = ..SegmentsThorax.ThoraxSeg;
182
  AnyFolder &R6Seg = ..SegmentsThorax.ThoraxSeg;
183
  AnyFolder &R5Seg = ..SegmentsThorax.ThoraxSeg;
184
  AnyFolder &R4Seg = ..SegmentsThorax.ThoraxSeg;
185
  AnyFolder &R3Seg = ..SegmentsThorax.ThoraxSeg;
186
  AnyFolder &R2Seg = ..SegmentsThorax.ThoraxSeg;
187
  AnyFolder &R1Seg = ..SegmentsThorax.ThoraxSeg;
188
 
189
 };
190
191
 RibsLeft = {
192
 
193
  AnyFolder &R12Seg = ..SegmentsThorax.ThoraxSeg;
194
  AnyFolder &R11Seg = ..SegmentsThorax.ThoraxSeg;
195
  AnyFolder &R10Seg = ..SegmentsThorax.ThoraxSeg;
196
  AnyFolder &R9Seg = ..SegmentsThorax.ThoraxSeg;
197
  AnyFolder &R8Seg = ..SegmentsThorax.ThoraxSeg;
198
  AnyFolder &R7Seg = ..SegmentsThorax.ThoraxSeg;
199
  AnyFolder &R6Seg = ..SegmentsThorax.ThoraxSeg;
200
  AnyFolder &R5Seg = ..SegmentsThorax.ThoraxSeg;
201
  AnyFolder &R4Seg = ..SegmentsThorax.ThoraxSeg;
202
  AnyFolder &R3Seg = ..SegmentsThorax.ThoraxSeg;
203
  AnyFolder &R2Seg = ..SegmentsThorax.ThoraxSeg;
204
  AnyFolder &R1Seg = ..SegmentsThorax.ThoraxSeg;
205
 
206
 };
207
208
209
};