Skip to content

Commit 0cf5e52

Browse files
committed
Update tutorials files for FDK lesson3 and lesson4 (#114)
* Update tutorials files for FDK lesson3 and lessor4 fixes: #83 * Update text with reference to lesson 3.
1 parent 8ecb06c commit 0cf5e52

5 files changed

Lines changed: 90 additions & 90 deletions

File tree

ForceDependentKinematics/Downloads/DemoSimpleKnee3.any

Lines changed: 18 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,18 @@ Main = {
99
// Global Reference Frame
1010
AnyFixedRefFrame GlobalRef = {
1111
}; // Global reference frame
12-
12+
1313
// Definition of the thigh segment
1414
AnySeg Thigh = {
1515
r0 = {0.4, 0, 0};
1616
Axes0 = RotMat(pi/2,z);
1717
Mass = 5;
1818
Jii = {0.3, 0.01, 0.3}*0.7;
19-
19+
2020
// This is the center of the nominal knee joint. Notice that
2121
// the actual knee center will vary when we use FDK.
2222
AnyRefNode KneeCenter = {
2323
sRel = {-0.03, -0.4, 0.0};
24-
AnyDrawRefFrame drw = {RGB = {0,0,0}; ScaleXYZ = 0.05 * {1,1,1};};
2524

2625
// Define a cylinder representing the femoral condyle. The quadriceps
2726
// will wrap about this cylinder.
@@ -34,26 +33,15 @@ Main = {
3433
RGB = {0, 0, 1};
3534
};
3635
};
37-
};
38-
39-
// Define a STL file as femoral condyle for the joint geometry. The tibial
40-
// condyle will slide along this geometry.
41-
AnySurfSTL FemoralHead = {
42-
FileName = "simplefemoral.stl";
43-
AnyDrawSurf drw = {
44-
FileName = .FileName;
45-
Opacity = 0.5;
46-
};
4736
};
4837
};
49-
5038
AnyRefNode HipCenter = {
5139
sRel = {0.0, 0.4, 0.0};
5240
};
5341

5442
// Origin of the quadriceps muscle.
5543
AnyRefNode Quadriceps = {
56-
sRel = {0.06, 0.0, 0.0};
44+
sRel = {0.00, 0.3, 0.0};
5745
};
5846
AnyDrawSeg drw ={
5947
Opacity = 0.5;
@@ -64,49 +52,20 @@ Main = {
6452
r0 = {0.8, -0.4, 0.0};
6553
Mass = 4;
6654
Jii = {0.4, 0.01, 0.4}*0.4;
67-
AnyDrawSeg drw = {
55+
AnyDrawSeg drw ={
6856
Opacity = 0.5;
6957
RGB = {1,0,0};
7058
};
7159

72-
7360
AnyRefNode KneeCenter = {
7461
sRel = {0.0, 0.4, 0.0};
75-
AnyDrawRefFrame drw = {RGB = {1,1,1}; ScaleXYZ = 0.05 * {1,1,1};};
76-
77-
78-
// Define a STL file as tibial plateau for the joint geometry. The
79-
// tibial plateau will slide along the femoral condile during movement.
80-
AnyRefNode SurfSTLCenter = {
81-
sRel = {0.01,-0.04,0};
82-
AnySurfSTL TibialPlateau= {
83-
FileName = "simpletibial.stl";
84-
AnyDrawSurf drw = {
85-
FileName = .FileName;
86-
Opacity = 0.5;
87-
};
88-
};
89-
};
9062
};
9163
AnyRefNode Quadriceps = {
92-
sRel={0.05, 0.3, 0.0};
64+
sRel={0.00, 0.3, 0.0};
9365
};
9466
};
95-
96-
97-
// Define a contact force between the STL surfaces of the femoral condyle and
98-
// the tibial plateau to make these surfaces to make the surfaces slide along
99-
// each other.
100-
AnyForceSurfaceContact ContactForce = {
101-
AnySurface &surfMaster = .Thigh.KneeCenter.FemoralHead;
102-
AnySurface &surfSlave = .Shank.KneeCenter.SurfSTLCenter.TibialPlateau;
103-
PressureModule = 5e7;
104-
ForceViewOnOff = On;
105-
};
106-
107-
108-
109-
67+
68+
11069
// Hip joint between the thigh and ground
11170
AnyRevoluteJoint Hip = {
11271
AnyRefFrame &ref1 = .GlobalRef;
@@ -119,7 +78,7 @@ Main = {
11978
DriverPos = {pi/2};
12079
DriverVel = {0};
12180
};
122-
81+
12382
// Knee joint. Notice that this is only going to be the nominal joint.
12483
// The actual position of the knee joint center will depend on the forces
12584
// acting upon it. Notice that we list the shank before the thigh. This
@@ -136,30 +95,33 @@ Main = {
13695
Constraints = {
13796
CType = {ForceDep, ForceDep, Hard, Hard, Hard};
13897
Reaction.Type={Off,Off,On,On,On};
139-
14098
};
14199
};
142100

101+
// AnyKinLinear lin =
102+
// {
103+
// //Ref = -1;
104+
// AnyRefFrame &Shank = .Shank.KneeCenter;
105+
// AnyRefFrame &Thigh = .Thigh.KneeCenter;
106+
// };
107+
143108

144109
// Define springs in the knee, simulating the effect of cartilage
145110
// and ligaments.
146111
AnyForce KneeStiffness = {
147112
// AnyKinLinear &lin = .lin;
148113
AnyKinLinear &lin = Main.MyModel.KneeJoint.Linear;
149-
F = {-1000*lin.Pos[0], -5000*lin.Pos[1], 0};
114+
F = {-1e3*lin.Pos[0], -5e3*lin.Pos[1], 0};
150115
};
151-
152-
153-
154-
116+
155117
// Knee driver- just a simple knee extension.
156118
AnyKinEqSimpleDriver KneeDriver = {
157119
DriverPos = {pi/2};
158120
DriverVel = {-pi/30};
159121
AnyRevoluteJoint &KneeJoint = .KneeJoint;
160122
Reaction.Type={Off}; // The muscles must carry this movement
161123
};
162-
124+
163125
// Muscle
164126
AnyMuscleShortestPath Quadriceps = {
165127
AnyMuscleModel MuscleModel = {
@@ -191,11 +153,3 @@ Main = {
191153
}; // Main
192154

193155

194-
195-
196-
197-
198-
199-
200-
201-

ForceDependentKinematics/Downloads/DemoSimpleKnee3a.any renamed to ForceDependentKinematics/Downloads/DemoSimpleKnee4.any

Lines changed: 64 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,19 @@ Main = {
99
// Global Reference Frame
1010
AnyFixedRefFrame GlobalRef = {
1111
}; // Global reference frame
12-
12+
1313
// Definition of the thigh segment
1414
AnySeg Thigh = {
1515
r0 = {0.4, 0, 0};
1616
Axes0 = RotMat(pi/2,z);
1717
Mass = 5;
1818
Jii = {0.3, 0.01, 0.3}*0.7;
19-
19+
2020
// This is the center of the nominal knee joint. Notice that
2121
// the actual knee center will vary when we use FDK.
2222
AnyRefNode KneeCenter = {
2323
sRel = {-0.03, -0.4, 0.0};
24+
AnyDrawRefFrame drw = {RGB = {0,0,0}; ScaleXYZ = 0.05 * {1,1,1};};
2425

2526
// Define a cylinder representing the femoral condyle. The quadriceps
2627
// will wrap about this cylinder.
@@ -33,15 +34,26 @@ Main = {
3334
RGB = {0, 0, 1};
3435
};
3536
};
37+
};
38+
39+
// Define a STL file as femoral condyle for the joint geometry. The tibial
40+
// condyle will slide along this geometry.
41+
AnySurfSTL FemoralHead = {
42+
FileName = "simplefemoral.stl";
43+
AnyDrawSurf drw = {
44+
FileName = .FileName;
45+
Opacity = 0.5;
46+
};
3647
};
3748
};
49+
3850
AnyRefNode HipCenter = {
3951
sRel = {0.0, 0.4, 0.0};
4052
};
4153

4254
// Origin of the quadriceps muscle.
4355
AnyRefNode Quadriceps = {
44-
sRel = {0.06, 0.0, 0.0};
56+
sRel = {0.00, 0.3, 0.0};
4557
};
4658
AnyDrawSeg drw ={
4759
Opacity = 0.5;
@@ -52,20 +64,49 @@ Main = {
5264
r0 = {0.8, -0.4, 0.0};
5365
Mass = 4;
5466
Jii = {0.4, 0.01, 0.4}*0.4;
55-
AnyDrawSeg drw ={
67+
AnyDrawSeg drw = {
5668
Opacity = 0.5;
5769
RGB = {1,0,0};
5870
};
5971

72+
6073
AnyRefNode KneeCenter = {
6174
sRel = {0.0, 0.4, 0.0};
75+
AnyDrawRefFrame drw = {RGB = {1,1,1}; ScaleXYZ = 0.05 * {1,1,1};};
76+
77+
78+
// Define a STL file as tibial plateau for the joint geometry. The
79+
// tibial plateau will slide along the femoral condile during movement.
80+
AnyRefNode SurfSTLCenter = {
81+
sRel = {0.01,-0.04,0};
82+
AnySurfSTL TibialPlateau= {
83+
FileName = "simpletibial.stl";
84+
AnyDrawSurf drw = {
85+
FileName = .FileName;
86+
Opacity = 0.5;
87+
};
88+
};
89+
};
6290
};
6391
AnyRefNode Quadriceps = {
64-
sRel={0.00, 0.3, 0.0};
92+
sRel={0.05, 0.3, 0.0};
6593
};
6694
};
67-
68-
95+
96+
97+
// Define a contact force between the STL surfaces of the femoral condyle and
98+
// the tibial plateau to make these surfaces to make the surfaces slide along
99+
// each other.
100+
AnyForceSurfaceContact ContactForce = {
101+
AnySurface &surfMaster = .Thigh.KneeCenter.FemoralHead;
102+
AnySurface &surfSlave = .Shank.KneeCenter.SurfSTLCenter.TibialPlateau;
103+
PressureModule = 5e7;
104+
ForceViewOnOff = On;
105+
};
106+
107+
108+
109+
69110
// Hip joint between the thigh and ground
70111
AnyRevoluteJoint Hip = {
71112
AnyRefFrame &ref1 = .GlobalRef;
@@ -78,7 +119,7 @@ Main = {
78119
DriverPos = {pi/2};
79120
DriverVel = {0};
80121
};
81-
122+
82123
// Knee joint. Notice that this is only going to be the nominal joint.
83124
// The actual position of the knee joint center will depend on the forces
84125
// acting upon it. Notice that we list the shank before the thigh. This
@@ -95,33 +136,30 @@ Main = {
95136
Constraints = {
96137
CType = {ForceDep, ForceDep, Hard, Hard, Hard};
97138
Reaction.Type={Off,Off,On,On,On};
139+
98140
};
99141
};
100142

101-
// AnyKinLinear lin =
102-
// {
103-
// //Ref = -1;
104-
// AnyRefFrame &Shank = .Shank.KneeCenter;
105-
// AnyRefFrame &Thigh = .Thigh.KneeCenter;
106-
// };
107-
108143

109144
// Define springs in the knee, simulating the effect of cartilage
110145
// and ligaments.
111146
AnyForce KneeStiffness = {
112147
// AnyKinLinear &lin = .lin;
113148
AnyKinLinear &lin = Main.MyModel.KneeJoint.Linear;
114-
F = {-1e3*lin.Pos[0], -5e3*lin.Pos[1], 0};
149+
F = {-1000*lin.Pos[0], -5000*lin.Pos[1], 0};
115150
};
116-
151+
152+
153+
154+
117155
// Knee driver- just a simple knee extension.
118156
AnyKinEqSimpleDriver KneeDriver = {
119157
DriverPos = {pi/2};
120158
DriverVel = {-pi/30};
121159
AnyRevoluteJoint &KneeJoint = .KneeJoint;
122160
Reaction.Type={Off}; // The muscles must carry this movement
123161
};
124-
162+
125163
// Muscle
126164
AnyMuscleShortestPath Quadriceps = {
127165
AnyMuscleModel MuscleModel = {
@@ -153,3 +191,11 @@ Main = {
153191
}; // Main
154192

155193

194+
195+
196+
197+
198+
199+
200+
201+

ForceDependentKinematics/lesson3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ AnySeg Shank = {
4949
sRel = {0.0, 0.4, 0.0};
5050
};
5151
AnyRefNode Quadriceps = {
52-
sRel={§0.00§, 0.3, 0.0};
52+
sRel={§0.00, 0.3, 0.0§};
5353
};
5454
};
5555
```

ForceDependentKinematics/lesson4.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ simple and does not resemble the geometry of a real anatomical knee very
88
well. However, AnyBody also contains facilities for development of more
99
realistic geometries of surfaces such as the femoral condyles, and we
1010
shall explore those in this lesson. We start from the model developed in
11-
the second lesson. If you did not manage to obtain a working model from
12-
the second lesson, then please download a new one
13-
{download}`here <Downloads/DemoSimpleKnee2.any>`.
11+
the third lesson. If you did not manage to obtain a working model from
12+
the third lesson, then please download a new one
13+
{download}`here <Downloads/DemoSimpleKnee3.any>`.
1414

1515
In this example, we are modeling the knee joint using some simplified
1616
2-D implants (see picture) for the femoral head and the tibial plateau.
@@ -59,7 +59,7 @@ AnySeg Thigh = {
5959
};
6060
6161
AnyRefNode Quadriceps = {
62-
sRel = {0.06, 0.0, 0.0};
62+
sRel = {0.00, 0.3, 0.0};
6363
};
6464
AnyDrawSeg drw ={
6565
Opacity = 0.5;
@@ -136,7 +136,7 @@ AnySeg Thigh = {
136136
sRel = {0.0, 0.4, 0.0};
137137
};
138138
AnyRefNode Quadriceps = {
139-
sRel = {0.06, 0.0, 0.0};
139+
sRel = {0.00, 0.3, 0.0};
140140
};
141141
AnyDrawSeg drw ={
142142
Opacity = 0.5;
@@ -228,7 +228,7 @@ We are now done with this lesson. You can now play around with this
228228
model by changing e.g. the pressure module to change the penetration of
229229
the implants or the positions of the tibial part to change the motion.
230230
If you couldn’t make your model run up to this point, you can find the
231-
complete model {download}`here <Downloads/DemoSimpleKnee3.any>`.
231+
complete model {download}`here <Downloads/DemoSimpleKnee4.any>`.
232232

233233
In {doc}`Lesson5 <lesson5>` we can see how this kind of joint can be
234234
included into an existing model based on an AMMR body model.

locale/ja/LC_MESSAGES/ForceDependentKinematics/lesson4.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ msgid ""
152152
" by changing e.g. the pressure module to change the penetration of the "
153153
"implants or the positions of the tibial part to change the motion. If you"
154154
" couldn’t make your model run up to this point, you can find the complete"
155-
" model :download:`here <Downloads/DemoSimpleKnee3.any>`."
155+
" model :download:`here <Downloads/DemoSimpleKnee4.any>`."
156156
msgstr ""
157157

158158
#: ../../ForceDependentKinematics/lesson4.rst:239

0 commit comments

Comments
 (0)