1988 lines (1571 with data), 97.7 kB
/***************** Seg.any *******************************
This files construct all segments in the LegTLEM model.
This model is based on the cadaver dataset published in:
M.D. Klein Horsman, H.F.J.M. Koopman, F.C.T. van der Helm,
L. Poliacu Pros? H.E.J. Veeger Morphological muscle and
joint parameters for musculoskeletal modelling of the lower
extremity Clinical Biomechanics, Volume 22, Issue 2,
February 2007, Pages 239-247, ISSN 0268-0033
Klein Horsman,M.D.; Koopman,H.F.J.M.; van der Helm,F.C.T.;
Pros?L.Poliacu; Veeger,H.E.J. (2007). The dataset is also
know as also know as the Twente Lower Extremity Model (TLEM).
The implementation in AnyBody retains the coordinate system of
the original dataset, to allow direct comparison with the
published data. Thus, all segment have their same technical
coordinate which correspond to the lab coordinate system during
the cadaver study. The lab coordinate system was fixed at the
hip joint center and alligned with the anatomical coordinate
system of the pelvis during the cadaver session.
The first implementation in AnyScript was done by Karin Gorter
in 2007. Some bug fixes and and structural changes have been
added implemention. These also include correction due to errors
in the original dataset.
Brief change log:
-------------------------------------------------
Sep. Translation vectors added to some of the foot and tibia
2007 insertion points or viapoints, to obtain a reasonable fit
with the anatomical position (and viapoints 9-13 for the
Extensor Hallucis Longus commented out for the same reason).
Mar. Axes of Rotation and Centers of Rotation of the Ankle and
2008 Subtalar joint changed with respect to a improved anatomical
position. Some muscle insertion and via point translated
(addtional translation vectors)
Sebastian Dendorfer March 2008
Sep. Added via points to the medial and lateral gastroc
2011
Apr. Restructring of the file. All hardcoded values have been moved
2012 to the file 'ModelParameters.any'. Added an option to redine
the ankle and knee joint to be defined by bony landmarks
instead of the original joint definitions. This new definition
of joint parameters is used in by some applications in AMMR1.5.
Moments of inertia have been changed to follow the main axis of
thigh and shank. Added coordinate system based on the ISB
definition of coordinate systems in the G. Wu, S. Siegler,
P. Allard, C. Kirtley, A. Leardini, D. Rosenbaum, M. Whittle,
D. D'Lima, L. Cristofolini, H. Witte, O. Schmid, I. Stokes.
J. Biomech.35(4):543-548, 2002
Apr. Restructure scaling for more accurate definition of anatomical
2013 frames for scaling including handling of un-scaled and scaled
definitions of these.
Furthermore, model updates arising from the TLEMsafe project
have been implemented and a new model morphology has been
introduced as a parallel option to the existing one.
The new morphology is prepared for TLEM version 2.0, which
is not released yet.
*/
// The Talus segment represents the part between the ankle joint
// and the subtalar joint.
#ifndef SKIN
#define SKIN 0
#endif
#ifndef MUSCLETISSUE
#define MUSCLETISSUE 0
#endif
#ifndef DRAWAXES
#define DRAWAXES 0
#endif
AnyFolder STL =
{
#include "<BM_LEG_DATASET_PATH>STL.any"
};
#if BM_FOOT_MODEL == _FOOT_MODEL_DEFAULT_
AnySeg &Talus = Foot.Talus;
AnySeg Foot =
{
AnyFolder &StdPar = ..ModelParameters.Foot;
JaboutCoMOnOff = On;
r0=.Talus.SubTalarJoint.sRel*.Talus.Axes0'+.Talus.r0-SubTalarJoint.sRel*Axes0';
/// pUnscaled = {LateralMalleolus, MedialMalleolus, Metatarsal2} //bony landmarks to define orgin and long axis of the foot and three coplanar points to define the
/// horizontal plane parallel to the ground. These can be on the bones, skin, shoe, etc. and determine the proximal-distal axis of the foot and ankle plantarflexion zero value
AnyFloat pUnscaled = {StdPar.LateralMalleolus, StdPar.MedialMalleolus, StdPar.Metatarsal2PlantarNode,StdPar.HeelPlantarNode, StdPar.Metatarsal5PlantarNode, StdPar.Metatarsal1PlantarNode};
AnyFunTransform3D& GeomScale = ..GeoScaling.Foot.ScaleFunction;
AnyVar Sign = ..Sign;
// p={LateralMalleolus, MedialMalleolus, Metatarsal2, Heel, Metatarsal5, Metatarsal1} //bony landmarks to define orgin and long axis of the foot
// and three coplanar points to define the horizontal plane parallel to the ground. These can be on the bones, skin, shoe, etc. and
// determine the proximal-distal axis of the foot and ankle plantarflexion zero value
#define MACRO_CONSTRUCT_ANATOMICAL_FRAME_s(p, SIGN) 0.5*(p[0]+p[1])
#define MACRO_CONSTRUCT_ANATOMICAL_FRAME_A(p, SIGN) RotMat(0.5*(p[0]+p[1]),0.5*(p[0]+p[1]) + cross(p[4]-p[3],p[5]-p[3])*SIGN, p[2]) * RotMat(-0.5*pi,z) * RotMat(1*pi,y)
#include "..\Scaling\SegScaleFunWrtAnatomicalFrame.any"
AnyRefNode AnatomicalFrame =
{
AnyFloat pScaled = .Scale(.pUnscaled);
sRel = MACRO_CONSTRUCT_ANATOMICAL_FRAME_s(pScaled, .Sign);
ARel = MACRO_CONSTRUCT_ANATOMICAL_FRAME_A(pScaled, .Sign);
AnyVec3 sRelUnscaled = MACRO_CONSTRUCT_ANATOMICAL_FRAME_s(.pUnscaled, .Sign);///< Generic unscaled position of foot ScalingNode
AnyMat33 ARelUnscaled = MACRO_CONSTRUCT_ANATOMICAL_FRAME_A(.pUnscaled, .Sign);///< Generic unscaled rotation of foot ScalingNode
};
AnySeg Talus =
{
AnyFolder &StdPar = ...ModelParameters.Talus;
JaboutCoMOnOff = On;
AnyVar MassS=...MassScaling.Talus.MassScale;
r0=..Shank.AnkleJoint.sRel*..Shank.Axes0'+..Shank.r0-AnkleJoint.sRel*Axes0';
/// pUnscaled = pUnscaled from foot = {LateralMalleolus, MedialMalleolus, Metatarsal2, Heel, Metatarsal5, Metatarsal1} //bony landmarks to define orgin and long axis of the foot
/// and three coplanar points to define the horizontal plane parallel to the ground. These can be on the bones, skin, shoe, etc. and
/// determine the proximal-distal axis of the foot and ankle plantarflexion zero value
AnyFloat pUnscaled = .pUnscaled;
AnyFunTransform3D& GeomScale = ...GeoScaling.Talus.ScaleFunction;
AnyVar Sign = ...Sign;
#include "..\Scaling\SegScaleFunWrtAnatomicalFrame.any"
AnyRefNode AnatomicalFrame =
{
AnyFloat pScaled = .Scale(.pUnscaled);
sRel = MACRO_CONSTRUCT_ANATOMICAL_FRAME_s(pScaled, .Sign);
ARel = MACRO_CONSTRUCT_ANATOMICAL_FRAME_A(pScaled, .Sign);
AnyVec3 sRelUnscaled = MACRO_CONSTRUCT_ANATOMICAL_FRAME_s(.pUnscaled, .Sign); ///< Generic unscaled position of talus ScalingNode
AnyMat33 ARelUnscaled = MACRO_CONSTRUCT_ANATOMICAL_FRAME_A(.pUnscaled, .Sign);///< Generic unscaled rotation of talus ScalingNode
};
/// For backwards Compatibility with AMMR 2.4 MoCap Marker protocols
AnyRefNode& MoCapMarkerFrameAMMR24 = AnatomicalFrame;
AnyRefNode& ScalingNode = AnatomicalFrame ;
/// For backwards Compatibility with AMMR 2.4 talus coordinate system
AnyRefNode TalusCompatibilityFrameAMMR24 = {
sRel = .Scale({0.01113461, 0.01995294, ..Sign*-0.01282196});
#if _LEFT_RIGHT_ == "Right"
ARel = {{0.9729412, -0.02857795, 0.2292786},
{0.01838066, 0.9987497, 0.04648894},
{-0.2303205, -0.04101672, 0.97225}};
#endif
#if _LEFT_RIGHT_ == "Left"
ARel = {{0.9729412, -0.02857795, -0.2292786},
{0.01838066, 0.9987497, -0.04648894},
{0.2303205, 0.04101672, 0.97225}};
#endif
};
sCoM = Scale(StdPar.sCoM);
Mass = MassS*StdPar.MassStandard;
Jii = StdPar.Jii;
Jij = StdPar.Jij;
AnyRefNode MedialMalleolus =
{
sRel = .Scale(.StdPar.MedialMalleolus );
// #include "../DrawSettings/BML.any"
};
AnyRefNode LateralMalleolus =
{
sRel = .Scale(.StdPar.LateralMalleolus );
// #include "../DrawSettings/BML.any"
};
#if TLEM_JOINT_TYPE_SUBTALAR != _JOINT_TYPE_USERDEFINED_
AnyRefNode SubTalarJoint =
{
sRel = .Scale(.StdPar.SubTalarJoint);
ARel = RotMat({0.0,0,0}, .StdPar.SubTalarJointAxis, .AnatomicalFrame.ARel'[1])*RotMat(pi/2,y);
#include "../DrawSettings/JointAxesProximal.any"
#if DRAWAXES
AnyDrawLine SJaxis2 =
{
Visible = On;
p0 = ..StdPar.SubTalarJoint + {..StdPar.SubTalarJointAxis[2],..StdPar.SubTalarJointAxis[1],..StdPar.SubTalarJointAxis[0]}*0.2;
p1 = ..StdPar.SubTalarJoint - {..StdPar.SubTalarJointAxis[2],..StdPar.SubTalarJointAxis[1],..StdPar.SubTalarJointAxis[0]}*0.2; //Offset = {0, 0, 0};
Line = {
Thickness = 0.001;
RGB = {0, 0, 0};
};
};
#endif
};
#endif
#if TLEM_JOINT_TYPE_ANKLE != _JOINT_TYPE_USERDEFINED_
AnyRefNode AnkleJoint =
{
#if TLEM_JOINT_TYPE_ANKLE == _JOINT_TYPE_BONY_LANDMARK_
AnyVec3 sRelUnscaled = 0.5*(.StdPar.LateralMalleolus+.StdPar.MedialMalleolus);
AnyMat33 ARelUnscaled = RotMat({0.0,0,0},
....Sign*(.StdPar.LateralMalleolus - .StdPar.MedialMalleolus ),
.AnatomicalFrame.ARelUnscaled'[1])*RotMat(pi/2,y);
/// Ankle joint is defined from the two malleolus bony landmarks
sRel = 0.5*(.Scale(.StdPar.LateralMalleolus)+.Scale(.StdPar.MedialMalleolus));
/// Ankle joint axis is defined from the two malleolus bony landmarks
ARel = RotMat({0.0,0,0}, ....Sign*(.Scale(.StdPar.LateralMalleolus) - .Scale(.StdPar.MedialMalleolus) ), .AnatomicalFrame.ARel'[1] )*RotMat(pi/2,y);
#endif
#if TLEM_JOINT_TYPE_ANKLE == _JOINT_TYPE_DEFAULT_
AnyVec3 sRelUnscaled = .StdPar.AnkleJoint;
AnyMat33 ARelUnscaled = RotMat({0.0,0,0}, .StdPar.AnkleJointAxis, .AnatomicalFrame.ARelUnscaled'[1])*RotMat(pi/2,y);
/// Control point for the Ankle joint. Found by projecting the malleolus bony landmarks onto the
/// ankle axis from the cadaver data set. Thus, scaling that moves the control points will also scale the ankle joint axis
AnyVec3 LateralControlPoint = .Scale(.StdPar.AnkleJoint + (.StdPar.LateralMalleolus - .StdPar.AnkleJoint)*.StdPar.AnkleJointAxis'*.StdPar.AnkleJointAxis);
/// Control point for the Ankle joint. Found by projecting the malleolus bony landmarks onto the
/// ankle axis from the cadaver data set. Thus, scaling that moves the control points will also scale the ankle joint axis
AnyVec3 MedialControlPoint = .Scale(.StdPar.AnkleJoint + (.StdPar.MedialMalleolus - .StdPar.AnkleJoint)*.StdPar.AnkleJointAxis'*.StdPar.AnkleJointAxis );
/// Ankle Joint defined directly from the cadaver dataset.
sRel = .Scale(.StdPar.AnkleJoint);
/// Ankle Joint orientation is calculated based on the direction between the two control points.
ARel = RotMat(0.0*{0,0,0}, .Sign*(LateralControlPoint-MedialControlPoint ), .AnatomicalFrame.ARel'[1] )*RotMat(pi/2,y);
#endif
#include "../DrawSettings/JointAxesDistal.any"
#if DRAWAXES
AnyDrawLine SJaxis2 =
{
Visible = On;
p0 = ..StdPar.TalocruralsRel + {..StdPar.AnkleJointAxis[2],..StdPar.AnkleJointAxis[1],..StdPar.AnkleJointAxis[0]}*0.2;
p1 = ..StdPar.TalocruralsRel - {..StdPar.AnkleJointAxis[2],..StdPar.AnkleJointAxis[1],..StdPar.AnkleJointAxis[0]}*0.2; //Offset = {0, 0, 0};
Line = {Thickness = 0.001; RGB = {0, 0, 0};};
};
#endif
};
#endif
#include "../DrawSettings/Nodes.any"
#include "../DrawSettings/SegmentAxes.any"
AnyDrawSurf DrwSurf =
{
FileName ??= ...STL.FilenameTalus;
ScaleXYZ ??= {1.0, 1.0, ....Sign*1.0};
RGB ??= ....ColorRef.Segments;
AnyFunTransform3D &Scale =.Scale;
Opacity ??= ....BonesOpacity.Talus;
};
}; // end of Talus segment
/// For backwards Compatibility with AMMR 2.4 MoCap Marker protocols
AnyRefNode& MoCapMarkerFrameAMMR24 = AnatomicalFrame;
AnyRefNode& ScalingNode=AnatomicalFrame;
#undef MACRO_CONSTRUCT_ANATOMICAL_FRAME_s
#undef MACRO_CONSTRUCT_ANATOMICAL_FRAME_A
AnyVar LengthStandard = vnorm(StdPar.SubTalarJoint-StdPar.ToeJoint,2);
AnyVar MassS = ..MassScaling.Foot.MassScale;
Mass = MassS*StdPar.MassStandard;
sCoM = Scale(StdPar.sCoM);
Jii = StdPar.Jii;
Jij = StdPar.Jij;
AnyRefNode &HeelJoint = HeelContactNodeLow;
#if TLEM_JOINT_TYPE_SUBTALAR != _JOINT_TYPE_USERDEFINED_
AnyRefNode SubTalarJoint =
{
AnyVec3 sRelUnscaled = .StdPar.SubTalarJoint;
AnyMat33 ARelUnscaled = RotMat({0.0, 0.0, 0.0 }, .StdPar.SubTalarJointAxis, .AnatomicalFrame.ARelUnscaled'[1])*RotMat(pi/2,y);
sRel = .Scale(.StdPar.SubTalarJoint);
ARel = RotMat({0.0, 0.0, 0.0 }, .StdPar.SubTalarJointAxis, .AnatomicalFrame.ARel'[1])*RotMat(pi/2,y);
};
#endif
/// This coordinate system is placed according the International Society of Biomechanics' (ISB)
/// recommendations for an anatomical coordinate system for the ankle joint in the foot segment.
/// See ISB proposal by G. Wu, S. Siegler, P. Allard, C. Kirtley, A. Leardini, D. Rosenbaum, M. Whittle, D.
/// D'Lima, L. Cristofolini, H. Witte, O. Schmid, I. Stokes. J. Biomech. 35(4):543-548, 2002
/// Section 3.4
AnyRefNode AnkleJointComplexAnatomicalFrame =
{
#if TLEM_JOINT_TYPE_ANKLE == _JOINT_TYPE_BONY_LANDMARK_
sRel = (.MedialMalleolus.sRel + .LateralMalleolus.sRel)*0.5;
#else
sRel = .Scale(.StdPar.AnkleJointInNeutralConf);
#endif
ARel = .AnatomicalFrame.ARel;
};
//bonylandmarks
AnyRefNode MedialMalleolus =
{
sRel = .Scale(.StdPar.MedialMalleolusInNeutralConf );
// #include "../DrawSettings/BML.any"
};
AnyRefNode LateralMalleolus =
{
sRel = .Scale(.StdPar.LateralMalleolusInNeutralConf );
// #include "../DrawSettings/BML.any"
};
AnyRefNode IntraMallolar =
{
sRel =0.5* (.MedialMalleolus.sRel+.LateralMalleolus.sRel);
// #include "../DrawSettings/BML.any"
};
AnyRefNode HeelPlantar =
{
sRel = .Scale(.StdPar.HeelPlantarNode);
};
AnyRefNode Metatarsal5Plantar =
{
sRel = .Scale(.StdPar.Metatarsal5PlantarNode);
};
AnyRefNode Metatarsal2Plantar =
{
sRel = .Scale(.StdPar.Metatarsal2PlantarNode);
};
AnyRefNode Metatarsal1Plantar =
{
sRel = .Scale(.StdPar.Metatarsal1PlantarNode);
};
AnyRefNode GroundJoint =
{
sRel = 0.55*.HeelContactNodeLow.sRel + 0.45*.BigToeNode.sRel;
ARel = .ScalingNode.ARel;
};
AnyRefNode HeelContactNodeLow =
{
sRel = .Scale(.StdPar.HeelContactNode1Node);
ARel = .AnatomicalFrame.ARel;
};
AnyRefNode ToeJoint =
{
sRel = .Scale(.StdPar.ToeJoint);
ARel = .ScalingNode.ARel;
};
AnyRefNode HeelNode =
{
sRel = .Scale(.StdPar.HeelNode ); // Estimation, Bony Landmark Heel
ARel = {{0, 1, 0}, {-1, 0, 0}, {0, 0, 1}};
};
//This block comes from TLEMsafe 2.0. It is unclear if it should be used.
AnyRefNode HeelContactNode =
{
sRel = .Scale(.StdPar.HeelContactNodeLow);
ARel = .AnatomicalFrame.ARel;
};
AnyRefNode ToeLateralContactNode =
{
sRel = .Scale(.StdPar.ToeLateralContactNode ); // Estimation, Bony landmark, distal 5th metatarsal
ARel = .AnatomicalFrame.ARel;
};
AnyRefNode ToeMedialContactNode =
{
sRel = .Scale(.StdPar.ToeMedialContactNode ); // Estimation, Bony landmark, distal 1st metatarsal
ARel = .AnatomicalFrame.ARel;
};
//Big toe , Estimation
AnyRefNode BigToeNode =
{
sRel = .Scale(.StdPar.BigToeNode);
ARel = .AnatomicalFrame.ARel;
};
///Metatarsal1 joint center (estimated)
AnyRefNode MetatarsalJoint1Node =
{
sRel = .Scale(.StdPar.MetatarsalJoint1Node );
};
///Metatarsal2 joint center (estimated)
AnyRefNode MetatarsalJoint2Node =
{
sRel = .Scale( .StdPar.MetatarsalJoint2Node );
ARel = .ScalingNode.ARel*RotMat(0.5*pi,z);
};
///Metatarsal3 joint center (estimated)
AnyRefNode MetatarsalJoint3Node =
{
sRel =.Scale( .StdPar.MetatarsalJoint3Node );
};
///Metatarsal4 joint center (estimated)
AnyRefNode MetatarsalJoint4Node =
{
sRel = .Scale( .StdPar.MetatarsalJoint4Node );
};
///Metatarsal5 joint center (estimated)
AnyRefNode MetatarsalJoint5Node =
{
sRel =.Scale( .StdPar.MetatarsalJoint5Node );
};
//Insertion points on Phalanges:
AnyRefNode ExtensorDigitorumLongus1Node = {sRel = .Scale( .StdPar.ExtensorDigitorumLongus1Node );};
AnyRefNode ExtensorDigitorumLongus2Node = {sRel = .Scale( .StdPar.ExtensorDigitorumLongus2Node );};
AnyRefNode ExtensorDigitorumLongus3Node = {sRel = .Scale( .StdPar.ExtensorDigitorumLongus3Node );};
AnyRefNode ExtensorDigitorumLongus4Node = {sRel = .Scale( .StdPar.ExtensorDigitorumLongus4Node );};
AnyRefNode ExtensorDigitorumLongusViaNode1 = {sRel = .Scale( .StdPar.ExtensorDigitorumViaNode1 );};
AnyRefNode ExtensorDigitorumLongusViaNode2 = {sRel = .Scale( .StdPar.ExtensorDigitorumViaNode2 );};
AnyRefNode ExtensorDigitorumLongusViaNode3 = {sRel = .Scale( .StdPar.ExtensorDigitorumViaNode3 );};
AnyRefNode ExtensorDigitorumLongusViaNode4 = {sRel = .Scale( .StdPar.ExtensorDigitorumViaNode4 );};
//AnyRefNode ExtensorDigitorumLongusViaNode5 = {sRel = .Scale( .StdPar.ExtensorDigitorumLongusViaNode5 );};
AnyRefNode ExtensorDigitorumSplitPoint1Node = {sRel = .Scale( .StdPar.ExtensorDigitorumSplitPoint1Node);};
AnyRefNode ExtensorHallucisLongus1Node = {sRel = .Scale( .StdPar.ExtensorHallucisLongus1Node );};
AnyRefNode ExtensorHallucisLongus2Node = {sRel = .Scale( .StdPar.ExtensorHallucisLongus1Node );};
AnyRefNode ExtensorHallucisLongus3Node = {sRel = .Scale( .StdPar.ExtensorHallucisLongus1Node );};
AnyRefNode ExtensorHallucisLongusViaNode4 = {sRel = .Scale( .StdPar.ExtensorHallucisLongusViaNode4 );};
//AnyRefNode ExtensorHallucisLongusViaNode5 = {sRel = .Scale( .StdPar.ExtensorHallucisLongusViaNode5 );};
AnyRefNode FlexorDigitorumLongus1Node = {sRel = .Scale( .StdPar.FlexorDigitorumLongus1Node );};
AnyRefNode FlexorDigitorumLongus2Node = {sRel = .Scale( .StdPar.FlexorDigitorumLongus2Node );};
AnyRefNode FlexorDigitorumLongus3Node = {sRel = .Scale( .StdPar.FlexorDigitorumLongus3Node );};
AnyRefNode FlexorDigitorumLongus4Node = {sRel = .Scale( .StdPar.FlexorDigitorumLongus4Node );};
AnyRefNode FlexorDigitorumLongusViaNode7 = {sRel = .Scale( .StdPar.FlexorDigitorumLongusViaNode1 );};
AnyRefNode FlexorDigitorumLongusViaNode8 = {sRel = .Scale( .StdPar.FlexorDigitorumLongusViaNode2 );};
// AnyRefNode FlexorDigitorumLongusViaNode9 = {sRel = .Scale( .StdPar.FlexorDigitorumLongusViaNode9 );};
// AnyRefNode FlexorDigitorumLongusViaNode10 = {sRel = .Scale( .StdPar.FlexorDigitorumLongusViaNode10);};
// AnyRefNode FlexorDigitorumLongusViaNode11 = {sRel = .Scale( .StdPar.FlexorDigitorumLongusViaNode11);};
// AnyRefNode FlexorDigitorumLongusViaNode12 = {sRel = .Scale( .StdPar.FlexorDigitorumLongusViaNode12);};
AnyRefNode FlexorHallucisLongus1Node = {sRel = .Scale( .StdPar.FlexorHallucisLongus1Node );};
AnyRefNode FlexorHallucisLongus2Node = {sRel = .Scale( .StdPar.FlexorHallucisLongus1Node );};
AnyRefNode FlexorHallucisLongus3Node = {sRel = .Scale( .StdPar.FlexorHallucisLongus1Node );};
AnyRefNode FlexorHallucisLongusViaNode7 = {sRel = .Scale( .StdPar.FlexorHallucisLongusViaNode1 );};
//Insertion points on Hindfoot:
AnyRefNode TendonCalcaneousNode = {sRel = .Scale( .StdPar.TendonCalcaneousNode );};
AnyRefNode GastrocnemiusLateralis1Node = {sRel = .Scale( .StdPar.GastrocnemiusLateralis1Node );};
AnyRefNode GastrocnemiusMedialis1Node = {sRel = .Scale( .StdPar.GastrocnemiusMedialis1Node );};
AnyRefNode Plantaris1Node = {sRel = .Scale( .StdPar.Plantaris1Node );};
AnyRefNode SoleusMedialis1Node = {sRel = .Scale( .StdPar.SoleusMedialis1Node );};
AnyRefNode SoleusMedialis2Node = {sRel = .Scale( .StdPar.SoleusMedialis2Node );};
AnyRefNode SoleusMedialis3Node = {sRel = .Scale( .StdPar.SoleusMedialis3Node );};
AnyRefNode SoleusLateralis1Node = {sRel = .Scale( .StdPar.SoleusLateralis1Node );};
AnyRefNode SoleusLateralis2Node = {sRel = .Scale( .StdPar.SoleusLateralis2Node );};
AnyRefNode SoleusLateralis3Node = {sRel = .Scale( .StdPar.SoleusLateralis3Node );};
AnyRefNode TendonCalcaneousSuperiorNode = {sRel = .Scale( .StdPar.TendonCalcaneousSuperiorNode );};
AnyRefNode GastrocnemiusLateralis1SuperiorNode = {sRel = .Scale( .StdPar.GastrocnemiusLateralis1SuperiorNode );};
AnyRefNode GastrocnemiusMedialis1SuperiorNode = {sRel = .Scale( .StdPar.GastrocnemiusMedialis1SuperiorNode );};
AnyRefNode Plantaris1SuperiorNode = {sRel = .Scale( .StdPar.Plantaris1SuperiorNode );};
AnyRefNode SoleusMedialis1SuperiorNode = {sRel = .Scale( .StdPar.SoleusMedialis1SuperiorNode );};
AnyRefNode SoleusMedialis2SuperiorNode = {sRel = .Scale( .StdPar.SoleusMedialis2SuperiorNode );};
AnyRefNode SoleusMedialis3SuperiorNode = {sRel = .Scale( .StdPar.SoleusMedialis3SuperiorNode );};
AnyRefNode SoleusLateralis1SuperiorNode = {sRel = .Scale( .StdPar.SoleusLateralis1SuperiorNode );};
AnyRefNode SoleusLateralis2SuperiorNode = {sRel = .Scale( .StdPar.SoleusLateralis2SuperiorNode );};
AnyRefNode SoleusLateralis3SuperiorNode = {sRel = .Scale( .StdPar.SoleusLateralis3SuperiorNode );};
//Insertion points on Midfoot:
AnyRefNode PeroneusBrevis1Node = {sRel = .Scale( .StdPar.PeroneusBrevisDistal1Node );};
AnyRefNode PeroneusBrevis2Node = {sRel = .Scale( .StdPar.PeroneusBrevisProximal1Node);};
// AnyRefNode PeroneusBrevis3Node = {sRel = .Scale( .StdPar.PeroneusBrevis1Node );};
AnyRefNode PeroneusBrevisSplitPoint1Node = {sRel = .Scale( .StdPar.PeroneusBrevisSplitPoint1Node);};
AnyRefNode PeroneusBrevisViaNode4 = {sRel = .Scale( .StdPar.PeroneusBrevisViaNode4 );};
AnyRefNode PeroneusLongus1Node = {sRel = .Scale( .StdPar.PeroneusLongus1Node );};
AnyRefNode PeroneusLongus2Node = {sRel = .Scale( .StdPar.PeroneusLongus1Node );};
AnyRefNode PeroneusLongus3Node = {sRel = .Scale( .StdPar.PeroneusLongus1Node );};
AnyRefNode PeroneusLongusViaNode5 = {sRel = .Scale( .StdPar.PeroneusLongusViaNode1 );};
AnyRefNode PeroneusLongusViaNode6 = {sRel = .Scale( .StdPar.PeroneusLongusViaNode2 );};
AnyRefNode PeroneusLongusViaNode7 = {sRel = .Scale( .StdPar.PeroneusLongusViaNode3 );};
AnyRefNode TibialisAnterior1Node = {sRel = .Scale( .StdPar.TibialisAnteriorDistal1Node );};
AnyRefNode TibialisAnterior2Node = {sRel = .Scale( .StdPar.TibialisAnteriorProximal1Node );};
// AnyRefNode TibialisAnterior3Node = {sRel = .Scale( .StdPar.TibialisAnterior1Node );};
AnyRefNode TibialisAnteriorViaNode3 = {sRel = .Scale( .StdPar.TibialisAnteriorViaNode1 );};
AnyRefNode TibialisPosteriorMedialis1Node = {sRel = .Scale( .StdPar.TibialisPosterior1Node );};
AnyRefNode TibialisPosteriorMedialis2Node = {sRel = .Scale( .StdPar.TibialisPosterior1Node );};
AnyRefNode TibialisPosteriorMedialis3Node = {sRel = .Scale( .StdPar.TibialisPosterior1Node );};
AnyRefNode TibialisPosteriorLateralis1Node = {sRel = .Scale( .StdPar.TibialisPosterior1Node );};
AnyRefNode TibialisPosteriorLateralis2Node = {sRel = .Scale( .StdPar.TibialisPosterior1Node );};
AnyRefNode TibialisPosteriorLateralis3Node = {sRel = .Scale( .StdPar.TibialisPosterior1Node );};
AnyRefNode TibialisPosteriorViaNode5 = {sRel = .Scale( .StdPar.TibialisPosteriorViaNode1 );};
AnyRefNode TibialisPosteriorViaNode6 = {sRel = .Scale( .StdPar.TibialisPosteriorViaNode2 );};
AnyRefNode TibialisPosteriorViaNode7 = {sRel = .Scale( .StdPar.TibialisPosteriorViaNode3 );};
AnyRefNode HeelContact = {sRel = .Scale( .StdPar.HeelContactNode1Node );};
AnyRefNode Metatarsal1Contact = {sRel = .Scale( .StdPar.Metatarsal1ContactNode );};
AnyRefNode Metatarsal2Contact = {sRel = .Scale( .StdPar.Metatarsal2ContactNode);};
AnyRefNode Metatarsal5Contact = {sRel = .Scale( .StdPar.Metatarsal5ContactNode );};
// AnyRefNode MetatarsalJoint = {sRel = .Scale( .StdPar.MetatarsalJoint );};
#include "../DrawSettings/Nodes.any"
#include "../DrawSettings/SegmentAxes.any"
AnyDrawSurf DrwSurf =
{
FileName ??= ..STL.FilenameFoot;
ScaleXYZ ??= {1.0, 1.0, ...Sign*1.0};
RGB ??= ...ColorRef.Segments;
AnyFunTransform3D &Scale =.Scale;
Opacity ??= ...BonesOpacity.Foot;
};
#if SKIN
AnyDrawSurf Drw2 =
{
FileName ??= ..STL.FilenameFootSkin;
ScaleXYZ ??= {1.0, 1.0, ...Sign*1.0};
RGB ??= ...ColorRef.Skin;
Opacity ??= Main.DrawSettings.SkinOpacity.Opacity;
AnyFunTransform3D &Scale =.Scale;
Face=-1;
};
#endif
#if MUSCLETISSUE
AnyDrawSurf Drw1 =
{
FileName ??= ..STL.FilenameFootMuscleTissue;
ScaleXYZ ??= {1.0, 1.0, ...Sign*1.0};
RGB ??= ...ColorRef.MuscleTissue;
Opacity ??= Main.DrawSettings.MuscleTissueOpacity.Opacity;
AnyFunTransform3D &Scale =.Scale;
Face=-1;
};
#endif
};// End of foot
#endif //BM_FOOT_MODEL == _FOOT_MODEL_DEFAULT_
AnySeg Shank =
{
AnyFolder &StdPar = ..ModelParameters.Shank;
JaboutCoMOnOff = On;
r0=.Thigh.KneeJoint.sRel*.Thigh.Axes0'+.Thigh.r0-KneeJoint.sRel*Axes0';
AnyVec3 r01 = .Thigh.KneeJoint.sRel;
AnyVec3 r02 = .Thigh.KneeJoint.sRel*.Thigh.Axes0';
AnyVec3 r03 = .Thigh.r0;
AnyVec3 r04 = KneeJoint.sRel*Axes0';
AnyFloat pUnscaled = {StdPar.LateralMalleolus, StdPar.MedialMalleolus, StdPar.LateralTibialEpicondyle, StdPar.MedialTibialEpicondyle, StdPar.EpicondylusFemorisLateralis, StdPar.EpicondylusFemorisMedialis};
AnyFunTransform3D& GeomScale = ..GeoScaling.Shank.ScaleFunction;
AnyVar Sign = ..Sign;
#define MACRO_CONSTRUCT_ANATOMICAL_FRAME_s(p, SIGN) 0.5*(p[2]+p[3])
#define MACRO_CONSTRUCT_ANATOMICAL_FRAME_A(p, SIGN) RotMat(0.5*(p[4]+p[5]), 0.5*(p[0]+p[1]), p[4]) *RotMat(0.5*pi,y)*RotMat(-0.5*pi,x)*RotMat(0.5*(SIGN-1)*pi,y)
// Shank does not use the anatomical frame for scaling.
// So the name of the included shared file here is a bit misleading.
#include "..\Scaling\SegScaleFunWrtAnatomicalFrame.any"
AnyRefNode ScalingNode = {
AnyFloat pScaled = .Scale(.pUnscaled);
sRel = MACRO_CONSTRUCT_ANATOMICAL_FRAME_s(pScaled, .Sign);
ARel = MACRO_CONSTRUCT_ANATOMICAL_FRAME_A(pScaled, .Sign);
AnyVec3 sRelUnscaled = MACRO_CONSTRUCT_ANATOMICAL_FRAME_s(.pUnscaled, .Sign); ///< Generic unscaled position of shank ScalingNode
AnyMat33 ARelUnscaled = MACRO_CONSTRUCT_ANATOMICAL_FRAME_A(.pUnscaled, .Sign);///< Generic unscaled rotation of shank ScalingNode
};
AnyRefNode AnatomicalFrame =
{
//^ The anatomical frame is separate from the scaling frame, and consistent with previous AMMR versions.
// The anatomical frame uses the tibial epicondyles to define the Z axis.
//^ We use different definition for scaling and anatomical frames to ensure the consistent
//^ scaling between femur and shank segments.
AnyFloat pUnscaledAnatomicalFrame = {.StdPar.LateralMalleolus, .StdPar.MedialMalleolus, .StdPar.LateralTibialEpicondyle, .StdPar.MedialTibialEpicondyle, .StdPar.LateralTibialEpicondyle, .StdPar.MedialTibialEpicondyle};
AnyFloat pScaled = .Scale(pUnscaledAnatomicalFrame);
sRel = MACRO_CONSTRUCT_ANATOMICAL_FRAME_s(pScaled, .Sign);
ARel = MACRO_CONSTRUCT_ANATOMICAL_FRAME_A(pScaled, .Sign);
AnyVec3 sRelUnscaled = MACRO_CONSTRUCT_ANATOMICAL_FRAME_s(.pUnscaled, .Sign); ///< Generic unscaled position of shank ScalingNode
AnyMat33 ARelUnscaled = MACRO_CONSTRUCT_ANATOMICAL_FRAME_A(.pUnscaled, .Sign);///< Generic unscaled rotation of shank ScalingNode
};
/// For backwards Compatibility with AMMR 2.4 MoCap Marker protocols
AnyRefNode& MoCapMarkerFrameAMMR24 = AnatomicalFrame;
#undef MACRO_CONSTRUCT_ANATOMICAL_FRAME_s
#undef MACRO_CONSTRUCT_ANATOMICAL_FRAME_A
AnyVar MassS = ..MassScaling.Shank.MassScale;
Mass = MassS*StdPar.MassStandard;
sCoM = Scale(StdPar.sCoM);
Jii = StdPar.Jii;
Jij = StdPar.Jij;
/// This coordinate system is placed based on the bony landmarks of tibial plateau.
/// O: Center of the two tibial epicondyles
/// Z: A vector going through the lateral and medial tibial epicondyle pointing to the right
/// X: The vector perpendicular to Z axis and the long axis of the shank point anteriorly
/// Y: The vector perpendicular to Z and X
AnyRefNode KneeJointAnatomicalFrame =
{
AnyVec3 O = 0.5*(.Scale(.StdPar.LateralTibialEpicondyle ) + .Scale(.StdPar.MedialTibialEpicondyle ) );
AnyVec3 Z = ...Sign*(.Scale(.StdPar.LateralTibialEpicondyle ) - .Scale(.StdPar.MedialTibialEpicondyle ) );
AnyVec3 X = cross(O-.AnkleJoint.sRel,Z);
AnyVec3 Y = cross(Z,X);
sRel = O;
ARel = {X/vnorm(X),Y/vnorm(Y),Z/vnorm(Z)}';
};
/// This coordinate system is placed according the International Society of Biomechanics' (ISB)
/// recommendations for an anatomical coordinate system for the ankle joint in the shank segment.
/// See ISB proposal by G. Wu, S. Siegler, P. Allard, C. Kirtley, A. Leardini, D. Rosenbaum, M. Whittle, D.
/// D'Lima, L. Cristofolini, H. Witte, O. Schmid, I. Stokes. J. Biomech. 35(4):543-548, 2002
/// Section 3.3
AnyRefNode AnkleJointComplexAnatomicalFrame =
{
#if TLEM_JOINT_TYPE_ANKLE == _JOINT_TYPE_BONY_LANDMARK_
AnyVec3 O = 0.5*(.Scale(.StdPar.LateralAnkleAxisMarker) + .Scale(.StdPar.MedialAnkleAxisMarker) );
AnyVec3 Z = ...Sign*(.Scale(.StdPar.LateralAnkleAxisMarker) - .Scale(.StdPar.MedialAnkleAxisMarker) );
#else
AnyVec3 O = 0.5*(.Scale(.StdPar.LateralMalleolus) + .Scale(.StdPar.MedialMalleolus));
AnyVec3 Z = ...Sign*(.Scale(.StdPar.LateralMalleolus) - .Scale(.StdPar.MedialMalleolus) );
#endif
AnyVec3 X = cross(0.5*( .Scale(.StdPar.LateralTibialEpicondyle) + .Scale(.StdPar.MedialTibialEpicondyle))-O,Z);
AnyVec3 Y = cross(Z,X);
sRel = O;
ARel = {X/vnorm(X),Y/vnorm(Y),Z/vnorm(Z)}';
};
#if TLEM_JOINT_TYPE_ANKLE != _JOINT_TYPE_USERDEFINED_
AnyRefNode AnkleJoint =
{
AnyVar TibialTorsionOffset = DesignVar(0);
#if TLEM_JOINT_TYPE_ANKLE == _JOINT_TYPE_BONY_LANDMARK_
AnyVec3 sRelUnscaled = 0.5*(.StdPar.LateralAnkleAxisMarker+ .StdPar.MedialAnkleAxisMarker);
AnyMat33 ARelUnscaled = RotMat({0.0, 0, 0 } , .Sign*(.StdPar.LateralAnkleAxisMarker - .StdPar.MedialAnkleAxisMarker ), .AnatomicalFrame.ARelUnscaled'[1])*RotMat(pi/2,y);
sRel = 0.5*(.Scale(.StdPar.LateralAnkleAxisMarker) + .Scale(.StdPar.MedialAnkleAxisMarker));
ARel = RotMat(sRel, sRel+ .Sign*(.Scale(.StdPar.LateralAnkleAxisMarker) - .Scale(.StdPar.MedialAnkleAxisMarker) ), .AnatomicalFrame.ARel'[1])*RotMat(pi/2,y)*RotMat(TibialTorsionOffset,y);
#endif
#if TLEM_JOINT_TYPE_ANKLE == _JOINT_TYPE_DEFAULT_
AnyVec3 sRelUnscaled = .StdPar.AnkleJoint;
AnyMat33 ARelUnscaled = RotMat({0, 0, 0.0}, .Sign*(AnkleLateralControlPoint-AnkleMedialControlPoint ), .AnatomicalFrame.ARelUnscaled'[1])*RotMat(pi/2,y);
// Control point for the Ankle joint. Found by projecting the malleolus bony landmarks onto the
// ankle axis from the cadaver data set. Thus, scaling the control points will also scale the ankle joint axis
AnyVec3 AnkleLateralControlPoint = .StdPar.AnkleJoint + (.StdPar.LateralMalleolus - .StdPar.AnkleJoint)*.StdPar.AnkleJointAxis'*.StdPar.AnkleJointAxis;
// Control point for the Ankle joint. Found by projecting the malleolus bony landmarks onto the
// ankle axis from the cadaver data set. Thus, scaling the control points will also scale the ankle joint axis
AnyVec3 AnkleMedialControlPoint = .StdPar.AnkleJoint + (.StdPar.MedialMalleolus - .StdPar.AnkleJoint)*.StdPar.AnkleJointAxis'*.StdPar.AnkleJointAxis;
sRel = .Scale(.StdPar.AnkleJoint);
// Ankle Joint orientation is calculated based on the direction between the two control points.
ARel = RotMat({0,0,0.0}, .Sign*(.Scale(AnkleLateralControlPoint) - .Scale(AnkleMedialControlPoint) ), .AnatomicalFrame.ARel'[1])*RotMat(pi/2,y)*RotMat(TibialTorsionOffset,y);
#endif
#include "../DrawSettings/JointAxesDistal.any"
};
#endif
#if TLEM_JOINT_TYPE_KNEE != _JOINT_TYPE_USERDEFINED_
AnyRefNode KneeJoint =
{
#if TLEM_JOINT_TYPE_KNEE == _JOINT_TYPE_BONY_LANDMARK_
AnyVec3 sRelUnscaled = 0.5*(.StdPar.LateralFemuralCondyleInNeutralConf + .StdPar.MedialFemuralCondyleInNeutralConf);
AnyMat33 ARelUnscaled = RotMat({0,0,0.0},
.Sign*(.StdPar.LateralFemuralCondyleInNeutralConf - .StdPar.MedialFemuralCondyleInNeutralConf),
-1*.AnatomicalFrame.ARelUnscaled'[1])*RotMat(pi,z)*RotMat(-pi/2,y);
/// Knee joint is defined from the two epicondyle bony landmarks
sRel = 0.5*(.Scale(.StdPar.LateralFemuralCondyleInNeutralConf )+.Scale(.StdPar.MedialFemuralCondyleInNeutralConf));
/// Knee joint axis is defined from the two epicondyle bony landmarks
ARel = RotMat({0,0,0.0},
.Sign*(.Scale(.StdPar.LateralFemuralCondyleInNeutralConf) - .Scale(.StdPar.MedialFemuralCondyleInNeutralConf)),
-1*.AnatomicalFrame.ARel'[1])*RotMat(pi,z)*RotMat(-pi/2,y);
#endif
#if TLEM_JOINT_TYPE_KNEE == _JOINT_TYPE_DEFAULT_
AnyVec3 sRelUnscaled = .StdPar.KneeJoint;
AnyMat33 ARelUnscaled = RotMat({0,0,0.0},
.Sign*(LateralControlPoint - MedialControlPoint),
-1*.AnatomicalFrame.ARelUnscaled'[1])*RotMat(pi,z)*RotMat(-pi/2,y);
/// Control point for the knee joint. Found by projecting the EpicondylusFemoris bony landmarks onto the
/// knee axis from the cadaver data set. Thus, scaling the control points will also scale the Knee joint axis
AnyVec3 LateralControlPoint = .StdPar.KneeJoint + (.StdPar.LateralFemuralCondyleInNeutralConf - .StdPar.KneeJoint)*.StdPar.KneeJointAxis'*.StdPar.KneeJointAxis;
/// Control point for the knee joint. Found by projecting the EpicondylusFemoris bony landmarks onto the
/// knee axis from the cadaver data set. Thus, scaling the control points will also scale the Knee joint axis
AnyVec3 MedialControlPoint = .StdPar.KneeJoint + (.StdPar.MedialFemuralCondyleInNeutralConf - .StdPar.KneeJoint)*.StdPar.KneeJointAxis'*.StdPar.KneeJointAxis;
sRel = .Scale(.StdPar.KneeJoint);
/// Knee Joint orientation is calculated based on the direction between the two control points.
ARel = RotMat({0,0,0.0}, .Sign*(.Scale(LateralControlPoint)-.Scale(MedialControlPoint)), -1*.AnatomicalFrame.ARel'[1])*RotMat(pi,z)*RotMat(-pi/2,y);
#endif
#include "../DrawSettings/JointAxesDistal.any"
};
#endif
#if BM_FOOT_MODEL != _FOOT_MODEL_NONE_
AnyRefNode AchillesWrapping1 = {
AnyVar ShankLengthScale = vnorm(.AnkleJoint.sRel-.KneeJoint.sRel)
/vnorm(.StdPar.AnkleJoint-.StdPar.KneeJoint);
sRel = .Scale({-0.0336, 0.0987, 0});
ARel = RotMat(-20*pi*.Sign/180, y);
AnySurfCylinder Cyl = {
Length = 0.2;
sRel = {-Radius,0,-0.5*Length};
Radius = .ShankLengthScale*0.105;
};
};
AnyRefNode AchillesWrapping2 = {
sRel = .Scale({-0.032, 0.0437, 0.000});
ARel = RotMat(-20*pi*.Sign/180, y);
AnySurfCylinder Cyl = {
Length = 0.2;
sRel = {Radius,0,-0.5*Length};
Radius = ..AchillesWrapping1.ShankLengthScale*0.07;
};
};
#endif
//BonyLandMarks
AnyRefNode MedialTibialEpicondyle =
{
sRel = .Scale(.StdPar.MedialTibialEpicondyle);
#include "../DrawSettings/BML.any"
};
AnyRefNode LateralTibialEpicondyle =
{
sRel = .Scale( .StdPar.LateralTibialEpicondyle );
#include "../DrawSettings/BML.any"
};
AnyRefNode IntraTibialEpicondyle =
{
sRel = (.MedialTibialEpicondyle.sRel+.LateralTibialEpicondyle.sRel)*0.5 ;
#include "../DrawSettings/BML.any"
};
AnyRefNode TibialTuberosity =
{
sRel = .Scale( .StdPar.TibialTuberosity );
#include "../DrawSettings/BML.any"
};
AnyRefNode FibularHead =
{
sRel = .Scale( .StdPar.FibularHead );
#include "../DrawSettings/BML.any"
};
AnyRefNode MedialMalleolus =
{
sRel = .Scale( .StdPar.MedialMalleolus );
#include "../DrawSettings/BML.any"
};
AnyRefNode LateralMalleolus =
{
sRel = .Scale( .StdPar.LateralMalleolus );
#include "../DrawSettings/BML.any"
};
AnyRefNode IntraMallolar =
{
sRel =0.5* (.MedialMalleolus.sRel+.LateralMalleolus.sRel);
#include "../DrawSettings/BML.any"
};
#if TLEM_JOINT_TYPE_PATELLATENDON != _JOINT_TYPE_USERDEFINED_
/// This node is a reference node for the patella tendon to define the movement of
/// the patella. The tendon will be regarded as being stiff, so the length will not change.
/// This is defined by an AnyKinPLine in the file Jnt.any.
/// The Origin lies on the Patella segment.
AnyRefNode Insertion_patella_tendon =
{
sRel = .Scale( .StdPar.Insertion_patella_tendon );
};
#endif
//Origin points on the Tibia:
AnyRefNode GastrocnemiusLateralis7ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusLateralis7ViaNode );};
AnyRefNode GastrocnemiusLateralis8ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusLateralis8ViaNode );};
AnyRefNode GastrocnemiusLateralis9ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusLateralis9ViaNode );};
AnyRefNode GastrocnemiusLateralis10ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusLateralis10ViaNode );};
AnyRefNode GastrocnemiusMedialis4ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusMedialis4ViaNode );};
AnyRefNode GastrocnemiusMedialis5ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusMedialis5ViaNode );};
AnyRefNode GastrocnemiusMedialis6ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusMedialis6ViaNode );};
AnyRefNode GastrocnemiusMedialis7ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusMedialis7ViaNode );};
AnyRefNode GastrocnemiusMedialis8ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusMedialis8ViaNode );};
AnyRefNode GastrocnemiusMedialis9ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusMedialis9ViaNode );};
//////
//Origin points on the Tibia:
AnyRefNode ExtensorDigitorumLongus1Node = {sRel = .Scale( .StdPar.ExtensorDigitorumLongus1Node );};
AnyRefNode ExtensorDigitorumLongus2Node = {sRel = .Scale( .StdPar.ExtensorDigitorumLongus2Node );};
AnyRefNode ExtensorDigitorumLongus3Node = {sRel = .Scale( .StdPar.ExtensorDigitorumLongus3Node );};
AnyRefNode ExtensorDigitorumLongus4Node = {sRel = .Scale( .StdPar.ExtensorDigitorumLongus4Node );};
AnyRefNode ExtensorDigitorumLongusViaNode1 = {sRel = .Scale( .StdPar.ExtensorDigitorumLongusViaNode1 );};
AnyRefNode ExtensorDigitorumLongusViaNode2 = {sRel = .Scale( .StdPar.ExtensorDigitorumLongusViaNode2 );};
AnyRefNode ExtensorDigitorumLongusViaNode3 = {sRel = .Scale( .StdPar.ExtensorDigitorumLongusViaNode3 );};
AnyRefNode ExtensorDigitorumLongusViaNode4 = {sRel = .Scale( .StdPar.ExtensorDigitorumLongusViaNode4 );};
AnyRefNode ExtensorHallucisLongus1Node = {sRel = .Scale( .StdPar.ExtensorHallucisLongus1Node );};
AnyRefNode ExtensorHallucisLongus2Node = {sRel = .Scale( .StdPar.ExtensorHallucisLongus2Node );};
AnyRefNode ExtensorHallucisLongus3Node = {sRel = .Scale( .StdPar.ExtensorHallucisLongus3Node );};
AnyRefNode ExtensorHallucisLongusViaNode1 = {sRel = .Scale( .StdPar.ExtensorHallucisLongusViaNode1 );};
AnyRefNode ExtensorHallucisLongusViaNode2 = {sRel = .Scale( .StdPar.ExtensorHallucisLongusViaNode2 );};
AnyRefNode ExtensorHallucisLongusViaNode3 = {sRel = .Scale( .StdPar.ExtensorHallucisLongusViaNode3 );};
AnyRefNode FlexorDigitorumLongus1Node = {sRel = .Scale( .StdPar.FlexorDigitorumLongus1Node );};
AnyRefNode FlexorDigitorumLongus2Node = {sRel = .Scale( .StdPar.FlexorDigitorumLongus2Node );};
AnyRefNode FlexorDigitorumLongus3Node = {sRel = .Scale( .StdPar.FlexorDigitorumLongus3Node );};
AnyRefNode FlexorDigitorumLongus4Node = {sRel = .Scale( .StdPar.FlexorDigitorumLongus4Node );};
AnyRefNode FlexorDigitorumLongusViaNode1 = {sRel = .Scale( .StdPar.FlexorDigitorumLongusViaNode1 );};
AnyRefNode FlexorDigitorumLongusViaNode2 = {sRel = .Scale( .StdPar.FlexorDigitorumLongusViaNode2 );};
AnyRefNode FlexorDigitorumLongusViaNode3 = {sRel = .Scale( .StdPar.FlexorDigitorumLongusViaNode3 );};
AnyRefNode FlexorDigitorumLongusViaNode4 = {sRel = .Scale( .StdPar.FlexorDigitorumLongusViaNode4 );};
AnyRefNode FlexorDigitorumLongusViaNode5 = {sRel = .Scale( .StdPar.FlexorDigitorumLongusViaNode5 );};
AnyRefNode FlexorDigitorumLongusViaNode6 = {sRel = .Scale( .StdPar.FlexorDigitorumLongusViaNode6 );};
AnyRefNode FlexorHallucisLongus1Node = {sRel = .Scale( .StdPar.FlexorHallucisLongus1Node );};
AnyRefNode FlexorHallucisLongus2Node = {sRel = .Scale( .StdPar.FlexorHallucisLongus2Node );};
AnyRefNode FlexorHallucisLongus3Node = {sRel = .Scale( .StdPar.FlexorHallucisLongus3Node );};
AnyRefNode FlexorHallucisLongusViaNode1 = {sRel = .Scale( .StdPar.FlexorHallucisLongusViaNode1 );};
AnyRefNode FlexorHallucisLongusViaNode2 = {sRel = .Scale( .StdPar.FlexorHallucisLongusViaNode2 );};
AnyRefNode FlexorHallucisLongusViaNode3 = {sRel = .Scale( .StdPar.FlexorHallucisLongusViaNode3 );};
AnyRefNode FlexorHallucisLongusViaNode4 = {sRel = .Scale( .StdPar.FlexorHallucisLongusViaNode4 );};
AnyRefNode FlexorHallucisLongusViaNode5 = {sRel = .Scale( .StdPar.FlexorHallucisLongusViaNode5 );};
AnyRefNode FlexorHallucisLongusViaNode6 = {sRel = .Scale( .StdPar.FlexorHallucisLongusViaNode6 );};
AnyRefNode PeroneusBrevis1Node = {sRel = .Scale( .StdPar.PeroneusBrevis1Node );};
AnyRefNode PeroneusBrevis2Node = {sRel = .Scale( .StdPar.PeroneusBrevis2Node );};
AnyRefNode PeroneusBrevis3Node = {sRel = .Scale( .StdPar.PeroneusBrevis3Node );};
AnyRefNode PeroneusBrevisViaNode1 = {sRel = .Scale( .StdPar.PeroneusBrevisViaNode1 );};
AnyRefNode PeroneusBrevisViaNode2 = {sRel = .Scale( .StdPar.PeroneusBrevisViaNode2 );};
AnyRefNode PeroneusBrevisViaNode3 = {sRel = .Scale( .StdPar.PeroneusBrevisViaNode3 );};
AnyRefNode PeroneusLongus1Node = {sRel = .Scale( .StdPar.PeroneusLongus1Node );};
AnyRefNode PeroneusLongus2Node = {sRel = .Scale( .StdPar.PeroneusLongus2Node );};
AnyRefNode PeroneusLongus3Node = {sRel = .Scale( .StdPar.PeroneusLongus3Node );};
AnyRefNode PeroneusLongusViaNode1 = {sRel = .Scale( .StdPar.PeroneusLongusViaNode1 );};
AnyRefNode PeroneusLongusViaNode2 = {sRel = .Scale( .StdPar.PeroneusLongusViaNode2 );};
AnyRefNode PeroneusLongusViaNode3 = {sRel = .Scale( .StdPar.PeroneusLongusViaNode3 );};
AnyRefNode PeroneusLongusViaNode4 = {sRel = .Scale( .StdPar.PeroneusLongusViaNode4 );};
AnyRefNode SoleusMedialis1Node = {sRel = .Scale( .StdPar.SoleusMedialis1Node );};
AnyRefNode SoleusMedialis2Node = {sRel = .Scale( .StdPar.SoleusMedialis2Node );};
AnyRefNode SoleusMedialis3Node = {sRel = .Scale( .StdPar.SoleusMedialis3Node );};
AnyRefNode SoleusLateralis1Node = {sRel = .Scale( .StdPar.SoleusLateralis1Node );};
AnyRefNode SoleusLateralis2Node = {sRel = .Scale( .StdPar.SoleusLateralis2Node );};
AnyRefNode SoleusLateralis3Node = {sRel = .Scale( .StdPar.SoleusLateralis3Node );};
AnyRefNode TibialisAnterior1Node = {sRel = .Scale( .StdPar.TibialisAnterior1Node );};
AnyRefNode TibialisAnterior2Node = {sRel = .Scale( .StdPar.TibialisAnterior2Node );};
AnyRefNode TibialisAnterior3Node = {sRel = .Scale( .StdPar.TibialisAnterior3Node );};
AnyRefNode TibialisAnteriorViaNode1 = {sRel =.Scale( .StdPar.TibialisAnteriorViaNode1 );};
AnyRefNode TibialisPosteriorMedialis1Node = {sRel = .Scale( .StdPar.TibialisPosteriorMedialis1Node );};
AnyRefNode TibialisPosteriorMedialis2Node = {sRel = .Scale( .StdPar.TibialisPosteriorMedialis2Node );};
AnyRefNode TibialisPosteriorMedialis3Node = {sRel = .Scale( .StdPar.TibialisPosteriorMedialis3Node );};
AnyRefNode TibialisPosteriorLateralis1Node = {sRel = .Scale( .StdPar.TibialisPosteriorLateralis1Node );};
AnyRefNode TibialisPosteriorLateralis2Node = {sRel = .Scale( .StdPar.TibialisPosteriorLateralis2Node );};
AnyRefNode TibialisPosteriorLateralis3Node = {sRel = .Scale( .StdPar.TibialisPosteriorLateralis3Node );};
AnyRefNode TibialisPosteriorViaNode1 = {sRel = .Scale( .StdPar.TibialisPosteriorViaNode1 );};
AnyRefNode TibialisPosteriorViaNode2 = {sRel = .Scale( .StdPar.TibialisPosteriorViaNode2 );};
AnyRefNode TibialisPosteriorViaNode3 = {sRel = .Scale( .StdPar.TibialisPosteriorViaNode3 );};
AnyRefNode TibialisPosteriorViaNode4 = {sRel = .Scale( .StdPar.TibialisPosteriorViaNode4 );};
//Insertion points on the Tibia (all these muscles, exept for the Biceps Femoris Caput Breve, originate from the Pelvis):
// AnyRefNode AdductorMagnusDistal1Node = {sRel = .Scale( .StdPar.AdductorMagnusDistal1Node );};
// AnyRefNode AdductorMagnusDistal2Node = {sRel = .Scale( .StdPar.AdductorMagnusDistal2Node );};
// AnyRefNode AdductorMagnusDistal3Node = {sRel = .Scale( .StdPar.AdductorMagnusDistal3Node );};
//
AnyRefNode BicepsFemorisCaputLongum1Node = {sRel = .Scale( .StdPar.BicepsFemoris1Node );};
AnyRefNode BicepsFemorisCaputBreve1Node = {sRel = .Scale( .StdPar.BicepsFemoris1Node );};
AnyRefNode BicepsFemorisCaputBreve2Node = {sRel = .Scale( .StdPar.BicepsFemoris1Node );};
AnyRefNode BicepsFemorisCaputBreve3Node = {sRel = .Scale( .StdPar.BicepsFemoris1Node );};
AnyRefNode Gracilis1Node = {sRel = .Scale( .StdPar.Gracilis1Node );};
AnyRefNode Gracilis2Node = {sRel = .Scale( .StdPar.Gracilis1Node );};
AnyRefNode GracilisViaNode1 = {sRel = .Scale( .StdPar.GracilisViaNode1 );};
AnyRefNode GracilisViaNode2 = {sRel = .Scale( .StdPar.GracilisViaNode2 );};
AnyRefNode GracilisViaNode3 = {sRel = .Scale( .StdPar.GracilisViaNode3 );};
AnyRefNode Sartorius1Node = {sRel = .Scale( .StdPar.Sartorius1Node );};
AnyRefNode SartoriusVia1Node = {sRel = .Scale( .StdPar.SartoriusVia1Node );};
AnyRefNode SartoriusVia2Node = {sRel = .Scale( .StdPar.SartoriusVia2Node );};
AnyRefNode SartoriusVia3Node = {sRel = .Scale( .StdPar.SartoriusVia3Node );};
AnyRefNode Semimembranosus1Node = {sRel = .Scale( .StdPar.Semimembranosus1Node );};
AnyRefNode Semimembranosus2Node = {sRel = .Scale( .StdPar.Semimembranosus2Node );};
AnyRefNode Semimembranosus3Node = {sRel = .Scale( .StdPar.Semimembranosus3Node );};
AnyRefNode Semitendinosus1Node = {sRel = .Scale( .StdPar.Semitendinosus1Node );};
AnyRefNode SemitendinosusViaNode1 = {sRel = .Scale( .StdPar.SemitendinosusViaNode1 );};
//Original nodes are placed to high on tibia this can not be correct
// AnyRefNode TensorFasciaeLatae1Node = {sRel = .Scale( .StdPar.TensorFasciaeLatae1Node );};
// AnyRefNode TensorFasciaeLatae2Node = {sRel = .Scale( .StdPar.TensorFasciaeLatae2Node );};
//New positions are based on bone
AnyRefNode TensorFasciaeLatae1Node = {sRel = .Scale( .StdPar.TensorFasciaeLatae1Node );};
AnyRefNode TensorFasciaeLatae2Node = {sRel = .Scale( .StdPar.TensorFasciaeLatae1Node );};
AnyRefNode Popliteus1Node = {sRel = .Scale( .StdPar.Popliteus1Node );};
AnyRefNode Popliteus2Node = {sRel = .Scale( .StdPar.Popliteus2Node );};
AnyRefNode Popliteus3Node = {sRel = .Scale( .StdPar.Popliteus3Node );};
AnyRefNode PopliteusViaNode1 = {sRel = .Scale( .StdPar.PopliteusViaNode1 );};
AnyRefNode PopliteusViaNode2 = {sRel = .Scale( .StdPar.PopliteusViaNode2 );};
AnyDrawSurf DrwSurfTibia =
{
FileName ??= ..STL.FilenameShank;
ScaleXYZ ??= {1.0, 1.0, ...Sign*1.0};
RGB ??= ...ColorRef.Segments;
AnyFunTransform3D &Scale =.Scale;
Opacity ??= ...BonesOpacity.Shank;
Face=-1;
};
AnyDrawSurf DrwSurfFibula = {
FileName ??= ..STL.FilenameFibula;
ScaleXYZ ??= {1.0, 1.0, ...Sign*1.0};
RGB ??= ...ColorRef.Segments;
AnyFunTransform3D &Scale =.Scale;
Opacity ??= ...BonesOpacity.Shank;
Face=-1;
};
#if SKIN
AnyDrawSurf Drw2 =
{
FileName ??= ..STL.FilenameShankSkin;
ScaleXYZ ??= {1.0, 1.0, ...Sign*1.0};
RGB ??= ...ColorRef.Skin;
Opacity ??= Main.DrawSettings.SkinOpacity.Opacity;
AnyFunTransform3D &Scale =.Scale;
Face=-1;
};
#endif
#if MUSCLETISSUE
AnyDrawSurf Drw1 =
{
FileName ??= ..STL.FilenameShankMuscleTissue;
ScaleXYZ ??= {1.0, 1.0, ...Sign*1.0};
RGB ??= ...ColorRef.MuscleTissue;
Opacity ??= Main.DrawSettings.MuscleTissueOpacity.Opacity;
AnyFunTransform3D &Scale =.Scale;
Face=-1;
};
#endif
#include "../DrawSettings/Nodes.any"
#include "../DrawSettings/SegmentAxes.any"
}; // End of Shank
AnySeg Thigh =
{
AnyFolder &StdPar = ..ModelParameters.Thigh;
JaboutCoMOnOff = On;
r0=.Pelvis.HipJoint.sRel*....Trunk.SegmentsLumbar.PelvisSeg.Axes0'+ ....Trunk.SegmentsLumbar.PelvisSeg.r0- HipJoint.sRel*Axes0';
#include "../DrawSettings/Nodes.any"
#include "../DrawSettings/SegmentAxes.any"
AnyFloat pUnscaled = {StdPar.HipJoint, StdPar.EpicondylusFemorisMedialis, StdPar.EpicondylusFemorisLateralis};
AnyFunTransform3D& GeomScale = ..GeoScaling.Thigh.ScaleFunction;
AnyVar Sign = ..Sign;
#define MACRO_CONSTRUCT_ANATOMICAL_FRAME_s(p, SIGN) p[0]
#define MACRO_CONSTRUCT_ANATOMICAL_FRAME_A(p, SIGN) RotMat(p[0],0.5*(p[1]+p[2]), p[1]) * RotMat(pi*0.5,x) * RotMat(pi*0.5,z) * RotMat(0.5*(SIGN-1)*pi,y)
#include "..\Scaling\SegScaleFunWrtAnatomicalFrame.any"
AnyRefNode AnatomicalFrame =
{
AnyFloat pScaled = .Scale(.pUnscaled);
sRel = MACRO_CONSTRUCT_ANATOMICAL_FRAME_s(pScaled, .Sign);
ARel = MACRO_CONSTRUCT_ANATOMICAL_FRAME_A(pScaled, .Sign);
AnyVec3 sRelUnscaled = MACRO_CONSTRUCT_ANATOMICAL_FRAME_s(.pUnscaled, .Sign); ///< Generic unscaled position of thigh ScalingNode
AnyMat33 ARelUnscaled = MACRO_CONSTRUCT_ANATOMICAL_FRAME_A(.pUnscaled, .Sign);///< Generic unscaled rotation of thigh ScalingNode
};
/// For backwards Compatibility with AMMR 2.4 MoCap Marker protocols
AnyRefNode& MoCapMarkerFrameAMMR24 = AnatomicalFrame;
AnyRefNode& ScalingNode=AnatomicalFrame ;
#undef MACRO_CONSTRUCT_ANATOMICAL_FRAME_s
#undef MACRO_CONSTRUCT_ANATOMICAL_FRAME_A
AnyVar MassS = ..MassScaling.Thigh.MassScale;
Mass = MassS*StdPar.MassStandard;
AnyVar LengthStandard = vnorm(StdPar.KneeJoint-StdPar.HipJoint,2);
/// This coordinate system is placed according the International Society of Biomechanics' (ISB)
/// recommendations for an anatomical coordinate system for the hip joint in the thigh segment.
/// See ISB proposal by G. Wu, S. Siegler, P. Allard, C. Kirtley, A. Leardini, D. Rosenbaum, M. Whittle, D.
/// D'Lima, L. Cristofolini, H. Witte, O. Schmid, I. Stokes. J. Biomech. 35(4):543-548, 2002
/// Section 4.4
AnyRefNode HipJointAnatomicalFrame =
{
AnyVec3 O = .Scale(.StdPar.HipJoint);
AnyVec3 Y = O - 0.5*(.Scale(.StdPar.EpicondylusFemorisLateralis) + .Scale(.StdPar.EpicondylusFemorisMedialis) );
AnyVec3 X = cross(Y,...Sign*(.Scale(.StdPar.EpicondylusFemorisLateralis) - .Scale(.StdPar.EpicondylusFemorisMedialis) ));
AnyVec3 Z = cross(X,Y);
sRel = O;
ARel = {X/vnorm(X),Y/vnorm(Y),Z/vnorm(Z)}';
};
/// This coordinate system is placed based on the bony landmarks of femur.
/// O: Center of the two femural epicondyles
/// Z: A vector going through the lateral and medial femural epicondyle pointing to the right
/// X: The vector perpendicular to Z axis and the long axis of the femur point anteriorly
/// Y: The vector perpendicular to Z and X
AnyRefNode KneeJointAnatomicalFrame =
{
AnyVec3 O = 0.5*(.Scale(.StdPar.EpicondylusFemorisLateralis) + .Scale(.StdPar.EpicondylusFemorisMedialis) );
AnyVec3 Z = ...Sign*(.Scale(.StdPar.EpicondylusFemorisLateralis) - .Scale(.StdPar.EpicondylusFemorisMedialis) );
AnyVec3 X = cross(.HipJoint.sRel-O,Z);
AnyVec3 Y = cross(Z,X);
sRel = O;
ARel = {X/vnorm(X),Y/vnorm(Y),Z/vnorm(Z)}';
};
sCoM = Scale(StdPar.sCoM);
Jii = StdPar.Jii;
Jij = StdPar.Jij;
AnyRefNode RectusVastiiWrapSurf =
{
AnyMatrix p = .Scale(.StdPar.RectusVastiiWrapLandmarks);
AnyFloat lengthscalefactor = 3.5;
AnyFloat radiusscalefactor = 1;
AnyVar Z_rotation =0;
#include "<ANYBODY_PATH_MODELUTILS>/WrappingSurfaces/WrappingCylinder5PointFit.any"
};
AnyRefNode IliacusWrapSurf =
{
AnyMatrix p = .Scale(.StdPar.IliacusWrapLandmarks);
AnyFloat lengthscalefactor = 1.2;
AnyFloat radiusscalefactor = 1.15;
AnyVar Z_rotation =pi*(1-...Sign)*0.5;
#include "<ANYBODY_PATH_MODELUTILS>/WrappingSurfaces/WrappingCylinder5PointFit.any"
cyl =
{
CapRatio = 1;
CapRatio2 = 2;
};
};
AnyRefNode RectusWrapSurf =
{
AnyMatrix p = .Scale({
.StdPar.IliacusWrapLandmarks[1]-(.StdPar.IliacusWrapLandmarks[1]-.StdPar.IliacusWrapLandmarks[0]),
.StdPar.IliacusWrapLandmarks[1]+(.StdPar.IliacusWrapLandmarks[1]-.StdPar.IliacusWrapLandmarks[0]),
.StdPar.IliacusWrapLandmarks[2],
.StdPar.IliacusWrapLandmarks[3],
.StdPar.IliacusWrapLandmarks[4]
});
AnyFloat lengthscalefactor = 0;
AnyFloat radiusscalefactor = 1.15;
AnyVar Z_rotation =pi*(1-...Sign)*0.5;
#include "<ANYBODY_PATH_MODELUTILS>/WrappingSurfaces/WrappingCylinder5PointFit.any"
cyl =
{
CapRatio = 1;
CapRatio2 = 3;
};
};
#if TLEM_JOINT_TYPE_KNEE != _JOINT_TYPE_USERDEFINED_
AnyRefNode KneeJoint =
{
/// Deprecated name the variable 'VarusValgusRotation'.
AnyVar AxisRot= VarusValgusRotation;
/// Variable that allows for changing the varus valgus rotation in the model.
AnyVar VarusValgusRotation = DesignVar(0);
#if TLEM_JOINT_TYPE_KNEE == _JOINT_TYPE_BONY_LANDMARK_
AnyVec3 sRelUnscaled = 0.5*(.StdPar.EpicondylusFemorisLateralis + .StdPar.EpicondylusFemorisMedialis);
AnyMat33 ARelUnscaled = RotMat({0.0,0,0}, .Sign*(.StdPar.EpicondylusFemorisLateralis - .StdPar.EpicondylusFemorisMedialis), .AnatomicalFrame.ARelUnscaled'[1])
*RotMat(pi/2,y)*RotMat(AxisRot,x);
/// Knee joint location. Defined from the two epicondyle bony landmarks
sRel =0.5*(.Scale(.StdPar.EpicondylusFemorisLateralis) + .Scale(.StdPar.EpicondylusFemorisMedialis));
/// Knee joint orientation. Defined from the two epicondyle bony landmarks
ARel = RotMat({0.0,0,0}, .Sign*(.Scale(.StdPar.EpicondylusFemorisLateralis) - .Scale(.StdPar.EpicondylusFemorisMedialis)), .AnatomicalFrame.ARel'[1])*RotMat(pi/2,y)*RotMat(AxisRot,x);
#endif
#if TLEM_JOINT_TYPE_KNEE == _JOINT_TYPE_DEFAULT_
AnyVec3 sRelUnscaled = .StdPar.KneeJoint;
AnyMat33 ARelUnscaled = RotMat({0,0,0.0},
.Sign * (KneeLateralControlPoint - KneeMedialControlPoint ),
.AnatomicalFrame.ARelUnscaled'[1]) * RotMat(pi/2,y) * RotMat(AxisRot,x);
/// Control point for the knee joint. Found by projecting the EpicondylusFemoris bony landmarks onto the
/// knee axis from the cadaver data set. Thus, scaling which moves the control points will also scale the Knee joint axis
AnyVec3 KneeLateralControlPoint = .StdPar.KneeJoint + ((.StdPar.EpicondylusFemorisLateralis - .StdPar.KneeJoint)*.StdPar.KneeJointAxis')*.StdPar.KneeJointAxis;
/// Control point for the knee joint. Found by projecting the EpicondylusFemoris bony landmarks onto the
/// knee axis from the cadaver data set. Thus, scaling which moves the control points will also scale the Knee joint axis
AnyVec3 KneeMedialControlPoint = .StdPar.KneeJoint + ((.StdPar.EpicondylusFemorisMedialis - .StdPar.KneeJoint)*.StdPar.KneeJointAxis')*.StdPar.KneeJointAxis;
sRel = .Scale(.StdPar.KneeJoint);
ARel = RotMat({0.0,0,0}, .Sign*(.Scale(KneeLateralControlPoint)-.Scale(KneeMedialControlPoint)), .AnatomicalFrame.ARel'[1])*RotMat(pi/2,y)*RotMat(AxisRot,x);
#endif
#include "../DrawSettings/JointAxesDistal.any"
#if DRAWAXES
AnyDrawLine SJaxis2 =
{
Visible = On;
p0 = ..StdPar.KneesRel + {..StdPar.KneeJointAxis[2],..StdPar.KneeJointAxis[1],..StdPar.KneeJointAxis[0]}*0.2;
p1 = ..StdPar.KneesRel - {..StdPar.KneeJointAxis[2],..StdPar.KneeJointAxis[1],..StdPar.KneeJointAxis[0]}*0.2; //Offset = {0, 0, 0};
Line =
{
Thickness = 0.001;
RGB = {0, 0, 0};
};
};
#endif
};
#endif
#if TLEM_JOINT_TYPE_HIP != _JOINT_TYPE_USERDEFINED_
AnyRefNode HipJoint =
{
AnyVec3 sRelUnscaled = .StdPar.HipJoint;
AnyMat33 ARelUnscaled = RotMat({0.0,0,0},sRelUnscaled-.KneeJoint.sRelUnscaled, .AnatomicalFrame.ARelUnscaled'[2]) *RotMat(-pi/2,x)*RotMat(-pi/2,z);
sRel = .Scale(sRelUnscaled);
ARel = RotMat({0.0,0,0}, .Scale(sRelUnscaled)-.Scale(.KneeJoint.sRelUnscaled), .AnatomicalFrame.ARel'[2])*RotMat(-pi/2,x)*RotMat(-pi/2,z);
#include "../DrawSettings/JointAxesProximal.any"
};
#endif
#if TLEM_JOINT_TYPE_PATELLOFEMORAL != _JOINT_TYPE_USERDEFINED_
AnyRefNode PatellaFemurJoint =
{
AnyVec3 sRelUnscaled = .StdPar.PatellaFemurJoint;
AnyMat33 ARelUnscaled = RotMat({0.0,0,0}, .Sign*(.StdPar.PatellaFemurJointAxis), .AnatomicalFrame.ARelUnscaled'[1])*RotMat(pi/2,y);
/// Control point for the PatellaFemurJoint. Found by projecting the EpicondylusFemoris bony landmarks onto the
/// PatellaFemurJoint axis from the cadaver data set. Thus, scaling which moves the control points will also scale the PatellaFemurJointjoint axis
AnyVec3 PFLateralControlPoint = .Scale(.StdPar.PatellaFemurJoint + (.StdPar.EpicondylusFemorisLateralis - .StdPar.PatellaFemurJoint)*.StdPar.PatellaFemurJointAxis'*.StdPar.PatellaFemurJointAxis);
/// Control point for the PatellaFemurJoint. Found by projecting the EpicondylusFemoris bony landmarks onto the
/// PatellaFemurJoint axis from the cadaver data set. Thus, scaling which moves the control points will also scale the PatellaFemurJointjoint axis
AnyVec3 PFMedialControlPoint = .Scale(.StdPar.PatellaFemurJoint + (.StdPar.EpicondylusFemorisMedialis - .StdPar.PatellaFemurJoint)*.StdPar.PatellaFemurJointAxis'*.StdPar.PatellaFemurJointAxis);
sRel = .Scale(.StdPar.PatellaFemurJoint);
/// PatellaFemurJoint Joint orientation is calculated based on the direction between the two control points.
ARel = RotMat({0.0,0,0}, .Sign*(PFLateralControlPoint - PFMedialControlPoint), .AnatomicalFrame.ARel'[1])*RotMat(pi/2,y);
#include "../DrawSettings/JointAxesDistal.any"
#if DRAWAXES
AnyDrawLine SJaxis2 =
{
Visible = On;
p0 = ..StdPar.PatellaFemursRel + {..StdPar.PatellaFemurJointAxis[2],..StdPar.PatellaFemurJointAxis[1],..StdPar.PatellaFemurJointAxis[0]}*0.2;
p1 = ..StdPar.PatellaFemursRel - {..StdPar.PatellaFemurJointAxis[2],..StdPar.PatellaFemurJointAxis[1],..StdPar.PatellaFemurJointAxis[0]}*0.2; //Offset = {0, 0, 0};
Line =
{
Thickness = 0.001;
RGB = {0, 0, 0};
};
};
#endif
};
#endif
AnyRefNode EpicondylusFemorisMedialis =
{
sRel=.Scale(.StdPar.EpicondylusFemorisMedialis);// Coordinates of the Medial Femur Epicondyle bony landmark, Klein Horsman
#include "../DrawSettings/BML.any"
};
AnyRefNode EpicondylusFemorisLateralis =
{
sRel = .Scale(.StdPar.EpicondylusFemorisLateralis );// Coordinates of the lateral Femur Epicondyle bony landmark, Klein Horsman
#include "../DrawSettings/BML.any"
};
AnyRefNode EpicondylusFemorisMidPoint =
{
sRel=0.5*(.EpicondylusFemorisMedialis.sRel+.EpicondylusFemorisLateralis.sRel) ;
};
// Origin points on the Femur (all Vastus muscles have their insertion point situated on the Patella) :
AnyRefNode BicepsFemorisCaputBreve1Node = {sRel = .Scale( .StdPar.BicepsFemorisCaputBreve1Node );};
AnyRefNode BicepsFemorisCaputBreve2Node = {sRel = .Scale( .StdPar.BicepsFemorisCaputBreve2Node );};
AnyRefNode BicepsFemorisCaputBreve3Node = {sRel = .Scale( .StdPar.BicepsFemorisCaputBreve3Node );};
AnyRefNode GastrocnemiusLateralis1Node = {sRel = .Scale( .StdPar.GastrocnemiusLateralis1Node );};
AnyRefNode GastrocnemiusLateralis1ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusLateralisVia1Node );};
AnyRefNode GastrocnemiusLateralis2ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusLateralisVia2Node );};
AnyRefNode GastrocnemiusLateralis3ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusLateralisVia3Node );};
AnyRefNode GastrocnemiusLateralis4ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusLateralisVia4Node );};
AnyRefNode GastrocnemiusLateralis5ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusLateralisVia5Node );};
AnyRefNode GastrocnemiusLateralis6ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusLateralisVia6Node );};
AnyRefNode GastrocnemiusMedialis1Node = {sRel = .Scale( .StdPar.GastrocnemiusMedialis1Node );};
AnyRefNode GastrocnemiusMedialis1ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusMedialisVia1Node );};
AnyRefNode GastrocnemiusMedialis2ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusMedialisVia2Node );};
AnyRefNode GastrocnemiusMedialis3ViaNode = {sRel = .Scale( .StdPar.GastrocnemiusMedialisVia3Node );};
AnyRefNode Plantaris1Node = {sRel = .Scale( .StdPar.Plantaris1Node );};
AnyRefNode Popliteus1Node = {sRel = .Scale( .StdPar.Popliteus1Node );};
AnyRefNode Popliteus2Node = {sRel = .Scale( .StdPar.Popliteus2Node );};
AnyRefNode Popliteus3Node = {sRel = .Scale( .StdPar.Popliteus3Node );};
AnyRefNode VastusIntermedius1Node = {sRel = .Scale( .StdPar.VastusIntermedius1Node );};
AnyRefNode VastusIntermedius2Node = {sRel = .Scale( .StdPar.VastusIntermedius2Node );};
AnyRefNode VastusIntermedius3Node = {sRel = .Scale( .StdPar.VastusIntermedius3Node );};
AnyRefNode VastusIntermedius4Node = {sRel = .Scale( .StdPar.VastusIntermedius4Node );};
AnyRefNode VastusIntermedius5Node = {sRel = .Scale( .StdPar.VastusIntermedius5Node );};
AnyRefNode VastusIntermedius6Node = {sRel = .Scale( .StdPar.VastusIntermedius6Node );};
AnyRefNode VastusLateralisInferior1Node = {sRel = .Scale( .StdPar.VastusLateralisInferior1Node );};
AnyRefNode VastusLateralisInferior2Node = {sRel = .Scale( .StdPar.VastusLateralisInferior2Node );};
AnyRefNode VastusLateralisInferior3Node = {sRel = .Scale( .StdPar.VastusLateralisInferior3Node );};
AnyRefNode VastusLateralisInferior4Node = {sRel = .Scale( .StdPar.VastusLateralisInferior4Node );};
AnyRefNode VastusLateralisInferior5Node = {sRel = .Scale( .StdPar.VastusLateralisInferior5Node );};
AnyRefNode VastusLateralisInferior6Node = {sRel = .Scale( .StdPar.VastusLateralisInferior6Node );};
AnyRefNode VastusLateralisSuperior1Node = {sRel = .Scale( .StdPar.VastusLateralisSuperior1Node );};
AnyRefNode VastusLateralisSuperior2Node = {sRel = .Scale( .StdPar.VastusLateralisSuperior2Node );};
AnyRefNode VastusMedialisInferior1Node = {sRel = .Scale( .StdPar.VastusMedialisInferior1Node );};
AnyRefNode VastusMedialisInferior2Node = {sRel = .Scale( .StdPar.VastusMedialisInferior2Node );};
AnyRefNode VastusMedialisMid1Node = {sRel = .Scale( .StdPar.VastusMedialisMid1Node );};
AnyRefNode VastusMedialisMid2Node = {sRel = .Scale( .StdPar.VastusMedialisMid2Node );};
AnyRefNode VastusMedialisSuperior1Node = {sRel = .Scale( .StdPar.VastusMedialisSuperior1Node );};
AnyRefNode VastusMedialisSuperior2Node = {sRel = .Scale( .StdPar.VastusMedialisSuperior2Node );};
AnyRefNode VastusMedialisSuperior3Node = {sRel = .Scale( .StdPar.VastusMedialisSuperior3Node );};
AnyRefNode VastusMedialisSuperior4Node = {sRel = .Scale( .StdPar.VastusMedialisSuperior4Node );};
AnyRefNode AdductorBrevisProximal1Node = {sRel = .Scale( .StdPar.AdductorBrevisProximal1Node );};
AnyRefNode AdductorBrevisProximal2Node = {sRel = .Scale( .StdPar.AdductorBrevisProximal2Node );};
AnyRefNode AdductorBrevisMid1Node = {sRel = .Scale( .StdPar.AdductorBrevisMid1Node );};
AnyRefNode AdductorBrevisMid2Node = {sRel = .Scale( .StdPar.AdductorBrevisMid2Node );};
AnyRefNode AdductorBrevisDistal1Node = {sRel = .Scale( .StdPar.AdductorBrevisDistal1Node );};
AnyRefNode AdductorBrevisDistal2Node = {sRel = .Scale( .StdPar.AdductorBrevisDistal2Node );};
AnyRefNode AdductorLongus1Node = {sRel = .Scale( .StdPar.AdductorLongus1Node );};
AnyRefNode AdductorLongus2Node = {sRel = .Scale( .StdPar.AdductorLongus2Node );};
AnyRefNode AdductorLongus3Node = {sRel = .Scale( .StdPar.AdductorLongus3Node );};
AnyRefNode AdductorLongus4Node = {sRel = .Scale( .StdPar.AdductorLongus4Node );};
AnyRefNode AdductorLongus5Node = {sRel = .Scale( .StdPar.AdductorLongus5Node );};
AnyRefNode AdductorLongus6Node = {sRel = .Scale( .StdPar.AdductorLongus6Node );};
AnyRefNode AdductorMagnusMid1Node = {sRel = .Scale( .StdPar.AdductorMagnusMid1Node );};
AnyRefNode AdductorMagnusMid2Node = {sRel = .Scale( .StdPar.AdductorMagnusMid2Node );};
AnyRefNode AdductorMagnusMid3Node = {sRel = .Scale( .StdPar.AdductorMagnusMid3Node );};
AnyRefNode AdductorMagnusMid4Node = {sRel = .Scale( .StdPar.AdductorMagnusMid4Node );};
AnyRefNode AdductorMagnusMid5Node = {sRel = .Scale( .StdPar.AdductorMagnusMid5Node );};
AnyRefNode AdductorMagnusMid6Node = {sRel = .Scale( .StdPar.AdductorMagnusMid6Node );};
AnyRefNode AdductorMagnusProximal1Node = {sRel = .Scale( .StdPar.AdductorMagnusProximal1Node );};
AnyRefNode AdductorMagnusProximal2Node = {sRel = .Scale( .StdPar.AdductorMagnusProximal2Node );};
AnyRefNode AdductorMagnusProximal3Node = {sRel = .Scale( .StdPar.AdductorMagnusProximal3Node );};
AnyRefNode AdductorMagnusProximal4Node = {sRel = .Scale( .StdPar.AdductorMagnusProximal4Node );};
AnyRefNode AdductorMagnusDistal1Node = {sRel = .Scale( .StdPar.AdductorMagnusDistal1Node );};
AnyRefNode AdductorMagnusDistal2Node = {sRel = .Scale( .StdPar.AdductorMagnusDistal1Node );};
AnyRefNode AdductorMagnusDistal3Node = {sRel = .Scale( .StdPar.AdductorMagnusDistal1Node );};
AnyRefNode GemellusInferior1Node = {sRel = .Scale( .StdPar.GemellusInferior1Node );};
AnyRefNode GemellusSuperior1Node = {sRel = .Scale( .StdPar.GemellusSuperior1Node );};
AnyRefNode GluteusMaximusSuperior1Node = {sRel = .Scale( .StdPar.GluteusMaximusSuperior1Node );};
AnyRefNode GluteusMaximusSuperior2Node = {sRel = .Scale( .StdPar.GluteusMaximusSuperior2Node );};
AnyRefNode GluteusMaximusSuperior3Node = {sRel = .Scale( .StdPar.GluteusMaximusSuperior3Node );};
AnyRefNode GluteusMaximusSuperior4Node = {sRel = .Scale( .StdPar.GluteusMaximusSuperior4Node );};
AnyRefNode GluteusMaximusSuperior5Node = {sRel = .Scale( .StdPar.GluteusMaximusSuperior5Node );};
AnyRefNode GluteusMaximusSuperior6Node = {sRel = .Scale( .StdPar.GluteusMaximusSuperior6Node );};
AnyRefNode GluteusMaximusInferior1Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior1Node );};
AnyRefNode GluteusMaximusInferior2Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior2Node );};
AnyRefNode GluteusMaximusInferior3Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior3Node );};
AnyRefNode GluteusMaximusInferior4Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior4Node );};
AnyRefNode GluteusMaximusInferior5Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior5Node );};
AnyRefNode GluteusMaximusInferior6Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior6Node );};
AnyRefNode GluteusMediusAnterior1Node = {sRel = .Scale( .StdPar.GluteusMediusAnterior1Node );};
AnyRefNode GluteusMediusAnterior2Node = {sRel = .Scale( .StdPar.GluteusMediusAnterior2Node );};
AnyRefNode GluteusMediusAnterior3Node = {sRel = .Scale( .StdPar.GluteusMediusAnterior3Node );};
AnyRefNode GluteusMediusAnterior4Node = {sRel = .Scale( .StdPar.GluteusMediusAnterior4Node );};
AnyRefNode GluteusMediusAnterior5Node = {sRel = .Scale( .StdPar.GluteusMediusAnterior5Node );};
AnyRefNode GluteusMediusAnterior6Node = {sRel = .Scale( .StdPar.GluteusMediusAnterior6Node );};
AnyRefNode GluteusMediusPosterior1Node = {sRel = .Scale( .StdPar.GluteusMediusPosterior1Node );};
AnyRefNode GluteusMediusPosterior2Node = {sRel = .Scale( .StdPar.GluteusMediusPosterior2Node );};
AnyRefNode GluteusMediusPosterior3Node = {sRel = .Scale( .StdPar.GluteusMediusPosterior3Node );};
AnyRefNode GluteusMediusPosterior4Node = {sRel = .Scale( .StdPar.GluteusMediusPosterior4Node );};
AnyRefNode GluteusMediusPosterior5Node = {sRel = .Scale( .StdPar.GluteusMediusPosterior5Node );};
AnyRefNode GluteusMediusPosterior6Node = {sRel = .Scale( .StdPar.GluteusMediusPosterior6Node );};
AnyRefNode GluteusMinimusAnterior1Node = {sRel = .Scale( .StdPar.GluteusMinimusAnterior1Node );};
AnyRefNode GluteusMinimusMid1Node = {sRel = .Scale( .StdPar.GluteusMinimusMid1Node );};
AnyRefNode GluteusMinimusPosterior1Node = {sRel = .Scale( .StdPar.GluteusMinimusPosterior1Node );};
AnyRefNode GluteusMinimusAnterior1Via = {sRel = .Scale( .StdPar.GluteusMinimusAnterior1Via );};
AnyRefNode GluteusMinimusMid1Via = {sRel = .Scale( .StdPar.GluteusMinimusMid1Via );};
AnyRefNode GluteusMinimusPosterior1Via = {sRel = .Scale( .StdPar.GluteusMinimusPosterior1Via );};
AnyRefNode ObturatorExternus1Node = {sRel = .Scale( .StdPar.ObturatorExternus1Node );};
AnyRefNode ObturatorExternusVia1Node = {sRel = .Scale( .StdPar.ObturatorExternusVia1Node );};
AnyRefNode ObturatorInternus1Node = {sRel = .Scale( .StdPar.ObturatorInternus1Node );};
AnyRefNode Pectineus1Node = {sRel = .Scale( .StdPar.Pectineus1Node );};
AnyRefNode Pectineus2Node = {sRel = .Scale( .StdPar.Pectineus2Node );};
AnyRefNode Pectineus3Node = {sRel = .Scale( .StdPar.Pectineus3Node );};
AnyRefNode Pectineus4Node = {sRel = .Scale( .StdPar.Pectineus4Node );};
AnyRefNode Piriformis1Node = {sRel = .Scale( .StdPar.Piriformis1Node );};
AnyRefNode Iliopsoas1Node = {sRel = .Scale( .StdPar.Iliopsoas1Node );};
AnyRefNode Iliopsoas2Node = {sRel = .Scale( .StdPar.Iliopsoas2Node );};
AnyRefNode Iliopsoas3Node = {sRel = .Scale( .StdPar.Iliopsoas3Node );};
AnyRefNode QuadratusFemoris1Node = {sRel = .Scale( .StdPar.QuadratusFemoris1Node );};
AnyRefNode QuadratusFemoris2Node = {sRel = .Scale( .StdPar.QuadratusFemoris2Node );};
AnyRefNode QuadratusFemoris3Node = {sRel = .Scale( .StdPar.QuadratusFemoris3Node );};
AnyRefNode QuadratusFemoris4Node = {sRel = .Scale( .StdPar.QuadratusFemoris4Node );};
AnyRefNode SartoriusVia1Node = {sRel = .Scale( .StdPar.SartoriusVia1Node );};
AnyRefNode SartoriusVia2Node = {sRel = .Scale( .StdPar.SartoriusVia2Node );};
AnyRefNode SartoriusVia3Node = {sRel = .Scale( .StdPar.SartoriusVia3Node );};
AnyRefNode SartoriusVia4Node = {sRel = .Scale( .StdPar.SartoriusVia4Node );};
AnyRefNode SartoriusVia5Node = {sRel = .Scale( .StdPar.SartoriusVia5Node );};
AnyRefNode SartoriusVia6Node = {sRel = .Scale( .StdPar.SartoriusVia6Node );};
AnyRefNode &IliopsoasIns = Iliopsoas1Node;
AnyRefNode TensorFasciaeLatae1ViaNode = {sRel = .Scale( .StdPar.TensorFasciaeLatae1ViaNode);};
AnyRefNode TensorFasciaeLatae2ViaNode = {sRel = .Scale( .StdPar.TensorFasciaeLatae2ViaNode);};
AnyRefNode GastroWrapSurf =
{
AnyMatrix p = .Scale(.StdPar.GastroWrapLandmarks);
AnyFloat lengthscalefactor = 2;
AnyFloat radiusscalefactor = 1;
AnyVar Z_rotation =0;
#include "<ANYBODY_PATH_MODELUTILS>/WrappingSurfaces/WrappingCylinder5PointFit.any"
};
AnyRefNode HamstringWrapSurf =
{
AnyMatrix p = .Scale(.StdPar.HamstringWrapLandmarks);
AnyFloat lengthscalefactor = 2;
AnyFloat radiusscalefactor = 1;
AnyVar Z_rotation =0;
cyl.CapRatio = 1;
#include "<ANYBODY_PATH_MODELUTILS>/WrappingSurfaces/WrappingCylinder5PointFit.any"
};
AnyDrawSurf Drw3 =
{
FileName ??= ..STL.FilenameThigh;
ScaleXYZ ??= {1.0, 1.0, ...Sign*1.0}*1;
RGB ??= ...ColorRef.Segments;
Opacity ??= ...BonesOpacity.Thigh;
AnyFunTransform3D &Scale =.Scale;
Face=-1;
};
#if SKIN
AnyRefNode SkinsRel =
{
sRel = {0,0,0};
ARel = RotMat(...Sign*-27*pi/180, y);
AnyDrawSurf Drw2 =
{
FileName ??= ...STL.FilenameThighSkin;
ScaleXYZ ??= {1.0, 1.0, ....Sign*1.0};
RGB ??= ....ColorRef.Skin;
Opacity ??= Main.DrawSettings.SkinOpacity.Opacity;
AnyFunTransform3D &Scale =..Scale;
Face=-1;
};
};
#endif
#if MUSCLETISSUE
AnyRefNode MuscleTissuesRel =
{
sRel = {0,0,0};
ARel = RotMat(...Sign*-27*pi/180, y);
AnyDrawSurf Drw2 = {
FileName ??= ...STL.FilenameThighMuscleTissue;
ScaleXYZ ??= {1.0, 1.0, ....Sign*1.0};
RGB ??= ....ColorRef.MuscleTissue;
Opacity ??= Main.DrawSettings.MuscleTissueOpacity.Opacity;
AnyFunTransform3D &Scale =..Scale;
Face=-1;
};
};
#endif
};
AnySeg Patella =
{
AnyFolder &StdPar = ..ModelParameters.Patella;
JaboutCoMOnOff = On;
r0=.Thigh.PatellaFemurJoint.sRel*.Thigh.Axes0'+.Thigh.r0-PatellaFemurJoint.sRel*Axes0';
AnyFloat pUnscaled = {StdPar.HipJoint, StdPar.EpicondylusFemorisMedialis, StdPar.EpicondylusFemorisLateralis};
#define MACRO_CONSTRUCT_ANATOMICAL_FRAME_s(p, SIGN) p[0]
#define MACRO_CONSTRUCT_ANATOMICAL_FRAME_A(p, SIGN) RotMat(p[0],0.5*(p[1]+p[2]), p[1]) * RotMat(pi*0.5,x) * RotMat(pi*0.5,z) * RotMat(0.5*(SIGN-1)*pi,y)
#include "..\Scaling\SegScaleFunWrtAnatomicalFrame.any"
#undef MACRO_CONSTRUCT_ANATOMICAL_FRAME_s
#undef MACRO_CONSTRUCT_ANATOMICAL_FRAME_A
AnyVar MassS = ..MassScaling.Shank.MassScale;
Mass = MassS*StdPar.MassStandard;
Jii = StdPar.Jii;
Jij = StdPar.Jij;
AnyVar Sign = ..Sign;
AnyFunTransform3D &GeomScale = ..GeoScaling.Patella.ScaleFunction;
AnyRefNode AnatomicalFrame=
{
ARel = ..Thigh.AnatomicalFrame.ARel;
sRel = .PatellaFemurJoint.sRel;
};
/// For backwards Compatibility with AMMR 2.4 MoCap Marker protocols
AnyRefNode& MoCapMarkerFrameAMMR24 = AnatomicalFrame;
AnyRefNode& ScalingNode=AnatomicalFrame ;
#if TLEM_JOINT_TYPE_PATELLOFEMORAL != _JOINT_TYPE_USERDEFINED_
AnyRefNode PatellaFemurJoint =
{
AnyVec3 sRelUnscaled = .StdPar.PatellaFemurJoint;
/// Control point for the PatellaFemurJoint. Found by projecting the EpicondylusFemoris bony landmarks onto the
/// PatellaFemurJoint axis from the cadaver data set. Thus, scaling which moves the control points will also scale the PatellaFemurJointjoint axis
AnyVec3 PFLateralControlPoint = .Scale(.StdPar.PatellaFemurJoint + (.StdPar.EpicondylusFemorisLateralis - .StdPar.PatellaFemurJoint)*.StdPar.PatellaFemurJointAxis'*.StdPar.PatellaFemurJointAxis);
/// Control point for the PatellaFemurJoint. Found by projecting the EpicondylusFemoris bony landmarks onto the
/// PatellaFemurJoint axis from the cadaver data set. Thus, scaling which moves the control points will also scale the PatellaFemurJointjoint axis
AnyVec3 PFMedialControlPoint = .Scale(.StdPar.PatellaFemurJoint + (.StdPar.EpicondylusFemorisMedialis - .StdPar.PatellaFemurJoint)*.StdPar.PatellaFemurJointAxis'*.StdPar.PatellaFemurJointAxis);
sRel = .Scale(.StdPar.PatellaFemurJoint);
// / PatellaFemurJoint Joint orientation is calculated based on the direction between the two control points.
ARel = RotMat({0.0,0,0}, .Sign*(PFLateralControlPoint-PFMedialControlPoint),
(0.5*(.RectusFemoris1Node.sRel+.RectusFemoris2Node.sRel) - .Origin_patella_tendon.sRel))*RotMat(pi/2,y);
};
#endif
AnyDrawSurf DrwSurf =
{
FileName ??= ..STL.FilenamePatella;
ScaleXYZ ??= {1.0, 1.0, ...Sign*1.0};
RGB ??= ...ColorRef.Segments;
AnyFunTransform3D &Scale =.Scale;
Opacity ??= ...BonesOpacity.Patella;
};
#if TLEM_JOINT_TYPE_PATELLATENDON != _JOINT_TYPE_USERDEFINED_
/// A reference node for the patella tendon to define the movement of
/// the patella. The tendon will be regarded as being stiff, so the length will not change.
/// This is defined by an AnyKinPLine in the file Jnt.any.
/// The insertion lies on the Shank segment.
AnyRefNode Origin_patella_tendon = {
sRel = .Scale( .StdPar.Origin_patella_tendon );//AnyDrawRefFrame drw = {RGB = {0,1,0};};
ARel = ..Thigh.KneeJoint.ARel;
};
#endif
#include "../DrawSettings/Nodes.any"
#include "../DrawSettings/SegmentAxes.any"
// Patella insertion points
AnyRefNode RectusFemoris1Node = {sRel = .Scale( .StdPar.RectusFemoris1Node );};
AnyRefNode RectusFemoris2Node = {sRel = .Scale( .StdPar.RectusFemoris2Node );};
AnyRefNode VastusIntermedius1Node = {sRel = .Scale( .StdPar.RectusFemoris1Node );};
AnyRefNode VastusIntermedius2Node = {sRel = .Scale( .StdPar.RectusFemoris2Node);};
AnyRefNode VastusIntermedius3Node = {sRel = .Scale( .StdPar.RectusFemoris1Node );};
AnyRefNode VastusIntermedius4Node = {sRel = .Scale( .StdPar.RectusFemoris2Node );};
AnyRefNode VastusIntermedius5Node = {sRel = .Scale( .StdPar.RectusFemoris1Node );};
AnyRefNode VastusIntermedius6Node = {sRel = .Scale( .StdPar.RectusFemoris2Node );};
AnyRefNode VastusLateralisInferior1Node = {sRel = .Scale( .StdPar.VastusLateralisInferior1Node );};
AnyRefNode VastusLateralisInferior2Node = {sRel = .Scale( .StdPar.VastusLateralisInferior1Node );};
AnyRefNode VastusLateralisInferior3Node = {sRel = .Scale( .StdPar.VastusLateralisInferior2Node );};
AnyRefNode VastusLateralisInferior4Node = {sRel = .Scale( .StdPar.VastusLateralisInferior2Node );};
AnyRefNode VastusLateralisInferior5Node = {sRel = .Scale( .StdPar.VastusLateralisInferior3Node );};
AnyRefNode VastusLateralisInferior6Node = {sRel = .Scale( .StdPar.VastusLateralisInferior3Node );};
AnyRefNode VastusLateralisSuperior1Node = {sRel = .Scale( .StdPar.VastusLateralisSuperior1Node );};
AnyRefNode VastusLateralisSuperior2Node = {sRel = .Scale( .StdPar.VastusLateralisSuperior1Node );};
AnyRefNode VastusMedialisInferior1Node = {sRel = .Scale( .StdPar.VastusMedialisInferior1Node );};
AnyRefNode VastusMedialisInferior2Node = {sRel = .Scale( .StdPar.VastusMedialisInferior1Node );};
AnyRefNode VastusMedialisMid1Node = {sRel = .Scale( .StdPar.VastusMedialisMid1Node );};
AnyRefNode VastusMedialisMid2Node = {sRel = .Scale( .StdPar.VastusMedialisMid1Node );};
AnyRefNode VastusMedialisSuperior1Node = {sRel = .Scale( .StdPar.VastusMedialisSuperior1Node );};
AnyRefNode VastusMedialisSuperior2Node = {sRel = .Scale( .StdPar.VastusMedialisSuperior1Node );};
AnyRefNode VastusMedialisSuperior3Node = {sRel = .Scale( .StdPar.VastusMedialisSuperior1Node );};
AnyRefNode VastusMedialisSuperior4Node = {sRel = .Scale( .StdPar.VastusMedialisSuperior1Node );};
};// end of Patella
#ifdef __RightLeft__
#undef __RightLeft__
#endif
#if SignRef == 1
#define __RightLeft__ Right
#else
#define __RightLeft__ Left
#endif
AnyRefFrame &Sacrum = ...Trunk.SegmentsLumbar.SacrumSeg.__RightLeft__;
AnyRefFrame& SacrumSeg = ...Trunk.SegmentsLumbar.SacrumSeg;
SacrumSeg =
{
__RightLeft__ =
{
AnyRefNode LegAttachmentNodes =
{
/// Folder with cadaver parameters for pelvis in the LegTLEM model
AnyFolder &StdPar = ....ModelParameters.Pelvis;
AnyFunTransform3D &Scale = ...PelvisSeg.AnatomicalFrame.Scale_Leg_Pelvis;
AnyRefNode GluteusMaximusInferior1Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior1Node );};
AnyRefNode GluteusMaximusInferior2Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior2Node );};
AnyRefNode GluteusMaximusInferior3Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior3Node );};
AnyRefNode GluteusMaximusInferior4Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior4Node );};
AnyRefNode GluteusMaximusInferior5Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior5Node );};
AnyRefNode GluteusMaximusInferior6Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior6Node );};
};
};// Sacrum.Left/Right
// Find drawing in the end of the file
};// SacrumSeg
AnyRefFrame &Pelvis = ...Trunk.SegmentsLumbar.PelvisSeg.__RightLeft__;
AnyRefFrame& PelvisSeg = ...Trunk.SegmentsLumbar.PelvisSeg;
PelvisSeg =
{
__RightLeft__ =
{
#undef __RightLeft__
#if TLEM_JOINT_TYPE_HIP != _JOINT_TYPE_USERDEFINED_
AnyRefNode HipJoint = {
AnyVec3 sRelUnscaled = .Muscles.StdPar.HipJoint;
sRel = ..AnatomicalFrame.Scale_Leg_Pelvis(sRelUnscaled );
#include "../DrawSettings/JointAxesProximal.any"
AnyRefNode ISB = {
ARel = ...AnatomicalFrameISB.ARel;
};
};
#endif
/// All muscle attachment nodes from the leg is placed inside
/// their own node (coordinate system). The reason for using
/// this procedure instead of putting the nodes directly on the
/// pelvis segment, is that it makes it possible to have the
/// leg as a selfcontained block. The nodes in this folder is
/// used by the LegTLEM model for muscle attachements on pelvis.
AnyRefNode Muscles =
{
/// Folder with cadaver parameters for pelvis in the LegTLEM model
AnyFolder &StdPar = ....ModelParameters.Pelvis;
AnyFunTransform3D &Scale = ..AnatomicalFrame.Scale_Leg_Pelvis;
#include "GluteusMaximumsWrappingSurfaces.any"
AnyRefNode GluteusMaximusWrapSurf =
{
AnyVec3 P1 = .Scale(.StdPar.GluteusWrappingSurfacePoints[0]);
AnyVec3 P2 = .Scale(.StdPar.GluteusWrappingSurfacePoints[1]);
sRel = P1-{0.02,0,0};
ARel = RotMat(P1, P2, P2 + 0.1)*RotMat(pi/2,y);
AnySurfCylinder cyl =
{
Radius = ....GeomScale({0.05,0.0,0.0})[0];
Length = ....GeomScale({0.0,0.25,0.0})[1];
// AnyDrawParamSurf drw={RGB={1,0,0};Opacity = 0.5;Visible = Off;};
CapRatio = 0.1;
};
};
AnyRefNode BicepsFemorisCaputLongumWrapSurf ={
AnyFloat p = {
.Semitendinosus1Node.sRel+{0.001,0,0},
.BicepsFemorisCaputLongum1Node.sRel+{0.001,0,0},
.BicepsFemorisCaputLongum1Node.sRel+{0.001,0,0},
.Semimembranosus3Node.sRel,
.QuadratusFemoris3Node.sRel
};
AnyVar lengthscalefactor=12;
AnyVar Z_rotation=0;
AnyVar radiusscalefactor=1;
#include "<ANYBODY_PATH_MODELUTILS>/WrappingSurfaces/WrappingCylinder5PointFit.any"
AnyDrawSphere p1 = {Position = (.p[0]-.sRel)*.ARel;ScaleXYZ = 0.002*{1,1,1};Visible=Off;};
AnyDrawSphere p2 = {Position = (.p[1]-.sRel)*.ARel;ScaleXYZ = 0.002*{1,1,1};Visible=Off;};
AnyDrawSphere p3 = {Position = (.p[2]-.sRel)*.ARel;ScaleXYZ = 0.002*{1,1,1};Visible=Off;};
AnyDrawSphere p4 = {Position = (.p[3]-.sRel)*.ARel;ScaleXYZ = 0.002*{1,1,1};Visible=Off;};
AnyDrawSphere p5 = {Position = (.p[4]-.sRel)*.ARel;ScaleXYZ = 0.002*{1,1,1};Visible=Off;};
cyl =
{
AnyDrawParamSurf drwsurf={RGB={1,0,0};Opacity = 0.3;Visible = Off;};
};
};
AnyRefNode Semitendinosus1WrapSurf ={
AnyFloat p = {
.Semitendinosus1Node.sRel+{0.001,0,0},
.BicepsFemorisCaputLongum1Node.sRel+{0.001,0,0},
.Semitendinosus1Node.sRel+{0.001,0,0},
.Semimembranosus3Node.sRel,
.QuadratusFemoris3Node.sRel
};
AnyVar lengthscalefactor=8;
AnyVar Z_rotation=0;
AnyVar radiusscalefactor=1;
#include "<ANYBODY_PATH_MODELUTILS>/WrappingSurfaces/WrappingCylinder5PointFit.any"
AnyDrawSphere p1 = {Position = (.p[0]-.sRel)*.ARel;ScaleXYZ = 0.002*{1,1,1};Visible=Off;};
AnyDrawSphere p2 = {Position = (.p[1]-.sRel)*.ARel;ScaleXYZ = 0.002*{1,1,1};Visible=Off;};
AnyDrawSphere p3 = {Position = (.p[2]-.sRel)*.ARel;ScaleXYZ = 0.002*{1,1,1};Visible=Off;};
AnyDrawSphere p4 = {Position = (.p[3]-.sRel)*.ARel;ScaleXYZ = 0.002*{1,1,1};Visible=Off;};
AnyDrawSphere p5 = {Position = (.p[4]-.sRel)*.ARel;ScaleXYZ = 0.002*{1,1,1};Visible=Off;};
cyl =
{
AnyDrawParamSurf drwsurf={RGB={1,0,0};Opacity = 0.3;Visible = Off;};
CapRatio = 1;
CapRatio2 = 1;
};
};
AnyRefNode IschialTuberosityWrapNode = {sRel = .Scale( .StdPar.IschialTuberosityWrapNode);};
// Origin points on the Pelvis
AnyRefNode ASIS = {sRel = .Scale( .StdPar.AsisIpsilateral); /*AnyDrawNode Node = {ScaleXYZ = {0.005, 0.005, 0.005};};*/};
AnyRefNode PSIS = {sRel = .Scale( .StdPar.PsisIpsilateral); /*AnyDrawNode Node = {ScaleXYZ = {0.005, 0.005, 0.005};};*/};
AnyRefNode AdductorBrevisProximal1Node = {sRel = .Scale( .StdPar.AdductorBrevisProximal1Node );};
AnyRefNode AdductorBrevisProximal2Node = {sRel = .Scale( .StdPar.AdductorBrevisProximal2Node );};
AnyRefNode AdductorBrevisMid1Node = {sRel = .Scale( .StdPar.AdductorBrevisMid1Node );};
AnyRefNode AdductorBrevisMid2Node = {sRel = .Scale( .StdPar.AdductorBrevisMid2Node );};
AnyRefNode AdductorBrevisDistal1Node = {sRel = .Scale( .StdPar.AdductorBrevisDistal1Node );};
AnyRefNode AdductorBrevisDistal2Node = {sRel = .Scale( .StdPar.AdductorBrevisDistal2Node );};
AnyRefNode AdductorLongus1Node = {sRel = .Scale( .StdPar.AdductorLongus1Node );};
AnyRefNode AdductorLongus2Node = {sRel = .Scale( .StdPar.AdductorLongus2Node );};
AnyRefNode AdductorLongus3Node = {sRel = .Scale( .StdPar.AdductorLongus3Node );};
AnyRefNode AdductorLongus4Node = {sRel = .Scale( .StdPar.AdductorLongus4Node );};
AnyRefNode AdductorLongus5Node = {sRel = .Scale( .StdPar.AdductorLongus5Node );};
AnyRefNode AdductorLongus6Node = {sRel = .Scale( .StdPar.AdductorLongus6Node );};
AnyRefNode AdductorMagnusDistal1Node = {sRel = .Scale( .StdPar.AdductorMagnusDistal1Node );};
AnyRefNode AdductorMagnusDistal2Node = {sRel = .Scale( .StdPar.AdductorMagnusDistal2Node );};
AnyRefNode AdductorMagnusDistal3Node = {sRel = .Scale( .StdPar.AdductorMagnusDistal3Node );};
AnyRefNode AdductorMagnusMid1Node = {sRel = .Scale( .StdPar.AdductorMagnusMid1Node );};
AnyRefNode AdductorMagnusMid2Node = {sRel = .Scale( .StdPar.AdductorMagnusMid2Node );};
AnyRefNode AdductorMagnusMid3Node = {sRel = .Scale( .StdPar.AdductorMagnusMid3Node );};
AnyRefNode AdductorMagnusMid4Node = {sRel = .Scale( .StdPar.AdductorMagnusMid4Node );};
AnyRefNode AdductorMagnusMid5Node = {sRel = .Scale( .StdPar.AdductorMagnusMid5Node );};
AnyRefNode AdductorMagnusMid6Node = {sRel = .Scale( .StdPar.AdductorMagnusMid6Node );};
AnyRefNode AdductorMagnusProximal1Node = {sRel = .Scale( .StdPar.AdductorMagnusProximal1Node );};
AnyRefNode AdductorMagnusProximal2Node = {sRel = .Scale( .StdPar.AdductorMagnusProximal2Node );};
AnyRefNode AdductorMagnusProximal3Node = {sRel = .Scale( .StdPar.AdductorMagnusProximal3Node );};
AnyRefNode AdductorMagnusProximal4Node = {sRel = .Scale( .StdPar.AdductorMagnusProximal4Node );};
AnyRefNode BicepsFemorisCaputLongum1Node = {sRel = .Scale( .StdPar.BicepsFemorisCaputLongum1Node );};
AnyRefNode GemellusInferior1Node = {sRel = .Scale( .StdPar.GemellusInferior1Node );};
AnyRefNode GemellusSuperior1Node = {sRel = .Scale( .StdPar.GemellusSuperior1Node );};
AnyRefNode GluteusMaximusSuperior1Node = {sRel = .Scale( .StdPar.GluteusMaximusSuperior1Node );};
AnyRefNode GluteusMaximusSuperior2Node = {sRel = .Scale( .StdPar.GluteusMaximusSuperior2Node );};
AnyRefNode GluteusMaximusSuperior3Node = {sRel = .Scale( .StdPar.GluteusMaximusSuperior3Node );};
AnyRefNode GluteusMaximusSuperior4Node = {sRel = .Scale( .StdPar.GluteusMaximusSuperior4Node );};
AnyRefNode GluteusMaximusSuperior5Node = {sRel = .Scale( .StdPar.GluteusMaximusSuperior5Node );};
AnyRefNode GluteusMaximusSuperior6Node = {sRel = .Scale( .StdPar.GluteusMaximusSuperior6Node );};
AnyRefNode GluteusMaximusInferior1Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior1Node );};
AnyRefNode GluteusMaximusInferior2Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior2Node );};
AnyRefNode GluteusMaximusInferior3Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior3Node );};
AnyRefNode GluteusMaximusInferior4Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior4Node );};
AnyRefNode GluteusMaximusInferior5Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior5Node );};
AnyRefNode GluteusMaximusInferior6Node = {sRel = .Scale( .StdPar.GluteusMaximusInferior6Node );};
AnyRefNode GluteusMediusAnterior1Node = {sRel = .Scale( .StdPar.GluteusMediusAnterior1Node );};
AnyRefNode GluteusMediusAnterior2Node = {sRel = .Scale( .StdPar.GluteusMediusAnterior2Node );};
AnyRefNode GluteusMediusAnterior3Node = {sRel = .Scale( .StdPar.GluteusMediusAnterior3Node );};
AnyRefNode GluteusMediusAnterior4Node = {sRel = .Scale( .StdPar.GluteusMediusAnterior4Node );};
AnyRefNode GluteusMediusAnterior5Node = {sRel = .Scale( .StdPar.GluteusMediusAnterior5Node );};
AnyRefNode GluteusMediusAnterior6Node = {sRel = .Scale( .StdPar.GluteusMediusAnterior6Node );};
AnyRefNode GluteusMediusPosterior1Node = {sRel = .Scale( .StdPar.GluteusMediusPosterior1Node );};
AnyRefNode GluteusMediusPosterior2Node = {sRel = .Scale( .StdPar.GluteusMediusPosterior2Node );};
AnyRefNode GluteusMediusPosterior3Node = {sRel = .Scale( .StdPar.GluteusMediusPosterior3Node );};
AnyRefNode GluteusMediusPosterior4Node = {sRel = .Scale( .StdPar.GluteusMediusPosterior4Node );};
AnyRefNode GluteusMediusPosterior5Node = {sRel = .Scale( .StdPar.GluteusMediusPosterior5Node );};
AnyRefNode GluteusMediusPosterior6Node = {sRel =.Scale( .StdPar.GluteusMediusPosterior6Node );};
AnyRefNode GluteusMinimusAnterior1Node = {sRel = .Scale( .StdPar.GluteusMinimusAnterior1Node );};
AnyRefNode GluteusMinimusMid1Node = {sRel = .Scale( .StdPar.GluteusMinimusMid1Node );};
AnyRefNode GluteusMinimusPosterior1Node = {sRel = .Scale( .StdPar.GluteusMinimusPosterior1Node );};
AnyRefNode Gracilis1Node = {sRel = .Scale( .StdPar.Gracilis1Node );};
AnyRefNode Gracilis2Node = {sRel = .Scale( .StdPar.Gracilis2Node );};
AnyRefNode IliacusLateralis1Node = {sRel = .Scale( .StdPar.IliacusLateralis1Node ); };
AnyRefNode IliacusLateralis2Node = {sRel = .Scale( .StdPar.IliacusLateralis2Node ); };
AnyRefNode IliacusLateralisViaNode1 = {sRel = .Scale( .StdPar.IliacusLateralisViaNode1 );};
AnyRefNode IliacusLateralisViaNode2 = {sRel = 0.5*.Scale(.StdPar.IliacusLateralisViaNode1) + 0.5*.Scale(.StdPar.IliacusMidViaNode1);};
AnyRefNode IliacusMid1Node = {sRel = .Scale( .StdPar.IliacusMid1Node );};
AnyRefNode IliacusMid2Node = {sRel = .Scale( .StdPar.IliacusMid2Node );};
AnyRefNode IliacusMidViaNode1 = {sRel = .Scale( .StdPar.IliacusMidViaNode1 );};
AnyRefNode IliacusMidViaNode2 = {sRel = (2/3)*.Scale(.StdPar.IliacusMidViaNode1 ) + (1/3)* .Scale(.StdPar.IliacusMedialisViaNode1); };
AnyRefNode IliacusMedialis1Node = {sRel =.Scale( .StdPar.IliacusMedialis1Node ); };
AnyRefNode IliacusMedialis2Node = {sRel = .Scale( .StdPar.IliacusMedialis2Node );};
AnyRefNode IliacusMedialisViaNode1 = {sRel = .Scale( .StdPar.IliacusMedialisViaNode1 );};
AnyRefNode IliacusMedialisViaNode2 = {sRel = (1/3)*.Scale(.StdPar.IliacusMidViaNode1 ) + (2/3)* .Scale(.StdPar.IliacusMedialisViaNode1); };
AnyRefNode ObturatorExternusInferior1Node = {sRel = .Scale( .StdPar.ObturatorExternusInferior1Node );};
AnyRefNode ObturatorExternusInferior2Node = {sRel =.Scale( .StdPar.ObturatorExternusInferior2Node );};
AnyRefNode ObturatorExternusSuperior1Node = {sRel = .Scale( .StdPar.ObturatorExternusSuperior1Node );};
AnyRefNode ObturatorExternusSuperior2Node = {sRel = .Scale( .StdPar.ObturatorExternusSuperior2Node );};
AnyRefNode ObturatorExternusSuperior3Node = {sRel = .Scale( .StdPar.ObturatorExternusSuperior3Node );};
AnyRefNode ObturatorInternus1Node = {sRel = .Scale( .StdPar.ObturatorInternus1Node );};
AnyRefNode ObturatorInternus2Node = {sRel = .Scale( .StdPar.ObturatorInternus2Node );};
AnyRefNode ObturatorInternus3Node = {sRel = .Scale( .StdPar.ObturatorInternus3Node );};
AnyRefNode ObturatorInternus4Node = {sRel = .Scale( .StdPar.ObturatorInternus4Node );};
AnyRefNode ObturatorInternus5Node = {sRel = .Scale( .StdPar.ObturatorInternus5Node );};
AnyRefNode ObturatorInternus6Node = {sRel = .Scale( .StdPar.ObturatorInternus6Node );};
AnyRefNode ObturatorInternusViaNode1 = {sRel = .Scale( .StdPar.ObturatorInternusVia1Node );};
AnyRefNode Pectineus1Node = {sRel = .Scale( .StdPar.Pectineus1Node );};
AnyRefNode Pectineus1ViaNode = {sRel = .Scale( .StdPar.Pectineus1ViaNode );};
AnyRefNode Pectineus2Node = {sRel = .Scale( .StdPar.Pectineus2Node );};
AnyRefNode Pectineus3Node = {sRel = .Scale( .StdPar.Pectineus3Node );};
AnyRefNode Pectineus4Node = {sRel = .Scale( .StdPar.Pectineus4Node );};
AnyRefNode Piriformis1Node = {sRel = .Scale( .StdPar.Piriformis1Node );};
AnyRefNode QuadratusFemoris1Node = {sRel = .Scale( .StdPar.QuadratusFemoris1Node );};
AnyRefNode QuadratusFemoris2Node = {sRel = .Scale( .StdPar.QuadratusFemoris2Node );};
AnyRefNode QuadratusFemoris3Node = {sRel = .Scale( .StdPar.QuadratusFemoris3Node );};
AnyRefNode QuadratusFemoris4Node = {sRel = .Scale( .StdPar.QuadratusFemoris4Node );};
AnyRefNode RectusFemoris1Node = {sRel = .Scale( .StdPar.RectusFemoris1Node );};
AnyRefNode RectusFemoris2Node = {sRel = .Scale( .StdPar.RectusFemoris2Node );};
AnyRefNode Sartorius1Node = {sRel = .Scale( .StdPar.Sartorius1Node );};
AnyRefNode Semimembranosus1Node = {sRel = .Scale( .StdPar.Semimembranosus1Node );};
AnyRefNode Semimembranosus2Node = {sRel = .Scale( .StdPar.Semimembranosus2Node );};
AnyRefNode Semimembranosus3Node = {sRel = .Scale( .StdPar.Semimembranosus3Node );};
AnyRefNode Semitendinosus1Node = {sRel = .Scale( .StdPar.Semitendinosus1Node );};
AnyRefNode TensorFasciaeLatae1Node = {sRel =.Scale( .StdPar.TensorFasciaeLatae1Node );};
AnyRefNode TensorFasciaeLatae2Node = {sRel = .Scale( .StdPar.TensorFasciaeLatae2Node );};
#ifdef GLUTEUS_MAX_WRAPPING_BETA
AnyRefNode GluteusCylSuperior =
{
AnyMatrix p = .Scale(.StdPar.GluteusSuperiorWrapLandmarks);
AnyFloat lengthscalefactor = 1;
AnyFloat radiusscalefactor = 1;
AnyVar Z_rotation =0;
#include "<ANYBODY_PATH_MODELUTILS>/WrappingSurfaces/WrappingCylinder5PointFit.any"
};
AnyRefNode GluteusCylInferior =
{
AnyMatrix p = .StdPar.GluteusInferiorWrapLandmarks;
AnyFloat lengthscalefactor = 1;
AnyFloat radiusscalefactor = 1;
AnyVar Z_rotation =0;
#include "<ANYBODY_PATH_MODELUTILS>/WrappingSurfaces/WrappingCylinder5PointFit.any"
};
#endif
}; // End Muscles
}; // End Pelvis.Left/Right
#if BM_PELVIS_DISPLAY >=1
#ifndef _BM_PELVIS_DISPLAY_
#define _BM_PELVIS_DISPLAY_
#if (BM_PELVIS_DISPLAY == _PELVIS_DISPLAY_LEGANDTRUNKPELVIS_)
AnyDrawSurf Drw_LegPelvis =
#else
AnyDrawSurf DrwPelvis =
#endif
{
FileName ??= ..STL.FilenamePelvis;
Opacity ??= Main.DrawSettings.BonesOpacity.Pelvis;
RGB ??= ...ColorRef.Segments;
AnyFunTransform3D &Scale = .AnatomicalFrame.Scale_Leg_Pelvis ;
};
#if (BM_PELVIS_DISPLAY == _PELVIS_DISPLAY_LEGANDTRUNKPELVIS_)
AnyDrawSurf Drw_LegSacrum =
#else
AnyDrawSurf DrwSacrum =
#endif
{
FileName ??= ..STL.FilenameSacrum;
Opacity ??= Main.DrawSettings.BonesOpacity.Pelvis;
RGB ??= ...ColorRef.Segments;
AnyFunTransform3D &Scale = .AnatomicalFrame.Scale_Leg_Pelvis ;
};
#endif
#endif
}; // End Pelvis