265 lines (221 with data), 13.1 kB
/**
This is the root file for the leg model, it is using the simple Muscle model without
Force-Lenght-Velocity relationships.
The data for this model orginates from different sources. The model is partly based on the leg
model of Scott Delp. But modification has been made along the way.
The model contains the following files:
"StandardParameters.any" for overall parameters on which the model is based
"Seg.any" segments on the leg.
"Jnt.any" joint definitions for the leg.
"Muscle.any" muscle definitons for the leg.
"MusParSimple.any" muscle parameters for constant strength model.
"SegmentsTrunk.any" definition of pelvis segment.
*/
HipNodeRef = {
AnyFunTransform3D &Scale =.Scaling.GeometricalScaling.PelvisSeg.ScaleFunction;
// This vector contain the coordinates of the right HipJointNode.
// These coordinates has to be use for transforming the coordinates of the muscle insertion points
AnyVec3 T = {0.000000, -0.115000, .Sign*0.096000}; // The values are set to constant values to make it possible to move model around!
// These nodes are made as nodes in nodes, the reason for using this procedure instead of putting the nodes directly on the
// pelvis where they eventually will end up are that it makes it possible to have the leg as a selfcontained block.
// The nodes which are defined on the following lines are used by the leg model for muscle attachements on pelvis.
#if LEG_SIMPLE_MUSCLES_LOCAL == 1
AnyRefNode GluteusMinimus1Node = {sRel = .Scale(-.T+{0.024, -0.035, ..Sign*0.132});};
AnyRefNode GluteusMinimus2Node = {sRel = .Scale(-.T+{0.007, -0.025, ..Sign*0.107});};
AnyRefNode GluteusMinimus3Node = {sRel = .Scale( -.T+{-0.016, -0.035, ..Sign*0.078});};
AnyRefNode GluteusMedius1Node = {sRel = .Scale(-.T+{0.057, -0.022, ..Sign*0.143});};
AnyRefNode GluteusMedius2Node = {sRel = .Scale(-.T+{0.010, 0.034, ..Sign*0.112});};
AnyRefNode GluteusMedius3Node = {sRel = .Scale(-.T+{-0.040, 0.021, ..Sign*0.062});};
AnyRefNode GluteusMaximus1Node = {sRel = .Scale( -.T+{-0.043, -0.009, ..Sign*0.052});};
AnyRefNode GluteusMaximus1ViaNode1 = {sRel = .Scale( -.T+{-0.050, -0.075, ..Sign*0.12});};
AnyRefNode GluteusMaximus2Node = {sRel = .Scale(-.T+{-0.046, -0.039, ..Sign*0.041});};
AnyRefNode GluteusMaximus2ViaNode1 = {sRel = .Scale(-.T+{-0.060, -0.07, ..Sign*0.07});};
AnyRefNode GluteusMaximus2ViaNode2 = {sRel = .Scale(-.T+{-0.060, -0.105, ..Sign*0.10});};
AnyRefNode GluteusMaximus3Node = {sRel = .Scale(-.T+{-0.038, -0.067, ..Sign*0.018});};
AnyRefNode GluteusMaximus3ViaNode1 = {sRel = .Scale(-.T+{-0.060, -0.173, ..Sign*0.060});};
AnyRefNode TensorFasciaeLataeNode = {sRel = .Scale(-.T+{0.068, -0.038, ..Sign*0.152});};
AnyRefNode PiriformisNode = {sRel = .Scale(-.T+{-0.038, -0.058, ..Sign*0.037});};
AnyRefNode PiriformisViaNode = {sRel = .Scale(-.T+{-0.02, -0.095, ..Sign*0.106});};
AnyRefNode AdductorLongusNode = {sRel = .Scale(-.T+{0.074, -0.166, ..Sign*0.024});};
AnyRefNode AdductorMagnusNode = {sRel = .Scale(-.T+{-0.004, -0.197, ..Sign*0.022});};
AnyRefNode RectusFemorisNode = { sRel = .Scale(-.T+{0.031, -0.093, ..Sign*0.116});};
AnyRefNode SemitendinosusNode = {sRel = .Scale(-.T+{-0.058, -0.178, ..Sign*0.055});};
AnyRefNode SemimembranosusNode = {sRel = .Scale(-.T+{-0.058, -0.178, ..Sign*0.055});};
AnyRefNode BicepsFemorisCaputLongumNode = {sRel = .Scale(-.T+{-0.058, -0.178, ..Sign*0.055});};
AnyRefNode IliopsoasNode = {sRel = .Scale(-.T+{0.030, 0.015, ..Sign*0.096});};
AnyRefNode IliopsoasViaNode1 = {sRel = .Scale(-.T+{0.042, -0.111, ..Sign*0.093});};
AnyRefNode SartoriusNode = {sRel = .Scale(-.T+{0.068, -0.038, ..Sign*0.152});};
AnyRefNode GracilisNode = {sRel = .Scale(-.T+{0.035, -0.181, ..Sign*0.023});};
AnyRefNode QuadratusFemorisNode = {sRel = .Scale(-.T+{-0.03, -0.14, ..Sign*0.08});};
AnyRefNode AbductorBrevisNode = {sRel = .Scale(-.T+{0.045, -0.16, ..Sign*0.045});};
AnyRefNode ObturatoriusExternusNode = {sRel = .Scale(-.T+{-0.015, -0.17, ..Sign*0.05});};
AnyRefNode ObturatoriusInternusNode = {sRel = .Scale(-.T+{-0.03, -0.17, ..Sign*0.04});};
AnyRefNode ObturatoriusInternusViaNode = {
sRel=0.5*(.GemellusSuperiorNode.sRel+.GemellusInferiorNode.sRel);
// AnyDrawRefFrame drw={RGB={1,0,0};};
};
AnyRefNode PictineusNode = { sRel = .Scale(-.T+{0.065, -0.15, ..Sign*0.045});};
AnyRefNode GemellusInferiorNode = { sRel = .Scale(-.T+{-0.05, -0.14, ..Sign*0.055});};
AnyRefNode GemellusSuperiorNode = { sRel = .Scale(-.T+{-0.04, -0.12, ..Sign*0.045});};
// Definition of cylinder used for wrapping of the iliopsoas major muscle
AnyVec3 HipOffset = {0.03, -0.10, 0.08*.Sign};
AnyVec3 v1 = {0.068+0.01,-0.1201+0.01,(0.056+0.015)*.Sign}-HipOffset;
AnyVec3 v2 = {0.04,-0.13,0.048*.Sign}-HipOffset;
AnyVec3 v3 = 0.1*{0,0.743294,0.668965*.Sign}+{0.04,-0.13,0.048*.Sign}-HipOffset;
AnyVec3 v4 = {0.04,-0.13,0.048*.Sign}+0.03*{0,0.668965,-0.743294*.Sign}-HipOffset;
AnyRefNode IliopubicEminenceEndNode = {
sRel = .Scale(.v1+.HipOffset) - .Scale(.HipOffset);
}; //Via point for Psoas Major, will first be used as end point.
// Definition of cylinder used for wrapping of the psoas major muscle
AnyRefNode pecent_ossis_pubis={
sRel= .Scale(.v2+.HipOffset) - .Scale(.HipOffset);
AnyVec3 p2=.Scale(.v3+.HipOffset) - .Scale(.HipOffset);
AnyVec3 p3=.Scale(.v4+.HipOffset) - .Scale(.HipOffset);
//Calculate rot matrix for cylinder using three points
//p2-p1 used to find x axis
//p3-p1 used to find the y axis
//z axis found as cross product
AnyMat33 Mat = RotMat(sRel,p3,p2);
//Switch around the on the columns to compensate that the cylinder has
//main axis along the zaxis
ARel={
{Mat[0][2],Mat[0][0],Mat[0][1]},
{Mat[1][2],Mat[1][0],Mat[1][1]},
{Mat[2][2],Mat[2][0],Mat[2][1]}};
AnySurfCylinder cyl = {
Radius=((.sRel[0]-.p3[0])^2+(.sRel[1]-.p3[1])^2+(.sRel[2]-.p3[2])^2)^0.5;
Length= (((.sRel[0]-.p2[0])^2+(.sRel[1]-.p2[1])^2+(.sRel[2]-.p2[2])^2)^0.5)*1.5;
//AnyDrawParamSurf drw={RGB={0,0,1};};
};
};
#endif
#if LEG_MUS_3E_LOCAL == 1
AnyRefNode GluteusMinimus1Node = {sRel = .Scale(-.T+{0.024, -0.035, ..Sign*0.132});};
AnyRefNode GluteusMinimus2Node = {sRel = .Scale(-.T+{0.007, -0.025, ..Sign*0.107});};
AnyRefNode GluteusMinimus3Node = {sRel = .Scale( -.T+{-0.016, -0.035, ..Sign*0.078});};
AnyRefNode GluteusMedius1Node = {sRel = .Scale(-.T+{0.057, -0.022, ..Sign*0.143});};
AnyRefNode GluteusMedius2Node = {sRel = .Scale(-.T+{0.010, 0.034, ..Sign*0.112});};
AnyRefNode GluteusMedius3Node = {sRel = .Scale(-.T+{-0.040, 0.021, ..Sign*0.062});};
AnyRefNode GluteusMaximus1Node = {sRel = .Scale( -.T+{-0.043, -0.009, ..Sign*0.052});};
AnyRefNode GluteusMaximus1ViaNode1 = {sRel = .Scale( -.T+{-0.050, -0.075, ..Sign*0.12});};
AnyRefNode GluteusMaximus2Node = {sRel = .Scale(-.T+{-0.046, -0.039, ..Sign*0.041});};
AnyRefNode GluteusMaximus2ViaNode1 = {sRel = .Scale(-.T+{-0.060, -0.07, ..Sign*0.07});};
AnyRefNode GluteusMaximus2ViaNode2 = {sRel = .Scale(-.T+{-0.060, -0.105, ..Sign*0.10});};
AnyRefNode GluteusMaximus3Node = {sRel = .Scale(-.T+{-0.038, -0.067, ..Sign*0.018});};
AnyRefNode GluteusMaximus3ViaNode1 = {sRel = .Scale(-.T+{-0.060, -0.173, ..Sign*0.060});};
AnyRefNode TensorFasciaeLataeNode = {sRel = .Scale(-.T+{0.068, -0.038, ..Sign*0.152});};
AnyRefNode PiriformisNode = {sRel = .Scale(-.T+{-0.038, -0.058, ..Sign*0.037});};
AnyRefNode PiriformisViaNode = {sRel = .Scale(-.T+{-0.02, -0.095, ..Sign*0.106});};
AnyRefNode AdductorLongusNode = {sRel = .Scale(-.T+{0.074, -0.166, ..Sign*0.024});};
AnyRefNode AdductorMagnusNode = {sRel = .Scale(-.T+{-0.004, -0.197, ..Sign*0.022});};
AnyRefNode RectusFemorisNode = { sRel = .Scale(-.T+{0.031, -0.093, ..Sign*0.116});};
AnyRefNode SemitendinosusNode = {sRel = .Scale(-.T+{-0.058, -0.178, ..Sign*0.055});};
AnyRefNode SemimembranosusNode = {sRel = .Scale(-.T+{-0.058, -0.178, ..Sign*0.055});};
AnyRefNode BicepsFemorisCaputLongumNode = {sRel = .Scale(-.T+{-0.058, -0.178, ..Sign*0.055});};
AnyRefNode IliopsoasNode = {sRel = .Scale(-.T+{0.030, 0.015, ..Sign*0.096});};
AnyRefNode IliopsoasViaNode1 = {sRel = .Scale(-.T+{0.042, -0.111, ..Sign*0.093});};
AnyRefNode SartoriusNode = {sRel = .Scale(-.T+{0.068, -0.038, ..Sign*0.152});};
AnyRefNode GracilisNode = {sRel = .Scale(-.T+{0.035, -0.181, ..Sign*0.023});};
AnyRefNode QuadratusFemorisNode = {sRel = .Scale(-.T+{-0.01, -0.16, ..Sign*0.06});};
AnyRefNode AbductorBrevisNode = {sRel = .Scale(-.T+{0.045, -0.16, ..Sign*0.045});};
AnyRefNode ObturatoriusExternusNode = {sRel = .Scale(-.T+{-0.015, -0.17, ..Sign*0.05});};
AnyRefNode ObturatoriusInternusNode = {sRel = .Scale(-.T+{-0.03, -0.17, ..Sign*0.04});};
AnyRefNode ObturatoriusInternusViaNode = { sRel=0.5*(.GemellusSuperiorViaNode.sRel+.GemellusInferiorViaNode.sRel); };
AnyRefNode ObturatoriusInternusVia2Node = { sRel = (-.T+{-0.044, -0.13, ..Sign*0.055}); };
AnyRefNode PictineusNode = { sRel = .Scale(-.T+{0.065, -0.15, ..Sign*0.045});};
AnyRefNode GemellusInferiorNode = { sRel = .Scale(-.T+{-0.05, -0.15, ..Sign*0.055});};
AnyRefNode GemellusSuperiorNode = { sRel = .Scale(-.T+{-0.04, -0.11, ..Sign*0.045});};
AnyRefNode GemellusSuperiorViaNode = { sRel = .Scale({-0.025, 0.01, ..Sign*0.01}); };
AnyRefNode GemellusInferiorViaNode = { sRel = .Scale({-0.025, -0.015, ..Sign*0.02});};
// Definition of cylinder used for wrapping of the iliopsoas major muscle
AnyVec3 HipOffset = {0.03, -0.10, 0.08*.Sign};
AnyVec3 v1 = {0.068+0.01,-0.1201+0.01,(0.056+0.015)*.Sign}-HipOffset;
AnyVec3 v2 = {0.04,-0.13,0.048*.Sign}-HipOffset;
AnyVec3 v3 = 0.1*{0,0.743294,0.668965*.Sign}+{0.04,-0.13,0.048*.Sign}-HipOffset;
AnyVec3 v4 = {0.04,-0.13,0.048*.Sign}+0.03*{0,0.668965,-0.743294*.Sign}-HipOffset;
AnyRefNode IliopubicEminenceEndNode = {
sRel = .Scale(.v1+.HipOffset) - .Scale(.HipOffset);
}; //Via point for Psoas Major, will first be used as end point.
// Definition of cylinder used for wrapping of the psoas major muscle
AnyRefNode pecent_ossis_pubis={
sRel= .Scale(.v2+.HipOffset) - .Scale(.HipOffset);
AnyVec3 p2=.Scale(.v3+.HipOffset) - .Scale(.HipOffset);
AnyVec3 p3=.Scale(.v4+.HipOffset) - .Scale(.HipOffset);
//Calculate rot matrix for cylinder using three points
//p2-p1 used to find x axis
//p3-p1 used to find the y axis
//z axis found as cross product
AnyMat33 Mat = RotMat(sRel,p3,p2);
//Switch around the on the columns to compensate that the cylinder has
//main axis along the zaxis
ARel={
{Mat[0][2],Mat[0][0],Mat[0][1]},
{Mat[1][2],Mat[1][0],Mat[1][1]},
{Mat[2][2],Mat[2][0],Mat[2][1]}};
AnySurfCylinder cyl = {
Radius=((.sRel[0]-.p3[0])^2+(.sRel[1]-.p3[1])^2+(.sRel[2]-.p3[2])^2)^0.5;
Length= 1.3*((.sRel[0]-.p2[0])^2+(.sRel[1]-.p2[1])^2+(.sRel[2]-.p2[2])^2)^0.5;
// AnyDrawParamSurf drw={RGB={0,0,1};};
};
};
#endif
};
// Collection of the joints into JntDOF which are used by the applications.
AnyKinMeasureOrg JntDOF = {
// This is where the DOF of the leg are assembled into one single measure, this measure has the following DOF:
// 0 Ankle flexion/extension
// 1 Ankle abduction adduction
// 2 Knee flextion/extension
// 3 Hip adduction/abduction
// 4 Hip rotation externa/internal
// 5 Hip flexion/extension
AnyUniversalJoint &Ankle = .Jnt.Ankle;
AnyRevoluteJoint &Knee = .Jnt.Knee;
AnySphericalJoint &Hip = .Jnt.Hip;
};
// Definition of the leg segments
AnyFolder Seg = {
#include "Seg.any"
};
// Definition of the joints
AnyFolder Jnt = {
#include "Jnt.any"
};
// Definition of the muscles
#if LEG_SIMPLE_MUSCLES_LOCAL == 0 & LEG_MUS_3E_LOCAL == 0
#include "JointMuscles.any"
#else
AnyFolder Mus =
{
#include "Mus.any"
};
#endif
// Definition of the muscleParameters of the simple muscle model
#if LEG_SIMPLE_MUSCLES_LOCAL != 0 | LEG_MUS_3E_LOCAL != 0
AnyFolder MuscleModels =
{
AnyVar StressIndex=.StrengthRef.StrengthIndexLeg;
#if LEG_SIMPLE_MUSCLES_LOCAL == 1
#include "MusParSimple.any"
#endif
#if LEG_MUS_3E_LOCAL == 1
#define MuscleModelType "AnyMuscleModel3E"
#include "MusPar.any"
#undef MuscleModelType
#endif
};
#endif
///Summation of masses in the leg
AnyFolder MassSummation={
AnyVar Mass=.Seg.Thigh.Mass+.Seg.Shank.Mass+.Seg.Foot.Mass;
};
#ifdef DONT_USE_INITIAL_POSITION_FROM_MANNEQUIN
#else
#include "InitialPositions.any"
#endif
InterfaceFolder ={
#include "Interface.any"
};
MannequinValuesFolder ={
#include "MannequinValuesFromModel.any"
};