[38ba34]: / Body / AAUHuman / LegTLEM1 / Jnt.any

Download this file

188 lines (150 with data), 6.4 kB

// SubTalar and PatellaFemur joint added. November 2007, Karin Gorter

// Definitions of joints in the right lower extremity.
//
// // Mark de Zee
//

#if BM_FOOT_MODEL == _FOOT_MODEL_DEFAULT_
#if (BM_JOINT_TYPE_ANKLE_RIGHT != _JOINT_TYPE_USERDEFINED_ & _LEFT_RIGHT_ == "Right") | (BM_JOINT_TYPE_ANKLE_LEFT != _JOINT_TYPE_USERDEFINED_ & _LEFT_RIGHT_ == "Left")
AnyRevoluteJoint Ankle = {
  Axis = z; //flexion extension
  //Axis2  =  x; //abduction adduction
  AnyRefNode &ShankNode = ..Seg.Shank.AnkleJoint;
  AnyRefNode &FootNode  = ..Seg.Talus.AnkleJoint;
  //ShankNode ={AnyDrawRefFrame drw={RGB={0,1,0};};};
  //AnyDrawStdJoint Ankle = {  };
};
#endif

#if (BM_JOINT_TYPE_SUBTALAR_RIGHT != _JOINT_TYPE_USERDEFINED_ & _LEFT_RIGHT_ == "Right") | (BM_JOINT_TYPE_SUBTALAR_LEFT != _JOINT_TYPE_USERDEFINED_ & _LEFT_RIGHT_ == "Left")
AnyRevoluteJoint SubTalar = {
  //Axis1 = z; //flexion extension
  Axis =  z; //inversion eversion 
  AnyRefNode &TalusNode = ..Seg.Talus.SubTalarJoint;
  AnyRefNode &FootNode  = ..Seg.Foot.SubTalarJoint;
  //TalusNode ={AnyDrawRefFrame drw={RGB={1,0,0};};};
  //AnyDrawStdJoint SubTalar = {  };
};
#endif
#endif

#if (BM_JOINT_TYPE_KNEE_RIGHT != _JOINT_TYPE_USERDEFINED_ & _LEFT_RIGHT_ == "Right") | (BM_JOINT_TYPE_KNEE_LEFT != _JOINT_TYPE_USERDEFINED_ & _LEFT_RIGHT_ == "Left")
AnyRevoluteJoint Knee = {
  Axis = z;
  AnyRefNode &ThighNode = ..Seg.Thigh.KneeJoint;
  AnyRefNode &ShankNode = ..Seg.Shank.KneeJoint;
  //AnyDrawStdJoint Knee = {  };
}; // End of knee
#endif

#if (BM_JOINT_TYPE_PATELLOFEMORAL_RIGHT != _JOINT_TYPE_USERDEFINED_ & _LEFT_RIGHT_ == "Right") | (BM_JOINT_TYPE_PATELLOFEMORAL_LEFT != _JOINT_TYPE_USERDEFINED_ & _LEFT_RIGHT_ == "Left")
AnyRevoluteJoint PatellaFemur = {
  Axis = z;
  AnyRefNode &ThighNode = ..Seg.Thigh.PatellaFemurJoint;
  AnyRefNode &PatellaNode = ..Seg.Patella.PatellaFemurJoint;
}; // End of patellafemur
#endif


//AnyUniversalJoint PatellaFemur = {
//  Axis1 = z;
//  Axis2 = x;
//  AnyRefNode &ThighNode = ..Seg.Thigh.PatellaFemurJoint;
// // ThighNode ={AnyDrawRefFrame drw={RGB={0,1,0};};};
//  AnyRefNode &PatellaNode = ..Seg.Patella.PatellaFemurJoint;
//
//};



#if (BM_JOINT_TYPE_PATELLATENDON_RIGHT != _JOINT_TYPE_USERDEFINED_ & _LEFT_RIGHT_ == "Right") | (BM_JOINT_TYPE_PATELLATENDON_LEFT != _JOINT_TYPE_USERDEFINED_ & _LEFT_RIGHT_ == "Left")
AnyFolder KinematicMeasures = {
  AnyKinPLine Patella = {
    // These are the nodes that the measure refers to. The connection is regarded
    // as being stiff. 
    AnyRefNode &Origin_patella_tendon = ...Seg.Patella.Origin_patella_tendon;
    AnyRefNode &Insertion_patella_tendon = ...Seg.Shank.Insertion_patella_tendon;
    
    
    //AnyRefNode &Insertion_patella_tendon = ...Seg.Shank.Insertion_patella_tendon;
    
    AnyDrawPLine Patella_tendon = 
    {
      Thickness = 0.001;
      RGB = {1,0,0};
      Opacity = ....BonesOpacity.Patella;
    };
  };
  
  //    AnyKinRotational PatellaRot = 
  //    {
  //      Type = RotAxesAngles;
  //      Axis1 = z;
  //      Axis2 = y;
  //      Axis3 = x;
  //      //Ref = 0;
  //      //AngVelOnOff = Off;
  //      //AngVelGlobal = Off;
  //      AnyRefFrame &Femur_pjoint = ...Seg.Thigh.PatellaFemurJoint;
  //      AnyRefFrame &Patella_joint = ...Seg.Patella.PatellaFemurJoint;
  //    //Ref =1;
  //    };
  //    
  //  AnyKinRotational PatellaTendonRot = 
  //  {
  //    Type = RotAxesAngles;
  //    Axis1 = z;
  //    Axis2 = x;
  //    Axis3 = y;
  //    //Ref = 0;
  //    //AngVelOnOff = Off;
  //    //AngVelGlobal = Off;
  //    AnyRefNode &PatellaInsertionNode = ...Seg.Patella.Insertion_patella_tendon;
  //    AnyRefNode &PatellaNode = ...Seg.Shank.Insertion_patella_tendon;
  //    //Ref =1;
  //  };
  
  
};

// KinematicMeasures


//  AnyKinEqSimpleDriver PFFlexion = 
//  {
//   // AnyVar Angle = .JntDOF.Knee.Pos[0];
////    MeasureOrganizer = {};
//  // CType = ;
//   // WeightFun = {};
//    DriverPos = {.JntDOF.Knee.Pos};
//    DriverVel = 0;
//    AnyKinMeasure& PFFlexion = Main.Studies.HumanModel.BodyModel.Interface.Right.PatellaFlexion;
//    Reaction.Type = {On};  
//  };

//  AnyKinEqSimpleDriver PatellaMovement = {
//    AnyKinPLine &Jnt = .KinematicMeasures.Patella;
//    
//    // Scale patella tendon length based on the over all leg length
//    AnyVar lengthScale = (vnorm(..Seg.Thigh.HipJoint.sRel-..Seg.Thigh.KneeJoint.sRel) + vnorm(..Seg.Shank.KneeJoint.sRel - ..Seg.Shank.AnkleJoint.sRel))
//                / vnorm((..Seg.Thigh.StdPar.HipJoint-..Seg.Thigh.StdPar.KneeJoint) + vnorm(..Seg.Shank.StdPar.AnkleJoint-..Seg.Shank.StdPar.KneeJoint));
//   AnyVar TendonLength =  lengthScale *0.097; 

//    DriverPos = {TendonLength};
//    DriverVel = {0.0};
//    Reaction.Type = {On};  // The muscles must do the work
//  };
//  AnyKinEqSimpleDriver PatellaMovement = {
//    AnyKinPLine &Jnt = .KinematicMeasures.Patella;
//    
//    AnyFloat gscale = vnorm(..GeoScaling.Shank.ScaleFunction.ScaleMat);
//    
//    DriverPos = gscale[1]*{0.0605};
//    DriverVel = {0.0};
//    Reaction.Type = {On};  // The muscles must do the work
//  };

AnyKinEqSimpleDriver PatellaMovement = {
  AnyKinPLine &Jnt = .KinematicMeasures.Patella;
  
  // Scale patella tendon length based on the over all leg length
  AnyVar lengthScale = vnorm(..Seg.Shank.KneeJoint.sRel - ..Seg.Shank.Insertion_patella_tendon.sRel)
  / vnorm(..Seg.Shank.StdPar.Insertion_patella_tendon-..Seg.Shank.StdPar.KneeJoint);
  
  
  
  
  
  AnyVar TendonLength =  lengthScale *..ModelParameters.PatellarLigamentLength; 
  
  
  
  DriverPos = {TendonLength};
  DriverVel = {0.0};
  Reaction.Type = {On};  // The muscles must do the work
};


//  AnyKinEq PatellaMRotation= 
//  {
//    MeasureOrganizer = {2};
//    AnyKinMeasure& PatellaJnt = .KinematicMeasures.PatellaRot;
//    Reaction.Type = {On};
//  };
//
#endif

#if (BM_JOINT_TYPE_HIP_RIGHT != _JOINT_TYPE_USERDEFINED_ & _LEFT_RIGHT_ == "Right") | (BM_JOINT_TYPE_HIP_LEFT != _JOINT_TYPE_USERDEFINED_ & _LEFT_RIGHT_ == "Left")
// Defined with the femoral node first so reactions are reported in femur based reference frame.
AnySphericalJoint Hip = {
  AnyRefNode &ThighNode = ..Seg.Thigh.HipJoint;
  AnyRefNode &PelvisNode = ..Seg.Pelvis.HipJoint;
  
}; // End of Hip
#endif