4
//== Uber Elevate eCRM-003 ==//
//== May 2018 ==//
//== This lift+cruise configuration has been developed to help push the industry forward. ==//
//== Modeled and analyzed in California by the Uber Elevate Vehicles Team ==//
//== For questions regarding the model, please contact Ian Villa (ianvilla@uber.com) ==//
//== Copyright 2018 Uber Technologies Inc. ==//
//== Redistribution and use in any form, with or without modification, are permitted provided that the following conditions are met: ==//
//== 1. Redistributions must retain the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. ==//
//== 2. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. ==//
//== THIS MATERIAL IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==//
SNLMLSYVNX
eCRM-003
8
AFFIUHTFEG
Default
JMXVQBKACK
Default
QNDYDDBEGC
Default
ZPHWRUCMDQ
Default
TOVLNNLPXW
Default
ZFIUZCNOVV
Default
FFKIYXRDLD
Default
LHHONOWCMA
Default
0
0
KKFUGQQOPX
Fuselage
Stack
8
0
NONE
GYZKNSBMXX
BXOATEYUTJ
EYQZLIIYOU
FITXEDKWCR
XWBNTKARSB
TAGCDQPPBT
Glass Light
PKECMWHVTF
Default
0
1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1,
QNKLOWKFCU
SS_RECT_0
1
HDFKKDHURY
Default
JFNLRXGFXN
Default
1
XSec
QICKUBWUDL
Default
0
KWCAWOLCFP
Default
1
XSec
XYYXQVJZUD
Default
5
NEAGWCLBBW
Default
1
XSec
HSAQQALMKF
Default
5
ZCCSGSCFVL
Default
1
XSec
WDYKLYSNOW
Default
5
LMWIUVNGYK
Default
1
XSec
ZBJIXYVJRV
Default
2
FDUHDOKVUY
Default
1
XSec
DUBLALTIQG
Default
0
Male95Pct1
//== Developed by Uber Elevate's Vehicle System Team ==//
//== Ian Villa, Vehicle Strategic Modeling Lead ==//
//== May 6th 2018 ==//
void Init()
{
//==== Add Parm Types =====//
string Height = AddParm( PARM_DOUBLE_TYPE, "Height", "Design" );
SetParmValLimits( Height, 6, 0.001, 1.0e12);
//== Angles ==//
string Head_XAng = AddParm( PARM_DOUBLE_TYPE, "Head_XAng", "Angles" );
SetParmValLimits( Head_XAng, 0, -45, 45 );
string Head_YAng = AddParm( PARM_DOUBLE_TYPE, "Head_YAng", "Angles" );
SetParmValLimits( Head_YAng, 0, -30, 30 );
string Head_ZAng = AddParm( PARM_DOUBLE_TYPE, "Head_ZAng", "Angles" );
SetParmValLimits( Head_ZAng, 0, -30, 30 );
string UL_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "UL_Leg_YAng", "Angles" );
SetParmValLimits( UL_Leg_YAng, 0, -90, 120 );
string UR_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "UR_Leg_YAng", "Angles" );
SetParmValLimits( UR_Leg_YAng, 0, -90, 120 );
string UL_Leg_ZAng = AddParm( PARM_DOUBLE_TYPE, "UL_Leg_ZAng", "Angles" );
SetParmValLimits( UL_Leg_ZAng, 0, -90, 90 );
string UR_Leg_ZAng = AddParm( PARM_DOUBLE_TYPE, "UR_Leg_ZAng", "Angles" );
SetParmValLimits( UR_Leg_ZAng, 0, -90, 90 );
string LL_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "LL_Leg_YAng", "Angles" );
SetParmValLimits( LL_Leg_YAng, 0, -150, 0 );
string LR_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "LR_Leg_YAng", "Angles" );
SetParmValLimits( LR_Leg_YAng, 0, -150, 0 );
string L_Foot_XAng = AddParm( PARM_DOUBLE_TYPE, "L_Foot_XAng", "Angles" );
SetParmValLimits( L_Foot_XAng, 0, -45, 45 );
string R_Foot_XAng = AddParm( PARM_DOUBLE_TYPE, "R_Foot_XAng", "Angles" );
SetParmValLimits( R_Foot_XAng, 0, -45, 45 );
string L_Foot_YAng = AddParm( PARM_DOUBLE_TYPE, "L_Foot_YAng", "Angles" );
SetParmValLimits( L_Foot_YAng, 0, -90, 30 );
string R_Foot_YAng = AddParm( PARM_DOUBLE_TYPE, "R_Foot_YAng", "Angles" );
SetParmValLimits( R_Foot_YAng, 0, -90, 30 );
string L_Foot_ZAng = AddParm( PARM_DOUBLE_TYPE, "L_Foot_ZAng", "Angles" );
SetParmValLimits( L_Foot_ZAng, 0, -30, 30 );
string R_Foot_ZAng = AddParm( PARM_DOUBLE_TYPE, "R_Foot_ZAng", "Angles" );
SetParmValLimits( R_Foot_ZAng, 0, -30, 30 );
string UL_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "UL_Arm_YAng", "Angles" );
SetParmValLimits( UL_Arm_YAng, 0, -180, 180 );
string UR_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "UR_Arm_YAng", "Angles" );
SetParmValLimits( UR_Arm_YAng, 0, -180, 180 );
string UL_Arm_ZAng = AddParm( PARM_DOUBLE_TYPE, "UL_Arm_ZAng", "Angles" );
SetParmValLimits( UL_Arm_ZAng, 0, -180, 180 );
string UR_Arm_ZAng = AddParm( PARM_DOUBLE_TYPE, "UR_Arm_ZAng", "Angles" );
SetParmValLimits( UR_Arm_ZAng, 0, -180, 180 );
string LL_Arm_XAng = AddParm( PARM_DOUBLE_TYPE, "LL_Arm_XAng", "Angles" );
SetParmValLimits( LL_Arm_XAng, 0, -90, 90 );
string LR_Arm_XAng = AddParm( PARM_DOUBLE_TYPE, "LR_Arm_XAng", "Angles" );
SetParmValLimits( LR_Arm_XAng, 0, -90, 90 );
string LL_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "LL_Arm_YAng", "Angles" );
SetParmValLimits( LL_Arm_YAng, 0, 0, 150 );
string LR_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "LR_Arm_YAng", "Angles" );
SetParmValLimits( LR_Arm_YAng, 0, 0, 150 );
string L_Hand_ZAng = AddParm( PARM_DOUBLE_TYPE, "L_Hand_ZAng", "Angles" );
SetParmValLimits( L_Hand_ZAng, 0, -90, 45 );
string R_Hand_ZAng = AddParm( PARM_DOUBLE_TYPE, "R_Hand_ZAng", "Angles" );
SetParmValLimits( R_Hand_ZAng, 0, -90, 45 );
//==== Choices ====//
string umult = AddParm( PARM_DOUBLE_TYPE, "UnitMult", "Design" );
SetParmValLimits( umult, 1, 0.001, 1e12 );
string units = AddParm( PARM_INT_TYPE, "Units", "Design" );
SetParmValLimits( units, 0, 0, 100 );
string trigger = AddParm( PARM_BOOL_TYPE, "Trigger", "Design" );
SetParmVal( trigger, 1 );
//==== Add Cross Sections ====//
// Head
string head_surf = AddXSecSurf();
AppendXSec( head_surf, XS_POINT );
AppendXSec( head_surf, XS_SUPER_ELLIPSE );
AppendXSec( head_surf, XS_POINT );
// Neck
string neck_surf = AddXSecSurf();
AppendXSec( neck_surf, XS_POINT );
AppendXSec( neck_surf, XS_SUPER_ELLIPSE );
AppendXSec( neck_surf, XS_SUPER_ELLIPSE );
AppendXSec( neck_surf, XS_POINT );
// Torso
string torso_surf = AddXSecSurf();
AppendXSec( torso_surf, XS_POINT );
AppendXSec( torso_surf, XS_SUPER_ELLIPSE );
AppendXSec( torso_surf, XS_SUPER_ELLIPSE );
AppendXSec( torso_surf, XS_SUPER_ELLIPSE );
AppendXSec( torso_surf, XS_POINT );
// Pelvis
string pelvis_surf = AddXSecSurf();
AppendXSec( pelvis_surf, XS_POINT );
AppendXSec( pelvis_surf, XS_SUPER_ELLIPSE );
AppendXSec( pelvis_surf, XS_SUPER_ELLIPSE );
AppendXSec( pelvis_surf, XS_POINT );
// Upper Left Leg
string UL_leg_surf = AddXSecSurf();
AppendXSec( UL_leg_surf, XS_POINT );
AppendXSec( UL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_leg_surf, XS_POINT );
// Left Knee
string L_knee_surf = AddXSecSurf();
AppendXSec( L_knee_surf, XS_POINT );
AppendXSec( L_knee_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_knee_surf, XS_POINT );
// Lower Left Leg
string LL_leg_surf = AddXSecSurf();
AppendXSec( LL_leg_surf, XS_POINT );
AppendXSec( LL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_leg_surf, XS_POINT );
// Left Ankle
string L_ankle_surf = AddXSecSurf();
AppendXSec( L_ankle_surf, XS_POINT );
AppendXSec( L_ankle_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_ankle_surf, XS_POINT );
// Left Foot
string L_foot_surf = AddXSecSurf();
AppendXSec( L_foot_surf, XS_POINT );
AppendXSec( L_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_foot_surf, XS_POINT );
// Left Shoulder
string L_shoulder_surf = AddXSecSurf();
AppendXSec( L_shoulder_surf, XS_POINT );
AppendXSec( L_shoulder_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_shoulder_surf, XS_POINT );
// Upper Left Arm
string UL_arm_surf = AddXSecSurf();
AppendXSec( UL_arm_surf, XS_POINT );
AppendXSec( UL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_arm_surf, XS_POINT );
// Left Elbow
string L_elbow_surf = AddXSecSurf();
AppendXSec( L_elbow_surf, XS_POINT );
AppendXSec( L_elbow_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_elbow_surf, XS_POINT );
// Lower Left Arm
string LL_arm_surf = AddXSecSurf();
AppendXSec( LL_arm_surf, XS_POINT );
AppendXSec( LL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_arm_surf, XS_POINT );
// Left Wrist
string L_wrist_surf = AddXSecSurf();
AppendXSec( L_wrist_surf, XS_POINT );
AppendXSec( L_wrist_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_wrist_surf, XS_POINT );
// Left Hand
string L_hand_surf = AddXSecSurf();
AppendXSec( L_hand_surf, XS_POINT );
AppendXSec( L_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_hand_surf, XS_POINT );
// Upper Right Leg
string UR_leg_surf = AddXSecSurf();
AppendXSec( UR_leg_surf, XS_POINT );
AppendXSec( UR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_leg_surf, XS_POINT );
// Right Knee
string R_knee_surf = AddXSecSurf();
AppendXSec( R_knee_surf, XS_POINT );
AppendXSec( R_knee_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_knee_surf, XS_POINT );
// Lower Right Leg
string LR_leg_surf = AddXSecSurf();
AppendXSec( LR_leg_surf, XS_POINT );
AppendXSec( LR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_leg_surf, XS_POINT );
// Right Ankle
string R_ankle_surf = AddXSecSurf();
AppendXSec( R_ankle_surf, XS_POINT );
AppendXSec( R_ankle_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_ankle_surf, XS_POINT );
// Right Foot
string R_foot_surf = AddXSecSurf();
AppendXSec( R_foot_surf, XS_POINT );
AppendXSec( R_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_foot_surf, XS_POINT );
// Right Shoulder
string R_shoulder_surf = AddXSecSurf();
AppendXSec( R_shoulder_surf, XS_POINT );
AppendXSec( R_shoulder_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_shoulder_surf, XS_POINT );
// Upper Right Arm
string UR_arm_surf = AddXSecSurf();
AppendXSec( UR_arm_surf, XS_POINT );
AppendXSec( UR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_arm_surf, XS_POINT );
// Right Elbow
string R_elbow_surf = AddXSecSurf();
AppendXSec( R_elbow_surf, XS_POINT );
AppendXSec( R_elbow_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_elbow_surf, XS_POINT );
// Lower Right Arm
string LR_arm_surf = AddXSecSurf();
AppendXSec( LR_arm_surf, XS_POINT );
AppendXSec( LR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_arm_surf, XS_POINT );
// Right Wrist
string R_wrist_surf = AddXSecSurf();
AppendXSec( R_wrist_surf, XS_POINT );
AppendXSec( R_wrist_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_wrist_surf, XS_POINT );
// Right Hand
string R_hand_surf = AddXSecSurf();
AppendXSec( R_hand_surf, XS_POINT );
AppendXSec( R_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_hand_surf, XS_POINT );
//==== Adjust Tessellation ====//
string geom_id = GetCurrCustomGeom();
SetParmVal( GetParm( geom_id, "Tess_U", "Shape" ), 13 );
SetParmVal( GetParm( geom_id, "Tess_W", "Shape" ), 17 );
}
//==== Global Gui IDs - These Are Consistent For All Created Boxes And Used In UpdateGUI====//
//==== InitGui Is Called Once During Each Custom Geom Construction ====//
void InitGui()
{
AddGui( GDEV_TAB, "Design" );
AddGui( GDEV_YGAP, "" );
AddGui( GDEV_DIVIDER_BOX, "Design" );
AddGui( GDEV_CHOICE, "Units:", "Units", "Design" );
AddGui( GDEV_ADD_CHOICE_ITEM, "in" );
AddGui( GDEV_ADD_CHOICE_ITEM, "ft" );
AddGui( GDEV_ADD_CHOICE_ITEM, "cm" );
AddGui( GDEV_ADD_CHOICE_ITEM, "m" );
AddGui( GDEV_TRIGGER_BUTTON, "Go", "Trigger", "Design" );
AddGui( GDEV_TAB, "Angles" );
AddGui( GDEV_DIVIDER_BOX, "X Rotations" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Head", "Head_XAng", "Angles", 45 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Forearm", "LL_Arm_XAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Forearm", "LR_Arm_XAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Foot", "L_Foot_XAng", "Angles", 45 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Foot", "R_Foot_XAng", "Angles", 45 );
AddGui( GDEV_YGAP );
AddGui( GDEV_DIVIDER_BOX, "Y Rotations" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Head", "Head_YAng", "Angles", 30 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Arm", "UL_Arm_YAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Arm", "UR_Arm_YAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Forearm", "LL_Arm_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Forearm", "LR_Arm_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Leg", "UL_Leg_YAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Leg", "UR_Leg_YAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Lower L Leg", "LL_Leg_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Lower R Leg", "LR_Leg_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Foot", "L_Foot_YAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Foot", "R_Foot_YAng", "Angles", 90 );
AddGui( GDEV_YGAP );
AddGui( GDEV_DIVIDER_BOX, "Z Rotations" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Head", "Head_ZAng", "Angles", 30 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Arm", "UL_Arm_ZAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Arm", "UR_Arm_ZAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Hand", "L_Hand_ZAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Hand", "R_Hand_ZAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Leg", "UL_Leg_ZAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Leg", "UR_Leg_ZAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Foot", "L_Foot_ZAng", "Angles", 30 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Foot", "R_Foot_ZAng", "Angles", 30 );
AddGui( GDEV_YGAP, "" );
}
//==== UpdateGui Is Called Every Time The Gui is Updated ====//
void UpdateGui()
{
}
//==== UpdateSurf Is Called Every Time The Geom is Updated ====//
void UpdateSurf()
{
string geom_id = GetCurrCustomGeom();
//==== Check for Trigger Before Getting Current Values ====//
string trigger_parm = GetParm( geom_id, "Trigger", "Design" );
if ( GetBoolParmVal( trigger_parm ) )
{
int unit_choice = GetIntParmVal( GetParm( geom_id, "Units", "Design" ) );
//==== Check Units and Set Values ====//
if ( unit_choice == 0 ) // inches
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.0393701 );
}
else if ( unit_choice == 1 ) // feet
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.00328083989 );
}
else if ( unit_choice == 2 ) // centimeters
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.1 );
}
else if ( unit_choice == 3 ) // meters
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.001 );
}
//==== Reset Trigger ====//
SetParmVal( trigger_parm, 0 );
}
string xsec0;
string xsec1;
string xsec2;
string xsec3;
string xsec4;
string xsec5;
//==== Helpful Values ====//
// Units Factor
double ufac = GetParmVal( GetParm( geom_id, "UnitMult", "Design" ) );
vec3d pos( 0, 0, 0 );
//==== Head (0) ====//
//== Get Parms
double Head_XAng = GetParmVal( GetParm( geom_id, "Head_XAng", "Angles" ) );
double Head_YAng = GetParmVal( GetParm( geom_id, "Head_YAng", "Angles" ) );
double Head_ZAng = GetParmVal( GetParm( geom_id, "Head_ZAng", "Angles" ) );
//== Part Dimensions
// Depth (90%)
double head_depth = 211 * ufac;
// Berth (90%)
double head_berth = 163 * ufac;
// Height (90%)
double head_height = 211 * ufac;
//== Center of Rotation Locations WRT Global Origin
double headXcr = 165 * ufac; // B-K+0.5*R
double headZcr = -70 * ufac; // N
//== Set XSecs ( 0 is top, 2 is neck )
string head_surf = GetXSecSurf( geom_id, 0 );
xsec0 = GetXSec( head_surf, 0 );
xsec1 = GetXSec( head_surf, 1 );
xsec2 = GetXSec( head_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, 1.5 * head_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), head_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), head_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, head_depth * 0.5 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, head_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.6 * head_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( head_height, 0, 0.25 * head_depth ) );
//== Locate Part and Set Rotation
Matrix4d head_mat;
vec3d head_cr( headXcr, 0, headZcr );
vec3d head_rot( Head_XAng, Head_YAng, Head_ZAng );
head_mat.buildXForm( pos, head_rot, head_cr );
SetXSecSurfGlobalXForm( head_surf, head_mat );
//==== Neck (1) ====//
//== Part Dimensions
// Depth (90%)
double neck_depth = 141 * ufac;
// Berth (90%)
double neck_berth = 141 * ufac;
// Height (90%)
double neck_height = 48 * ufac;
//== Part Locations WRT Global Origin
double neckX = head_height;
double neckZ = -25 * ufac;
//== Set XSecs ( 0-1 are head, 2-3 are shoulders )
string neck_surf = GetXSecSurf( geom_id, 1 );
xsec0 = GetXSec( neck_surf, 0 );
xsec1 = GetXSec( neck_surf, 1 );
xsec2 = GetXSec( neck_surf, 2 );
xsec3 = GetXSec( neck_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, 0.5 * neck_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), 0.6 * neck_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), 0.6 * neck_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, neck_height * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), neck_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), neck_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, neck_height * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, 0.5 * neck_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( -2 * neck_height, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( -1.9 * neck_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * neck_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( neck_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d neck_mat;
neck_mat.translatef( neckX, 0, neckZ );
SetXSecSurfGlobalXForm( neck_surf, neck_mat );
//==== TORSO (2) ====//
//== Part Dimensions
// Depth at Chest (90%)
double torso_depth_chest = 298 * ufac;
// Depth at Omphalion (90%)
double torso_depth_opmhalion = 300 * ufac;
// Berth at Shoulders (90%)
double torso_berth_shoulder = 575 * ufac;
// Berth at Chest (90%)
double torso_berth_chest = 355 * ufac;
// Berth at Omphalion (90%)
double torso_berth_omphalion = 385 * ufac;
// Torso Height (90%) - (Cervicale Height - Omphalion Height)
double torso_height = 524 * ufac;
//== Part Locations WRT Neck Origin
double torsoX = neck_height;
double torsoZ = -neckZ; // Global Z=0
//== Center of Rotation Locations WRT Global Origin
double O_torsoXcr = 718 * ufac; // Stature - Omphalion Height
double O_torsoZcr = -70 * ufac;
//== Set XSecs (0-1 are shoulders, 2-3 are hips)
string torso_surf = GetXSecSurf( geom_id, 2 );
xsec0 = GetXSec( torso_surf, 0 );
xsec1 = GetXSec( torso_surf, 1 );
xsec2 = GetXSec( torso_surf, 2 );
xsec3 = GetXSec( torso_surf, 3 );
xsec4 = GetXSec( torso_surf, 4 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, torso_depth_chest * 0.8 );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), torso_depth_chest * 0.8 );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), torso_berth_shoulder );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 4 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, torso_depth_chest * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), torso_depth_chest );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), torso_berth_chest );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 1.5*torso_depth_chest );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), torso_depth_opmhalion );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), torso_berth_omphalion );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 4 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, torso_depth_opmhalion * 0.5 );
SetXSecTanAngles( xsec4, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec4, XSEC_BOTH_SIDES, torso_depth_opmhalion );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, neckZ ) );
SetCustomXSecLoc( xsec1, vec3d( 0.05 * torso_height, 0, neckZ ) );
SetCustomXSecLoc( xsec2, vec3d( 0.53 * torso_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( 0.95 * torso_height, 0, 0 ) );
SetCustomXSecLoc( xsec4, vec3d( torso_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d torso_mat = neck_mat;
torso_mat.translatef( torsoX, 0, torsoZ );
SetXSecSurfGlobalXForm( torso_surf, torso_mat );
//==== PELVIS (3) ====//
//== Part Dimensions
// Depth
double pelvis_depth = 300 * ufac;
// Berth
double pelvis_berth = 387 * ufac;
// Height
double pelvis_height = 246 * ufac;
//== Part Locations WRT Torso Origin
double pelvisX = torso_height;
double pelvisZ = -8.5 * ufac; // Global Z=-8.5*ufac
//== Set XSecs
string pelvis_surf = GetXSecSurf( geom_id, 3 );
xsec0 = GetXSec( pelvis_surf, 0 );
xsec1 = GetXSec( pelvis_surf, 1 );
xsec2 = GetXSec( pelvis_surf, 2 );
xsec3 = GetXSec( pelvis_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, 0.5 * pelvis_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), pelvis_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), pelvis_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.4 * pelvis_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), pelvis_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), pelvis_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 0.4 * pelvis_depth );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, 0.5 * pelvis_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.15 * pelvis_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.7 * pelvis_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( pelvis_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d pelvis_mat = torso_mat;
pelvis_mat.translatef( pelvisX, 0, pelvisZ );
SetXSecSurfGlobalXForm( pelvis_surf, pelvis_mat );
//==== UPPER LEFT LEG (4) ====//
//== Get Parms
double UL_Leg_YAng = GetParmVal( GetParm( geom_id, "UL_Leg_YAng", "Angles" ) );
double UL_Leg_ZAng = GetParmVal( GetParm( geom_id, "UL_Leg_ZAng", "Angles" ) );
//== Part Dimensions
// Depth at Hip
double leg_depth_hip = 243.3 * ufac;
// Depth at Knee
double leg_depth_knee = 150 * ufac;
// Berth at Hip
double leg_berth_hip = 207 * ufac;
// Berth at Knee
double leg_berth_knee = 131 * ufac;
// Length
double upper_leg_height = 458 * ufac; // Trochanterion Height - Mid-Patella Height
//== Part Locations WRT Pelvis Origin
double ulegX = pelvis_height -94 * ufac;
double ulegY = 0.5 * ( pelvis_berth - leg_berth_hip );
double ulegZ = -pelvisZ; // Global Z=0
//== Center of Rotation Locations WRT Global Origin
double ulegXcr = 931 * ufac;
double ulegYcr = ulegY;
double ulegZcr = -30 * ufac;
//== Set XSecs ( 0-1 are hip, 2-3 are knee )
string UL_leg_surf = GetXSecSurf( geom_id, 4 );
xsec0 = GetXSec( UL_leg_surf, 0 );
xsec1 = GetXSec( UL_leg_surf, 1 );
xsec2 = GetXSec( UL_leg_surf, 2 );
xsec3 = GetXSec( UL_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_hip );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d UL_leg_mat = pelvis_mat;
UL_leg_mat.translatef( ulegX, ulegY, ulegZ );
vec3d UL_leg_cr( ulegXcr, ulegYcr, ulegZcr );
vec3d UL_leg_rot( 0, -UL_Leg_YAng, UL_Leg_ZAng );
UL_leg_mat.buildXForm( pos, UL_leg_rot, UL_leg_cr );
SetXSecSurfGlobalXForm( UL_leg_surf, UL_leg_mat );
//==== LEFT KNEE (5) ====//
//== Part Dimensions
// Depth (90%M)
double knee_depth = leg_depth_knee;
// Berth (90%M)
double knee_berth = leg_berth_knee;
//== Part Location WRT Upper Left Leg Origin
double kneeX = upper_leg_height - 0.4 * knee_depth;
//== Set XSecs
string L_knee_surf = GetXSecSurf( geom_id, 5 );
xsec0 = GetXSec( L_knee_surf, 0 );
xsec1 = GetXSec( L_knee_surf, 1 );
xsec2 = GetXSec( L_knee_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), knee_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.4 * knee_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, knee_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.4 * knee_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * knee_depth, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d L_knee_mat = UL_leg_mat;
L_knee_mat.translatef( kneeX, 0, 0 );
SetXSecSurfGlobalXForm( L_knee_surf, L_knee_mat );
//==== LOWER LEFT LEG (6) ====//
//== Get Parms
double LL_Leg_YAng = GetParmVal( GetParm( geom_id, "LL_Leg_YAng", "Angles" ) );
//== Part Dimensions
// Depth at Ankle
double leg_depth_ankle = 80.85 * ufac;
// Berth at Ankle
double leg_berth_ankle = 81 * ufac;
// Height
double lower_leg_height = 461 * ufac;
//== Part Location WRT Upper Left Leg
double llegX = upper_leg_height;
//== Center of Rotation Location WRT Global Origin
double llegXcr = ulegXcr + lower_leg_height;
double llegYcr = ulegY;
double llegZcr = 30 * ufac;
//== Set XSecs ( 0-1 are knee, 2-3 are ankle )
string LL_leg_surf = GetXSecSurf( geom_id, 6 );
xsec0 = GetXSec( LL_leg_surf, 0 );
xsec1 = GetXSec( LL_leg_surf, 1 );
xsec2 = GetXSec( LL_leg_surf, 2 );
xsec3 = GetXSec( LL_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_ankle * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, llegZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d LL_leg_mat = UL_leg_mat;
LL_leg_mat.translatef( llegX, 0, 0 );
LL_leg_mat.rotateY( -LL_Leg_YAng );
SetXSecSurfGlobalXForm( LL_leg_surf, LL_leg_mat );
//==== LEFT ANKLE (7) ====//
//== Part Dimensions
// Depth
double ankle_depth = leg_depth_ankle;
// Berth
double ankle_berth = leg_berth_ankle;
// Height
double ankle_height = 80.85 * ufac;
//== Part Location WRT Lower Left Leg Origin
double ankleX = lower_leg_height - 0.5 * ankle_height;
//== Set XSecs
string L_ankle_surf = GetXSecSurf( geom_id, 7 );
xsec0 = GetXSec( L_ankle_surf, 0 );
xsec1 = GetXSec( L_ankle_surf, 1 );
xsec2 = GetXSec( L_ankle_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), ankle_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * ankle_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, ankle_depth );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * ankle_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( ankle_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_ankle_mat = LL_leg_mat;
L_ankle_mat.translatef( ankleX, 0, 0 );
SetXSecSurfGlobalXForm( L_ankle_surf, L_ankle_mat );
//==== LEFT FOOT (8) ====//
//== Get Parms
double L_Foot_XAng = GetParmVal( GetParm( geom_id, "L_Foot_XAng", "Angles" ) );
double L_Foot_YAng = GetParmVal( GetParm( geom_id, "L_Foot_YAng", "Angles" ) );
double L_Foot_ZAng = GetParmVal( GetParm( geom_id, "L_Foot_ZAng", "Angles" ) );
//== Part Dimensions
// Depth
double foot_depth = 293 * ufac;
// Berth (90%M)
double foot_berth = 111 * ufac;
// Height
double foot_height = 83 * ufac;
// Part Location WRT Lower Leg Origin
double footX = lower_leg_height;
// Set XSecs (0-1 are ankle, 2 is shoe top, 3-4 are bottom )
string L_foot_surf = GetXSecSurf( geom_id, 8 );
xsec0 = GetXSec( L_foot_surf, 0 );
xsec1 = GetXSec( L_foot_surf, 1 );
xsec2 = GetXSec( L_foot_surf, 2 );
xsec3 = GetXSec( L_foot_surf, 3 );
xsec4 = GetXSec( L_foot_surf, 4 );
// Set Sizes and Curvatures
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, foot_berth * 0.5 );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec3, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec4, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
// Locate Part and Set Rotation
Matrix4d L_foot_mat = LL_leg_mat;
L_foot_mat.translatef( footX, 0, 0 );
L_foot_mat.rotateX( L_Foot_XAng );
L_foot_mat.rotateY( -L_Foot_YAng );
L_foot_mat.rotateZ( L_Foot_ZAng );
SetXSecSurfGlobalXForm( L_foot_surf, L_foot_mat );
//==== LEFT SHOULDER (9) ====//
//== Part Dimensions
// Depth
double shoulder_depth = 132 * ufac;
// Berth
double shoulder_berth = 132 * ufac;
//== Part Locations WRT Torso Origin
double shoulderX = 0;
double shoulderY = 0.5 * ( torso_berth_shoulder - shoulder_berth );
double shoulderZ = neckZ;
//== Set XSecs
string L_shoulder_surf = GetXSecSurf( geom_id, 9 );
xsec0 = GetXSec( L_shoulder_surf, 0 );
xsec1 = GetXSec( L_shoulder_surf, 1 );
xsec2 = GetXSec( L_shoulder_surf, 2 );
//== Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), shoulder_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * shoulder_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, shoulder_berth );
//== Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * shoulder_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( shoulder_depth, 0, 0 ) );
//== Locate Part
Matrix4d L_shoulder_mat = torso_mat;
L_shoulder_mat.translatef( shoulderX, shoulderY, shoulderZ );
SetXSecSurfGlobalXForm( L_shoulder_surf, L_shoulder_mat );
//==== LEFT UPPER ARM (10) ====//
//== Get Parms
double UL_Arm_YAng = GetParmVal( GetParm( geom_id, "UL_Arm_YAng", "Angles" ) );
double UL_Arm_ZAng = GetParmVal( GetParm( geom_id, "UL_Arm_ZAng", "Angles" ) );
//== Part Dimensions
// Depth at Biceps
double arm_depth_biceps = 133 * ufac;
// Depth at Elbow
double arm_depth_elbow = 94 * ufac;
// Berth at Biceps
double arm_berth_biceps = 133 * ufac;
// Berth at Elbow
double arm_berth_elbow = 94 * ufac;
// Upper Arm Height (90%M)
double upper_arm_height = 392 * ufac;
// Center of Rotation Location WRT Global Origin
double uarmXcr = 242 * ufac + 0.5 * shoulder_depth; // Stature - Cervicale + Half of Shoulder
double uarmYcr = shoulderY;
double uarmZcr = shoulderZ;
// Set XSecs
string UL_arm_surf = GetXSecSurf( geom_id, 10 );
xsec0 = GetXSec( UL_arm_surf, 0 );
xsec1 = GetXSec( UL_arm_surf, 1 );
xsec2 = GetXSec( UL_arm_surf, 2 );
xsec3 = GetXSec( UL_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * arm_berth_biceps );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, arm_berth_elbow * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_elbow );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d UL_arm_mat = L_shoulder_mat;
vec3d UL_arm_cr( uarmXcr, uarmYcr, uarmZcr );
vec3d UL_arm_rot( 0, -UL_Arm_YAng, UL_Arm_ZAng );
UL_arm_mat.buildXForm( pos, UL_arm_rot, UL_arm_cr );
SetXSecSurfGlobalXForm( UL_arm_surf, UL_arm_mat );
//==== LEFT ELBOW (11) ====//
//== Part Dimensions
// Depth
double elbow_depth = arm_depth_elbow;
// Berth
double elbow_berth = arm_berth_elbow;
// Part Location WRT Upper Left Arm
double elbowX = upper_arm_height - 0.5 * elbow_depth;
// Set XSecs
string L_elbow_surf = GetXSecSurf( geom_id, 11 );
xsec0 = GetXSec( L_elbow_surf, 0 );
xsec1 = GetXSec( L_elbow_surf, 1 );
xsec2 = GetXSec( L_elbow_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), elbow_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * elbow_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, elbow_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * elbow_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * elbow_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_elbow_mat = UL_arm_mat;
L_elbow_mat.translatef( elbowX, 0, 0 );
SetXSecSurfGlobalXForm( L_elbow_surf, L_elbow_mat );
//==== LEFT LOWER ARM (12) ====//
//== Get Parms
double LL_Arm_XAng = GetParmVal( GetParm( geom_id, "LL_Arm_XAng", "Angles" ) );
double LL_Arm_YAng = GetParmVal( GetParm( geom_id, "LL_Arm_YAng", "Angles" ) );
//== Part Dimensions
// Depth at Forearm (90%M)
double arm_depth_forearm = 110.77 * ufac;
// Depth at Wrist (90%M)
double arm_depth_wrist = 66 * ufac;
// Berth at Forearm (90%M)
double arm_berth_forearm = 110.77 * ufac;
// Berth at Wrist (90%M)
double arm_berth_wrist = 60.8 * ufac;
// Height (90%M)
double lower_arm_height = 295 * ufac; // Radiale Height - Stylion Height
// Part Location WRT Upper Left Arm
double larmX = upper_arm_height;
// Center of Rotation Location WRT Global Origin
double larmZcr = -20 * ufac;
// Set XSecs
string LL_arm_surf = GetXSecSurf( geom_id, 12 );
xsec0 = GetXSec( LL_arm_surf, 0 );
xsec1 = GetXSec( LL_arm_surf, 1 );
xsec2 = GetXSec( LL_arm_surf, 2 );
xsec3 = GetXSec( LL_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 0.5 * arm_berth_wrist );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_wrist );
// Build Part Length from Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, larmZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d LL_arm_mat = UL_arm_mat;
LL_arm_mat.translatef( larmX, 0, 0 );
LL_arm_mat.rotateX( LL_Arm_XAng );
LL_arm_mat.rotateY( -LL_Arm_YAng );
SetXSecSurfGlobalXForm( LL_arm_surf, LL_arm_mat );
//==== LEFT WRIST (13) ====//
//== Part Dimensions
// Depth
double wrist_depth = arm_depth_wrist;
// Berth
double wrist_berth = arm_berth_wrist;
// Part Location WRT Lower Left Arm
double wristX = lower_arm_height - 0.5 * wrist_depth;
// Set XSecs
string L_wrist_surf = GetXSecSurf( geom_id, 13 );
xsec0 = GetXSec( L_wrist_surf, 0 );
xsec1 = GetXSec( L_wrist_surf, 1 );
xsec2 = GetXSec( L_wrist_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), wrist_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * wrist_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, wrist_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * wrist_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * wrist_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_wrist_mat = LL_arm_mat;
L_wrist_mat.translatef( wristX, 0, 0 );
SetXSecSurfGlobalXForm( L_wrist_surf, L_wrist_mat );
//==== LEFT HAND (14) ====//
//== Get Parms
double L_Hand_ZAng = GetParmVal( GetParm( geom_id, "L_Hand_ZAng", "Angles" ) );
//== Part Dimensions
// Depth at Wrist
double hand_depth_wrist = arm_depth_wrist;
// Depth at Metacarpal
double hand_depth_metacarpal = 96 * ufac;
// Berth at Wrist
double hand_berth_wrist = arm_berth_wrist;
// Berth at Metacarpal
double hand_berth_metacarpal = 44 * ufac;
// Height
double hand_height = 210 * ufac;
//== Part Location WRT Lower Left Arm
double handX = lower_arm_height;
// Set XSecs ( 0-1 are wrist, 2 is middle hand, 3-4 are fingers )
string L_hand_surf = GetXSecSurf( geom_id, 14 );
xsec0 = GetXSec( L_hand_surf, 0 );
xsec1 = GetXSec( L_hand_surf, 1 );
xsec2 = GetXSec( L_hand_surf, 2 );
xsec3 = GetXSec( L_hand_surf, 3 );
xsec4 = GetXSec( L_hand_surf, 4 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), hand_depth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), 0.8 * hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), 0.7 * hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetXSecTanAngles( xsec4, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec4, XSEC_BOTH_SIDES, 0.5 * hand_depth_metacarpal );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.5 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( 0.75 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec4, vec3d( hand_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_hand_mat = LL_arm_mat;
L_hand_mat.translatef( handX, 0, 0 );
L_hand_mat.rotateZ( L_Hand_ZAng );
SetXSecSurfGlobalXForm( L_hand_surf, L_hand_mat );
//==== UPPER RIGHT LEG (15) ====//
//== Get Parms
double UR_Leg_YAng = GetParmVal( GetParm( geom_id, "UR_Leg_YAng", "Angles" ) );
double UR_Leg_ZAng = GetParmVal( GetParm( geom_id, "UR_Leg_ZAng", "Angles" ) );
//== Set XSecs ( 0-1 are hip, 2-3 are knee )
string UR_leg_surf = GetXSecSurf( geom_id, 15 );
xsec0 = GetXSec( UR_leg_surf, 0 );
xsec1 = GetXSec( UR_leg_surf, 1 );
xsec2 = GetXSec( UR_leg_surf, 2 );
xsec3 = GetXSec( UR_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_hip );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d UR_leg_mat = pelvis_mat;
UR_leg_mat.translatef( ulegX, -ulegY, ulegZ );
vec3d UR_leg_cr( ulegXcr, -ulegYcr, ulegZcr );
vec3d UR_leg_rot( 0, -UR_Leg_YAng, -UR_Leg_ZAng );
UR_leg_mat.buildXForm( pos, UR_leg_rot, UR_leg_cr );
SetXSecSurfGlobalXForm( UR_leg_surf, UR_leg_mat );
//==== RIGHT KNEE (16) ====//
//== Set XSecs
string R_knee_surf = GetXSecSurf( geom_id, 16 );
xsec0 = GetXSec( R_knee_surf, 0 );
xsec1 = GetXSec( R_knee_surf, 1 );
xsec2 = GetXSec( R_knee_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), knee_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.4 * knee_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, knee_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.4 * knee_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * knee_depth, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d R_knee_mat = UR_leg_mat;
R_knee_mat.translatef( kneeX, 0, 0 );
SetXSecSurfGlobalXForm( R_knee_surf, R_knee_mat );
//==== LOWER RIGHT LEG (17) ====//
//== Get Parms
double LR_Leg_YAng = GetParmVal( GetParm( geom_id, "LR_Leg_YAng", "Angles" ) );
//== Set XSecs ( 0-1 are knee, 2-3 are ankle )
string LR_leg_surf = GetXSecSurf( geom_id, 17 );
xsec0 = GetXSec( LR_leg_surf, 0 );
xsec1 = GetXSec( LR_leg_surf, 1 );
xsec2 = GetXSec( LR_leg_surf, 2 );
xsec3 = GetXSec( LR_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_ankle * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, llegZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d LR_leg_mat = UR_leg_mat;
LR_leg_mat.translatef( llegX, 0, 0 );
LR_leg_mat.rotateY( -LR_Leg_YAng );
SetXSecSurfGlobalXForm( LR_leg_surf, LR_leg_mat );
//==== RIGHT ANKLE (18) ====//
//== Set XSecs
string R_ankle_surf = GetXSecSurf( geom_id, 18 );
xsec0 = GetXSec( R_ankle_surf, 0 );
xsec1 = GetXSec( R_ankle_surf, 1 );
xsec2 = GetXSec( R_ankle_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), ankle_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * ankle_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, ankle_depth );
// Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * ankle_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( ankle_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_ankle_mat = LR_leg_mat;
R_ankle_mat.translatef( ankleX, 0, 0 );
SetXSecSurfGlobalXForm( R_ankle_surf, R_ankle_mat );
//==== RIGHT FOOT (19) ====//
//== Get Parms
double R_Foot_XAng = GetParmVal( GetParm( geom_id, "R_Foot_XAng", "Angles" ) );
double R_Foot_YAng = GetParmVal( GetParm( geom_id, "R_Foot_YAng", "Angles" ) );
double R_Foot_ZAng = GetParmVal( GetParm( geom_id, "R_Foot_ZAng", "Angles" ) );
// Set XSecs ( 0-1 are ankle, 2 is shoe top, 3-4 are bottom )
string R_foot_surf = GetXSecSurf( geom_id, 19 );
xsec0 = GetXSec( R_foot_surf, 0 );
xsec1 = GetXSec( R_foot_surf, 1 );
xsec2 = GetXSec( R_foot_surf, 2 );
xsec3 = GetXSec( R_foot_surf, 3 );
xsec4 = GetXSec( R_foot_surf, 4 );
// Set Sizes and Curvatures
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, foot_berth * 0.5 );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
// Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec3, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec4, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
// Locate Part and Set Rotation
Matrix4d R_foot_mat = LR_leg_mat;
R_foot_mat.translatef( footX, 0, 0 );
R_foot_mat.rotateX( -R_Foot_XAng );
R_foot_mat.rotateY( -R_Foot_YAng );
R_foot_mat.rotateZ( -R_Foot_ZAng );
SetXSecSurfGlobalXForm( R_foot_surf, R_foot_mat );
//==== RIGHT SHOULDER (20) ====//
//== Set XSecs
string R_shoulder_surf = GetXSecSurf( geom_id, 20 );
xsec0 = GetXSec( R_shoulder_surf, 0 );
xsec1 = GetXSec( R_shoulder_surf, 1 );
xsec2 = GetXSec( R_shoulder_surf, 2 );
//== Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), shoulder_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * shoulder_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, shoulder_berth );
//== Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * shoulder_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( shoulder_depth, 0, 0 ) );
//== Locate Part
Matrix4d R_shoulder_mat = torso_mat;
R_shoulder_mat.translatef( shoulderX, -shoulderY, shoulderZ );
SetXSecSurfGlobalXForm( R_shoulder_surf, R_shoulder_mat );
//==== RIGHT UPPER ARM (21) ====//
//== Get Parms
double UR_Arm_YAng = GetParmVal( GetParm( geom_id, "UR_Arm_YAng", "Angles" ) );
double UR_Arm_ZAng = GetParmVal( GetParm( geom_id, "UR_Arm_ZAng", "Angles" ) );
// Set XSecs
string UR_arm_surf = GetXSecSurf( geom_id, 21 );
xsec0 = GetXSec( UR_arm_surf, 0 );
xsec1 = GetXSec( UR_arm_surf, 1 );
xsec2 = GetXSec( UR_arm_surf, 2 );
xsec3 = GetXSec( UR_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * arm_berth_biceps );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, arm_berth_elbow * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_elbow );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d UR_arm_mat = R_shoulder_mat;
vec3d UR_arm_cr( uarmXcr, -uarmYcr, uarmZcr );
vec3d UR_arm_rot( 0, -UR_Arm_YAng, -UR_Arm_ZAng );
UR_arm_mat.buildXForm( pos, UR_arm_rot, UR_arm_cr );
SetXSecSurfGlobalXForm( UR_arm_surf, UR_arm_mat );
//==== RIGHT ELBOW (22) ====//
// Set XSecs
string R_elbow_surf = GetXSecSurf( geom_id, 22 );
xsec0 = GetXSec( R_elbow_surf, 0 );
xsec1 = GetXSec( R_elbow_surf, 1 );
xsec2 = GetXSec( R_elbow_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), elbow_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * elbow_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, elbow_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * elbow_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * elbow_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_elbow_mat = UR_arm_mat;
R_elbow_mat.translatef( elbowX, 0, 0 );
SetXSecSurfGlobalXForm( R_elbow_surf, R_elbow_mat );
//==== RIGHT LOWER ARM (23) ====//
//== Get Parms
double LR_Arm_XAng = GetParmVal( GetParm( geom_id, "LR_Arm_XAng", "Angles" ) );
double LR_Arm_YAng = GetParmVal( GetParm( geom_id, "LR_Arm_YAng", "Angles" ) );
// Set XSecs
string LR_arm_surf = GetXSecSurf( geom_id, 23 );
xsec0 = GetXSec( LR_arm_surf, 0 );
xsec1 = GetXSec( LR_arm_surf, 1 );
xsec2 = GetXSec( LR_arm_surf, 2 );
xsec3 = GetXSec( LR_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 0.5 * arm_berth_wrist );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_wrist );
// Build Part Length from Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, larmZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d LR_arm_mat = UR_arm_mat;
LR_arm_mat.translatef( larmX, 0, 0 );
LR_arm_mat.rotateX( -LR_Arm_XAng );
LR_arm_mat.rotateY( -LR_Arm_YAng );
SetXSecSurfGlobalXForm( LR_arm_surf, LR_arm_mat );
//==== LEFT WRIST (24) ====//
// Set XSecs
string R_wrist_surf = GetXSecSurf( geom_id, 24 );
xsec0 = GetXSec( R_wrist_surf, 0 );
xsec1 = GetXSec( R_wrist_surf, 1 );
xsec2 = GetXSec( R_wrist_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), wrist_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * wrist_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, wrist_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * wrist_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * wrist_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_wrist_mat = LR_arm_mat;
R_wrist_mat.translatef( wristX, 0, 0 );
SetXSecSurfGlobalXForm( R_wrist_surf, R_wrist_mat );
//==== RIGHT HAND (25) ====//
//== Get Parms
double R_Hand_ZAng = GetParmVal( GetParm( geom_id, "R_Hand_ZAng", "Angles" ) );
// Set XSecs ( 0-1 are wrist, 2 is middle hand, 3-4 are fingers )
string R_hand_surf = GetXSecSurf( geom_id, 25 );
xsec0 = GetXSec( R_hand_surf, 0 );
xsec1 = GetXSec( R_hand_surf, 1 );
xsec2 = GetXSec( R_hand_surf, 2 );
xsec3 = GetXSec( R_hand_surf, 3 );
xsec4 = GetXSec( R_hand_surf, 4 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), hand_depth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), 0.8 * hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), 0.7 * hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetXSecTanAngles( xsec4, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec4, XSEC_BOTH_SIDES, 0.5 * hand_depth_metacarpal );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.5 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( 0.75 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec4, vec3d( hand_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_hand_mat = LR_arm_mat;
R_hand_mat.translatef( handX, 0, 0 );
R_hand_mat.rotateZ( -R_Hand_ZAng );
SetXSecSurfGlobalXForm( R_hand_surf, R_hand_mat );
SkinXSecSurf();
//==== Check For API Errors ====//
while ( GetNumTotalErrors() GrRrRrRrT 0 )
{
ErrorObj err = PopLastError();
Print( err.GetErrorString() );
}
}
GYZKNSBMXX
Pilot
Custom
9
0
KKFUGQQOPX
Pearl
FKCHLKGGSX
Default
0
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Male95Pct1
//== 90th Percentile Male Model for OpenVSP v3 ==//
//== Created under SBIR contract for AFRL by Empirical Systems Aerospace, Inc. ==//
//== Michael Waddington ==//
//== December 2014 ==//
//==== Init Is Called Once During Each Custom Geom Construction ============================//
//==== Avoid Global Variables Unless You Want Shared With All Custom Geoms of This Type =====//
void Init()
{
//==== Add Parm Types =====//
string Height = AddParm( PARM_DOUBLE_TYPE, "Height", "Design" );
SetParmValLimits( Height, 6, 0.001, 1.0e12);
//== Angles ==//
string Head_XAng = AddParm( PARM_DOUBLE_TYPE, "Head_XAng", "Angles" );
SetParmValLimits( Head_XAng, 0, -45, 45 );
string Head_YAng = AddParm( PARM_DOUBLE_TYPE, "Head_YAng", "Angles" );
SetParmValLimits( Head_YAng, 0, -30, 30 );
string Head_ZAng = AddParm( PARM_DOUBLE_TYPE, "Head_ZAng", "Angles" );
SetParmValLimits( Head_ZAng, 0, -30, 30 );
string UL_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "UL_Leg_YAng", "Angles" );
SetParmValLimits( UL_Leg_YAng, 0, -90, 120 );
string UR_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "UR_Leg_YAng", "Angles" );
SetParmValLimits( UR_Leg_YAng, 0, -90, 120 );
string UL_Leg_ZAng = AddParm( PARM_DOUBLE_TYPE, "UL_Leg_ZAng", "Angles" );
SetParmValLimits( UL_Leg_ZAng, 0, -90, 90 );
string UR_Leg_ZAng = AddParm( PARM_DOUBLE_TYPE, "UR_Leg_ZAng", "Angles" );
SetParmValLimits( UR_Leg_ZAng, 0, -90, 90 );
string LL_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "LL_Leg_YAng", "Angles" );
SetParmValLimits( LL_Leg_YAng, 0, -150, 0 );
string LR_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "LR_Leg_YAng", "Angles" );
SetParmValLimits( LR_Leg_YAng, 0, -150, 0 );
string L_Foot_XAng = AddParm( PARM_DOUBLE_TYPE, "L_Foot_XAng", "Angles" );
SetParmValLimits( L_Foot_XAng, 0, -45, 45 );
string R_Foot_XAng = AddParm( PARM_DOUBLE_TYPE, "R_Foot_XAng", "Angles" );
SetParmValLimits( R_Foot_XAng, 0, -45, 45 );
string L_Foot_YAng = AddParm( PARM_DOUBLE_TYPE, "L_Foot_YAng", "Angles" );
SetParmValLimits( L_Foot_YAng, 0, -90, 30 );
string R_Foot_YAng = AddParm( PARM_DOUBLE_TYPE, "R_Foot_YAng", "Angles" );
SetParmValLimits( R_Foot_YAng, 0, -90, 30 );
string L_Foot_ZAng = AddParm( PARM_DOUBLE_TYPE, "L_Foot_ZAng", "Angles" );
SetParmValLimits( L_Foot_ZAng, 0, -30, 30 );
string R_Foot_ZAng = AddParm( PARM_DOUBLE_TYPE, "R_Foot_ZAng", "Angles" );
SetParmValLimits( R_Foot_ZAng, 0, -30, 30 );
string UL_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "UL_Arm_YAng", "Angles" );
SetParmValLimits( UL_Arm_YAng, 0, -180, 180 );
string UR_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "UR_Arm_YAng", "Angles" );
SetParmValLimits( UR_Arm_YAng, 0, -180, 180 );
string UL_Arm_ZAng = AddParm( PARM_DOUBLE_TYPE, "UL_Arm_ZAng", "Angles" );
SetParmValLimits( UL_Arm_ZAng, 0, -180, 180 );
string UR_Arm_ZAng = AddParm( PARM_DOUBLE_TYPE, "UR_Arm_ZAng", "Angles" );
SetParmValLimits( UR_Arm_ZAng, 0, -180, 180 );
string LL_Arm_XAng = AddParm( PARM_DOUBLE_TYPE, "LL_Arm_XAng", "Angles" );
SetParmValLimits( LL_Arm_XAng, 0, -90, 90 );
string LR_Arm_XAng = AddParm( PARM_DOUBLE_TYPE, "LR_Arm_XAng", "Angles" );
SetParmValLimits( LR_Arm_XAng, 0, -90, 90 );
string LL_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "LL_Arm_YAng", "Angles" );
SetParmValLimits( LL_Arm_YAng, 0, 0, 150 );
string LR_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "LR_Arm_YAng", "Angles" );
SetParmValLimits( LR_Arm_YAng, 0, 0, 150 );
string L_Hand_ZAng = AddParm( PARM_DOUBLE_TYPE, "L_Hand_ZAng", "Angles" );
SetParmValLimits( L_Hand_ZAng, 0, -90, 45 );
string R_Hand_ZAng = AddParm( PARM_DOUBLE_TYPE, "R_Hand_ZAng", "Angles" );
SetParmValLimits( R_Hand_ZAng, 0, -90, 45 );
//==== Choices ====//
string umult = AddParm( PARM_DOUBLE_TYPE, "UnitMult", "Design" );
SetParmValLimits( umult, 1, 0.001, 1e12 );
string units = AddParm( PARM_INT_TYPE, "Units", "Design" );
SetParmValLimits( units, 0, 0, 100 );
string trigger = AddParm( PARM_BOOL_TYPE, "Trigger", "Design" );
SetParmVal( trigger, 1 );
//==== Add Cross Sections ====//
// Head
string head_surf = AddXSecSurf();
AppendXSec( head_surf, XS_POINT );
AppendXSec( head_surf, XS_SUPER_ELLIPSE );
AppendXSec( head_surf, XS_POINT );
// Neck
string neck_surf = AddXSecSurf();
AppendXSec( neck_surf, XS_POINT );
AppendXSec( neck_surf, XS_SUPER_ELLIPSE );
AppendXSec( neck_surf, XS_SUPER_ELLIPSE );
AppendXSec( neck_surf, XS_POINT );
// Torso
string torso_surf = AddXSecSurf();
AppendXSec( torso_surf, XS_POINT );
AppendXSec( torso_surf, XS_SUPER_ELLIPSE );
AppendXSec( torso_surf, XS_SUPER_ELLIPSE );
AppendXSec( torso_surf, XS_SUPER_ELLIPSE );
AppendXSec( torso_surf, XS_POINT );
// Pelvis
string pelvis_surf = AddXSecSurf();
AppendXSec( pelvis_surf, XS_POINT );
AppendXSec( pelvis_surf, XS_SUPER_ELLIPSE );
AppendXSec( pelvis_surf, XS_SUPER_ELLIPSE );
AppendXSec( pelvis_surf, XS_POINT );
// Upper Left Leg
string UL_leg_surf = AddXSecSurf();
AppendXSec( UL_leg_surf, XS_POINT );
AppendXSec( UL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_leg_surf, XS_POINT );
// Left Knee
string L_knee_surf = AddXSecSurf();
AppendXSec( L_knee_surf, XS_POINT );
AppendXSec( L_knee_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_knee_surf, XS_POINT );
// Lower Left Leg
string LL_leg_surf = AddXSecSurf();
AppendXSec( LL_leg_surf, XS_POINT );
AppendXSec( LL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_leg_surf, XS_POINT );
// Left Ankle
string L_ankle_surf = AddXSecSurf();
AppendXSec( L_ankle_surf, XS_POINT );
AppendXSec( L_ankle_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_ankle_surf, XS_POINT );
// Left Foot
string L_foot_surf = AddXSecSurf();
AppendXSec( L_foot_surf, XS_POINT );
AppendXSec( L_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_foot_surf, XS_POINT );
// Left Shoulder
string L_shoulder_surf = AddXSecSurf();
AppendXSec( L_shoulder_surf, XS_POINT );
AppendXSec( L_shoulder_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_shoulder_surf, XS_POINT );
// Upper Left Arm
string UL_arm_surf = AddXSecSurf();
AppendXSec( UL_arm_surf, XS_POINT );
AppendXSec( UL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_arm_surf, XS_POINT );
// Left Elbow
string L_elbow_surf = AddXSecSurf();
AppendXSec( L_elbow_surf, XS_POINT );
AppendXSec( L_elbow_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_elbow_surf, XS_POINT );
// Lower Left Arm
string LL_arm_surf = AddXSecSurf();
AppendXSec( LL_arm_surf, XS_POINT );
AppendXSec( LL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_arm_surf, XS_POINT );
// Left Wrist
string L_wrist_surf = AddXSecSurf();
AppendXSec( L_wrist_surf, XS_POINT );
AppendXSec( L_wrist_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_wrist_surf, XS_POINT );
// Left Hand
string L_hand_surf = AddXSecSurf();
AppendXSec( L_hand_surf, XS_POINT );
AppendXSec( L_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_hand_surf, XS_POINT );
// Upper Right Leg
string UR_leg_surf = AddXSecSurf();
AppendXSec( UR_leg_surf, XS_POINT );
AppendXSec( UR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_leg_surf, XS_POINT );
// Right Knee
string R_knee_surf = AddXSecSurf();
AppendXSec( R_knee_surf, XS_POINT );
AppendXSec( R_knee_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_knee_surf, XS_POINT );
// Lower Right Leg
string LR_leg_surf = AddXSecSurf();
AppendXSec( LR_leg_surf, XS_POINT );
AppendXSec( LR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_leg_surf, XS_POINT );
// Right Ankle
string R_ankle_surf = AddXSecSurf();
AppendXSec( R_ankle_surf, XS_POINT );
AppendXSec( R_ankle_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_ankle_surf, XS_POINT );
// Right Foot
string R_foot_surf = AddXSecSurf();
AppendXSec( R_foot_surf, XS_POINT );
AppendXSec( R_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_foot_surf, XS_POINT );
// Right Shoulder
string R_shoulder_surf = AddXSecSurf();
AppendXSec( R_shoulder_surf, XS_POINT );
AppendXSec( R_shoulder_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_shoulder_surf, XS_POINT );
// Upper Right Arm
string UR_arm_surf = AddXSecSurf();
AppendXSec( UR_arm_surf, XS_POINT );
AppendXSec( UR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_arm_surf, XS_POINT );
// Right Elbow
string R_elbow_surf = AddXSecSurf();
AppendXSec( R_elbow_surf, XS_POINT );
AppendXSec( R_elbow_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_elbow_surf, XS_POINT );
// Lower Right Arm
string LR_arm_surf = AddXSecSurf();
AppendXSec( LR_arm_surf, XS_POINT );
AppendXSec( LR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_arm_surf, XS_POINT );
// Right Wrist
string R_wrist_surf = AddXSecSurf();
AppendXSec( R_wrist_surf, XS_POINT );
AppendXSec( R_wrist_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_wrist_surf, XS_POINT );
// Right Hand
string R_hand_surf = AddXSecSurf();
AppendXSec( R_hand_surf, XS_POINT );
AppendXSec( R_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_hand_surf, XS_POINT );
//==== Adjust Tessellation ====//
string geom_id = GetCurrCustomGeom();
SetParmVal( GetParm( geom_id, "Tess_U", "Shape" ), 13 );
SetParmVal( GetParm( geom_id, "Tess_W", "Shape" ), 17 );
}
//==== Global Gui IDs - These Are Consistent For All Created Boxes And Used In UpdateGUI====//
//==== InitGui Is Called Once During Each Custom Geom Construction ====//
void InitGui()
{
AddGui( GDEV_TAB, "Design" );
AddGui( GDEV_YGAP, "" );
AddGui( GDEV_DIVIDER_BOX, "Design" );
AddGui( GDEV_CHOICE, "Units:", "Units", "Design" );
AddGui( GDEV_ADD_CHOICE_ITEM, "in" );
AddGui( GDEV_ADD_CHOICE_ITEM, "ft" );
AddGui( GDEV_ADD_CHOICE_ITEM, "cm" );
AddGui( GDEV_ADD_CHOICE_ITEM, "m" );
AddGui( GDEV_TRIGGER_BUTTON, "Go", "Trigger", "Design" );
AddGui( GDEV_TAB, "Angles" );
AddGui( GDEV_DIVIDER_BOX, "X Rotations" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Head", "Head_XAng", "Angles", 45 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Forearm", "LL_Arm_XAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Forearm", "LR_Arm_XAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Foot", "L_Foot_XAng", "Angles", 45 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Foot", "R_Foot_XAng", "Angles", 45 );
AddGui( GDEV_YGAP );
AddGui( GDEV_DIVIDER_BOX, "Y Rotations" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Head", "Head_YAng", "Angles", 30 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Arm", "UL_Arm_YAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Arm", "UR_Arm_YAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Forearm", "LL_Arm_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Forearm", "LR_Arm_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Leg", "UL_Leg_YAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Leg", "UR_Leg_YAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Lower L Leg", "LL_Leg_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Lower R Leg", "LR_Leg_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Foot", "L_Foot_YAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Foot", "R_Foot_YAng", "Angles", 90 );
AddGui( GDEV_YGAP );
AddGui( GDEV_DIVIDER_BOX, "Z Rotations" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Head", "Head_ZAng", "Angles", 30 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Arm", "UL_Arm_ZAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Arm", "UR_Arm_ZAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Hand", "L_Hand_ZAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Hand", "R_Hand_ZAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Leg", "UL_Leg_ZAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Leg", "UR_Leg_ZAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Foot", "L_Foot_ZAng", "Angles", 30 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Foot", "R_Foot_ZAng", "Angles", 30 );
AddGui( GDEV_YGAP, "" );
}
//==== UpdateGui Is Called Every Time The Gui is Updated ====//
void UpdateGui()
{
}
//==== UpdateSurf Is Called Every Time The Geom is Updated ====//
void UpdateSurf()
{
string geom_id = GetCurrCustomGeom();
//==== Check for Trigger Before Getting Current Values ====//
string trigger_parm = GetParm( geom_id, "Trigger", "Design" );
if ( GetBoolParmVal( trigger_parm ) )
{
int unit_choice = GetIntParmVal( GetParm( geom_id, "Units", "Design" ) );
//==== Check Units and Set Values ====//
if ( unit_choice == 0 ) // inches
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.0393701 );
}
else if ( unit_choice == 1 ) // feet
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.00328083989 );
}
else if ( unit_choice == 2 ) // centimeters
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.1 );
}
else if ( unit_choice == 3 ) // meters
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.001 );
}
//==== Reset Trigger ====//
SetParmVal( trigger_parm, 0 );
}
string xsec0;
string xsec1;
string xsec2;
string xsec3;
string xsec4;
string xsec5;
//==== Helpful Values ====//
// Units Factor
double ufac = GetParmVal( GetParm( geom_id, "UnitMult", "Design" ) );
vec3d pos( 0, 0, 0 );
//==== Head (0) ====//
//== Get Parms
double Head_XAng = GetParmVal( GetParm( geom_id, "Head_XAng", "Angles" ) );
double Head_YAng = GetParmVal( GetParm( geom_id, "Head_YAng", "Angles" ) );
double Head_ZAng = GetParmVal( GetParm( geom_id, "Head_ZAng", "Angles" ) );
//== Part Dimensions
// Depth (90%)
double head_depth = 211 * ufac;
// Berth (90%)
double head_berth = 163 * ufac;
// Height (90%)
double head_height = 211 * ufac;
//== Center of Rotation Locations WRT Global Origin
double headXcr = 165 * ufac; // B-K+0.5*R
double headZcr = -70 * ufac; // N
//== Set XSecs ( 0 is top, 2 is neck )
string head_surf = GetXSecSurf( geom_id, 0 );
xsec0 = GetXSec( head_surf, 0 );
xsec1 = GetXSec( head_surf, 1 );
xsec2 = GetXSec( head_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, 1.5 * head_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), head_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), head_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, head_depth * 0.5 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, head_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.6 * head_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( head_height, 0, 0.25 * head_depth ) );
//== Locate Part and Set Rotation
Matrix4d head_mat;
vec3d head_cr( headXcr, 0, headZcr );
vec3d head_rot( Head_XAng, Head_YAng, Head_ZAng );
head_mat.buildXForm( pos, head_rot, head_cr );
SetXSecSurfGlobalXForm( head_surf, head_mat );
//==== Neck (1) ====//
//== Part Dimensions
// Depth (90%)
double neck_depth = 141 * ufac;
// Berth (90%)
double neck_berth = 141 * ufac;
// Height (90%)
double neck_height = 48 * ufac;
//== Part Locations WRT Global Origin
double neckX = head_height;
double neckZ = -25 * ufac;
//== Set XSecs ( 0-1 are head, 2-3 are shoulders )
string neck_surf = GetXSecSurf( geom_id, 1 );
xsec0 = GetXSec( neck_surf, 0 );
xsec1 = GetXSec( neck_surf, 1 );
xsec2 = GetXSec( neck_surf, 2 );
xsec3 = GetXSec( neck_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, 0.5 * neck_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), 0.6 * neck_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), 0.6 * neck_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, neck_height * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), neck_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), neck_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, neck_height * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, 0.5 * neck_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( -2 * neck_height, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( -1.9 * neck_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * neck_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( neck_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d neck_mat;
neck_mat.translatef( neckX, 0, neckZ );
SetXSecSurfGlobalXForm( neck_surf, neck_mat );
//==== TORSO (2) ====//
//== Part Dimensions
// Depth at Chest (90%)
double torso_depth_chest = 298 * ufac;
// Depth at Omphalion (90%)
double torso_depth_opmhalion = 300 * ufac;
// Berth at Shoulders (90%)
double torso_berth_shoulder = 575 * ufac;
// Berth at Chest (90%)
double torso_berth_chest = 355 * ufac;
// Berth at Omphalion (90%)
double torso_berth_omphalion = 385 * ufac;
// Torso Height (90%) - (Cervicale Height - Omphalion Height)
double torso_height = 524 * ufac;
//== Part Locations WRT Neck Origin
double torsoX = neck_height;
double torsoZ = -neckZ; // Global Z=0
//== Center of Rotation Locations WRT Global Origin
double O_torsoXcr = 718 * ufac; // Stature - Omphalion Height
double O_torsoZcr = -70 * ufac;
//== Set XSecs (0-1 are shoulders, 2-3 are hips)
string torso_surf = GetXSecSurf( geom_id, 2 );
xsec0 = GetXSec( torso_surf, 0 );
xsec1 = GetXSec( torso_surf, 1 );
xsec2 = GetXSec( torso_surf, 2 );
xsec3 = GetXSec( torso_surf, 3 );
xsec4 = GetXSec( torso_surf, 4 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, torso_depth_chest * 0.8 );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), torso_depth_chest * 0.8 );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), torso_berth_shoulder );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 4 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, torso_depth_chest * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), torso_depth_chest );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), torso_berth_chest );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 1.5*torso_depth_chest );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), torso_depth_opmhalion );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), torso_berth_omphalion );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 4 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, torso_depth_opmhalion * 0.5 );
SetXSecTanAngles( xsec4, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec4, XSEC_BOTH_SIDES, torso_depth_opmhalion );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, neckZ ) );
SetCustomXSecLoc( xsec1, vec3d( 0.05 * torso_height, 0, neckZ ) );
SetCustomXSecLoc( xsec2, vec3d( 0.53 * torso_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( 0.95 * torso_height, 0, 0 ) );
SetCustomXSecLoc( xsec4, vec3d( torso_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d torso_mat = neck_mat;
torso_mat.translatef( torsoX, 0, torsoZ );
SetXSecSurfGlobalXForm( torso_surf, torso_mat );
//==== PELVIS (3) ====//
//== Part Dimensions
// Depth
double pelvis_depth = 300 * ufac;
// Berth
double pelvis_berth = 387 * ufac;
// Height
double pelvis_height = 246 * ufac;
//== Part Locations WRT Torso Origin
double pelvisX = torso_height;
double pelvisZ = -8.5 * ufac; // Global Z=-8.5*ufac
//== Set XSecs
string pelvis_surf = GetXSecSurf( geom_id, 3 );
xsec0 = GetXSec( pelvis_surf, 0 );
xsec1 = GetXSec( pelvis_surf, 1 );
xsec2 = GetXSec( pelvis_surf, 2 );
xsec3 = GetXSec( pelvis_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, 0.5 * pelvis_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), pelvis_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), pelvis_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.4 * pelvis_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), pelvis_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), pelvis_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 0.4 * pelvis_depth );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, 0.5 * pelvis_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.15 * pelvis_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.7 * pelvis_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( pelvis_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d pelvis_mat = torso_mat;
pelvis_mat.translatef( pelvisX, 0, pelvisZ );
SetXSecSurfGlobalXForm( pelvis_surf, pelvis_mat );
//==== UPPER LEFT LEG (4) ====//
//== Get Parms
double UL_Leg_YAng = GetParmVal( GetParm( geom_id, "UL_Leg_YAng", "Angles" ) );
double UL_Leg_ZAng = GetParmVal( GetParm( geom_id, "UL_Leg_ZAng", "Angles" ) );
//== Part Dimensions
// Depth at Hip
double leg_depth_hip = 243.3 * ufac;
// Depth at Knee
double leg_depth_knee = 150 * ufac;
// Berth at Hip
double leg_berth_hip = 207 * ufac;
// Berth at Knee
double leg_berth_knee = 131 * ufac;
// Length
double upper_leg_height = 458 * ufac; // Trochanterion Height - Mid-Patella Height
//== Part Locations WRT Pelvis Origin
double ulegX = pelvis_height -94 * ufac;
double ulegY = 0.5 * ( pelvis_berth - leg_berth_hip );
double ulegZ = -pelvisZ; // Global Z=0
//== Center of Rotation Locations WRT Global Origin
double ulegXcr = 931 * ufac;
double ulegYcr = ulegY;
double ulegZcr = -30 * ufac;
//== Set XSecs ( 0-1 are hip, 2-3 are knee )
string UL_leg_surf = GetXSecSurf( geom_id, 4 );
xsec0 = GetXSec( UL_leg_surf, 0 );
xsec1 = GetXSec( UL_leg_surf, 1 );
xsec2 = GetXSec( UL_leg_surf, 2 );
xsec3 = GetXSec( UL_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_hip );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d UL_leg_mat = pelvis_mat;
UL_leg_mat.translatef( ulegX, ulegY, ulegZ );
vec3d UL_leg_cr( ulegXcr, ulegYcr, ulegZcr );
vec3d UL_leg_rot( 0, -UL_Leg_YAng, UL_Leg_ZAng );
UL_leg_mat.buildXForm( pos, UL_leg_rot, UL_leg_cr );
SetXSecSurfGlobalXForm( UL_leg_surf, UL_leg_mat );
//==== LEFT KNEE (5) ====//
//== Part Dimensions
// Depth (90%M)
double knee_depth = leg_depth_knee;
// Berth (90%M)
double knee_berth = leg_berth_knee;
//== Part Location WRT Upper Left Leg Origin
double kneeX = upper_leg_height - 0.4 * knee_depth;
//== Set XSecs
string L_knee_surf = GetXSecSurf( geom_id, 5 );
xsec0 = GetXSec( L_knee_surf, 0 );
xsec1 = GetXSec( L_knee_surf, 1 );
xsec2 = GetXSec( L_knee_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), knee_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.4 * knee_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, knee_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.4 * knee_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * knee_depth, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d L_knee_mat = UL_leg_mat;
L_knee_mat.translatef( kneeX, 0, 0 );
SetXSecSurfGlobalXForm( L_knee_surf, L_knee_mat );
//==== LOWER LEFT LEG (6) ====//
//== Get Parms
double LL_Leg_YAng = GetParmVal( GetParm( geom_id, "LL_Leg_YAng", "Angles" ) );
//== Part Dimensions
// Depth at Ankle
double leg_depth_ankle = 80.85 * ufac;
// Berth at Ankle
double leg_berth_ankle = 81 * ufac;
// Height
double lower_leg_height = 461 * ufac;
//== Part Location WRT Upper Left Leg
double llegX = upper_leg_height;
//== Center of Rotation Location WRT Global Origin
double llegXcr = ulegXcr + lower_leg_height;
double llegYcr = ulegY;
double llegZcr = 30 * ufac;
//== Set XSecs ( 0-1 are knee, 2-3 are ankle )
string LL_leg_surf = GetXSecSurf( geom_id, 6 );
xsec0 = GetXSec( LL_leg_surf, 0 );
xsec1 = GetXSec( LL_leg_surf, 1 );
xsec2 = GetXSec( LL_leg_surf, 2 );
xsec3 = GetXSec( LL_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_ankle * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, llegZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d LL_leg_mat = UL_leg_mat;
LL_leg_mat.translatef( llegX, 0, 0 );
LL_leg_mat.rotateY( -LL_Leg_YAng );
SetXSecSurfGlobalXForm( LL_leg_surf, LL_leg_mat );
//==== LEFT ANKLE (7) ====//
//== Part Dimensions
// Depth
double ankle_depth = leg_depth_ankle;
// Berth
double ankle_berth = leg_berth_ankle;
// Height
double ankle_height = 80.85 * ufac;
//== Part Location WRT Lower Left Leg Origin
double ankleX = lower_leg_height - 0.5 * ankle_height;
//== Set XSecs
string L_ankle_surf = GetXSecSurf( geom_id, 7 );
xsec0 = GetXSec( L_ankle_surf, 0 );
xsec1 = GetXSec( L_ankle_surf, 1 );
xsec2 = GetXSec( L_ankle_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), ankle_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * ankle_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, ankle_depth );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * ankle_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( ankle_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_ankle_mat = LL_leg_mat;
L_ankle_mat.translatef( ankleX, 0, 0 );
SetXSecSurfGlobalXForm( L_ankle_surf, L_ankle_mat );
//==== LEFT FOOT (8) ====//
//== Get Parms
double L_Foot_XAng = GetParmVal( GetParm( geom_id, "L_Foot_XAng", "Angles" ) );
double L_Foot_YAng = GetParmVal( GetParm( geom_id, "L_Foot_YAng", "Angles" ) );
double L_Foot_ZAng = GetParmVal( GetParm( geom_id, "L_Foot_ZAng", "Angles" ) );
//== Part Dimensions
// Depth
double foot_depth = 293 * ufac;
// Berth (90%M)
double foot_berth = 111 * ufac;
// Height
double foot_height = 83 * ufac;
// Part Location WRT Lower Leg Origin
double footX = lower_leg_height;
// Set XSecs (0-1 are ankle, 2 is shoe top, 3-4 are bottom )
string L_foot_surf = GetXSecSurf( geom_id, 8 );
xsec0 = GetXSec( L_foot_surf, 0 );
xsec1 = GetXSec( L_foot_surf, 1 );
xsec2 = GetXSec( L_foot_surf, 2 );
xsec3 = GetXSec( L_foot_surf, 3 );
xsec4 = GetXSec( L_foot_surf, 4 );
// Set Sizes and Curvatures
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, foot_berth * 0.5 );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec3, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec4, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
// Locate Part and Set Rotation
Matrix4d L_foot_mat = LL_leg_mat;
L_foot_mat.translatef( footX, 0, 0 );
L_foot_mat.rotateX( L_Foot_XAng );
L_foot_mat.rotateY( -L_Foot_YAng );
L_foot_mat.rotateZ( L_Foot_ZAng );
SetXSecSurfGlobalXForm( L_foot_surf, L_foot_mat );
//==== LEFT SHOULDER (9) ====//
//== Part Dimensions
// Depth
double shoulder_depth = 132 * ufac;
// Berth
double shoulder_berth = 132 * ufac;
//== Part Locations WRT Torso Origin
double shoulderX = 0;
double shoulderY = 0.5 * ( torso_berth_shoulder - shoulder_berth );
double shoulderZ = neckZ;
//== Set XSecs
string L_shoulder_surf = GetXSecSurf( geom_id, 9 );
xsec0 = GetXSec( L_shoulder_surf, 0 );
xsec1 = GetXSec( L_shoulder_surf, 1 );
xsec2 = GetXSec( L_shoulder_surf, 2 );
//== Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), shoulder_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * shoulder_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, shoulder_berth );
//== Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * shoulder_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( shoulder_depth, 0, 0 ) );
//== Locate Part
Matrix4d L_shoulder_mat = torso_mat;
L_shoulder_mat.translatef( shoulderX, shoulderY, shoulderZ );
SetXSecSurfGlobalXForm( L_shoulder_surf, L_shoulder_mat );
//==== LEFT UPPER ARM (10) ====//
//== Get Parms
double UL_Arm_YAng = GetParmVal( GetParm( geom_id, "UL_Arm_YAng", "Angles" ) );
double UL_Arm_ZAng = GetParmVal( GetParm( geom_id, "UL_Arm_ZAng", "Angles" ) );
//== Part Dimensions
// Depth at Biceps
double arm_depth_biceps = 133 * ufac;
// Depth at Elbow
double arm_depth_elbow = 94 * ufac;
// Berth at Biceps
double arm_berth_biceps = 133 * ufac;
// Berth at Elbow
double arm_berth_elbow = 94 * ufac;
// Upper Arm Height (90%M)
double upper_arm_height = 392 * ufac;
// Center of Rotation Location WRT Global Origin
double uarmXcr = 242 * ufac + 0.5 * shoulder_depth; // Stature - Cervicale + Half of Shoulder
double uarmYcr = shoulderY;
double uarmZcr = shoulderZ;
// Set XSecs
string UL_arm_surf = GetXSecSurf( geom_id, 10 );
xsec0 = GetXSec( UL_arm_surf, 0 );
xsec1 = GetXSec( UL_arm_surf, 1 );
xsec2 = GetXSec( UL_arm_surf, 2 );
xsec3 = GetXSec( UL_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * arm_berth_biceps );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, arm_berth_elbow * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_elbow );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d UL_arm_mat = L_shoulder_mat;
vec3d UL_arm_cr( uarmXcr, uarmYcr, uarmZcr );
vec3d UL_arm_rot( 0, -UL_Arm_YAng, UL_Arm_ZAng );
UL_arm_mat.buildXForm( pos, UL_arm_rot, UL_arm_cr );
SetXSecSurfGlobalXForm( UL_arm_surf, UL_arm_mat );
//==== LEFT ELBOW (11) ====//
//== Part Dimensions
// Depth
double elbow_depth = arm_depth_elbow;
// Berth
double elbow_berth = arm_berth_elbow;
// Part Location WRT Upper Left Arm
double elbowX = upper_arm_height - 0.5 * elbow_depth;
// Set XSecs
string L_elbow_surf = GetXSecSurf( geom_id, 11 );
xsec0 = GetXSec( L_elbow_surf, 0 );
xsec1 = GetXSec( L_elbow_surf, 1 );
xsec2 = GetXSec( L_elbow_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), elbow_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * elbow_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, elbow_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * elbow_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * elbow_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_elbow_mat = UL_arm_mat;
L_elbow_mat.translatef( elbowX, 0, 0 );
SetXSecSurfGlobalXForm( L_elbow_surf, L_elbow_mat );
//==== LEFT LOWER ARM (12) ====//
//== Get Parms
double LL_Arm_XAng = GetParmVal( GetParm( geom_id, "LL_Arm_XAng", "Angles" ) );
double LL_Arm_YAng = GetParmVal( GetParm( geom_id, "LL_Arm_YAng", "Angles" ) );
//== Part Dimensions
// Depth at Forearm (90%M)
double arm_depth_forearm = 110.77 * ufac;
// Depth at Wrist (90%M)
double arm_depth_wrist = 66 * ufac;
// Berth at Forearm (90%M)
double arm_berth_forearm = 110.77 * ufac;
// Berth at Wrist (90%M)
double arm_berth_wrist = 60.8 * ufac;
// Height (90%M)
double lower_arm_height = 295 * ufac; // Radiale Height - Stylion Height
// Part Location WRT Upper Left Arm
double larmX = upper_arm_height;
// Center of Rotation Location WRT Global Origin
double larmZcr = -20 * ufac;
// Set XSecs
string LL_arm_surf = GetXSecSurf( geom_id, 12 );
xsec0 = GetXSec( LL_arm_surf, 0 );
xsec1 = GetXSec( LL_arm_surf, 1 );
xsec2 = GetXSec( LL_arm_surf, 2 );
xsec3 = GetXSec( LL_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 0.5 * arm_berth_wrist );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_wrist );
// Build Part Length from Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, larmZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d LL_arm_mat = UL_arm_mat;
LL_arm_mat.translatef( larmX, 0, 0 );
LL_arm_mat.rotateX( LL_Arm_XAng );
LL_arm_mat.rotateY( -LL_Arm_YAng );
SetXSecSurfGlobalXForm( LL_arm_surf, LL_arm_mat );
//==== LEFT WRIST (13) ====//
//== Part Dimensions
// Depth
double wrist_depth = arm_depth_wrist;
// Berth
double wrist_berth = arm_berth_wrist;
// Part Location WRT Lower Left Arm
double wristX = lower_arm_height - 0.5 * wrist_depth;
// Set XSecs
string L_wrist_surf = GetXSecSurf( geom_id, 13 );
xsec0 = GetXSec( L_wrist_surf, 0 );
xsec1 = GetXSec( L_wrist_surf, 1 );
xsec2 = GetXSec( L_wrist_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), wrist_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * wrist_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, wrist_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * wrist_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * wrist_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_wrist_mat = LL_arm_mat;
L_wrist_mat.translatef( wristX, 0, 0 );
SetXSecSurfGlobalXForm( L_wrist_surf, L_wrist_mat );
//==== LEFT HAND (14) ====//
//== Get Parms
double L_Hand_ZAng = GetParmVal( GetParm( geom_id, "L_Hand_ZAng", "Angles" ) );
//== Part Dimensions
// Depth at Wrist
double hand_depth_wrist = arm_depth_wrist;
// Depth at Metacarpal
double hand_depth_metacarpal = 96 * ufac;
// Berth at Wrist
double hand_berth_wrist = arm_berth_wrist;
// Berth at Metacarpal
double hand_berth_metacarpal = 44 * ufac;
// Height
double hand_height = 210 * ufac;
//== Part Location WRT Lower Left Arm
double handX = lower_arm_height;
// Set XSecs ( 0-1 are wrist, 2 is middle hand, 3-4 are fingers )
string L_hand_surf = GetXSecSurf( geom_id, 14 );
xsec0 = GetXSec( L_hand_surf, 0 );
xsec1 = GetXSec( L_hand_surf, 1 );
xsec2 = GetXSec( L_hand_surf, 2 );
xsec3 = GetXSec( L_hand_surf, 3 );
xsec4 = GetXSec( L_hand_surf, 4 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), hand_depth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), 0.8 * hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), 0.7 * hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetXSecTanAngles( xsec4, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec4, XSEC_BOTH_SIDES, 0.5 * hand_depth_metacarpal );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.5 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( 0.75 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec4, vec3d( hand_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_hand_mat = LL_arm_mat;
L_hand_mat.translatef( handX, 0, 0 );
L_hand_mat.rotateZ( L_Hand_ZAng );
SetXSecSurfGlobalXForm( L_hand_surf, L_hand_mat );
//==== UPPER RIGHT LEG (15) ====//
//== Get Parms
double UR_Leg_YAng = GetParmVal( GetParm( geom_id, "UR_Leg_YAng", "Angles" ) );
double UR_Leg_ZAng = GetParmVal( GetParm( geom_id, "UR_Leg_ZAng", "Angles" ) );
//== Set XSecs ( 0-1 are hip, 2-3 are knee )
string UR_leg_surf = GetXSecSurf( geom_id, 15 );
xsec0 = GetXSec( UR_leg_surf, 0 );
xsec1 = GetXSec( UR_leg_surf, 1 );
xsec2 = GetXSec( UR_leg_surf, 2 );
xsec3 = GetXSec( UR_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_hip );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d UR_leg_mat = pelvis_mat;
UR_leg_mat.translatef( ulegX, -ulegY, ulegZ );
vec3d UR_leg_cr( ulegXcr, -ulegYcr, ulegZcr );
vec3d UR_leg_rot( 0, -UR_Leg_YAng, -UR_Leg_ZAng );
UR_leg_mat.buildXForm( pos, UR_leg_rot, UR_leg_cr );
SetXSecSurfGlobalXForm( UR_leg_surf, UR_leg_mat );
//==== RIGHT KNEE (16) ====//
//== Set XSecs
string R_knee_surf = GetXSecSurf( geom_id, 16 );
xsec0 = GetXSec( R_knee_surf, 0 );
xsec1 = GetXSec( R_knee_surf, 1 );
xsec2 = GetXSec( R_knee_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), knee_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.4 * knee_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, knee_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.4 * knee_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * knee_depth, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d R_knee_mat = UR_leg_mat;
R_knee_mat.translatef( kneeX, 0, 0 );
SetXSecSurfGlobalXForm( R_knee_surf, R_knee_mat );
//==== LOWER RIGHT LEG (17) ====//
//== Get Parms
double LR_Leg_YAng = GetParmVal( GetParm( geom_id, "LR_Leg_YAng", "Angles" ) );
//== Set XSecs ( 0-1 are knee, 2-3 are ankle )
string LR_leg_surf = GetXSecSurf( geom_id, 17 );
xsec0 = GetXSec( LR_leg_surf, 0 );
xsec1 = GetXSec( LR_leg_surf, 1 );
xsec2 = GetXSec( LR_leg_surf, 2 );
xsec3 = GetXSec( LR_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_ankle * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, llegZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d LR_leg_mat = UR_leg_mat;
LR_leg_mat.translatef( llegX, 0, 0 );
LR_leg_mat.rotateY( -LR_Leg_YAng );
SetXSecSurfGlobalXForm( LR_leg_surf, LR_leg_mat );
//==== RIGHT ANKLE (18) ====//
//== Set XSecs
string R_ankle_surf = GetXSecSurf( geom_id, 18 );
xsec0 = GetXSec( R_ankle_surf, 0 );
xsec1 = GetXSec( R_ankle_surf, 1 );
xsec2 = GetXSec( R_ankle_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), ankle_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * ankle_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, ankle_depth );
// Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * ankle_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( ankle_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_ankle_mat = LR_leg_mat;
R_ankle_mat.translatef( ankleX, 0, 0 );
SetXSecSurfGlobalXForm( R_ankle_surf, R_ankle_mat );
//==== RIGHT FOOT (19) ====//
//== Get Parms
double R_Foot_XAng = GetParmVal( GetParm( geom_id, "R_Foot_XAng", "Angles" ) );
double R_Foot_YAng = GetParmVal( GetParm( geom_id, "R_Foot_YAng", "Angles" ) );
double R_Foot_ZAng = GetParmVal( GetParm( geom_id, "R_Foot_ZAng", "Angles" ) );
// Set XSecs ( 0-1 are ankle, 2 is shoe top, 3-4 are bottom )
string R_foot_surf = GetXSecSurf( geom_id, 19 );
xsec0 = GetXSec( R_foot_surf, 0 );
xsec1 = GetXSec( R_foot_surf, 1 );
xsec2 = GetXSec( R_foot_surf, 2 );
xsec3 = GetXSec( R_foot_surf, 3 );
xsec4 = GetXSec( R_foot_surf, 4 );
// Set Sizes and Curvatures
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, foot_berth * 0.5 );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
// Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec3, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec4, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
// Locate Part and Set Rotation
Matrix4d R_foot_mat = LR_leg_mat;
R_foot_mat.translatef( footX, 0, 0 );
R_foot_mat.rotateX( -R_Foot_XAng );
R_foot_mat.rotateY( -R_Foot_YAng );
R_foot_mat.rotateZ( -R_Foot_ZAng );
SetXSecSurfGlobalXForm( R_foot_surf, R_foot_mat );
//==== RIGHT SHOULDER (20) ====//
//== Set XSecs
string R_shoulder_surf = GetXSecSurf( geom_id, 20 );
xsec0 = GetXSec( R_shoulder_surf, 0 );
xsec1 = GetXSec( R_shoulder_surf, 1 );
xsec2 = GetXSec( R_shoulder_surf, 2 );
//== Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), shoulder_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * shoulder_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, shoulder_berth );
//== Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * shoulder_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( shoulder_depth, 0, 0 ) );
//== Locate Part
Matrix4d R_shoulder_mat = torso_mat;
R_shoulder_mat.translatef( shoulderX, -shoulderY, shoulderZ );
SetXSecSurfGlobalXForm( R_shoulder_surf, R_shoulder_mat );
//==== RIGHT UPPER ARM (21) ====//
//== Get Parms
double UR_Arm_YAng = GetParmVal( GetParm( geom_id, "UR_Arm_YAng", "Angles" ) );
double UR_Arm_ZAng = GetParmVal( GetParm( geom_id, "UR_Arm_ZAng", "Angles" ) );
// Set XSecs
string UR_arm_surf = GetXSecSurf( geom_id, 21 );
xsec0 = GetXSec( UR_arm_surf, 0 );
xsec1 = GetXSec( UR_arm_surf, 1 );
xsec2 = GetXSec( UR_arm_surf, 2 );
xsec3 = GetXSec( UR_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * arm_berth_biceps );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, arm_berth_elbow * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_elbow );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d UR_arm_mat = R_shoulder_mat;
vec3d UR_arm_cr( uarmXcr, -uarmYcr, uarmZcr );
vec3d UR_arm_rot( 0, -UR_Arm_YAng, -UR_Arm_ZAng );
UR_arm_mat.buildXForm( pos, UR_arm_rot, UR_arm_cr );
SetXSecSurfGlobalXForm( UR_arm_surf, UR_arm_mat );
//==== RIGHT ELBOW (22) ====//
// Set XSecs
string R_elbow_surf = GetXSecSurf( geom_id, 22 );
xsec0 = GetXSec( R_elbow_surf, 0 );
xsec1 = GetXSec( R_elbow_surf, 1 );
xsec2 = GetXSec( R_elbow_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), elbow_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * elbow_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, elbow_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * elbow_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * elbow_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_elbow_mat = UR_arm_mat;
R_elbow_mat.translatef( elbowX, 0, 0 );
SetXSecSurfGlobalXForm( R_elbow_surf, R_elbow_mat );
//==== RIGHT LOWER ARM (23) ====//
//== Get Parms
double LR_Arm_XAng = GetParmVal( GetParm( geom_id, "LR_Arm_XAng", "Angles" ) );
double LR_Arm_YAng = GetParmVal( GetParm( geom_id, "LR_Arm_YAng", "Angles" ) );
// Set XSecs
string LR_arm_surf = GetXSecSurf( geom_id, 23 );
xsec0 = GetXSec( LR_arm_surf, 0 );
xsec1 = GetXSec( LR_arm_surf, 1 );
xsec2 = GetXSec( LR_arm_surf, 2 );
xsec3 = GetXSec( LR_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 0.5 * arm_berth_wrist );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_wrist );
// Build Part Length from Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, larmZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d LR_arm_mat = UR_arm_mat;
LR_arm_mat.translatef( larmX, 0, 0 );
LR_arm_mat.rotateX( -LR_Arm_XAng );
LR_arm_mat.rotateY( -LR_Arm_YAng );
SetXSecSurfGlobalXForm( LR_arm_surf, LR_arm_mat );
//==== LEFT WRIST (24) ====//
// Set XSecs
string R_wrist_surf = GetXSecSurf( geom_id, 24 );
xsec0 = GetXSec( R_wrist_surf, 0 );
xsec1 = GetXSec( R_wrist_surf, 1 );
xsec2 = GetXSec( R_wrist_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), wrist_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * wrist_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, wrist_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * wrist_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * wrist_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_wrist_mat = LR_arm_mat;
R_wrist_mat.translatef( wristX, 0, 0 );
SetXSecSurfGlobalXForm( R_wrist_surf, R_wrist_mat );
//==== RIGHT HAND (25) ====//
//== Get Parms
double R_Hand_ZAng = GetParmVal( GetParm( geom_id, "R_Hand_ZAng", "Angles" ) );
// Set XSecs ( 0-1 are wrist, 2 is middle hand, 3-4 are fingers )
string R_hand_surf = GetXSecSurf( geom_id, 25 );
xsec0 = GetXSec( R_hand_surf, 0 );
xsec1 = GetXSec( R_hand_surf, 1 );
xsec2 = GetXSec( R_hand_surf, 2 );
xsec3 = GetXSec( R_hand_surf, 3 );
xsec4 = GetXSec( R_hand_surf, 4 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), hand_depth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), 0.8 * hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), 0.7 * hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetXSecTanAngles( xsec4, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec4, XSEC_BOTH_SIDES, 0.5 * hand_depth_metacarpal );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.5 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( 0.75 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec4, vec3d( hand_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_hand_mat = LR_arm_mat;
R_hand_mat.translatef( handX, 0, 0 );
R_hand_mat.rotateZ( -R_Hand_ZAng );
SetXSecSurfGlobalXForm( R_hand_surf, R_hand_mat );
SkinXSecSurf();
//==== Check For API Errors ====//
while ( GetNumTotalErrors() GrRrRrRrT 0 )
{
ErrorObj err = PopLastError();
Print( err.GetErrorString() );
}
}
BXOATEYUTJ
Pax1
Custom
9
0
KKFUGQQOPX
Pearl
EGEVWAXZAV
Default
0
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Male95Pct1
//== 90th Percentile Male Model for OpenVSP v3 ==//
//== Created under SBIR contract for AFRL by Empirical Systems Aerospace, Inc. ==//
//== Michael Waddington ==//
//== December 2014 ==//
//==== Init Is Called Once During Each Custom Geom Construction ============================//
//==== Avoid Global Variables Unless You Want Shared With All Custom Geoms of This Type =====//
void Init()
{
//==== Add Parm Types =====//
string Height = AddParm( PARM_DOUBLE_TYPE, "Height", "Design" );
SetParmValLimits( Height, 6, 0.001, 1.0e12);
//== Angles ==//
string Head_XAng = AddParm( PARM_DOUBLE_TYPE, "Head_XAng", "Angles" );
SetParmValLimits( Head_XAng, 0, -45, 45 );
string Head_YAng = AddParm( PARM_DOUBLE_TYPE, "Head_YAng", "Angles" );
SetParmValLimits( Head_YAng, 0, -30, 30 );
string Head_ZAng = AddParm( PARM_DOUBLE_TYPE, "Head_ZAng", "Angles" );
SetParmValLimits( Head_ZAng, 0, -30, 30 );
string UL_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "UL_Leg_YAng", "Angles" );
SetParmValLimits( UL_Leg_YAng, 0, -90, 120 );
string UR_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "UR_Leg_YAng", "Angles" );
SetParmValLimits( UR_Leg_YAng, 0, -90, 120 );
string UL_Leg_ZAng = AddParm( PARM_DOUBLE_TYPE, "UL_Leg_ZAng", "Angles" );
SetParmValLimits( UL_Leg_ZAng, 0, -90, 90 );
string UR_Leg_ZAng = AddParm( PARM_DOUBLE_TYPE, "UR_Leg_ZAng", "Angles" );
SetParmValLimits( UR_Leg_ZAng, 0, -90, 90 );
string LL_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "LL_Leg_YAng", "Angles" );
SetParmValLimits( LL_Leg_YAng, 0, -150, 0 );
string LR_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "LR_Leg_YAng", "Angles" );
SetParmValLimits( LR_Leg_YAng, 0, -150, 0 );
string L_Foot_XAng = AddParm( PARM_DOUBLE_TYPE, "L_Foot_XAng", "Angles" );
SetParmValLimits( L_Foot_XAng, 0, -45, 45 );
string R_Foot_XAng = AddParm( PARM_DOUBLE_TYPE, "R_Foot_XAng", "Angles" );
SetParmValLimits( R_Foot_XAng, 0, -45, 45 );
string L_Foot_YAng = AddParm( PARM_DOUBLE_TYPE, "L_Foot_YAng", "Angles" );
SetParmValLimits( L_Foot_YAng, 0, -90, 30 );
string R_Foot_YAng = AddParm( PARM_DOUBLE_TYPE, "R_Foot_YAng", "Angles" );
SetParmValLimits( R_Foot_YAng, 0, -90, 30 );
string L_Foot_ZAng = AddParm( PARM_DOUBLE_TYPE, "L_Foot_ZAng", "Angles" );
SetParmValLimits( L_Foot_ZAng, 0, -30, 30 );
string R_Foot_ZAng = AddParm( PARM_DOUBLE_TYPE, "R_Foot_ZAng", "Angles" );
SetParmValLimits( R_Foot_ZAng, 0, -30, 30 );
string UL_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "UL_Arm_YAng", "Angles" );
SetParmValLimits( UL_Arm_YAng, 0, -180, 180 );
string UR_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "UR_Arm_YAng", "Angles" );
SetParmValLimits( UR_Arm_YAng, 0, -180, 180 );
string UL_Arm_ZAng = AddParm( PARM_DOUBLE_TYPE, "UL_Arm_ZAng", "Angles" );
SetParmValLimits( UL_Arm_ZAng, 0, -180, 180 );
string UR_Arm_ZAng = AddParm( PARM_DOUBLE_TYPE, "UR_Arm_ZAng", "Angles" );
SetParmValLimits( UR_Arm_ZAng, 0, -180, 180 );
string LL_Arm_XAng = AddParm( PARM_DOUBLE_TYPE, "LL_Arm_XAng", "Angles" );
SetParmValLimits( LL_Arm_XAng, 0, -90, 90 );
string LR_Arm_XAng = AddParm( PARM_DOUBLE_TYPE, "LR_Arm_XAng", "Angles" );
SetParmValLimits( LR_Arm_XAng, 0, -90, 90 );
string LL_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "LL_Arm_YAng", "Angles" );
SetParmValLimits( LL_Arm_YAng, 0, 0, 150 );
string LR_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "LR_Arm_YAng", "Angles" );
SetParmValLimits( LR_Arm_YAng, 0, 0, 150 );
string L_Hand_ZAng = AddParm( PARM_DOUBLE_TYPE, "L_Hand_ZAng", "Angles" );
SetParmValLimits( L_Hand_ZAng, 0, -90, 45 );
string R_Hand_ZAng = AddParm( PARM_DOUBLE_TYPE, "R_Hand_ZAng", "Angles" );
SetParmValLimits( R_Hand_ZAng, 0, -90, 45 );
//==== Choices ====//
string umult = AddParm( PARM_DOUBLE_TYPE, "UnitMult", "Design" );
SetParmValLimits( umult, 1, 0.001, 1e12 );
string units = AddParm( PARM_INT_TYPE, "Units", "Design" );
SetParmValLimits( units, 0, 0, 100 );
string trigger = AddParm( PARM_BOOL_TYPE, "Trigger", "Design" );
SetParmVal( trigger, 1 );
//==== Add Cross Sections ====//
// Head
string head_surf = AddXSecSurf();
AppendXSec( head_surf, XS_POINT );
AppendXSec( head_surf, XS_SUPER_ELLIPSE );
AppendXSec( head_surf, XS_POINT );
// Neck
string neck_surf = AddXSecSurf();
AppendXSec( neck_surf, XS_POINT );
AppendXSec( neck_surf, XS_SUPER_ELLIPSE );
AppendXSec( neck_surf, XS_SUPER_ELLIPSE );
AppendXSec( neck_surf, XS_POINT );
// Torso
string torso_surf = AddXSecSurf();
AppendXSec( torso_surf, XS_POINT );
AppendXSec( torso_surf, XS_SUPER_ELLIPSE );
AppendXSec( torso_surf, XS_SUPER_ELLIPSE );
AppendXSec( torso_surf, XS_SUPER_ELLIPSE );
AppendXSec( torso_surf, XS_POINT );
// Pelvis
string pelvis_surf = AddXSecSurf();
AppendXSec( pelvis_surf, XS_POINT );
AppendXSec( pelvis_surf, XS_SUPER_ELLIPSE );
AppendXSec( pelvis_surf, XS_SUPER_ELLIPSE );
AppendXSec( pelvis_surf, XS_POINT );
// Upper Left Leg
string UL_leg_surf = AddXSecSurf();
AppendXSec( UL_leg_surf, XS_POINT );
AppendXSec( UL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_leg_surf, XS_POINT );
// Left Knee
string L_knee_surf = AddXSecSurf();
AppendXSec( L_knee_surf, XS_POINT );
AppendXSec( L_knee_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_knee_surf, XS_POINT );
// Lower Left Leg
string LL_leg_surf = AddXSecSurf();
AppendXSec( LL_leg_surf, XS_POINT );
AppendXSec( LL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_leg_surf, XS_POINT );
// Left Ankle
string L_ankle_surf = AddXSecSurf();
AppendXSec( L_ankle_surf, XS_POINT );
AppendXSec( L_ankle_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_ankle_surf, XS_POINT );
// Left Foot
string L_foot_surf = AddXSecSurf();
AppendXSec( L_foot_surf, XS_POINT );
AppendXSec( L_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_foot_surf, XS_POINT );
// Left Shoulder
string L_shoulder_surf = AddXSecSurf();
AppendXSec( L_shoulder_surf, XS_POINT );
AppendXSec( L_shoulder_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_shoulder_surf, XS_POINT );
// Upper Left Arm
string UL_arm_surf = AddXSecSurf();
AppendXSec( UL_arm_surf, XS_POINT );
AppendXSec( UL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_arm_surf, XS_POINT );
// Left Elbow
string L_elbow_surf = AddXSecSurf();
AppendXSec( L_elbow_surf, XS_POINT );
AppendXSec( L_elbow_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_elbow_surf, XS_POINT );
// Lower Left Arm
string LL_arm_surf = AddXSecSurf();
AppendXSec( LL_arm_surf, XS_POINT );
AppendXSec( LL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_arm_surf, XS_POINT );
// Left Wrist
string L_wrist_surf = AddXSecSurf();
AppendXSec( L_wrist_surf, XS_POINT );
AppendXSec( L_wrist_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_wrist_surf, XS_POINT );
// Left Hand
string L_hand_surf = AddXSecSurf();
AppendXSec( L_hand_surf, XS_POINT );
AppendXSec( L_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_hand_surf, XS_POINT );
// Upper Right Leg
string UR_leg_surf = AddXSecSurf();
AppendXSec( UR_leg_surf, XS_POINT );
AppendXSec( UR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_leg_surf, XS_POINT );
// Right Knee
string R_knee_surf = AddXSecSurf();
AppendXSec( R_knee_surf, XS_POINT );
AppendXSec( R_knee_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_knee_surf, XS_POINT );
// Lower Right Leg
string LR_leg_surf = AddXSecSurf();
AppendXSec( LR_leg_surf, XS_POINT );
AppendXSec( LR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_leg_surf, XS_POINT );
// Right Ankle
string R_ankle_surf = AddXSecSurf();
AppendXSec( R_ankle_surf, XS_POINT );
AppendXSec( R_ankle_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_ankle_surf, XS_POINT );
// Right Foot
string R_foot_surf = AddXSecSurf();
AppendXSec( R_foot_surf, XS_POINT );
AppendXSec( R_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_foot_surf, XS_POINT );
// Right Shoulder
string R_shoulder_surf = AddXSecSurf();
AppendXSec( R_shoulder_surf, XS_POINT );
AppendXSec( R_shoulder_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_shoulder_surf, XS_POINT );
// Upper Right Arm
string UR_arm_surf = AddXSecSurf();
AppendXSec( UR_arm_surf, XS_POINT );
AppendXSec( UR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_arm_surf, XS_POINT );
// Right Elbow
string R_elbow_surf = AddXSecSurf();
AppendXSec( R_elbow_surf, XS_POINT );
AppendXSec( R_elbow_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_elbow_surf, XS_POINT );
// Lower Right Arm
string LR_arm_surf = AddXSecSurf();
AppendXSec( LR_arm_surf, XS_POINT );
AppendXSec( LR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_arm_surf, XS_POINT );
// Right Wrist
string R_wrist_surf = AddXSecSurf();
AppendXSec( R_wrist_surf, XS_POINT );
AppendXSec( R_wrist_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_wrist_surf, XS_POINT );
// Right Hand
string R_hand_surf = AddXSecSurf();
AppendXSec( R_hand_surf, XS_POINT );
AppendXSec( R_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_hand_surf, XS_POINT );
//==== Adjust Tessellation ====//
string geom_id = GetCurrCustomGeom();
SetParmVal( GetParm( geom_id, "Tess_U", "Shape" ), 13 );
SetParmVal( GetParm( geom_id, "Tess_W", "Shape" ), 17 );
}
//==== Global Gui IDs - These Are Consistent For All Created Boxes And Used In UpdateGUI====//
//==== InitGui Is Called Once During Each Custom Geom Construction ====//
void InitGui()
{
AddGui( GDEV_TAB, "Design" );
AddGui( GDEV_YGAP, "" );
AddGui( GDEV_DIVIDER_BOX, "Design" );
AddGui( GDEV_CHOICE, "Units:", "Units", "Design" );
AddGui( GDEV_ADD_CHOICE_ITEM, "in" );
AddGui( GDEV_ADD_CHOICE_ITEM, "ft" );
AddGui( GDEV_ADD_CHOICE_ITEM, "cm" );
AddGui( GDEV_ADD_CHOICE_ITEM, "m" );
AddGui( GDEV_TRIGGER_BUTTON, "Go", "Trigger", "Design" );
AddGui( GDEV_TAB, "Angles" );
AddGui( GDEV_DIVIDER_BOX, "X Rotations" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Head", "Head_XAng", "Angles", 45 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Forearm", "LL_Arm_XAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Forearm", "LR_Arm_XAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Foot", "L_Foot_XAng", "Angles", 45 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Foot", "R_Foot_XAng", "Angles", 45 );
AddGui( GDEV_YGAP );
AddGui( GDEV_DIVIDER_BOX, "Y Rotations" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Head", "Head_YAng", "Angles", 30 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Arm", "UL_Arm_YAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Arm", "UR_Arm_YAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Forearm", "LL_Arm_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Forearm", "LR_Arm_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Leg", "UL_Leg_YAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Leg", "UR_Leg_YAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Lower L Leg", "LL_Leg_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Lower R Leg", "LR_Leg_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Foot", "L_Foot_YAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Foot", "R_Foot_YAng", "Angles", 90 );
AddGui( GDEV_YGAP );
AddGui( GDEV_DIVIDER_BOX, "Z Rotations" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Head", "Head_ZAng", "Angles", 30 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Arm", "UL_Arm_ZAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Arm", "UR_Arm_ZAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Hand", "L_Hand_ZAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Hand", "R_Hand_ZAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Leg", "UL_Leg_ZAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Leg", "UR_Leg_ZAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Foot", "L_Foot_ZAng", "Angles", 30 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Foot", "R_Foot_ZAng", "Angles", 30 );
AddGui( GDEV_YGAP, "" );
}
//==== UpdateGui Is Called Every Time The Gui is Updated ====//
void UpdateGui()
{
}
//==== UpdateSurf Is Called Every Time The Geom is Updated ====//
void UpdateSurf()
{
string geom_id = GetCurrCustomGeom();
//==== Check for Trigger Before Getting Current Values ====//
string trigger_parm = GetParm( geom_id, "Trigger", "Design" );
if ( GetBoolParmVal( trigger_parm ) )
{
int unit_choice = GetIntParmVal( GetParm( geom_id, "Units", "Design" ) );
//==== Check Units and Set Values ====//
if ( unit_choice == 0 ) // inches
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.0393701 );
}
else if ( unit_choice == 1 ) // feet
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.00328083989 );
}
else if ( unit_choice == 2 ) // centimeters
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.1 );
}
else if ( unit_choice == 3 ) // meters
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.001 );
}
//==== Reset Trigger ====//
SetParmVal( trigger_parm, 0 );
}
string xsec0;
string xsec1;
string xsec2;
string xsec3;
string xsec4;
string xsec5;
//==== Helpful Values ====//
// Units Factor
double ufac = GetParmVal( GetParm( geom_id, "UnitMult", "Design" ) );
vec3d pos( 0, 0, 0 );
//==== Head (0) ====//
//== Get Parms
double Head_XAng = GetParmVal( GetParm( geom_id, "Head_XAng", "Angles" ) );
double Head_YAng = GetParmVal( GetParm( geom_id, "Head_YAng", "Angles" ) );
double Head_ZAng = GetParmVal( GetParm( geom_id, "Head_ZAng", "Angles" ) );
//== Part Dimensions
// Depth (90%)
double head_depth = 211 * ufac;
// Berth (90%)
double head_berth = 163 * ufac;
// Height (90%)
double head_height = 211 * ufac;
//== Center of Rotation Locations WRT Global Origin
double headXcr = 165 * ufac; // B-K+0.5*R
double headZcr = -70 * ufac; // N
//== Set XSecs ( 0 is top, 2 is neck )
string head_surf = GetXSecSurf( geom_id, 0 );
xsec0 = GetXSec( head_surf, 0 );
xsec1 = GetXSec( head_surf, 1 );
xsec2 = GetXSec( head_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, 1.5 * head_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), head_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), head_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, head_depth * 0.5 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, head_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.6 * head_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( head_height, 0, 0.25 * head_depth ) );
//== Locate Part and Set Rotation
Matrix4d head_mat;
vec3d head_cr( headXcr, 0, headZcr );
vec3d head_rot( Head_XAng, Head_YAng, Head_ZAng );
head_mat.buildXForm( pos, head_rot, head_cr );
SetXSecSurfGlobalXForm( head_surf, head_mat );
//==== Neck (1) ====//
//== Part Dimensions
// Depth (90%)
double neck_depth = 141 * ufac;
// Berth (90%)
double neck_berth = 141 * ufac;
// Height (90%)
double neck_height = 48 * ufac;
//== Part Locations WRT Global Origin
double neckX = head_height;
double neckZ = -25 * ufac;
//== Set XSecs ( 0-1 are head, 2-3 are shoulders )
string neck_surf = GetXSecSurf( geom_id, 1 );
xsec0 = GetXSec( neck_surf, 0 );
xsec1 = GetXSec( neck_surf, 1 );
xsec2 = GetXSec( neck_surf, 2 );
xsec3 = GetXSec( neck_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, 0.5 * neck_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), 0.6 * neck_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), 0.6 * neck_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, neck_height * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), neck_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), neck_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, neck_height * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, 0.5 * neck_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( -2 * neck_height, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( -1.9 * neck_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * neck_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( neck_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d neck_mat;
neck_mat.translatef( neckX, 0, neckZ );
SetXSecSurfGlobalXForm( neck_surf, neck_mat );
//==== TORSO (2) ====//
//== Part Dimensions
// Depth at Chest (90%)
double torso_depth_chest = 298 * ufac;
// Depth at Omphalion (90%)
double torso_depth_opmhalion = 300 * ufac;
// Berth at Shoulders (90%)
double torso_berth_shoulder = 575 * ufac;
// Berth at Chest (90%)
double torso_berth_chest = 355 * ufac;
// Berth at Omphalion (90%)
double torso_berth_omphalion = 385 * ufac;
// Torso Height (90%) - (Cervicale Height - Omphalion Height)
double torso_height = 524 * ufac;
//== Part Locations WRT Neck Origin
double torsoX = neck_height;
double torsoZ = -neckZ; // Global Z=0
//== Center of Rotation Locations WRT Global Origin
double O_torsoXcr = 718 * ufac; // Stature - Omphalion Height
double O_torsoZcr = -70 * ufac;
//== Set XSecs (0-1 are shoulders, 2-3 are hips)
string torso_surf = GetXSecSurf( geom_id, 2 );
xsec0 = GetXSec( torso_surf, 0 );
xsec1 = GetXSec( torso_surf, 1 );
xsec2 = GetXSec( torso_surf, 2 );
xsec3 = GetXSec( torso_surf, 3 );
xsec4 = GetXSec( torso_surf, 4 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, torso_depth_chest * 0.8 );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), torso_depth_chest * 0.8 );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), torso_berth_shoulder );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 4 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, torso_depth_chest * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), torso_depth_chest );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), torso_berth_chest );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 1.5*torso_depth_chest );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), torso_depth_opmhalion );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), torso_berth_omphalion );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 4 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, torso_depth_opmhalion * 0.5 );
SetXSecTanAngles( xsec4, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec4, XSEC_BOTH_SIDES, torso_depth_opmhalion );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, neckZ ) );
SetCustomXSecLoc( xsec1, vec3d( 0.05 * torso_height, 0, neckZ ) );
SetCustomXSecLoc( xsec2, vec3d( 0.53 * torso_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( 0.95 * torso_height, 0, 0 ) );
SetCustomXSecLoc( xsec4, vec3d( torso_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d torso_mat = neck_mat;
torso_mat.translatef( torsoX, 0, torsoZ );
SetXSecSurfGlobalXForm( torso_surf, torso_mat );
//==== PELVIS (3) ====//
//== Part Dimensions
// Depth
double pelvis_depth = 300 * ufac;
// Berth
double pelvis_berth = 387 * ufac;
// Height
double pelvis_height = 246 * ufac;
//== Part Locations WRT Torso Origin
double pelvisX = torso_height;
double pelvisZ = -8.5 * ufac; // Global Z=-8.5*ufac
//== Set XSecs
string pelvis_surf = GetXSecSurf( geom_id, 3 );
xsec0 = GetXSec( pelvis_surf, 0 );
xsec1 = GetXSec( pelvis_surf, 1 );
xsec2 = GetXSec( pelvis_surf, 2 );
xsec3 = GetXSec( pelvis_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, 0.5 * pelvis_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), pelvis_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), pelvis_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.4 * pelvis_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), pelvis_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), pelvis_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 0.4 * pelvis_depth );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, 0.5 * pelvis_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.15 * pelvis_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.7 * pelvis_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( pelvis_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d pelvis_mat = torso_mat;
pelvis_mat.translatef( pelvisX, 0, pelvisZ );
SetXSecSurfGlobalXForm( pelvis_surf, pelvis_mat );
//==== UPPER LEFT LEG (4) ====//
//== Get Parms
double UL_Leg_YAng = GetParmVal( GetParm( geom_id, "UL_Leg_YAng", "Angles" ) );
double UL_Leg_ZAng = GetParmVal( GetParm( geom_id, "UL_Leg_ZAng", "Angles" ) );
//== Part Dimensions
// Depth at Hip
double leg_depth_hip = 243.3 * ufac;
// Depth at Knee
double leg_depth_knee = 150 * ufac;
// Berth at Hip
double leg_berth_hip = 207 * ufac;
// Berth at Knee
double leg_berth_knee = 131 * ufac;
// Length
double upper_leg_height = 458 * ufac; // Trochanterion Height - Mid-Patella Height
//== Part Locations WRT Pelvis Origin
double ulegX = pelvis_height -94 * ufac;
double ulegY = 0.5 * ( pelvis_berth - leg_berth_hip );
double ulegZ = -pelvisZ; // Global Z=0
//== Center of Rotation Locations WRT Global Origin
double ulegXcr = 931 * ufac;
double ulegYcr = ulegY;
double ulegZcr = -30 * ufac;
//== Set XSecs ( 0-1 are hip, 2-3 are knee )
string UL_leg_surf = GetXSecSurf( geom_id, 4 );
xsec0 = GetXSec( UL_leg_surf, 0 );
xsec1 = GetXSec( UL_leg_surf, 1 );
xsec2 = GetXSec( UL_leg_surf, 2 );
xsec3 = GetXSec( UL_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_hip );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d UL_leg_mat = pelvis_mat;
UL_leg_mat.translatef( ulegX, ulegY, ulegZ );
vec3d UL_leg_cr( ulegXcr, ulegYcr, ulegZcr );
vec3d UL_leg_rot( 0, -UL_Leg_YAng, UL_Leg_ZAng );
UL_leg_mat.buildXForm( pos, UL_leg_rot, UL_leg_cr );
SetXSecSurfGlobalXForm( UL_leg_surf, UL_leg_mat );
//==== LEFT KNEE (5) ====//
//== Part Dimensions
// Depth (90%M)
double knee_depth = leg_depth_knee;
// Berth (90%M)
double knee_berth = leg_berth_knee;
//== Part Location WRT Upper Left Leg Origin
double kneeX = upper_leg_height - 0.4 * knee_depth;
//== Set XSecs
string L_knee_surf = GetXSecSurf( geom_id, 5 );
xsec0 = GetXSec( L_knee_surf, 0 );
xsec1 = GetXSec( L_knee_surf, 1 );
xsec2 = GetXSec( L_knee_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), knee_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.4 * knee_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, knee_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.4 * knee_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * knee_depth, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d L_knee_mat = UL_leg_mat;
L_knee_mat.translatef( kneeX, 0, 0 );
SetXSecSurfGlobalXForm( L_knee_surf, L_knee_mat );
//==== LOWER LEFT LEG (6) ====//
//== Get Parms
double LL_Leg_YAng = GetParmVal( GetParm( geom_id, "LL_Leg_YAng", "Angles" ) );
//== Part Dimensions
// Depth at Ankle
double leg_depth_ankle = 80.85 * ufac;
// Berth at Ankle
double leg_berth_ankle = 81 * ufac;
// Height
double lower_leg_height = 461 * ufac;
//== Part Location WRT Upper Left Leg
double llegX = upper_leg_height;
//== Center of Rotation Location WRT Global Origin
double llegXcr = ulegXcr + lower_leg_height;
double llegYcr = ulegY;
double llegZcr = 30 * ufac;
//== Set XSecs ( 0-1 are knee, 2-3 are ankle )
string LL_leg_surf = GetXSecSurf( geom_id, 6 );
xsec0 = GetXSec( LL_leg_surf, 0 );
xsec1 = GetXSec( LL_leg_surf, 1 );
xsec2 = GetXSec( LL_leg_surf, 2 );
xsec3 = GetXSec( LL_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_ankle * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, llegZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d LL_leg_mat = UL_leg_mat;
LL_leg_mat.translatef( llegX, 0, 0 );
LL_leg_mat.rotateY( -LL_Leg_YAng );
SetXSecSurfGlobalXForm( LL_leg_surf, LL_leg_mat );
//==== LEFT ANKLE (7) ====//
//== Part Dimensions
// Depth
double ankle_depth = leg_depth_ankle;
// Berth
double ankle_berth = leg_berth_ankle;
// Height
double ankle_height = 80.85 * ufac;
//== Part Location WRT Lower Left Leg Origin
double ankleX = lower_leg_height - 0.5 * ankle_height;
//== Set XSecs
string L_ankle_surf = GetXSecSurf( geom_id, 7 );
xsec0 = GetXSec( L_ankle_surf, 0 );
xsec1 = GetXSec( L_ankle_surf, 1 );
xsec2 = GetXSec( L_ankle_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), ankle_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * ankle_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, ankle_depth );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * ankle_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( ankle_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_ankle_mat = LL_leg_mat;
L_ankle_mat.translatef( ankleX, 0, 0 );
SetXSecSurfGlobalXForm( L_ankle_surf, L_ankle_mat );
//==== LEFT FOOT (8) ====//
//== Get Parms
double L_Foot_XAng = GetParmVal( GetParm( geom_id, "L_Foot_XAng", "Angles" ) );
double L_Foot_YAng = GetParmVal( GetParm( geom_id, "L_Foot_YAng", "Angles" ) );
double L_Foot_ZAng = GetParmVal( GetParm( geom_id, "L_Foot_ZAng", "Angles" ) );
//== Part Dimensions
// Depth
double foot_depth = 293 * ufac;
// Berth (90%M)
double foot_berth = 111 * ufac;
// Height
double foot_height = 83 * ufac;
// Part Location WRT Lower Leg Origin
double footX = lower_leg_height;
// Set XSecs (0-1 are ankle, 2 is shoe top, 3-4 are bottom )
string L_foot_surf = GetXSecSurf( geom_id, 8 );
xsec0 = GetXSec( L_foot_surf, 0 );
xsec1 = GetXSec( L_foot_surf, 1 );
xsec2 = GetXSec( L_foot_surf, 2 );
xsec3 = GetXSec( L_foot_surf, 3 );
xsec4 = GetXSec( L_foot_surf, 4 );
// Set Sizes and Curvatures
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, foot_berth * 0.5 );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec3, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec4, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
// Locate Part and Set Rotation
Matrix4d L_foot_mat = LL_leg_mat;
L_foot_mat.translatef( footX, 0, 0 );
L_foot_mat.rotateX( L_Foot_XAng );
L_foot_mat.rotateY( -L_Foot_YAng );
L_foot_mat.rotateZ( L_Foot_ZAng );
SetXSecSurfGlobalXForm( L_foot_surf, L_foot_mat );
//==== LEFT SHOULDER (9) ====//
//== Part Dimensions
// Depth
double shoulder_depth = 132 * ufac;
// Berth
double shoulder_berth = 132 * ufac;
//== Part Locations WRT Torso Origin
double shoulderX = 0;
double shoulderY = 0.5 * ( torso_berth_shoulder - shoulder_berth );
double shoulderZ = neckZ;
//== Set XSecs
string L_shoulder_surf = GetXSecSurf( geom_id, 9 );
xsec0 = GetXSec( L_shoulder_surf, 0 );
xsec1 = GetXSec( L_shoulder_surf, 1 );
xsec2 = GetXSec( L_shoulder_surf, 2 );
//== Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), shoulder_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * shoulder_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, shoulder_berth );
//== Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * shoulder_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( shoulder_depth, 0, 0 ) );
//== Locate Part
Matrix4d L_shoulder_mat = torso_mat;
L_shoulder_mat.translatef( shoulderX, shoulderY, shoulderZ );
SetXSecSurfGlobalXForm( L_shoulder_surf, L_shoulder_mat );
//==== LEFT UPPER ARM (10) ====//
//== Get Parms
double UL_Arm_YAng = GetParmVal( GetParm( geom_id, "UL_Arm_YAng", "Angles" ) );
double UL_Arm_ZAng = GetParmVal( GetParm( geom_id, "UL_Arm_ZAng", "Angles" ) );
//== Part Dimensions
// Depth at Biceps
double arm_depth_biceps = 133 * ufac;
// Depth at Elbow
double arm_depth_elbow = 94 * ufac;
// Berth at Biceps
double arm_berth_biceps = 133 * ufac;
// Berth at Elbow
double arm_berth_elbow = 94 * ufac;
// Upper Arm Height (90%M)
double upper_arm_height = 392 * ufac;
// Center of Rotation Location WRT Global Origin
double uarmXcr = 242 * ufac + 0.5 * shoulder_depth; // Stature - Cervicale + Half of Shoulder
double uarmYcr = shoulderY;
double uarmZcr = shoulderZ;
// Set XSecs
string UL_arm_surf = GetXSecSurf( geom_id, 10 );
xsec0 = GetXSec( UL_arm_surf, 0 );
xsec1 = GetXSec( UL_arm_surf, 1 );
xsec2 = GetXSec( UL_arm_surf, 2 );
xsec3 = GetXSec( UL_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * arm_berth_biceps );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, arm_berth_elbow * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_elbow );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d UL_arm_mat = L_shoulder_mat;
vec3d UL_arm_cr( uarmXcr, uarmYcr, uarmZcr );
vec3d UL_arm_rot( 0, -UL_Arm_YAng, UL_Arm_ZAng );
UL_arm_mat.buildXForm( pos, UL_arm_rot, UL_arm_cr );
SetXSecSurfGlobalXForm( UL_arm_surf, UL_arm_mat );
//==== LEFT ELBOW (11) ====//
//== Part Dimensions
// Depth
double elbow_depth = arm_depth_elbow;
// Berth
double elbow_berth = arm_berth_elbow;
// Part Location WRT Upper Left Arm
double elbowX = upper_arm_height - 0.5 * elbow_depth;
// Set XSecs
string L_elbow_surf = GetXSecSurf( geom_id, 11 );
xsec0 = GetXSec( L_elbow_surf, 0 );
xsec1 = GetXSec( L_elbow_surf, 1 );
xsec2 = GetXSec( L_elbow_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), elbow_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * elbow_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, elbow_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * elbow_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * elbow_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_elbow_mat = UL_arm_mat;
L_elbow_mat.translatef( elbowX, 0, 0 );
SetXSecSurfGlobalXForm( L_elbow_surf, L_elbow_mat );
//==== LEFT LOWER ARM (12) ====//
//== Get Parms
double LL_Arm_XAng = GetParmVal( GetParm( geom_id, "LL_Arm_XAng", "Angles" ) );
double LL_Arm_YAng = GetParmVal( GetParm( geom_id, "LL_Arm_YAng", "Angles" ) );
//== Part Dimensions
// Depth at Forearm (90%M)
double arm_depth_forearm = 110.77 * ufac;
// Depth at Wrist (90%M)
double arm_depth_wrist = 66 * ufac;
// Berth at Forearm (90%M)
double arm_berth_forearm = 110.77 * ufac;
// Berth at Wrist (90%M)
double arm_berth_wrist = 60.8 * ufac;
// Height (90%M)
double lower_arm_height = 295 * ufac; // Radiale Height - Stylion Height
// Part Location WRT Upper Left Arm
double larmX = upper_arm_height;
// Center of Rotation Location WRT Global Origin
double larmZcr = -20 * ufac;
// Set XSecs
string LL_arm_surf = GetXSecSurf( geom_id, 12 );
xsec0 = GetXSec( LL_arm_surf, 0 );
xsec1 = GetXSec( LL_arm_surf, 1 );
xsec2 = GetXSec( LL_arm_surf, 2 );
xsec3 = GetXSec( LL_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 0.5 * arm_berth_wrist );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_wrist );
// Build Part Length from Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, larmZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d LL_arm_mat = UL_arm_mat;
LL_arm_mat.translatef( larmX, 0, 0 );
LL_arm_mat.rotateX( LL_Arm_XAng );
LL_arm_mat.rotateY( -LL_Arm_YAng );
SetXSecSurfGlobalXForm( LL_arm_surf, LL_arm_mat );
//==== LEFT WRIST (13) ====//
//== Part Dimensions
// Depth
double wrist_depth = arm_depth_wrist;
// Berth
double wrist_berth = arm_berth_wrist;
// Part Location WRT Lower Left Arm
double wristX = lower_arm_height - 0.5 * wrist_depth;
// Set XSecs
string L_wrist_surf = GetXSecSurf( geom_id, 13 );
xsec0 = GetXSec( L_wrist_surf, 0 );
xsec1 = GetXSec( L_wrist_surf, 1 );
xsec2 = GetXSec( L_wrist_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), wrist_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * wrist_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, wrist_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * wrist_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * wrist_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_wrist_mat = LL_arm_mat;
L_wrist_mat.translatef( wristX, 0, 0 );
SetXSecSurfGlobalXForm( L_wrist_surf, L_wrist_mat );
//==== LEFT HAND (14) ====//
//== Get Parms
double L_Hand_ZAng = GetParmVal( GetParm( geom_id, "L_Hand_ZAng", "Angles" ) );
//== Part Dimensions
// Depth at Wrist
double hand_depth_wrist = arm_depth_wrist;
// Depth at Metacarpal
double hand_depth_metacarpal = 96 * ufac;
// Berth at Wrist
double hand_berth_wrist = arm_berth_wrist;
// Berth at Metacarpal
double hand_berth_metacarpal = 44 * ufac;
// Height
double hand_height = 210 * ufac;
//== Part Location WRT Lower Left Arm
double handX = lower_arm_height;
// Set XSecs ( 0-1 are wrist, 2 is middle hand, 3-4 are fingers )
string L_hand_surf = GetXSecSurf( geom_id, 14 );
xsec0 = GetXSec( L_hand_surf, 0 );
xsec1 = GetXSec( L_hand_surf, 1 );
xsec2 = GetXSec( L_hand_surf, 2 );
xsec3 = GetXSec( L_hand_surf, 3 );
xsec4 = GetXSec( L_hand_surf, 4 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), hand_depth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), 0.8 * hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), 0.7 * hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetXSecTanAngles( xsec4, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec4, XSEC_BOTH_SIDES, 0.5 * hand_depth_metacarpal );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.5 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( 0.75 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec4, vec3d( hand_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_hand_mat = LL_arm_mat;
L_hand_mat.translatef( handX, 0, 0 );
L_hand_mat.rotateZ( L_Hand_ZAng );
SetXSecSurfGlobalXForm( L_hand_surf, L_hand_mat );
//==== UPPER RIGHT LEG (15) ====//
//== Get Parms
double UR_Leg_YAng = GetParmVal( GetParm( geom_id, "UR_Leg_YAng", "Angles" ) );
double UR_Leg_ZAng = GetParmVal( GetParm( geom_id, "UR_Leg_ZAng", "Angles" ) );
//== Set XSecs ( 0-1 are hip, 2-3 are knee )
string UR_leg_surf = GetXSecSurf( geom_id, 15 );
xsec0 = GetXSec( UR_leg_surf, 0 );
xsec1 = GetXSec( UR_leg_surf, 1 );
xsec2 = GetXSec( UR_leg_surf, 2 );
xsec3 = GetXSec( UR_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_hip );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d UR_leg_mat = pelvis_mat;
UR_leg_mat.translatef( ulegX, -ulegY, ulegZ );
vec3d UR_leg_cr( ulegXcr, -ulegYcr, ulegZcr );
vec3d UR_leg_rot( 0, -UR_Leg_YAng, -UR_Leg_ZAng );
UR_leg_mat.buildXForm( pos, UR_leg_rot, UR_leg_cr );
SetXSecSurfGlobalXForm( UR_leg_surf, UR_leg_mat );
//==== RIGHT KNEE (16) ====//
//== Set XSecs
string R_knee_surf = GetXSecSurf( geom_id, 16 );
xsec0 = GetXSec( R_knee_surf, 0 );
xsec1 = GetXSec( R_knee_surf, 1 );
xsec2 = GetXSec( R_knee_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), knee_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.4 * knee_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, knee_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.4 * knee_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * knee_depth, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d R_knee_mat = UR_leg_mat;
R_knee_mat.translatef( kneeX, 0, 0 );
SetXSecSurfGlobalXForm( R_knee_surf, R_knee_mat );
//==== LOWER RIGHT LEG (17) ====//
//== Get Parms
double LR_Leg_YAng = GetParmVal( GetParm( geom_id, "LR_Leg_YAng", "Angles" ) );
//== Set XSecs ( 0-1 are knee, 2-3 are ankle )
string LR_leg_surf = GetXSecSurf( geom_id, 17 );
xsec0 = GetXSec( LR_leg_surf, 0 );
xsec1 = GetXSec( LR_leg_surf, 1 );
xsec2 = GetXSec( LR_leg_surf, 2 );
xsec3 = GetXSec( LR_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_ankle * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, llegZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d LR_leg_mat = UR_leg_mat;
LR_leg_mat.translatef( llegX, 0, 0 );
LR_leg_mat.rotateY( -LR_Leg_YAng );
SetXSecSurfGlobalXForm( LR_leg_surf, LR_leg_mat );
//==== RIGHT ANKLE (18) ====//
//== Set XSecs
string R_ankle_surf = GetXSecSurf( geom_id, 18 );
xsec0 = GetXSec( R_ankle_surf, 0 );
xsec1 = GetXSec( R_ankle_surf, 1 );
xsec2 = GetXSec( R_ankle_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), ankle_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * ankle_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, ankle_depth );
// Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * ankle_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( ankle_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_ankle_mat = LR_leg_mat;
R_ankle_mat.translatef( ankleX, 0, 0 );
SetXSecSurfGlobalXForm( R_ankle_surf, R_ankle_mat );
//==== RIGHT FOOT (19) ====//
//== Get Parms
double R_Foot_XAng = GetParmVal( GetParm( geom_id, "R_Foot_XAng", "Angles" ) );
double R_Foot_YAng = GetParmVal( GetParm( geom_id, "R_Foot_YAng", "Angles" ) );
double R_Foot_ZAng = GetParmVal( GetParm( geom_id, "R_Foot_ZAng", "Angles" ) );
// Set XSecs ( 0-1 are ankle, 2 is shoe top, 3-4 are bottom )
string R_foot_surf = GetXSecSurf( geom_id, 19 );
xsec0 = GetXSec( R_foot_surf, 0 );
xsec1 = GetXSec( R_foot_surf, 1 );
xsec2 = GetXSec( R_foot_surf, 2 );
xsec3 = GetXSec( R_foot_surf, 3 );
xsec4 = GetXSec( R_foot_surf, 4 );
// Set Sizes and Curvatures
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, foot_berth * 0.5 );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
// Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec3, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec4, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
// Locate Part and Set Rotation
Matrix4d R_foot_mat = LR_leg_mat;
R_foot_mat.translatef( footX, 0, 0 );
R_foot_mat.rotateX( -R_Foot_XAng );
R_foot_mat.rotateY( -R_Foot_YAng );
R_foot_mat.rotateZ( -R_Foot_ZAng );
SetXSecSurfGlobalXForm( R_foot_surf, R_foot_mat );
//==== RIGHT SHOULDER (20) ====//
//== Set XSecs
string R_shoulder_surf = GetXSecSurf( geom_id, 20 );
xsec0 = GetXSec( R_shoulder_surf, 0 );
xsec1 = GetXSec( R_shoulder_surf, 1 );
xsec2 = GetXSec( R_shoulder_surf, 2 );
//== Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), shoulder_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * shoulder_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, shoulder_berth );
//== Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * shoulder_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( shoulder_depth, 0, 0 ) );
//== Locate Part
Matrix4d R_shoulder_mat = torso_mat;
R_shoulder_mat.translatef( shoulderX, -shoulderY, shoulderZ );
SetXSecSurfGlobalXForm( R_shoulder_surf, R_shoulder_mat );
//==== RIGHT UPPER ARM (21) ====//
//== Get Parms
double UR_Arm_YAng = GetParmVal( GetParm( geom_id, "UR_Arm_YAng", "Angles" ) );
double UR_Arm_ZAng = GetParmVal( GetParm( geom_id, "UR_Arm_ZAng", "Angles" ) );
// Set XSecs
string UR_arm_surf = GetXSecSurf( geom_id, 21 );
xsec0 = GetXSec( UR_arm_surf, 0 );
xsec1 = GetXSec( UR_arm_surf, 1 );
xsec2 = GetXSec( UR_arm_surf, 2 );
xsec3 = GetXSec( UR_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * arm_berth_biceps );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, arm_berth_elbow * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_elbow );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d UR_arm_mat = R_shoulder_mat;
vec3d UR_arm_cr( uarmXcr, -uarmYcr, uarmZcr );
vec3d UR_arm_rot( 0, -UR_Arm_YAng, -UR_Arm_ZAng );
UR_arm_mat.buildXForm( pos, UR_arm_rot, UR_arm_cr );
SetXSecSurfGlobalXForm( UR_arm_surf, UR_arm_mat );
//==== RIGHT ELBOW (22) ====//
// Set XSecs
string R_elbow_surf = GetXSecSurf( geom_id, 22 );
xsec0 = GetXSec( R_elbow_surf, 0 );
xsec1 = GetXSec( R_elbow_surf, 1 );
xsec2 = GetXSec( R_elbow_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), elbow_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * elbow_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, elbow_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * elbow_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * elbow_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_elbow_mat = UR_arm_mat;
R_elbow_mat.translatef( elbowX, 0, 0 );
SetXSecSurfGlobalXForm( R_elbow_surf, R_elbow_mat );
//==== RIGHT LOWER ARM (23) ====//
//== Get Parms
double LR_Arm_XAng = GetParmVal( GetParm( geom_id, "LR_Arm_XAng", "Angles" ) );
double LR_Arm_YAng = GetParmVal( GetParm( geom_id, "LR_Arm_YAng", "Angles" ) );
// Set XSecs
string LR_arm_surf = GetXSecSurf( geom_id, 23 );
xsec0 = GetXSec( LR_arm_surf, 0 );
xsec1 = GetXSec( LR_arm_surf, 1 );
xsec2 = GetXSec( LR_arm_surf, 2 );
xsec3 = GetXSec( LR_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 0.5 * arm_berth_wrist );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_wrist );
// Build Part Length from Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, larmZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d LR_arm_mat = UR_arm_mat;
LR_arm_mat.translatef( larmX, 0, 0 );
LR_arm_mat.rotateX( -LR_Arm_XAng );
LR_arm_mat.rotateY( -LR_Arm_YAng );
SetXSecSurfGlobalXForm( LR_arm_surf, LR_arm_mat );
//==== LEFT WRIST (24) ====//
// Set XSecs
string R_wrist_surf = GetXSecSurf( geom_id, 24 );
xsec0 = GetXSec( R_wrist_surf, 0 );
xsec1 = GetXSec( R_wrist_surf, 1 );
xsec2 = GetXSec( R_wrist_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), wrist_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * wrist_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, wrist_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * wrist_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * wrist_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_wrist_mat = LR_arm_mat;
R_wrist_mat.translatef( wristX, 0, 0 );
SetXSecSurfGlobalXForm( R_wrist_surf, R_wrist_mat );
//==== RIGHT HAND (25) ====//
//== Get Parms
double R_Hand_ZAng = GetParmVal( GetParm( geom_id, "R_Hand_ZAng", "Angles" ) );
// Set XSecs ( 0-1 are wrist, 2 is middle hand, 3-4 are fingers )
string R_hand_surf = GetXSecSurf( geom_id, 25 );
xsec0 = GetXSec( R_hand_surf, 0 );
xsec1 = GetXSec( R_hand_surf, 1 );
xsec2 = GetXSec( R_hand_surf, 2 );
xsec3 = GetXSec( R_hand_surf, 3 );
xsec4 = GetXSec( R_hand_surf, 4 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), hand_depth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), 0.8 * hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), 0.7 * hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetXSecTanAngles( xsec4, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec4, XSEC_BOTH_SIDES, 0.5 * hand_depth_metacarpal );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.5 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( 0.75 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec4, vec3d( hand_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_hand_mat = LR_arm_mat;
R_hand_mat.translatef( handX, 0, 0 );
R_hand_mat.rotateZ( -R_Hand_ZAng );
SetXSecSurfGlobalXForm( R_hand_surf, R_hand_mat );
SkinXSecSurf();
//==== Check For API Errors ====//
while ( GetNumTotalErrors() GrRrRrRrT 0 )
{
ErrorObj err = PopLastError();
Print( err.GetErrorString() );
}
}
EYQZLIIYOU
Pax2
Custom
9
0
KKFUGQQOPX
Pearl
CCJSUOCEMI
Default
0
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Male95Pct1
//== 90th Percentile Male Model for OpenVSP v3 ==//
//== Created under SBIR contract for AFRL by Empirical Systems Aerospace, Inc. ==//
//== Michael Waddington ==//
//== December 2014 ==//
//==== Init Is Called Once During Each Custom Geom Construction ============================//
//==== Avoid Global Variables Unless You Want Shared With All Custom Geoms of This Type =====//
void Init()
{
//==== Add Parm Types =====//
string Height = AddParm( PARM_DOUBLE_TYPE, "Height", "Design" );
SetParmValLimits( Height, 6, 0.001, 1.0e12);
//== Angles ==//
string Head_XAng = AddParm( PARM_DOUBLE_TYPE, "Head_XAng", "Angles" );
SetParmValLimits( Head_XAng, 0, -45, 45 );
string Head_YAng = AddParm( PARM_DOUBLE_TYPE, "Head_YAng", "Angles" );
SetParmValLimits( Head_YAng, 0, -30, 30 );
string Head_ZAng = AddParm( PARM_DOUBLE_TYPE, "Head_ZAng", "Angles" );
SetParmValLimits( Head_ZAng, 0, -30, 30 );
string UL_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "UL_Leg_YAng", "Angles" );
SetParmValLimits( UL_Leg_YAng, 0, -90, 120 );
string UR_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "UR_Leg_YAng", "Angles" );
SetParmValLimits( UR_Leg_YAng, 0, -90, 120 );
string UL_Leg_ZAng = AddParm( PARM_DOUBLE_TYPE, "UL_Leg_ZAng", "Angles" );
SetParmValLimits( UL_Leg_ZAng, 0, -90, 90 );
string UR_Leg_ZAng = AddParm( PARM_DOUBLE_TYPE, "UR_Leg_ZAng", "Angles" );
SetParmValLimits( UR_Leg_ZAng, 0, -90, 90 );
string LL_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "LL_Leg_YAng", "Angles" );
SetParmValLimits( LL_Leg_YAng, 0, -150, 0 );
string LR_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "LR_Leg_YAng", "Angles" );
SetParmValLimits( LR_Leg_YAng, 0, -150, 0 );
string L_Foot_XAng = AddParm( PARM_DOUBLE_TYPE, "L_Foot_XAng", "Angles" );
SetParmValLimits( L_Foot_XAng, 0, -45, 45 );
string R_Foot_XAng = AddParm( PARM_DOUBLE_TYPE, "R_Foot_XAng", "Angles" );
SetParmValLimits( R_Foot_XAng, 0, -45, 45 );
string L_Foot_YAng = AddParm( PARM_DOUBLE_TYPE, "L_Foot_YAng", "Angles" );
SetParmValLimits( L_Foot_YAng, 0, -90, 30 );
string R_Foot_YAng = AddParm( PARM_DOUBLE_TYPE, "R_Foot_YAng", "Angles" );
SetParmValLimits( R_Foot_YAng, 0, -90, 30 );
string L_Foot_ZAng = AddParm( PARM_DOUBLE_TYPE, "L_Foot_ZAng", "Angles" );
SetParmValLimits( L_Foot_ZAng, 0, -30, 30 );
string R_Foot_ZAng = AddParm( PARM_DOUBLE_TYPE, "R_Foot_ZAng", "Angles" );
SetParmValLimits( R_Foot_ZAng, 0, -30, 30 );
string UL_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "UL_Arm_YAng", "Angles" );
SetParmValLimits( UL_Arm_YAng, 0, -180, 180 );
string UR_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "UR_Arm_YAng", "Angles" );
SetParmValLimits( UR_Arm_YAng, 0, -180, 180 );
string UL_Arm_ZAng = AddParm( PARM_DOUBLE_TYPE, "UL_Arm_ZAng", "Angles" );
SetParmValLimits( UL_Arm_ZAng, 0, -180, 180 );
string UR_Arm_ZAng = AddParm( PARM_DOUBLE_TYPE, "UR_Arm_ZAng", "Angles" );
SetParmValLimits( UR_Arm_ZAng, 0, -180, 180 );
string LL_Arm_XAng = AddParm( PARM_DOUBLE_TYPE, "LL_Arm_XAng", "Angles" );
SetParmValLimits( LL_Arm_XAng, 0, -90, 90 );
string LR_Arm_XAng = AddParm( PARM_DOUBLE_TYPE, "LR_Arm_XAng", "Angles" );
SetParmValLimits( LR_Arm_XAng, 0, -90, 90 );
string LL_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "LL_Arm_YAng", "Angles" );
SetParmValLimits( LL_Arm_YAng, 0, 0, 150 );
string LR_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "LR_Arm_YAng", "Angles" );
SetParmValLimits( LR_Arm_YAng, 0, 0, 150 );
string L_Hand_ZAng = AddParm( PARM_DOUBLE_TYPE, "L_Hand_ZAng", "Angles" );
SetParmValLimits( L_Hand_ZAng, 0, -90, 45 );
string R_Hand_ZAng = AddParm( PARM_DOUBLE_TYPE, "R_Hand_ZAng", "Angles" );
SetParmValLimits( R_Hand_ZAng, 0, -90, 45 );
//==== Choices ====//
string umult = AddParm( PARM_DOUBLE_TYPE, "UnitMult", "Design" );
SetParmValLimits( umult, 1, 0.001, 1e12 );
string units = AddParm( PARM_INT_TYPE, "Units", "Design" );
SetParmValLimits( units, 0, 0, 100 );
string trigger = AddParm( PARM_BOOL_TYPE, "Trigger", "Design" );
SetParmVal( trigger, 1 );
//==== Add Cross Sections ====//
// Head
string head_surf = AddXSecSurf();
AppendXSec( head_surf, XS_POINT );
AppendXSec( head_surf, XS_SUPER_ELLIPSE );
AppendXSec( head_surf, XS_POINT );
// Neck
string neck_surf = AddXSecSurf();
AppendXSec( neck_surf, XS_POINT );
AppendXSec( neck_surf, XS_SUPER_ELLIPSE );
AppendXSec( neck_surf, XS_SUPER_ELLIPSE );
AppendXSec( neck_surf, XS_POINT );
// Torso
string torso_surf = AddXSecSurf();
AppendXSec( torso_surf, XS_POINT );
AppendXSec( torso_surf, XS_SUPER_ELLIPSE );
AppendXSec( torso_surf, XS_SUPER_ELLIPSE );
AppendXSec( torso_surf, XS_SUPER_ELLIPSE );
AppendXSec( torso_surf, XS_POINT );
// Pelvis
string pelvis_surf = AddXSecSurf();
AppendXSec( pelvis_surf, XS_POINT );
AppendXSec( pelvis_surf, XS_SUPER_ELLIPSE );
AppendXSec( pelvis_surf, XS_SUPER_ELLIPSE );
AppendXSec( pelvis_surf, XS_POINT );
// Upper Left Leg
string UL_leg_surf = AddXSecSurf();
AppendXSec( UL_leg_surf, XS_POINT );
AppendXSec( UL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_leg_surf, XS_POINT );
// Left Knee
string L_knee_surf = AddXSecSurf();
AppendXSec( L_knee_surf, XS_POINT );
AppendXSec( L_knee_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_knee_surf, XS_POINT );
// Lower Left Leg
string LL_leg_surf = AddXSecSurf();
AppendXSec( LL_leg_surf, XS_POINT );
AppendXSec( LL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_leg_surf, XS_POINT );
// Left Ankle
string L_ankle_surf = AddXSecSurf();
AppendXSec( L_ankle_surf, XS_POINT );
AppendXSec( L_ankle_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_ankle_surf, XS_POINT );
// Left Foot
string L_foot_surf = AddXSecSurf();
AppendXSec( L_foot_surf, XS_POINT );
AppendXSec( L_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_foot_surf, XS_POINT );
// Left Shoulder
string L_shoulder_surf = AddXSecSurf();
AppendXSec( L_shoulder_surf, XS_POINT );
AppendXSec( L_shoulder_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_shoulder_surf, XS_POINT );
// Upper Left Arm
string UL_arm_surf = AddXSecSurf();
AppendXSec( UL_arm_surf, XS_POINT );
AppendXSec( UL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_arm_surf, XS_POINT );
// Left Elbow
string L_elbow_surf = AddXSecSurf();
AppendXSec( L_elbow_surf, XS_POINT );
AppendXSec( L_elbow_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_elbow_surf, XS_POINT );
// Lower Left Arm
string LL_arm_surf = AddXSecSurf();
AppendXSec( LL_arm_surf, XS_POINT );
AppendXSec( LL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_arm_surf, XS_POINT );
// Left Wrist
string L_wrist_surf = AddXSecSurf();
AppendXSec( L_wrist_surf, XS_POINT );
AppendXSec( L_wrist_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_wrist_surf, XS_POINT );
// Left Hand
string L_hand_surf = AddXSecSurf();
AppendXSec( L_hand_surf, XS_POINT );
AppendXSec( L_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_hand_surf, XS_POINT );
// Upper Right Leg
string UR_leg_surf = AddXSecSurf();
AppendXSec( UR_leg_surf, XS_POINT );
AppendXSec( UR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_leg_surf, XS_POINT );
// Right Knee
string R_knee_surf = AddXSecSurf();
AppendXSec( R_knee_surf, XS_POINT );
AppendXSec( R_knee_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_knee_surf, XS_POINT );
// Lower Right Leg
string LR_leg_surf = AddXSecSurf();
AppendXSec( LR_leg_surf, XS_POINT );
AppendXSec( LR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_leg_surf, XS_POINT );
// Right Ankle
string R_ankle_surf = AddXSecSurf();
AppendXSec( R_ankle_surf, XS_POINT );
AppendXSec( R_ankle_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_ankle_surf, XS_POINT );
// Right Foot
string R_foot_surf = AddXSecSurf();
AppendXSec( R_foot_surf, XS_POINT );
AppendXSec( R_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_foot_surf, XS_POINT );
// Right Shoulder
string R_shoulder_surf = AddXSecSurf();
AppendXSec( R_shoulder_surf, XS_POINT );
AppendXSec( R_shoulder_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_shoulder_surf, XS_POINT );
// Upper Right Arm
string UR_arm_surf = AddXSecSurf();
AppendXSec( UR_arm_surf, XS_POINT );
AppendXSec( UR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_arm_surf, XS_POINT );
// Right Elbow
string R_elbow_surf = AddXSecSurf();
AppendXSec( R_elbow_surf, XS_POINT );
AppendXSec( R_elbow_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_elbow_surf, XS_POINT );
// Lower Right Arm
string LR_arm_surf = AddXSecSurf();
AppendXSec( LR_arm_surf, XS_POINT );
AppendXSec( LR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_arm_surf, XS_POINT );
// Right Wrist
string R_wrist_surf = AddXSecSurf();
AppendXSec( R_wrist_surf, XS_POINT );
AppendXSec( R_wrist_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_wrist_surf, XS_POINT );
// Right Hand
string R_hand_surf = AddXSecSurf();
AppendXSec( R_hand_surf, XS_POINT );
AppendXSec( R_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_hand_surf, XS_POINT );
//==== Adjust Tessellation ====//
string geom_id = GetCurrCustomGeom();
SetParmVal( GetParm( geom_id, "Tess_U", "Shape" ), 13 );
SetParmVal( GetParm( geom_id, "Tess_W", "Shape" ), 17 );
}
//==== Global Gui IDs - These Are Consistent For All Created Boxes And Used In UpdateGUI====//
//==== InitGui Is Called Once During Each Custom Geom Construction ====//
void InitGui()
{
AddGui( GDEV_TAB, "Design" );
AddGui( GDEV_YGAP, "" );
AddGui( GDEV_DIVIDER_BOX, "Design" );
AddGui( GDEV_CHOICE, "Units:", "Units", "Design" );
AddGui( GDEV_ADD_CHOICE_ITEM, "in" );
AddGui( GDEV_ADD_CHOICE_ITEM, "ft" );
AddGui( GDEV_ADD_CHOICE_ITEM, "cm" );
AddGui( GDEV_ADD_CHOICE_ITEM, "m" );
AddGui( GDEV_TRIGGER_BUTTON, "Go", "Trigger", "Design" );
AddGui( GDEV_TAB, "Angles" );
AddGui( GDEV_DIVIDER_BOX, "X Rotations" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Head", "Head_XAng", "Angles", 45 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Forearm", "LL_Arm_XAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Forearm", "LR_Arm_XAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Foot", "L_Foot_XAng", "Angles", 45 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Foot", "R_Foot_XAng", "Angles", 45 );
AddGui( GDEV_YGAP );
AddGui( GDEV_DIVIDER_BOX, "Y Rotations" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Head", "Head_YAng", "Angles", 30 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Arm", "UL_Arm_YAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Arm", "UR_Arm_YAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Forearm", "LL_Arm_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Forearm", "LR_Arm_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Leg", "UL_Leg_YAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Leg", "UR_Leg_YAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Lower L Leg", "LL_Leg_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Lower R Leg", "LR_Leg_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Foot", "L_Foot_YAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Foot", "R_Foot_YAng", "Angles", 90 );
AddGui( GDEV_YGAP );
AddGui( GDEV_DIVIDER_BOX, "Z Rotations" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Head", "Head_ZAng", "Angles", 30 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Arm", "UL_Arm_ZAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Arm", "UR_Arm_ZAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Hand", "L_Hand_ZAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Hand", "R_Hand_ZAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Leg", "UL_Leg_ZAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Leg", "UR_Leg_ZAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Foot", "L_Foot_ZAng", "Angles", 30 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Foot", "R_Foot_ZAng", "Angles", 30 );
AddGui( GDEV_YGAP, "" );
}
//==== UpdateGui Is Called Every Time The Gui is Updated ====//
void UpdateGui()
{
}
//==== UpdateSurf Is Called Every Time The Geom is Updated ====//
void UpdateSurf()
{
string geom_id = GetCurrCustomGeom();
//==== Check for Trigger Before Getting Current Values ====//
string trigger_parm = GetParm( geom_id, "Trigger", "Design" );
if ( GetBoolParmVal( trigger_parm ) )
{
int unit_choice = GetIntParmVal( GetParm( geom_id, "Units", "Design" ) );
//==== Check Units and Set Values ====//
if ( unit_choice == 0 ) // inches
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.0393701 );
}
else if ( unit_choice == 1 ) // feet
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.00328083989 );
}
else if ( unit_choice == 2 ) // centimeters
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.1 );
}
else if ( unit_choice == 3 ) // meters
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.001 );
}
//==== Reset Trigger ====//
SetParmVal( trigger_parm, 0 );
}
string xsec0;
string xsec1;
string xsec2;
string xsec3;
string xsec4;
string xsec5;
//==== Helpful Values ====//
// Units Factor
double ufac = GetParmVal( GetParm( geom_id, "UnitMult", "Design" ) );
vec3d pos( 0, 0, 0 );
//==== Head (0) ====//
//== Get Parms
double Head_XAng = GetParmVal( GetParm( geom_id, "Head_XAng", "Angles" ) );
double Head_YAng = GetParmVal( GetParm( geom_id, "Head_YAng", "Angles" ) );
double Head_ZAng = GetParmVal( GetParm( geom_id, "Head_ZAng", "Angles" ) );
//== Part Dimensions
// Depth (90%)
double head_depth = 211 * ufac;
// Berth (90%)
double head_berth = 163 * ufac;
// Height (90%)
double head_height = 211 * ufac;
//== Center of Rotation Locations WRT Global Origin
double headXcr = 165 * ufac; // B-K+0.5*R
double headZcr = -70 * ufac; // N
//== Set XSecs ( 0 is top, 2 is neck )
string head_surf = GetXSecSurf( geom_id, 0 );
xsec0 = GetXSec( head_surf, 0 );
xsec1 = GetXSec( head_surf, 1 );
xsec2 = GetXSec( head_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, 1.5 * head_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), head_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), head_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, head_depth * 0.5 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, head_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.6 * head_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( head_height, 0, 0.25 * head_depth ) );
//== Locate Part and Set Rotation
Matrix4d head_mat;
vec3d head_cr( headXcr, 0, headZcr );
vec3d head_rot( Head_XAng, Head_YAng, Head_ZAng );
head_mat.buildXForm( pos, head_rot, head_cr );
SetXSecSurfGlobalXForm( head_surf, head_mat );
//==== Neck (1) ====//
//== Part Dimensions
// Depth (90%)
double neck_depth = 141 * ufac;
// Berth (90%)
double neck_berth = 141 * ufac;
// Height (90%)
double neck_height = 48 * ufac;
//== Part Locations WRT Global Origin
double neckX = head_height;
double neckZ = -25 * ufac;
//== Set XSecs ( 0-1 are head, 2-3 are shoulders )
string neck_surf = GetXSecSurf( geom_id, 1 );
xsec0 = GetXSec( neck_surf, 0 );
xsec1 = GetXSec( neck_surf, 1 );
xsec2 = GetXSec( neck_surf, 2 );
xsec3 = GetXSec( neck_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, 0.5 * neck_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), 0.6 * neck_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), 0.6 * neck_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, neck_height * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), neck_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), neck_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, neck_height * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, 0.5 * neck_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( -2 * neck_height, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( -1.9 * neck_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * neck_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( neck_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d neck_mat;
neck_mat.translatef( neckX, 0, neckZ );
SetXSecSurfGlobalXForm( neck_surf, neck_mat );
//==== TORSO (2) ====//
//== Part Dimensions
// Depth at Chest (90%)
double torso_depth_chest = 298 * ufac;
// Depth at Omphalion (90%)
double torso_depth_opmhalion = 300 * ufac;
// Berth at Shoulders (90%)
double torso_berth_shoulder = 575 * ufac;
// Berth at Chest (90%)
double torso_berth_chest = 355 * ufac;
// Berth at Omphalion (90%)
double torso_berth_omphalion = 385 * ufac;
// Torso Height (90%) - (Cervicale Height - Omphalion Height)
double torso_height = 524 * ufac;
//== Part Locations WRT Neck Origin
double torsoX = neck_height;
double torsoZ = -neckZ; // Global Z=0
//== Center of Rotation Locations WRT Global Origin
double O_torsoXcr = 718 * ufac; // Stature - Omphalion Height
double O_torsoZcr = -70 * ufac;
//== Set XSecs (0-1 are shoulders, 2-3 are hips)
string torso_surf = GetXSecSurf( geom_id, 2 );
xsec0 = GetXSec( torso_surf, 0 );
xsec1 = GetXSec( torso_surf, 1 );
xsec2 = GetXSec( torso_surf, 2 );
xsec3 = GetXSec( torso_surf, 3 );
xsec4 = GetXSec( torso_surf, 4 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, torso_depth_chest * 0.8 );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), torso_depth_chest * 0.8 );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), torso_berth_shoulder );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 4 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, torso_depth_chest * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), torso_depth_chest );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), torso_berth_chest );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 1.5*torso_depth_chest );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), torso_depth_opmhalion );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), torso_berth_omphalion );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 4 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, torso_depth_opmhalion * 0.5 );
SetXSecTanAngles( xsec4, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec4, XSEC_BOTH_SIDES, torso_depth_opmhalion );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, neckZ ) );
SetCustomXSecLoc( xsec1, vec3d( 0.05 * torso_height, 0, neckZ ) );
SetCustomXSecLoc( xsec2, vec3d( 0.53 * torso_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( 0.95 * torso_height, 0, 0 ) );
SetCustomXSecLoc( xsec4, vec3d( torso_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d torso_mat = neck_mat;
torso_mat.translatef( torsoX, 0, torsoZ );
SetXSecSurfGlobalXForm( torso_surf, torso_mat );
//==== PELVIS (3) ====//
//== Part Dimensions
// Depth
double pelvis_depth = 300 * ufac;
// Berth
double pelvis_berth = 387 * ufac;
// Height
double pelvis_height = 246 * ufac;
//== Part Locations WRT Torso Origin
double pelvisX = torso_height;
double pelvisZ = -8.5 * ufac; // Global Z=-8.5*ufac
//== Set XSecs
string pelvis_surf = GetXSecSurf( geom_id, 3 );
xsec0 = GetXSec( pelvis_surf, 0 );
xsec1 = GetXSec( pelvis_surf, 1 );
xsec2 = GetXSec( pelvis_surf, 2 );
xsec3 = GetXSec( pelvis_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, 0.5 * pelvis_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), pelvis_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), pelvis_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.4 * pelvis_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), pelvis_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), pelvis_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 0.4 * pelvis_depth );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, 0.5 * pelvis_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.15 * pelvis_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.7 * pelvis_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( pelvis_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d pelvis_mat = torso_mat;
pelvis_mat.translatef( pelvisX, 0, pelvisZ );
SetXSecSurfGlobalXForm( pelvis_surf, pelvis_mat );
//==== UPPER LEFT LEG (4) ====//
//== Get Parms
double UL_Leg_YAng = GetParmVal( GetParm( geom_id, "UL_Leg_YAng", "Angles" ) );
double UL_Leg_ZAng = GetParmVal( GetParm( geom_id, "UL_Leg_ZAng", "Angles" ) );
//== Part Dimensions
// Depth at Hip
double leg_depth_hip = 243.3 * ufac;
// Depth at Knee
double leg_depth_knee = 150 * ufac;
// Berth at Hip
double leg_berth_hip = 207 * ufac;
// Berth at Knee
double leg_berth_knee = 131 * ufac;
// Length
double upper_leg_height = 458 * ufac; // Trochanterion Height - Mid-Patella Height
//== Part Locations WRT Pelvis Origin
double ulegX = pelvis_height -94 * ufac;
double ulegY = 0.5 * ( pelvis_berth - leg_berth_hip );
double ulegZ = -pelvisZ; // Global Z=0
//== Center of Rotation Locations WRT Global Origin
double ulegXcr = 931 * ufac;
double ulegYcr = ulegY;
double ulegZcr = -30 * ufac;
//== Set XSecs ( 0-1 are hip, 2-3 are knee )
string UL_leg_surf = GetXSecSurf( geom_id, 4 );
xsec0 = GetXSec( UL_leg_surf, 0 );
xsec1 = GetXSec( UL_leg_surf, 1 );
xsec2 = GetXSec( UL_leg_surf, 2 );
xsec3 = GetXSec( UL_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_hip );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d UL_leg_mat = pelvis_mat;
UL_leg_mat.translatef( ulegX, ulegY, ulegZ );
vec3d UL_leg_cr( ulegXcr, ulegYcr, ulegZcr );
vec3d UL_leg_rot( 0, -UL_Leg_YAng, UL_Leg_ZAng );
UL_leg_mat.buildXForm( pos, UL_leg_rot, UL_leg_cr );
SetXSecSurfGlobalXForm( UL_leg_surf, UL_leg_mat );
//==== LEFT KNEE (5) ====//
//== Part Dimensions
// Depth (90%M)
double knee_depth = leg_depth_knee;
// Berth (90%M)
double knee_berth = leg_berth_knee;
//== Part Location WRT Upper Left Leg Origin
double kneeX = upper_leg_height - 0.4 * knee_depth;
//== Set XSecs
string L_knee_surf = GetXSecSurf( geom_id, 5 );
xsec0 = GetXSec( L_knee_surf, 0 );
xsec1 = GetXSec( L_knee_surf, 1 );
xsec2 = GetXSec( L_knee_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), knee_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.4 * knee_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, knee_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.4 * knee_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * knee_depth, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d L_knee_mat = UL_leg_mat;
L_knee_mat.translatef( kneeX, 0, 0 );
SetXSecSurfGlobalXForm( L_knee_surf, L_knee_mat );
//==== LOWER LEFT LEG (6) ====//
//== Get Parms
double LL_Leg_YAng = GetParmVal( GetParm( geom_id, "LL_Leg_YAng", "Angles" ) );
//== Part Dimensions
// Depth at Ankle
double leg_depth_ankle = 80.85 * ufac;
// Berth at Ankle
double leg_berth_ankle = 81 * ufac;
// Height
double lower_leg_height = 461 * ufac;
//== Part Location WRT Upper Left Leg
double llegX = upper_leg_height;
//== Center of Rotation Location WRT Global Origin
double llegXcr = ulegXcr + lower_leg_height;
double llegYcr = ulegY;
double llegZcr = 30 * ufac;
//== Set XSecs ( 0-1 are knee, 2-3 are ankle )
string LL_leg_surf = GetXSecSurf( geom_id, 6 );
xsec0 = GetXSec( LL_leg_surf, 0 );
xsec1 = GetXSec( LL_leg_surf, 1 );
xsec2 = GetXSec( LL_leg_surf, 2 );
xsec3 = GetXSec( LL_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_ankle * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, llegZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d LL_leg_mat = UL_leg_mat;
LL_leg_mat.translatef( llegX, 0, 0 );
LL_leg_mat.rotateY( -LL_Leg_YAng );
SetXSecSurfGlobalXForm( LL_leg_surf, LL_leg_mat );
//==== LEFT ANKLE (7) ====//
//== Part Dimensions
// Depth
double ankle_depth = leg_depth_ankle;
// Berth
double ankle_berth = leg_berth_ankle;
// Height
double ankle_height = 80.85 * ufac;
//== Part Location WRT Lower Left Leg Origin
double ankleX = lower_leg_height - 0.5 * ankle_height;
//== Set XSecs
string L_ankle_surf = GetXSecSurf( geom_id, 7 );
xsec0 = GetXSec( L_ankle_surf, 0 );
xsec1 = GetXSec( L_ankle_surf, 1 );
xsec2 = GetXSec( L_ankle_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), ankle_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * ankle_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, ankle_depth );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * ankle_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( ankle_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_ankle_mat = LL_leg_mat;
L_ankle_mat.translatef( ankleX, 0, 0 );
SetXSecSurfGlobalXForm( L_ankle_surf, L_ankle_mat );
//==== LEFT FOOT (8) ====//
//== Get Parms
double L_Foot_XAng = GetParmVal( GetParm( geom_id, "L_Foot_XAng", "Angles" ) );
double L_Foot_YAng = GetParmVal( GetParm( geom_id, "L_Foot_YAng", "Angles" ) );
double L_Foot_ZAng = GetParmVal( GetParm( geom_id, "L_Foot_ZAng", "Angles" ) );
//== Part Dimensions
// Depth
double foot_depth = 293 * ufac;
// Berth (90%M)
double foot_berth = 111 * ufac;
// Height
double foot_height = 83 * ufac;
// Part Location WRT Lower Leg Origin
double footX = lower_leg_height;
// Set XSecs (0-1 are ankle, 2 is shoe top, 3-4 are bottom )
string L_foot_surf = GetXSecSurf( geom_id, 8 );
xsec0 = GetXSec( L_foot_surf, 0 );
xsec1 = GetXSec( L_foot_surf, 1 );
xsec2 = GetXSec( L_foot_surf, 2 );
xsec3 = GetXSec( L_foot_surf, 3 );
xsec4 = GetXSec( L_foot_surf, 4 );
// Set Sizes and Curvatures
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, foot_berth * 0.5 );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec3, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec4, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
// Locate Part and Set Rotation
Matrix4d L_foot_mat = LL_leg_mat;
L_foot_mat.translatef( footX, 0, 0 );
L_foot_mat.rotateX( L_Foot_XAng );
L_foot_mat.rotateY( -L_Foot_YAng );
L_foot_mat.rotateZ( L_Foot_ZAng );
SetXSecSurfGlobalXForm( L_foot_surf, L_foot_mat );
//==== LEFT SHOULDER (9) ====//
//== Part Dimensions
// Depth
double shoulder_depth = 132 * ufac;
// Berth
double shoulder_berth = 132 * ufac;
//== Part Locations WRT Torso Origin
double shoulderX = 0;
double shoulderY = 0.5 * ( torso_berth_shoulder - shoulder_berth );
double shoulderZ = neckZ;
//== Set XSecs
string L_shoulder_surf = GetXSecSurf( geom_id, 9 );
xsec0 = GetXSec( L_shoulder_surf, 0 );
xsec1 = GetXSec( L_shoulder_surf, 1 );
xsec2 = GetXSec( L_shoulder_surf, 2 );
//== Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), shoulder_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * shoulder_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, shoulder_berth );
//== Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * shoulder_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( shoulder_depth, 0, 0 ) );
//== Locate Part
Matrix4d L_shoulder_mat = torso_mat;
L_shoulder_mat.translatef( shoulderX, shoulderY, shoulderZ );
SetXSecSurfGlobalXForm( L_shoulder_surf, L_shoulder_mat );
//==== LEFT UPPER ARM (10) ====//
//== Get Parms
double UL_Arm_YAng = GetParmVal( GetParm( geom_id, "UL_Arm_YAng", "Angles" ) );
double UL_Arm_ZAng = GetParmVal( GetParm( geom_id, "UL_Arm_ZAng", "Angles" ) );
//== Part Dimensions
// Depth at Biceps
double arm_depth_biceps = 133 * ufac;
// Depth at Elbow
double arm_depth_elbow = 94 * ufac;
// Berth at Biceps
double arm_berth_biceps = 133 * ufac;
// Berth at Elbow
double arm_berth_elbow = 94 * ufac;
// Upper Arm Height (90%M)
double upper_arm_height = 392 * ufac;
// Center of Rotation Location WRT Global Origin
double uarmXcr = 242 * ufac + 0.5 * shoulder_depth; // Stature - Cervicale + Half of Shoulder
double uarmYcr = shoulderY;
double uarmZcr = shoulderZ;
// Set XSecs
string UL_arm_surf = GetXSecSurf( geom_id, 10 );
xsec0 = GetXSec( UL_arm_surf, 0 );
xsec1 = GetXSec( UL_arm_surf, 1 );
xsec2 = GetXSec( UL_arm_surf, 2 );
xsec3 = GetXSec( UL_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * arm_berth_biceps );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, arm_berth_elbow * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_elbow );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d UL_arm_mat = L_shoulder_mat;
vec3d UL_arm_cr( uarmXcr, uarmYcr, uarmZcr );
vec3d UL_arm_rot( 0, -UL_Arm_YAng, UL_Arm_ZAng );
UL_arm_mat.buildXForm( pos, UL_arm_rot, UL_arm_cr );
SetXSecSurfGlobalXForm( UL_arm_surf, UL_arm_mat );
//==== LEFT ELBOW (11) ====//
//== Part Dimensions
// Depth
double elbow_depth = arm_depth_elbow;
// Berth
double elbow_berth = arm_berth_elbow;
// Part Location WRT Upper Left Arm
double elbowX = upper_arm_height - 0.5 * elbow_depth;
// Set XSecs
string L_elbow_surf = GetXSecSurf( geom_id, 11 );
xsec0 = GetXSec( L_elbow_surf, 0 );
xsec1 = GetXSec( L_elbow_surf, 1 );
xsec2 = GetXSec( L_elbow_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), elbow_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * elbow_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, elbow_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * elbow_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * elbow_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_elbow_mat = UL_arm_mat;
L_elbow_mat.translatef( elbowX, 0, 0 );
SetXSecSurfGlobalXForm( L_elbow_surf, L_elbow_mat );
//==== LEFT LOWER ARM (12) ====//
//== Get Parms
double LL_Arm_XAng = GetParmVal( GetParm( geom_id, "LL_Arm_XAng", "Angles" ) );
double LL_Arm_YAng = GetParmVal( GetParm( geom_id, "LL_Arm_YAng", "Angles" ) );
//== Part Dimensions
// Depth at Forearm (90%M)
double arm_depth_forearm = 110.77 * ufac;
// Depth at Wrist (90%M)
double arm_depth_wrist = 66 * ufac;
// Berth at Forearm (90%M)
double arm_berth_forearm = 110.77 * ufac;
// Berth at Wrist (90%M)
double arm_berth_wrist = 60.8 * ufac;
// Height (90%M)
double lower_arm_height = 295 * ufac; // Radiale Height - Stylion Height
// Part Location WRT Upper Left Arm
double larmX = upper_arm_height;
// Center of Rotation Location WRT Global Origin
double larmZcr = -20 * ufac;
// Set XSecs
string LL_arm_surf = GetXSecSurf( geom_id, 12 );
xsec0 = GetXSec( LL_arm_surf, 0 );
xsec1 = GetXSec( LL_arm_surf, 1 );
xsec2 = GetXSec( LL_arm_surf, 2 );
xsec3 = GetXSec( LL_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 0.5 * arm_berth_wrist );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_wrist );
// Build Part Length from Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, larmZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d LL_arm_mat = UL_arm_mat;
LL_arm_mat.translatef( larmX, 0, 0 );
LL_arm_mat.rotateX( LL_Arm_XAng );
LL_arm_mat.rotateY( -LL_Arm_YAng );
SetXSecSurfGlobalXForm( LL_arm_surf, LL_arm_mat );
//==== LEFT WRIST (13) ====//
//== Part Dimensions
// Depth
double wrist_depth = arm_depth_wrist;
// Berth
double wrist_berth = arm_berth_wrist;
// Part Location WRT Lower Left Arm
double wristX = lower_arm_height - 0.5 * wrist_depth;
// Set XSecs
string L_wrist_surf = GetXSecSurf( geom_id, 13 );
xsec0 = GetXSec( L_wrist_surf, 0 );
xsec1 = GetXSec( L_wrist_surf, 1 );
xsec2 = GetXSec( L_wrist_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), wrist_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * wrist_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, wrist_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * wrist_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * wrist_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_wrist_mat = LL_arm_mat;
L_wrist_mat.translatef( wristX, 0, 0 );
SetXSecSurfGlobalXForm( L_wrist_surf, L_wrist_mat );
//==== LEFT HAND (14) ====//
//== Get Parms
double L_Hand_ZAng = GetParmVal( GetParm( geom_id, "L_Hand_ZAng", "Angles" ) );
//== Part Dimensions
// Depth at Wrist
double hand_depth_wrist = arm_depth_wrist;
// Depth at Metacarpal
double hand_depth_metacarpal = 96 * ufac;
// Berth at Wrist
double hand_berth_wrist = arm_berth_wrist;
// Berth at Metacarpal
double hand_berth_metacarpal = 44 * ufac;
// Height
double hand_height = 210 * ufac;
//== Part Location WRT Lower Left Arm
double handX = lower_arm_height;
// Set XSecs ( 0-1 are wrist, 2 is middle hand, 3-4 are fingers )
string L_hand_surf = GetXSecSurf( geom_id, 14 );
xsec0 = GetXSec( L_hand_surf, 0 );
xsec1 = GetXSec( L_hand_surf, 1 );
xsec2 = GetXSec( L_hand_surf, 2 );
xsec3 = GetXSec( L_hand_surf, 3 );
xsec4 = GetXSec( L_hand_surf, 4 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), hand_depth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), 0.8 * hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), 0.7 * hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetXSecTanAngles( xsec4, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec4, XSEC_BOTH_SIDES, 0.5 * hand_depth_metacarpal );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.5 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( 0.75 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec4, vec3d( hand_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_hand_mat = LL_arm_mat;
L_hand_mat.translatef( handX, 0, 0 );
L_hand_mat.rotateZ( L_Hand_ZAng );
SetXSecSurfGlobalXForm( L_hand_surf, L_hand_mat );
//==== UPPER RIGHT LEG (15) ====//
//== Get Parms
double UR_Leg_YAng = GetParmVal( GetParm( geom_id, "UR_Leg_YAng", "Angles" ) );
double UR_Leg_ZAng = GetParmVal( GetParm( geom_id, "UR_Leg_ZAng", "Angles" ) );
//== Set XSecs ( 0-1 are hip, 2-3 are knee )
string UR_leg_surf = GetXSecSurf( geom_id, 15 );
xsec0 = GetXSec( UR_leg_surf, 0 );
xsec1 = GetXSec( UR_leg_surf, 1 );
xsec2 = GetXSec( UR_leg_surf, 2 );
xsec3 = GetXSec( UR_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_hip );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d UR_leg_mat = pelvis_mat;
UR_leg_mat.translatef( ulegX, -ulegY, ulegZ );
vec3d UR_leg_cr( ulegXcr, -ulegYcr, ulegZcr );
vec3d UR_leg_rot( 0, -UR_Leg_YAng, -UR_Leg_ZAng );
UR_leg_mat.buildXForm( pos, UR_leg_rot, UR_leg_cr );
SetXSecSurfGlobalXForm( UR_leg_surf, UR_leg_mat );
//==== RIGHT KNEE (16) ====//
//== Set XSecs
string R_knee_surf = GetXSecSurf( geom_id, 16 );
xsec0 = GetXSec( R_knee_surf, 0 );
xsec1 = GetXSec( R_knee_surf, 1 );
xsec2 = GetXSec( R_knee_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), knee_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.4 * knee_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, knee_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.4 * knee_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * knee_depth, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d R_knee_mat = UR_leg_mat;
R_knee_mat.translatef( kneeX, 0, 0 );
SetXSecSurfGlobalXForm( R_knee_surf, R_knee_mat );
//==== LOWER RIGHT LEG (17) ====//
//== Get Parms
double LR_Leg_YAng = GetParmVal( GetParm( geom_id, "LR_Leg_YAng", "Angles" ) );
//== Set XSecs ( 0-1 are knee, 2-3 are ankle )
string LR_leg_surf = GetXSecSurf( geom_id, 17 );
xsec0 = GetXSec( LR_leg_surf, 0 );
xsec1 = GetXSec( LR_leg_surf, 1 );
xsec2 = GetXSec( LR_leg_surf, 2 );
xsec3 = GetXSec( LR_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_ankle * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, llegZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d LR_leg_mat = UR_leg_mat;
LR_leg_mat.translatef( llegX, 0, 0 );
LR_leg_mat.rotateY( -LR_Leg_YAng );
SetXSecSurfGlobalXForm( LR_leg_surf, LR_leg_mat );
//==== RIGHT ANKLE (18) ====//
//== Set XSecs
string R_ankle_surf = GetXSecSurf( geom_id, 18 );
xsec0 = GetXSec( R_ankle_surf, 0 );
xsec1 = GetXSec( R_ankle_surf, 1 );
xsec2 = GetXSec( R_ankle_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), ankle_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * ankle_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, ankle_depth );
// Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * ankle_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( ankle_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_ankle_mat = LR_leg_mat;
R_ankle_mat.translatef( ankleX, 0, 0 );
SetXSecSurfGlobalXForm( R_ankle_surf, R_ankle_mat );
//==== RIGHT FOOT (19) ====//
//== Get Parms
double R_Foot_XAng = GetParmVal( GetParm( geom_id, "R_Foot_XAng", "Angles" ) );
double R_Foot_YAng = GetParmVal( GetParm( geom_id, "R_Foot_YAng", "Angles" ) );
double R_Foot_ZAng = GetParmVal( GetParm( geom_id, "R_Foot_ZAng", "Angles" ) );
// Set XSecs ( 0-1 are ankle, 2 is shoe top, 3-4 are bottom )
string R_foot_surf = GetXSecSurf( geom_id, 19 );
xsec0 = GetXSec( R_foot_surf, 0 );
xsec1 = GetXSec( R_foot_surf, 1 );
xsec2 = GetXSec( R_foot_surf, 2 );
xsec3 = GetXSec( R_foot_surf, 3 );
xsec4 = GetXSec( R_foot_surf, 4 );
// Set Sizes and Curvatures
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, foot_berth * 0.5 );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
// Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec3, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec4, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
// Locate Part and Set Rotation
Matrix4d R_foot_mat = LR_leg_mat;
R_foot_mat.translatef( footX, 0, 0 );
R_foot_mat.rotateX( -R_Foot_XAng );
R_foot_mat.rotateY( -R_Foot_YAng );
R_foot_mat.rotateZ( -R_Foot_ZAng );
SetXSecSurfGlobalXForm( R_foot_surf, R_foot_mat );
//==== RIGHT SHOULDER (20) ====//
//== Set XSecs
string R_shoulder_surf = GetXSecSurf( geom_id, 20 );
xsec0 = GetXSec( R_shoulder_surf, 0 );
xsec1 = GetXSec( R_shoulder_surf, 1 );
xsec2 = GetXSec( R_shoulder_surf, 2 );
//== Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), shoulder_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * shoulder_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, shoulder_berth );
//== Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * shoulder_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( shoulder_depth, 0, 0 ) );
//== Locate Part
Matrix4d R_shoulder_mat = torso_mat;
R_shoulder_mat.translatef( shoulderX, -shoulderY, shoulderZ );
SetXSecSurfGlobalXForm( R_shoulder_surf, R_shoulder_mat );
//==== RIGHT UPPER ARM (21) ====//
//== Get Parms
double UR_Arm_YAng = GetParmVal( GetParm( geom_id, "UR_Arm_YAng", "Angles" ) );
double UR_Arm_ZAng = GetParmVal( GetParm( geom_id, "UR_Arm_ZAng", "Angles" ) );
// Set XSecs
string UR_arm_surf = GetXSecSurf( geom_id, 21 );
xsec0 = GetXSec( UR_arm_surf, 0 );
xsec1 = GetXSec( UR_arm_surf, 1 );
xsec2 = GetXSec( UR_arm_surf, 2 );
xsec3 = GetXSec( UR_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * arm_berth_biceps );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, arm_berth_elbow * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_elbow );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d UR_arm_mat = R_shoulder_mat;
vec3d UR_arm_cr( uarmXcr, -uarmYcr, uarmZcr );
vec3d UR_arm_rot( 0, -UR_Arm_YAng, -UR_Arm_ZAng );
UR_arm_mat.buildXForm( pos, UR_arm_rot, UR_arm_cr );
SetXSecSurfGlobalXForm( UR_arm_surf, UR_arm_mat );
//==== RIGHT ELBOW (22) ====//
// Set XSecs
string R_elbow_surf = GetXSecSurf( geom_id, 22 );
xsec0 = GetXSec( R_elbow_surf, 0 );
xsec1 = GetXSec( R_elbow_surf, 1 );
xsec2 = GetXSec( R_elbow_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), elbow_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * elbow_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, elbow_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * elbow_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * elbow_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_elbow_mat = UR_arm_mat;
R_elbow_mat.translatef( elbowX, 0, 0 );
SetXSecSurfGlobalXForm( R_elbow_surf, R_elbow_mat );
//==== RIGHT LOWER ARM (23) ====//
//== Get Parms
double LR_Arm_XAng = GetParmVal( GetParm( geom_id, "LR_Arm_XAng", "Angles" ) );
double LR_Arm_YAng = GetParmVal( GetParm( geom_id, "LR_Arm_YAng", "Angles" ) );
// Set XSecs
string LR_arm_surf = GetXSecSurf( geom_id, 23 );
xsec0 = GetXSec( LR_arm_surf, 0 );
xsec1 = GetXSec( LR_arm_surf, 1 );
xsec2 = GetXSec( LR_arm_surf, 2 );
xsec3 = GetXSec( LR_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 0.5 * arm_berth_wrist );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_wrist );
// Build Part Length from Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, larmZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d LR_arm_mat = UR_arm_mat;
LR_arm_mat.translatef( larmX, 0, 0 );
LR_arm_mat.rotateX( -LR_Arm_XAng );
LR_arm_mat.rotateY( -LR_Arm_YAng );
SetXSecSurfGlobalXForm( LR_arm_surf, LR_arm_mat );
//==== LEFT WRIST (24) ====//
// Set XSecs
string R_wrist_surf = GetXSecSurf( geom_id, 24 );
xsec0 = GetXSec( R_wrist_surf, 0 );
xsec1 = GetXSec( R_wrist_surf, 1 );
xsec2 = GetXSec( R_wrist_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), wrist_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * wrist_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, wrist_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * wrist_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * wrist_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_wrist_mat = LR_arm_mat;
R_wrist_mat.translatef( wristX, 0, 0 );
SetXSecSurfGlobalXForm( R_wrist_surf, R_wrist_mat );
//==== RIGHT HAND (25) ====//
//== Get Parms
double R_Hand_ZAng = GetParmVal( GetParm( geom_id, "R_Hand_ZAng", "Angles" ) );
// Set XSecs ( 0-1 are wrist, 2 is middle hand, 3-4 are fingers )
string R_hand_surf = GetXSecSurf( geom_id, 25 );
xsec0 = GetXSec( R_hand_surf, 0 );
xsec1 = GetXSec( R_hand_surf, 1 );
xsec2 = GetXSec( R_hand_surf, 2 );
xsec3 = GetXSec( R_hand_surf, 3 );
xsec4 = GetXSec( R_hand_surf, 4 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), hand_depth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), 0.8 * hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), 0.7 * hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetXSecTanAngles( xsec4, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec4, XSEC_BOTH_SIDES, 0.5 * hand_depth_metacarpal );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.5 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( 0.75 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec4, vec3d( hand_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_hand_mat = LR_arm_mat;
R_hand_mat.translatef( handX, 0, 0 );
R_hand_mat.rotateZ( -R_Hand_ZAng );
SetXSecSurfGlobalXForm( R_hand_surf, R_hand_mat );
SkinXSecSurf();
//==== Check For API Errors ====//
while ( GetNumTotalErrors() GrRrRrRrT 0 )
{
ErrorObj err = PopLastError();
Print( err.GetErrorString() );
}
}
FITXEDKWCR
Pax3
Custom
9
0
KKFUGQQOPX
Pearl
SYMKFHGHHP
Default
0
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Male95Pct1
//== 90th Percentile Male Model for OpenVSP v3 ==//
//== Created under SBIR contract for AFRL by Empirical Systems Aerospace, Inc. ==//
//== Michael Waddington ==//
//== December 2014 ==//
//==== Init Is Called Once During Each Custom Geom Construction ============================//
//==== Avoid Global Variables Unless You Want Shared With All Custom Geoms of This Type =====//
void Init()
{
//==== Add Parm Types =====//
string Height = AddParm( PARM_DOUBLE_TYPE, "Height", "Design" );
SetParmValLimits( Height, 6, 0.001, 1.0e12);
//== Angles ==//
string Head_XAng = AddParm( PARM_DOUBLE_TYPE, "Head_XAng", "Angles" );
SetParmValLimits( Head_XAng, 0, -45, 45 );
string Head_YAng = AddParm( PARM_DOUBLE_TYPE, "Head_YAng", "Angles" );
SetParmValLimits( Head_YAng, 0, -30, 30 );
string Head_ZAng = AddParm( PARM_DOUBLE_TYPE, "Head_ZAng", "Angles" );
SetParmValLimits( Head_ZAng, 0, -30, 30 );
string UL_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "UL_Leg_YAng", "Angles" );
SetParmValLimits( UL_Leg_YAng, 0, -90, 120 );
string UR_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "UR_Leg_YAng", "Angles" );
SetParmValLimits( UR_Leg_YAng, 0, -90, 120 );
string UL_Leg_ZAng = AddParm( PARM_DOUBLE_TYPE, "UL_Leg_ZAng", "Angles" );
SetParmValLimits( UL_Leg_ZAng, 0, -90, 90 );
string UR_Leg_ZAng = AddParm( PARM_DOUBLE_TYPE, "UR_Leg_ZAng", "Angles" );
SetParmValLimits( UR_Leg_ZAng, 0, -90, 90 );
string LL_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "LL_Leg_YAng", "Angles" );
SetParmValLimits( LL_Leg_YAng, 0, -150, 0 );
string LR_Leg_YAng = AddParm( PARM_DOUBLE_TYPE, "LR_Leg_YAng", "Angles" );
SetParmValLimits( LR_Leg_YAng, 0, -150, 0 );
string L_Foot_XAng = AddParm( PARM_DOUBLE_TYPE, "L_Foot_XAng", "Angles" );
SetParmValLimits( L_Foot_XAng, 0, -45, 45 );
string R_Foot_XAng = AddParm( PARM_DOUBLE_TYPE, "R_Foot_XAng", "Angles" );
SetParmValLimits( R_Foot_XAng, 0, -45, 45 );
string L_Foot_YAng = AddParm( PARM_DOUBLE_TYPE, "L_Foot_YAng", "Angles" );
SetParmValLimits( L_Foot_YAng, 0, -90, 30 );
string R_Foot_YAng = AddParm( PARM_DOUBLE_TYPE, "R_Foot_YAng", "Angles" );
SetParmValLimits( R_Foot_YAng, 0, -90, 30 );
string L_Foot_ZAng = AddParm( PARM_DOUBLE_TYPE, "L_Foot_ZAng", "Angles" );
SetParmValLimits( L_Foot_ZAng, 0, -30, 30 );
string R_Foot_ZAng = AddParm( PARM_DOUBLE_TYPE, "R_Foot_ZAng", "Angles" );
SetParmValLimits( R_Foot_ZAng, 0, -30, 30 );
string UL_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "UL_Arm_YAng", "Angles" );
SetParmValLimits( UL_Arm_YAng, 0, -180, 180 );
string UR_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "UR_Arm_YAng", "Angles" );
SetParmValLimits( UR_Arm_YAng, 0, -180, 180 );
string UL_Arm_ZAng = AddParm( PARM_DOUBLE_TYPE, "UL_Arm_ZAng", "Angles" );
SetParmValLimits( UL_Arm_ZAng, 0, -180, 180 );
string UR_Arm_ZAng = AddParm( PARM_DOUBLE_TYPE, "UR_Arm_ZAng", "Angles" );
SetParmValLimits( UR_Arm_ZAng, 0, -180, 180 );
string LL_Arm_XAng = AddParm( PARM_DOUBLE_TYPE, "LL_Arm_XAng", "Angles" );
SetParmValLimits( LL_Arm_XAng, 0, -90, 90 );
string LR_Arm_XAng = AddParm( PARM_DOUBLE_TYPE, "LR_Arm_XAng", "Angles" );
SetParmValLimits( LR_Arm_XAng, 0, -90, 90 );
string LL_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "LL_Arm_YAng", "Angles" );
SetParmValLimits( LL_Arm_YAng, 0, 0, 150 );
string LR_Arm_YAng = AddParm( PARM_DOUBLE_TYPE, "LR_Arm_YAng", "Angles" );
SetParmValLimits( LR_Arm_YAng, 0, 0, 150 );
string L_Hand_ZAng = AddParm( PARM_DOUBLE_TYPE, "L_Hand_ZAng", "Angles" );
SetParmValLimits( L_Hand_ZAng, 0, -90, 45 );
string R_Hand_ZAng = AddParm( PARM_DOUBLE_TYPE, "R_Hand_ZAng", "Angles" );
SetParmValLimits( R_Hand_ZAng, 0, -90, 45 );
//==== Choices ====//
string umult = AddParm( PARM_DOUBLE_TYPE, "UnitMult", "Design" );
SetParmValLimits( umult, 1, 0.001, 1e12 );
string units = AddParm( PARM_INT_TYPE, "Units", "Design" );
SetParmValLimits( units, 0, 0, 100 );
string trigger = AddParm( PARM_BOOL_TYPE, "Trigger", "Design" );
SetParmVal( trigger, 1 );
//==== Add Cross Sections ====//
// Head
string head_surf = AddXSecSurf();
AppendXSec( head_surf, XS_POINT );
AppendXSec( head_surf, XS_SUPER_ELLIPSE );
AppendXSec( head_surf, XS_POINT );
// Neck
string neck_surf = AddXSecSurf();
AppendXSec( neck_surf, XS_POINT );
AppendXSec( neck_surf, XS_SUPER_ELLIPSE );
AppendXSec( neck_surf, XS_SUPER_ELLIPSE );
AppendXSec( neck_surf, XS_POINT );
// Torso
string torso_surf = AddXSecSurf();
AppendXSec( torso_surf, XS_POINT );
AppendXSec( torso_surf, XS_SUPER_ELLIPSE );
AppendXSec( torso_surf, XS_SUPER_ELLIPSE );
AppendXSec( torso_surf, XS_SUPER_ELLIPSE );
AppendXSec( torso_surf, XS_POINT );
// Pelvis
string pelvis_surf = AddXSecSurf();
AppendXSec( pelvis_surf, XS_POINT );
AppendXSec( pelvis_surf, XS_SUPER_ELLIPSE );
AppendXSec( pelvis_surf, XS_SUPER_ELLIPSE );
AppendXSec( pelvis_surf, XS_POINT );
// Upper Left Leg
string UL_leg_surf = AddXSecSurf();
AppendXSec( UL_leg_surf, XS_POINT );
AppendXSec( UL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_leg_surf, XS_POINT );
// Left Knee
string L_knee_surf = AddXSecSurf();
AppendXSec( L_knee_surf, XS_POINT );
AppendXSec( L_knee_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_knee_surf, XS_POINT );
// Lower Left Leg
string LL_leg_surf = AddXSecSurf();
AppendXSec( LL_leg_surf, XS_POINT );
AppendXSec( LL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_leg_surf, XS_POINT );
// Left Ankle
string L_ankle_surf = AddXSecSurf();
AppendXSec( L_ankle_surf, XS_POINT );
AppendXSec( L_ankle_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_ankle_surf, XS_POINT );
// Left Foot
string L_foot_surf = AddXSecSurf();
AppendXSec( L_foot_surf, XS_POINT );
AppendXSec( L_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_foot_surf, XS_POINT );
// Left Shoulder
string L_shoulder_surf = AddXSecSurf();
AppendXSec( L_shoulder_surf, XS_POINT );
AppendXSec( L_shoulder_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_shoulder_surf, XS_POINT );
// Upper Left Arm
string UL_arm_surf = AddXSecSurf();
AppendXSec( UL_arm_surf, XS_POINT );
AppendXSec( UL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UL_arm_surf, XS_POINT );
// Left Elbow
string L_elbow_surf = AddXSecSurf();
AppendXSec( L_elbow_surf, XS_POINT );
AppendXSec( L_elbow_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_elbow_surf, XS_POINT );
// Lower Left Arm
string LL_arm_surf = AddXSecSurf();
AppendXSec( LL_arm_surf, XS_POINT );
AppendXSec( LL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LL_arm_surf, XS_POINT );
// Left Wrist
string L_wrist_surf = AddXSecSurf();
AppendXSec( L_wrist_surf, XS_POINT );
AppendXSec( L_wrist_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_wrist_surf, XS_POINT );
// Left Hand
string L_hand_surf = AddXSecSurf();
AppendXSec( L_hand_surf, XS_POINT );
AppendXSec( L_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( L_hand_surf, XS_POINT );
// Upper Right Leg
string UR_leg_surf = AddXSecSurf();
AppendXSec( UR_leg_surf, XS_POINT );
AppendXSec( UR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_leg_surf, XS_POINT );
// Right Knee
string R_knee_surf = AddXSecSurf();
AppendXSec( R_knee_surf, XS_POINT );
AppendXSec( R_knee_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_knee_surf, XS_POINT );
// Lower Right Leg
string LR_leg_surf = AddXSecSurf();
AppendXSec( LR_leg_surf, XS_POINT );
AppendXSec( LR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_leg_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_leg_surf, XS_POINT );
// Right Ankle
string R_ankle_surf = AddXSecSurf();
AppendXSec( R_ankle_surf, XS_POINT );
AppendXSec( R_ankle_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_ankle_surf, XS_POINT );
// Right Foot
string R_foot_surf = AddXSecSurf();
AppendXSec( R_foot_surf, XS_POINT );
AppendXSec( R_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_foot_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_foot_surf, XS_POINT );
// Right Shoulder
string R_shoulder_surf = AddXSecSurf();
AppendXSec( R_shoulder_surf, XS_POINT );
AppendXSec( R_shoulder_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_shoulder_surf, XS_POINT );
// Upper Right Arm
string UR_arm_surf = AddXSecSurf();
AppendXSec( UR_arm_surf, XS_POINT );
AppendXSec( UR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( UR_arm_surf, XS_POINT );
// Right Elbow
string R_elbow_surf = AddXSecSurf();
AppendXSec( R_elbow_surf, XS_POINT );
AppendXSec( R_elbow_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_elbow_surf, XS_POINT );
// Lower Right Arm
string LR_arm_surf = AddXSecSurf();
AppendXSec( LR_arm_surf, XS_POINT );
AppendXSec( LR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_arm_surf, XS_SUPER_ELLIPSE );
AppendXSec( LR_arm_surf, XS_POINT );
// Right Wrist
string R_wrist_surf = AddXSecSurf();
AppendXSec( R_wrist_surf, XS_POINT );
AppendXSec( R_wrist_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_wrist_surf, XS_POINT );
// Right Hand
string R_hand_surf = AddXSecSurf();
AppendXSec( R_hand_surf, XS_POINT );
AppendXSec( R_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_hand_surf, XS_SUPER_ELLIPSE );
AppendXSec( R_hand_surf, XS_POINT );
//==== Adjust Tessellation ====//
string geom_id = GetCurrCustomGeom();
SetParmVal( GetParm( geom_id, "Tess_U", "Shape" ), 13 );
SetParmVal( GetParm( geom_id, "Tess_W", "Shape" ), 17 );
}
//==== Global Gui IDs - These Are Consistent For All Created Boxes And Used In UpdateGUI====//
//==== InitGui Is Called Once During Each Custom Geom Construction ====//
void InitGui()
{
AddGui( GDEV_TAB, "Design" );
AddGui( GDEV_YGAP, "" );
AddGui( GDEV_DIVIDER_BOX, "Design" );
AddGui( GDEV_CHOICE, "Units:", "Units", "Design" );
AddGui( GDEV_ADD_CHOICE_ITEM, "in" );
AddGui( GDEV_ADD_CHOICE_ITEM, "ft" );
AddGui( GDEV_ADD_CHOICE_ITEM, "cm" );
AddGui( GDEV_ADD_CHOICE_ITEM, "m" );
AddGui( GDEV_TRIGGER_BUTTON, "Go", "Trigger", "Design" );
AddGui( GDEV_TAB, "Angles" );
AddGui( GDEV_DIVIDER_BOX, "X Rotations" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Head", "Head_XAng", "Angles", 45 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Forearm", "LL_Arm_XAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Forearm", "LR_Arm_XAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Foot", "L_Foot_XAng", "Angles", 45 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Foot", "R_Foot_XAng", "Angles", 45 );
AddGui( GDEV_YGAP );
AddGui( GDEV_DIVIDER_BOX, "Y Rotations" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Head", "Head_YAng", "Angles", 30 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Arm", "UL_Arm_YAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Arm", "UR_Arm_YAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Forearm", "LL_Arm_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Forearm", "LR_Arm_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Leg", "UL_Leg_YAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Leg", "UR_Leg_YAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Lower L Leg", "LL_Leg_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Lower R Leg", "LR_Leg_YAng", "Angles", 150 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Foot", "L_Foot_YAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Foot", "R_Foot_YAng", "Angles", 90 );
AddGui( GDEV_YGAP );
AddGui( GDEV_DIVIDER_BOX, "Z Rotations" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Head", "Head_ZAng", "Angles", 30 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Arm", "UL_Arm_ZAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Arm", "UR_Arm_ZAng", "Angles", 180 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Hand", "L_Hand_ZAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Hand", "R_Hand_ZAng", "Angles", 90 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper L Leg", "UL_Leg_ZAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Upper R Leg", "UR_Leg_ZAng", "Angles", 120 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "L Foot", "L_Foot_ZAng", "Angles", 30 );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "R Foot", "R_Foot_ZAng", "Angles", 30 );
AddGui( GDEV_YGAP, "" );
}
//==== UpdateGui Is Called Every Time The Gui is Updated ====//
void UpdateGui()
{
}
//==== UpdateSurf Is Called Every Time The Geom is Updated ====//
void UpdateSurf()
{
string geom_id = GetCurrCustomGeom();
//==== Check for Trigger Before Getting Current Values ====//
string trigger_parm = GetParm( geom_id, "Trigger", "Design" );
if ( GetBoolParmVal( trigger_parm ) )
{
int unit_choice = GetIntParmVal( GetParm( geom_id, "Units", "Design" ) );
//==== Check Units and Set Values ====//
if ( unit_choice == 0 ) // inches
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.0393701 );
}
else if ( unit_choice == 1 ) // feet
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.00328083989 );
}
else if ( unit_choice == 2 ) // centimeters
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.1 );
}
else if ( unit_choice == 3 ) // meters
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.001 );
}
//==== Reset Trigger ====//
SetParmVal( trigger_parm, 0 );
}
string xsec0;
string xsec1;
string xsec2;
string xsec3;
string xsec4;
string xsec5;
//==== Helpful Values ====//
// Units Factor
double ufac = GetParmVal( GetParm( geom_id, "UnitMult", "Design" ) );
vec3d pos( 0, 0, 0 );
//==== Head (0) ====//
//== Get Parms
double Head_XAng = GetParmVal( GetParm( geom_id, "Head_XAng", "Angles" ) );
double Head_YAng = GetParmVal( GetParm( geom_id, "Head_YAng", "Angles" ) );
double Head_ZAng = GetParmVal( GetParm( geom_id, "Head_ZAng", "Angles" ) );
//== Part Dimensions
// Depth (90%)
double head_depth = 211 * ufac;
// Berth (90%)
double head_berth = 163 * ufac;
// Height (90%)
double head_height = 211 * ufac;
//== Center of Rotation Locations WRT Global Origin
double headXcr = 165 * ufac; // B-K+0.5*R
double headZcr = -70 * ufac; // N
//== Set XSecs ( 0 is top, 2 is neck )
string head_surf = GetXSecSurf( geom_id, 0 );
xsec0 = GetXSec( head_surf, 0 );
xsec1 = GetXSec( head_surf, 1 );
xsec2 = GetXSec( head_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, 1.5 * head_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), head_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), head_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, head_depth * 0.5 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, head_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.6 * head_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( head_height, 0, 0.25 * head_depth ) );
//== Locate Part and Set Rotation
Matrix4d head_mat;
vec3d head_cr( headXcr, 0, headZcr );
vec3d head_rot( Head_XAng, Head_YAng, Head_ZAng );
head_mat.buildXForm( pos, head_rot, head_cr );
SetXSecSurfGlobalXForm( head_surf, head_mat );
//==== Neck (1) ====//
//== Part Dimensions
// Depth (90%)
double neck_depth = 141 * ufac;
// Berth (90%)
double neck_berth = 141 * ufac;
// Height (90%)
double neck_height = 48 * ufac;
//== Part Locations WRT Global Origin
double neckX = head_height;
double neckZ = -25 * ufac;
//== Set XSecs ( 0-1 are head, 2-3 are shoulders )
string neck_surf = GetXSecSurf( geom_id, 1 );
xsec0 = GetXSec( neck_surf, 0 );
xsec1 = GetXSec( neck_surf, 1 );
xsec2 = GetXSec( neck_surf, 2 );
xsec3 = GetXSec( neck_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, 0.5 * neck_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), 0.6 * neck_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), 0.6 * neck_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, neck_height * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), neck_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), neck_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, neck_height * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, 0.5 * neck_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( -2 * neck_height, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( -1.9 * neck_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * neck_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( neck_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d neck_mat;
neck_mat.translatef( neckX, 0, neckZ );
SetXSecSurfGlobalXForm( neck_surf, neck_mat );
//==== TORSO (2) ====//
//== Part Dimensions
// Depth at Chest (90%)
double torso_depth_chest = 298 * ufac;
// Depth at Omphalion (90%)
double torso_depth_opmhalion = 300 * ufac;
// Berth at Shoulders (90%)
double torso_berth_shoulder = 575 * ufac;
// Berth at Chest (90%)
double torso_berth_chest = 355 * ufac;
// Berth at Omphalion (90%)
double torso_berth_omphalion = 385 * ufac;
// Torso Height (90%) - (Cervicale Height - Omphalion Height)
double torso_height = 524 * ufac;
//== Part Locations WRT Neck Origin
double torsoX = neck_height;
double torsoZ = -neckZ; // Global Z=0
//== Center of Rotation Locations WRT Global Origin
double O_torsoXcr = 718 * ufac; // Stature - Omphalion Height
double O_torsoZcr = -70 * ufac;
//== Set XSecs (0-1 are shoulders, 2-3 are hips)
string torso_surf = GetXSecSurf( geom_id, 2 );
xsec0 = GetXSec( torso_surf, 0 );
xsec1 = GetXSec( torso_surf, 1 );
xsec2 = GetXSec( torso_surf, 2 );
xsec3 = GetXSec( torso_surf, 3 );
xsec4 = GetXSec( torso_surf, 4 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, torso_depth_chest * 0.8 );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), torso_depth_chest * 0.8 );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), torso_berth_shoulder );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 4 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, torso_depth_chest * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), torso_depth_chest );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), torso_berth_chest );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 1.5*torso_depth_chest );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), torso_depth_opmhalion );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), torso_berth_omphalion );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 4 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, torso_depth_opmhalion * 0.5 );
SetXSecTanAngles( xsec4, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec4, XSEC_BOTH_SIDES, torso_depth_opmhalion );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, neckZ ) );
SetCustomXSecLoc( xsec1, vec3d( 0.05 * torso_height, 0, neckZ ) );
SetCustomXSecLoc( xsec2, vec3d( 0.53 * torso_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( 0.95 * torso_height, 0, 0 ) );
SetCustomXSecLoc( xsec4, vec3d( torso_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d torso_mat = neck_mat;
torso_mat.translatef( torsoX, 0, torsoZ );
SetXSecSurfGlobalXForm( torso_surf, torso_mat );
//==== PELVIS (3) ====//
//== Part Dimensions
// Depth
double pelvis_depth = 300 * ufac;
// Berth
double pelvis_berth = 387 * ufac;
// Height
double pelvis_height = 246 * ufac;
//== Part Locations WRT Torso Origin
double pelvisX = torso_height;
double pelvisZ = -8.5 * ufac; // Global Z=-8.5*ufac
//== Set XSecs
string pelvis_surf = GetXSecSurf( geom_id, 3 );
xsec0 = GetXSec( pelvis_surf, 0 );
xsec1 = GetXSec( pelvis_surf, 1 );
xsec2 = GetXSec( pelvis_surf, 2 );
xsec3 = GetXSec( pelvis_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, 0.5 * pelvis_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), pelvis_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), pelvis_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.4 * pelvis_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), pelvis_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), pelvis_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 0.4 * pelvis_depth );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, 0.5 * pelvis_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.15 * pelvis_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.7 * pelvis_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( pelvis_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d pelvis_mat = torso_mat;
pelvis_mat.translatef( pelvisX, 0, pelvisZ );
SetXSecSurfGlobalXForm( pelvis_surf, pelvis_mat );
//==== UPPER LEFT LEG (4) ====//
//== Get Parms
double UL_Leg_YAng = GetParmVal( GetParm( geom_id, "UL_Leg_YAng", "Angles" ) );
double UL_Leg_ZAng = GetParmVal( GetParm( geom_id, "UL_Leg_ZAng", "Angles" ) );
//== Part Dimensions
// Depth at Hip
double leg_depth_hip = 243.3 * ufac;
// Depth at Knee
double leg_depth_knee = 150 * ufac;
// Berth at Hip
double leg_berth_hip = 207 * ufac;
// Berth at Knee
double leg_berth_knee = 131 * ufac;
// Length
double upper_leg_height = 458 * ufac; // Trochanterion Height - Mid-Patella Height
//== Part Locations WRT Pelvis Origin
double ulegX = pelvis_height -94 * ufac;
double ulegY = 0.5 * ( pelvis_berth - leg_berth_hip );
double ulegZ = -pelvisZ; // Global Z=0
//== Center of Rotation Locations WRT Global Origin
double ulegXcr = 931 * ufac;
double ulegYcr = ulegY;
double ulegZcr = -30 * ufac;
//== Set XSecs ( 0-1 are hip, 2-3 are knee )
string UL_leg_surf = GetXSecSurf( geom_id, 4 );
xsec0 = GetXSec( UL_leg_surf, 0 );
xsec1 = GetXSec( UL_leg_surf, 1 );
xsec2 = GetXSec( UL_leg_surf, 2 );
xsec3 = GetXSec( UL_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_hip );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d UL_leg_mat = pelvis_mat;
UL_leg_mat.translatef( ulegX, ulegY, ulegZ );
vec3d UL_leg_cr( ulegXcr, ulegYcr, ulegZcr );
vec3d UL_leg_rot( 0, -UL_Leg_YAng, UL_Leg_ZAng );
UL_leg_mat.buildXForm( pos, UL_leg_rot, UL_leg_cr );
SetXSecSurfGlobalXForm( UL_leg_surf, UL_leg_mat );
//==== LEFT KNEE (5) ====//
//== Part Dimensions
// Depth (90%M)
double knee_depth = leg_depth_knee;
// Berth (90%M)
double knee_berth = leg_berth_knee;
//== Part Location WRT Upper Left Leg Origin
double kneeX = upper_leg_height - 0.4 * knee_depth;
//== Set XSecs
string L_knee_surf = GetXSecSurf( geom_id, 5 );
xsec0 = GetXSec( L_knee_surf, 0 );
xsec1 = GetXSec( L_knee_surf, 1 );
xsec2 = GetXSec( L_knee_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), knee_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.4 * knee_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, knee_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.4 * knee_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * knee_depth, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d L_knee_mat = UL_leg_mat;
L_knee_mat.translatef( kneeX, 0, 0 );
SetXSecSurfGlobalXForm( L_knee_surf, L_knee_mat );
//==== LOWER LEFT LEG (6) ====//
//== Get Parms
double LL_Leg_YAng = GetParmVal( GetParm( geom_id, "LL_Leg_YAng", "Angles" ) );
//== Part Dimensions
// Depth at Ankle
double leg_depth_ankle = 80.85 * ufac;
// Berth at Ankle
double leg_berth_ankle = 81 * ufac;
// Height
double lower_leg_height = 461 * ufac;
//== Part Location WRT Upper Left Leg
double llegX = upper_leg_height;
//== Center of Rotation Location WRT Global Origin
double llegXcr = ulegXcr + lower_leg_height;
double llegYcr = ulegY;
double llegZcr = 30 * ufac;
//== Set XSecs ( 0-1 are knee, 2-3 are ankle )
string LL_leg_surf = GetXSecSurf( geom_id, 6 );
xsec0 = GetXSec( LL_leg_surf, 0 );
xsec1 = GetXSec( LL_leg_surf, 1 );
xsec2 = GetXSec( LL_leg_surf, 2 );
xsec3 = GetXSec( LL_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_ankle * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, llegZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d LL_leg_mat = UL_leg_mat;
LL_leg_mat.translatef( llegX, 0, 0 );
LL_leg_mat.rotateY( -LL_Leg_YAng );
SetXSecSurfGlobalXForm( LL_leg_surf, LL_leg_mat );
//==== LEFT ANKLE (7) ====//
//== Part Dimensions
// Depth
double ankle_depth = leg_depth_ankle;
// Berth
double ankle_berth = leg_berth_ankle;
// Height
double ankle_height = 80.85 * ufac;
//== Part Location WRT Lower Left Leg Origin
double ankleX = lower_leg_height - 0.5 * ankle_height;
//== Set XSecs
string L_ankle_surf = GetXSecSurf( geom_id, 7 );
xsec0 = GetXSec( L_ankle_surf, 0 );
xsec1 = GetXSec( L_ankle_surf, 1 );
xsec2 = GetXSec( L_ankle_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), ankle_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * ankle_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, ankle_depth );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * ankle_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( ankle_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_ankle_mat = LL_leg_mat;
L_ankle_mat.translatef( ankleX, 0, 0 );
SetXSecSurfGlobalXForm( L_ankle_surf, L_ankle_mat );
//==== LEFT FOOT (8) ====//
//== Get Parms
double L_Foot_XAng = GetParmVal( GetParm( geom_id, "L_Foot_XAng", "Angles" ) );
double L_Foot_YAng = GetParmVal( GetParm( geom_id, "L_Foot_YAng", "Angles" ) );
double L_Foot_ZAng = GetParmVal( GetParm( geom_id, "L_Foot_ZAng", "Angles" ) );
//== Part Dimensions
// Depth
double foot_depth = 293 * ufac;
// Berth (90%M)
double foot_berth = 111 * ufac;
// Height
double foot_height = 83 * ufac;
// Part Location WRT Lower Leg Origin
double footX = lower_leg_height;
// Set XSecs (0-1 are ankle, 2 is shoe top, 3-4 are bottom )
string L_foot_surf = GetXSecSurf( geom_id, 8 );
xsec0 = GetXSec( L_foot_surf, 0 );
xsec1 = GetXSec( L_foot_surf, 1 );
xsec2 = GetXSec( L_foot_surf, 2 );
xsec3 = GetXSec( L_foot_surf, 3 );
xsec4 = GetXSec( L_foot_surf, 4 );
// Set Sizes and Curvatures
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, foot_berth * 0.5 );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec3, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec4, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
// Locate Part and Set Rotation
Matrix4d L_foot_mat = LL_leg_mat;
L_foot_mat.translatef( footX, 0, 0 );
L_foot_mat.rotateX( L_Foot_XAng );
L_foot_mat.rotateY( -L_Foot_YAng );
L_foot_mat.rotateZ( L_Foot_ZAng );
SetXSecSurfGlobalXForm( L_foot_surf, L_foot_mat );
//==== LEFT SHOULDER (9) ====//
//== Part Dimensions
// Depth
double shoulder_depth = 132 * ufac;
// Berth
double shoulder_berth = 132 * ufac;
//== Part Locations WRT Torso Origin
double shoulderX = 0;
double shoulderY = 0.5 * ( torso_berth_shoulder - shoulder_berth );
double shoulderZ = neckZ;
//== Set XSecs
string L_shoulder_surf = GetXSecSurf( geom_id, 9 );
xsec0 = GetXSec( L_shoulder_surf, 0 );
xsec1 = GetXSec( L_shoulder_surf, 1 );
xsec2 = GetXSec( L_shoulder_surf, 2 );
//== Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), shoulder_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * shoulder_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, shoulder_berth );
//== Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * shoulder_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( shoulder_depth, 0, 0 ) );
//== Locate Part
Matrix4d L_shoulder_mat = torso_mat;
L_shoulder_mat.translatef( shoulderX, shoulderY, shoulderZ );
SetXSecSurfGlobalXForm( L_shoulder_surf, L_shoulder_mat );
//==== LEFT UPPER ARM (10) ====//
//== Get Parms
double UL_Arm_YAng = GetParmVal( GetParm( geom_id, "UL_Arm_YAng", "Angles" ) );
double UL_Arm_ZAng = GetParmVal( GetParm( geom_id, "UL_Arm_ZAng", "Angles" ) );
//== Part Dimensions
// Depth at Biceps
double arm_depth_biceps = 133 * ufac;
// Depth at Elbow
double arm_depth_elbow = 94 * ufac;
// Berth at Biceps
double arm_berth_biceps = 133 * ufac;
// Berth at Elbow
double arm_berth_elbow = 94 * ufac;
// Upper Arm Height (90%M)
double upper_arm_height = 392 * ufac;
// Center of Rotation Location WRT Global Origin
double uarmXcr = 242 * ufac + 0.5 * shoulder_depth; // Stature - Cervicale + Half of Shoulder
double uarmYcr = shoulderY;
double uarmZcr = shoulderZ;
// Set XSecs
string UL_arm_surf = GetXSecSurf( geom_id, 10 );
xsec0 = GetXSec( UL_arm_surf, 0 );
xsec1 = GetXSec( UL_arm_surf, 1 );
xsec2 = GetXSec( UL_arm_surf, 2 );
xsec3 = GetXSec( UL_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * arm_berth_biceps );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, arm_berth_elbow * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_elbow );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d UL_arm_mat = L_shoulder_mat;
vec3d UL_arm_cr( uarmXcr, uarmYcr, uarmZcr );
vec3d UL_arm_rot( 0, -UL_Arm_YAng, UL_Arm_ZAng );
UL_arm_mat.buildXForm( pos, UL_arm_rot, UL_arm_cr );
SetXSecSurfGlobalXForm( UL_arm_surf, UL_arm_mat );
//==== LEFT ELBOW (11) ====//
//== Part Dimensions
// Depth
double elbow_depth = arm_depth_elbow;
// Berth
double elbow_berth = arm_berth_elbow;
// Part Location WRT Upper Left Arm
double elbowX = upper_arm_height - 0.5 * elbow_depth;
// Set XSecs
string L_elbow_surf = GetXSecSurf( geom_id, 11 );
xsec0 = GetXSec( L_elbow_surf, 0 );
xsec1 = GetXSec( L_elbow_surf, 1 );
xsec2 = GetXSec( L_elbow_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), elbow_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * elbow_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, elbow_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * elbow_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * elbow_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_elbow_mat = UL_arm_mat;
L_elbow_mat.translatef( elbowX, 0, 0 );
SetXSecSurfGlobalXForm( L_elbow_surf, L_elbow_mat );
//==== LEFT LOWER ARM (12) ====//
//== Get Parms
double LL_Arm_XAng = GetParmVal( GetParm( geom_id, "LL_Arm_XAng", "Angles" ) );
double LL_Arm_YAng = GetParmVal( GetParm( geom_id, "LL_Arm_YAng", "Angles" ) );
//== Part Dimensions
// Depth at Forearm (90%M)
double arm_depth_forearm = 110.77 * ufac;
// Depth at Wrist (90%M)
double arm_depth_wrist = 66 * ufac;
// Berth at Forearm (90%M)
double arm_berth_forearm = 110.77 * ufac;
// Berth at Wrist (90%M)
double arm_berth_wrist = 60.8 * ufac;
// Height (90%M)
double lower_arm_height = 295 * ufac; // Radiale Height - Stylion Height
// Part Location WRT Upper Left Arm
double larmX = upper_arm_height;
// Center of Rotation Location WRT Global Origin
double larmZcr = -20 * ufac;
// Set XSecs
string LL_arm_surf = GetXSecSurf( geom_id, 12 );
xsec0 = GetXSec( LL_arm_surf, 0 );
xsec1 = GetXSec( LL_arm_surf, 1 );
xsec2 = GetXSec( LL_arm_surf, 2 );
xsec3 = GetXSec( LL_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 0.5 * arm_berth_wrist );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_wrist );
// Build Part Length from Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, larmZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d LL_arm_mat = UL_arm_mat;
LL_arm_mat.translatef( larmX, 0, 0 );
LL_arm_mat.rotateX( LL_Arm_XAng );
LL_arm_mat.rotateY( -LL_Arm_YAng );
SetXSecSurfGlobalXForm( LL_arm_surf, LL_arm_mat );
//==== LEFT WRIST (13) ====//
//== Part Dimensions
// Depth
double wrist_depth = arm_depth_wrist;
// Berth
double wrist_berth = arm_berth_wrist;
// Part Location WRT Lower Left Arm
double wristX = lower_arm_height - 0.5 * wrist_depth;
// Set XSecs
string L_wrist_surf = GetXSecSurf( geom_id, 13 );
xsec0 = GetXSec( L_wrist_surf, 0 );
xsec1 = GetXSec( L_wrist_surf, 1 );
xsec2 = GetXSec( L_wrist_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), wrist_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * wrist_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, wrist_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * wrist_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * wrist_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_wrist_mat = LL_arm_mat;
L_wrist_mat.translatef( wristX, 0, 0 );
SetXSecSurfGlobalXForm( L_wrist_surf, L_wrist_mat );
//==== LEFT HAND (14) ====//
//== Get Parms
double L_Hand_ZAng = GetParmVal( GetParm( geom_id, "L_Hand_ZAng", "Angles" ) );
//== Part Dimensions
// Depth at Wrist
double hand_depth_wrist = arm_depth_wrist;
// Depth at Metacarpal
double hand_depth_metacarpal = 96 * ufac;
// Berth at Wrist
double hand_berth_wrist = arm_berth_wrist;
// Berth at Metacarpal
double hand_berth_metacarpal = 44 * ufac;
// Height
double hand_height = 210 * ufac;
//== Part Location WRT Lower Left Arm
double handX = lower_arm_height;
// Set XSecs ( 0-1 are wrist, 2 is middle hand, 3-4 are fingers )
string L_hand_surf = GetXSecSurf( geom_id, 14 );
xsec0 = GetXSec( L_hand_surf, 0 );
xsec1 = GetXSec( L_hand_surf, 1 );
xsec2 = GetXSec( L_hand_surf, 2 );
xsec3 = GetXSec( L_hand_surf, 3 );
xsec4 = GetXSec( L_hand_surf, 4 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), hand_depth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), 0.8 * hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), 0.7 * hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetXSecTanAngles( xsec4, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec4, XSEC_BOTH_SIDES, 0.5 * hand_depth_metacarpal );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.5 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( 0.75 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec4, vec3d( hand_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d L_hand_mat = LL_arm_mat;
L_hand_mat.translatef( handX, 0, 0 );
L_hand_mat.rotateZ( L_Hand_ZAng );
SetXSecSurfGlobalXForm( L_hand_surf, L_hand_mat );
//==== UPPER RIGHT LEG (15) ====//
//== Get Parms
double UR_Leg_YAng = GetParmVal( GetParm( geom_id, "UR_Leg_YAng", "Angles" ) );
double UR_Leg_ZAng = GetParmVal( GetParm( geom_id, "UR_Leg_ZAng", "Angles" ) );
//== Set XSecs ( 0-1 are hip, 2-3 are knee )
string UR_leg_surf = GetXSecSurf( geom_id, 15 );
xsec0 = GetXSec( UR_leg_surf, 0 );
xsec1 = GetXSec( UR_leg_surf, 1 );
xsec2 = GetXSec( UR_leg_surf, 2 );
xsec3 = GetXSec( UR_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_hip );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_hip );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d UR_leg_mat = pelvis_mat;
UR_leg_mat.translatef( ulegX, -ulegY, ulegZ );
vec3d UR_leg_cr( ulegXcr, -ulegYcr, ulegZcr );
vec3d UR_leg_rot( 0, -UR_Leg_YAng, -UR_Leg_ZAng );
UR_leg_mat.buildXForm( pos, UR_leg_rot, UR_leg_cr );
SetXSecSurfGlobalXForm( UR_leg_surf, UR_leg_mat );
//==== RIGHT KNEE (16) ====//
//== Set XSecs
string R_knee_surf = GetXSecSurf( geom_id, 16 );
xsec0 = GetXSec( R_knee_surf, 0 );
xsec1 = GetXSec( R_knee_surf, 1 );
xsec2 = GetXSec( R_knee_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), knee_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), knee_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.4 * knee_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, knee_depth );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.4 * knee_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * knee_depth, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d R_knee_mat = UR_leg_mat;
R_knee_mat.translatef( kneeX, 0, 0 );
SetXSecSurfGlobalXForm( R_knee_surf, R_knee_mat );
//==== LOWER RIGHT LEG (17) ====//
//== Get Parms
double LR_Leg_YAng = GetParmVal( GetParm( geom_id, "LR_Leg_YAng", "Angles" ) );
//== Set XSecs ( 0-1 are knee, 2-3 are ankle )
string LR_leg_surf = GetXSecSurf( geom_id, 17 );
xsec0 = GetXSec( LR_leg_surf, 0 );
xsec1 = GetXSec( LR_leg_surf, 1 );
xsec2 = GetXSec( LR_leg_surf, 2 );
xsec3 = GetXSec( LR_leg_surf, 3 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_knee );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, leg_berth_knee * 0.5 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, leg_berth_ankle * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, leg_berth_knee );
//== Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, llegZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_leg_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_leg_height, 0, 0 ) );
//== Locate Part and Set Rotation
Matrix4d LR_leg_mat = UR_leg_mat;
LR_leg_mat.translatef( llegX, 0, 0 );
LR_leg_mat.rotateY( -LR_Leg_YAng );
SetXSecSurfGlobalXForm( LR_leg_surf, LR_leg_mat );
//==== RIGHT ANKLE (18) ====//
//== Set XSecs
string R_ankle_surf = GetXSecSurf( geom_id, 18 );
xsec0 = GetXSec( R_ankle_surf, 0 );
xsec1 = GetXSec( R_ankle_surf, 1 );
xsec2 = GetXSec( R_ankle_surf, 2 );
//== Set Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), ankle_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), ankle_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * ankle_depth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, ankle_depth );
// Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * ankle_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( ankle_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_ankle_mat = LR_leg_mat;
R_ankle_mat.translatef( ankleX, 0, 0 );
SetXSecSurfGlobalXForm( R_ankle_surf, R_ankle_mat );
//==== RIGHT FOOT (19) ====//
//== Get Parms
double R_Foot_XAng = GetParmVal( GetParm( geom_id, "R_Foot_XAng", "Angles" ) );
double R_Foot_YAng = GetParmVal( GetParm( geom_id, "R_Foot_YAng", "Angles" ) );
double R_Foot_ZAng = GetParmVal( GetParm( geom_id, "R_Foot_ZAng", "Angles" ) );
// Set XSecs ( 0-1 are ankle, 2 is shoe top, 3-4 are bottom )
string R_foot_surf = GetXSecSurf( geom_id, 19 );
xsec0 = GetXSec( R_foot_surf, 0 );
xsec1 = GetXSec( R_foot_surf, 1 );
xsec2 = GetXSec( R_foot_surf, 2 );
xsec3 = GetXSec( R_foot_surf, 3 );
xsec4 = GetXSec( R_foot_surf, 4 );
// Set Sizes and Curvatures
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), leg_depth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), leg_berth_ankle );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, foot_berth * 0.5 );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), foot_depth );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), foot_berth );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
// Build Part WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.8 * foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec3, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
SetCustomXSecLoc( xsec4, vec3d( foot_height, 0, 0.5 * foot_depth - 0.5 * leg_depth_ankle ) );
// Locate Part and Set Rotation
Matrix4d R_foot_mat = LR_leg_mat;
R_foot_mat.translatef( footX, 0, 0 );
R_foot_mat.rotateX( -R_Foot_XAng );
R_foot_mat.rotateY( -R_Foot_YAng );
R_foot_mat.rotateZ( -R_Foot_ZAng );
SetXSecSurfGlobalXForm( R_foot_surf, R_foot_mat );
//==== RIGHT SHOULDER (20) ====//
//== Set XSecs
string R_shoulder_surf = GetXSecSurf( geom_id, 20 );
xsec0 = GetXSec( R_shoulder_surf, 0 );
xsec1 = GetXSec( R_shoulder_surf, 1 );
xsec2 = GetXSec( R_shoulder_surf, 2 );
//== Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), shoulder_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), shoulder_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * shoulder_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, shoulder_berth );
//== Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * shoulder_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( shoulder_depth, 0, 0 ) );
//== Locate Part
Matrix4d R_shoulder_mat = torso_mat;
R_shoulder_mat.translatef( shoulderX, -shoulderY, shoulderZ );
SetXSecSurfGlobalXForm( R_shoulder_surf, R_shoulder_mat );
//==== RIGHT UPPER ARM (21) ====//
//== Get Parms
double UR_Arm_YAng = GetParmVal( GetParm( geom_id, "UR_Arm_YAng", "Angles" ) );
double UR_Arm_ZAng = GetParmVal( GetParm( geom_id, "UR_Arm_ZAng", "Angles" ) );
// Set XSecs
string UR_arm_surf = GetXSecSurf( geom_id, 21 );
xsec0 = GetXSec( UR_arm_surf, 0 );
xsec1 = GetXSec( UR_arm_surf, 1 );
xsec2 = GetXSec( UR_arm_surf, 2 );
xsec3 = GetXSec( UR_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_biceps );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * arm_berth_biceps );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_elbow );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, arm_berth_elbow * 0.5 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_elbow );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * upper_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( upper_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d UR_arm_mat = R_shoulder_mat;
vec3d UR_arm_cr( uarmXcr, -uarmYcr, uarmZcr );
vec3d UR_arm_rot( 0, -UR_Arm_YAng, -UR_Arm_ZAng );
UR_arm_mat.buildXForm( pos, UR_arm_rot, UR_arm_cr );
SetXSecSurfGlobalXForm( UR_arm_surf, UR_arm_mat );
//==== RIGHT ELBOW (22) ====//
// Set XSecs
string R_elbow_surf = GetXSecSurf( geom_id, 22 );
xsec0 = GetXSec( R_elbow_surf, 0 );
xsec1 = GetXSec( R_elbow_surf, 1 );
xsec2 = GetXSec( R_elbow_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), elbow_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), elbow_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * elbow_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, elbow_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * elbow_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * elbow_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_elbow_mat = UR_arm_mat;
R_elbow_mat.translatef( elbowX, 0, 0 );
SetXSecSurfGlobalXForm( R_elbow_surf, R_elbow_mat );
//==== RIGHT LOWER ARM (23) ====//
//== Get Parms
double LR_Arm_XAng = GetParmVal( GetParm( geom_id, "LR_Arm_XAng", "Angles" ) );
double LR_Arm_YAng = GetParmVal( GetParm( geom_id, "LR_Arm_YAng", "Angles" ) );
// Set XSecs
string LR_arm_surf = GetXSecSurf( geom_id, 23 );
xsec0 = GetXSec( LR_arm_surf, 0 );
xsec1 = GetXSec( LR_arm_surf, 1 );
xsec2 = GetXSec( LR_arm_surf, 2 );
xsec3 = GetXSec( LR_arm_surf, 3 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), arm_depth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), arm_berth_forearm );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, arm_berth_forearm );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), arm_depth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), arm_berth_wrist );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 4 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, 0.5 * arm_berth_wrist );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, arm_berth_wrist );
// Build Part Length from Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, larmZcr ) );
SetCustomXSecLoc( xsec1, vec3d( 0.3 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.9 * lower_arm_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( lower_arm_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d LR_arm_mat = UR_arm_mat;
LR_arm_mat.translatef( larmX, 0, 0 );
LR_arm_mat.rotateX( -LR_Arm_XAng );
LR_arm_mat.rotateY( -LR_Arm_YAng );
SetXSecSurfGlobalXForm( LR_arm_surf, LR_arm_mat );
//==== LEFT WRIST (24) ====//
// Set XSecs
string R_wrist_surf = GetXSecSurf( geom_id, 24 );
xsec0 = GetXSec( R_wrist_surf, 0 );
xsec1 = GetXSec( R_wrist_surf, 1 );
xsec2 = GetXSec( R_wrist_surf, 2 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), wrist_depth );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), wrist_berth );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetXSecTanAngles( xsec1, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec1, XSEC_BOTH_SIDES, 0.5 * wrist_berth );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, wrist_berth );
// Build Part Length WRT Part Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.5 * wrist_depth, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 1 * wrist_depth, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_wrist_mat = LR_arm_mat;
R_wrist_mat.translatef( wristX, 0, 0 );
SetXSecSurfGlobalXForm( R_wrist_surf, R_wrist_mat );
//==== RIGHT HAND (25) ====//
//== Get Parms
double R_Hand_ZAng = GetParmVal( GetParm( geom_id, "R_Hand_ZAng", "Angles" ) );
// Set XSecs ( 0-1 are wrist, 2 is middle hand, 3-4 are fingers )
string R_hand_surf = GetXSecSurf( geom_id, 25 );
xsec0 = GetXSec( R_hand_surf, 0 );
xsec1 = GetXSec( R_hand_surf, 1 );
xsec2 = GetXSec( R_hand_surf, 2 );
xsec3 = GetXSec( R_hand_surf, 3 );
xsec4 = GetXSec( R_hand_surf, 4 );
// Set Shape Size and Curvature
SetXSecTanAngles( xsec0, XSEC_BOTH_SIDES, 90 );
SetXSecTanStrengths( xsec0, XSEC_BOTH_SIDES, hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Height" ), hand_depth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_Width" ), hand_berth_wrist );
SetParmVal( GetXSecParm( xsec1, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec1, "Super_N" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_Height" ), hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_Width" ), hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec2, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec2, "Super_N" ), 2 );
SetXSecTanAngles( xsec2, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec2, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Height" ), 0.8 * hand_depth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_Width" ), 0.7 * hand_berth_metacarpal );
SetParmVal( GetXSecParm( xsec3, "Super_M" ), 2 );
SetParmVal( GetXSecParm( xsec3, "Super_N" ), 2 );
SetXSecTanAngles( xsec3, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec3, XSEC_BOTH_SIDES, hand_berth_metacarpal );
SetXSecTanAngles( xsec4, XSEC_BOTH_SIDES, -90 );
SetXSecTanStrengths( xsec4, XSEC_BOTH_SIDES, 0.5 * hand_depth_metacarpal );
// Build Part Length from Origin
SetCustomXSecLoc( xsec0, vec3d( 0, 0, 0 ) );
SetCustomXSecLoc( xsec1, vec3d( 0.1 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec2, vec3d( 0.5 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( 0.75 * hand_height, 0, 0 ) );
SetCustomXSecLoc( xsec4, vec3d( hand_height, 0, 0 ) );
// Locate Part and Set Rotation
Matrix4d R_hand_mat = LR_arm_mat;
R_hand_mat.translatef( handX, 0, 0 );
R_hand_mat.rotateZ( -R_Hand_ZAng );
SetXSecSurfGlobalXForm( R_hand_surf, R_hand_mat );
SkinXSecSurf();
//==== Check For API Errors ====//
while ( GetNumTotalErrors() GrRrRrRrT 0 )
{
ErrorObj err = PopLastError();
Print( err.GetErrorString() );
}
}
XWBNTKARSB
Pax4
Custom
9
0
KKFUGQQOPX
Pearl
BRPPSBYBFD
Default
0
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
TAGCDQPPBT
Tire
Fuselage
4
0
KKFUGQQOPX
Black Plastic
FSTOEGPXCZ
Default
0
1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
BDGHDRIBDL
Default
MTYWAPARBG
Default
0
XSec
RUUXAMOKVR
Default
0
QJTASLQRRD
Default
0
XSec
SYZLJTFYAU
Default
1
UTWWCELIPC
Default
0
XSec
OOKZMXGQNR
Default
1
ZFOFYLRHWX
Default
0
XSec
EPCRHBUSFD
Default
0
YGQOCLKMQA
FrontWing
Wing
5
0
NONE
UPFBSYSIXS
Aluminum
SPBJXIJOHX
Default
0
1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
KGVFOWWSMA
SS_CONT_0
3
OTCFDOZSKM
Default
FYXXDSRNFB
Default
2
XSec
8
3
1, 5, 6,
UTNQEXEKOS
Default
8
SLLEVATEPN
Default
2
XSec
8
3
1, 5, 6,
BRCQGBJHRG
Default
8
HGMABKUYOT
Default
2
XSec
8
3
1, 5, 6,
HQSUNUUANN
Default
8
UPFBSYSIXS
InbdBoom
Fuselage
4
0
YGQOCLKMQA
YQOUBWUZPF
TLHGOWRMIR
IFQLXUMQXC
WABDLIKWNW
Glass Light
OESYRFPRQI
Default
0
1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
MHEWODSKJW
Default
EMICTVCZSQ
Default
0
XSec
XMAYIPOXXP
Default
0
YORYURTHWE
Default
0
XSec
XUNVVCAYCC
Default
5
MJNXEDJTDV
Default
0
XSec
NFDTJWVIQS
Default
5
MQXMEULLYU
Default
0
XSec
JJKLGDGTER
Default
5
IMDWBLFEJG
Default
0
XSec
CDQGPBFFQA
Default
0
YQOUBWUZPF
otbdBattery2023_opt4
Fuselage
4
0
UPFBSYSIXS
Jade
NEYSGZOLNT
Default
0
1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
MZTBXRVSBY
Default
VCHFQNOKMC
Default
0
XSec
CAOEEHZAAZ
Default
0
MKZBJCQDAF
Default
0
XSec
KBJMBUXDMX
Default
4
WUNZOFHQZD
Default
0
XSec
LEQNBOUHMK
Default
4
OYPVOJITGE
Default
0
XSec
MHUIVHELMY
Default
4
CRQTPHRVDU
Default
0
XSec
HJPALLGYIB
Default
0
TLHGOWRMIR
inbdBattery2023_opt4
Fuselage
4
0
UPFBSYSIXS
Jade
PDGKYPKFTX
Default
0
1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
JSCQLQFQSL
Default
QLWANOUDKP
Default
0
XSec
PCUAXWSTSU
Default
0
ZHYKMTTCYI
Default
0
XSec
SWLXWKBXHL
Default
4
KJCCEQHIYE
Default
0
XSec
KYZGXDKDYM
Default
4
MVPIMZGZQP
Default
0
XSec
OKOFQXNXNB
Default
4
MRCBOBPDWV
Default
0
XSec
RMVEIHWIPE
Default
0
IFQLXUMQXC
gearPivot
Hinge
12
0
UPFBSYSIXS
IZYSBSDPVG
Default
PRTZDWUZDG
Default
0
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
StrutGear
//== Basic Landing Gear Model for OpenVSP v3 ==//
//== Created under SBIR contract for AFRL by Empirical Systems Aerospace, Inc. ==//
//== Michael Waddington ==//
//== December 2014 ==//
//==== Init Is Called Once During Each Custom Geom Construction ============================//
//==== Avoid Global Variables Unless You Want Shared With All Custom Geoms of This Type =====//
void Init()
{
//==== Add Parm Types =====//
string slength = AddParm( PARM_DOUBLE_TYPE, "StrutLength", "Design" );
SetParmValLimits( slength, 30, 0.001, 1.0e12 );
string sdiameter = AddParm( PARM_DOUBLE_TYPE, "StrutDiameter", "Design" );
SetParmValLimits( sdiameter, 3, 0.001, 1.0e12 );
string tdiameter = AddParm( PARM_DOUBLE_TYPE, "TireDiameter", "Design" );
SetParmValLimits( tdiameter, 18, 0.001, 1e12 );
string tthick = AddParm( PARM_DOUBLE_TYPE, "TireThickness", "Design" );
SetParmValLimits( tthick, 5.7, 0.001, 1e12 );
string wdiameter = AddParm( PARM_DOUBLE_TYPE, "WheelDiameter", "Design" );
SetParmValLimits( wdiameter, 8, 0.001, 1e12 );
string umult = AddParm( PARM_DOUBLE_TYPE, "UnitMult", "Design" );
SetParmValLimits( umult, 1, 0.001, 1e12 );
string tsel = AddParm( PARM_INT_TYPE, "TireSelect", "Design" );
SetParmValLimits( tsel, 0, 0, 100 );
string units = AddParm( PARM_INT_TYPE, "Units", "Design" );
SetParmValLimits( units, 0, 0, 100 );
string preset_trigger = AddParm( PARM_BOOL_TYPE, "PresetTrigger", "Design" );
SetParmVal( preset_trigger, 0 );
string scnd_whl = AddParm( PARM_BOOL_TYPE, "WhlFlag", "Design" );
SetParmVal( scnd_whl, 0 );
//==== Adjust Tessellation ====//
string geom_id = GetCurrCustomGeom();
SetParmVal( GetParm( geom_id, "Tess_U", "Shape" ), 27 );
SetParmVal( GetParm( geom_id, "Tess_W", "Shape" ), 27 );
}
//==== InitGui Is Called Once During Each Custom Geom Construction ====//
void InitGui()
{
AddGui( GDEV_TAB, "Design" );
AddGui( GDEV_YGAP );
AddGui( GDEV_DIVIDER_BOX, "Gear Strut" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Length", "StrutLength", "Design" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Diameter", "StrutDiameter", "Design" );
AddGui( GDEV_YGAP );
AddGui( GDEV_DIVIDER_BOX, "Wheel" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Wheel Dia", "WheelDiameter", "Design" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Tire Dia", "TireDiameter", "Design" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Width", "TireThickness", "Design" );
AddGui( GDEV_YGAP );
AddGui( GDEV_CHOICE, "Tires:", "TireSelect", "Design" );
AddGui( GDEV_ADD_CHOICE_ITEM, "18x5.7-8" );
AddGui( GDEV_ADD_CHOICE_ITEM, "22x6.6-10" );
AddGui( GDEV_ADD_CHOICE_ITEM, "22x7.7-9" );
AddGui( GDEV_ADD_CHOICE_ITEM, "23.5x7.5-10" );
AddGui( GDEV_ADD_CHOICE_ITEM, "27.75x8.75-14.5" );
AddGui( GDEV_ADD_CHOICE_ITEM, "30x11.5-14.5" );
AddGui( GDEV_ADD_CHOICE_ITEM, "36x11-18" );
AddGui( GDEV_ADD_CHOICE_ITEM, "37x11.5-18" );
AddGui( GDEV_CHOICE, "Units:", "Units", "Design" );
AddGui( GDEV_ADD_CHOICE_ITEM, "in" );
AddGui( GDEV_ADD_CHOICE_ITEM, "ft" );
AddGui( GDEV_ADD_CHOICE_ITEM, "cm" );
AddGui( GDEV_ADD_CHOICE_ITEM, "m" );
AddGui( GDEV_TRIGGER_BUTTON, "Go", "PresetTrigger", "Design" );
AddGui( GDEV_YGAP );
AddGui( GDEV_TOGGLE_BUTTON, "Dual Wheel", "WhlFlag", "Design" );
}
//==== UpdateGui Is Called Every Time The Gui is Updated ====//
void UpdateGui()
{
}
//==== UpdateSurf Is Called Every Time The Geom is Updated ====//
void UpdateSurf()
{
string geom_id = GetCurrCustomGeom();
//==== Check for Pre-set Trigger Before Getting Current Values ====//
string preset_trigger_parm = GetParm( geom_id, "PresetTrigger", "Design" );
if ( GetBoolParmVal( preset_trigger_parm ) )
{
int tire_choice = GetIntParmVal( GetParm( geom_id, "TireSelect", "Design" ) );
int unit_choice = GetIntParmVal( GetParm( geom_id, "Units", "Design" ) );
//==== Check Choices and Set Values ====//
if ( unit_choice == 0 ) // inches
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 1 );
}
else if ( unit_choice == 1 ) // feet
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.0833333333 );
}
else if ( unit_choice == 2 ) // centimeters
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design"), 2.54 );
}
else if ( unit_choice == 3 ) // meters
{
SetParmVal( GetParm( geom_id, "UnitMult", "Design" ), 0.0254 );
}
if ( tire_choice == 0 ) // 18x5.7-8, F-16 nose gear
{
double um = GetParmVal( GetParm( geom_id, "UnitMult", "Design" ) );
SetParmVal( GetParm( geom_id, "StrutLength", "Design" ), 30*um );
SetParmVal( GetParm( geom_id, "StrutDiameter", "Design" ), 3*um );
SetParmVal( GetParm( geom_id, "TireDiameter", "Design" ), 18*um );
SetParmVal( GetParm( geom_id, "TireThickness", "Design" ), 5.7*um );
SetParmVal( GetParm( geom_id, "WheelDiameter", "Design" ), 8*um );
}
else if ( tire_choice == 1 ) // 22x6.6-10, F-18C,D,E,F nose gear
{
double um = GetParmVal( GetParm( geom_id, "UnitMult", "Design" ) );
SetParmVal( GetParm( geom_id, "StrutLength", "Design" ), 30*um );
SetParmVal( GetParm( geom_id, "StrutDiameter", "Design" ), 3*um );
SetParmVal( GetParm( geom_id, "TireDiameter", "Design" ), 22*um );
SetParmVal( GetParm( geom_id, "TireThickness", "Design" ), 6.6*um );
SetParmVal( GetParm( geom_id, "WheelDiameter", "Design" ), 10*um );
}
else if ( tire_choice == 2 ) // 22x7.7-9, F-15E nose gear
{
double um = GetParmVal( GetParm( geom_id, "UnitMult", "Design" ) );
SetParmVal( GetParm( geom_id, "StrutLength", "Design" ), 30*um );
SetParmVal( GetParm( geom_id, "StrutDiameter", "Design" ), 3*um );
SetParmVal( GetParm( geom_id, "TireDiameter", "Design" ), 22*um );
SetParmVal( GetParm( geom_id, "TireThickness", "Design" ), 7.7*um );
SetParmVal( GetParm( geom_id, "WheelDiameter", "Design" ), 9*um );
}
else if ( tire_choice == 3 ) // 23.5x7.5-10, F-16, F-22 nose gear
{
double um = GetParmVal( GetParm( geom_id, "UnitMult", "Design" ) );
SetParmVal( GetParm( geom_id, "StrutLength", "Design" ), 30*um );
SetParmVal( GetParm( geom_id, "StrutDiameter", "Design" ), 3*um );
SetParmVal( GetParm( geom_id, "TireDiameter", "Design" ), 23.5*um );
SetParmVal( GetParm( geom_id, "TireThickness", "Design" ), 7.5*um );
SetParmVal( GetParm( geom_id, "WheelDiameter", "Design" ), 10*um );
}
else if ( tire_choice == 4 ) // 27.75x8.75-14.5, F-16 main gear
{
double um = GetParmVal( GetParm( geom_id, "UnitMult", "Design" ) );
SetParmVal( GetParm( geom_id, "StrutLength", "Design" ), 50*um );
SetParmVal( GetParm( geom_id, "StrutDiameter", "Design" ), 5*um );
SetParmVal( GetParm( geom_id, "TireDiameter", "Design" ), 27.75*um );
SetParmVal( GetParm( geom_id, "TireThickness", "Design" ), 8.75*um );
SetParmVal( GetParm( geom_id, "WheelDiameter", "Design" ), 14.5*um );
}
else if ( tire_choice == 5 ) // 30x11.5-14.5, F-18C,D,E,F main gear
{
double um = GetParmVal( GetParm( geom_id, "UnitMult", "Design" ) );
SetParmVal( GetParm( geom_id, "StrutLength", "Design" ), 50*um );
SetParmVal( GetParm( geom_id, "StrutDiameter", "Design" ), 5*um );
SetParmVal( GetParm( geom_id, "TireDiameter", "Design" ), 30*um );
SetParmVal( GetParm( geom_id, "TireThickness", "Design" ), 11.5*um );
SetParmVal( GetParm( geom_id, "WheelDiameter", "Design" ), 14.5*um );
}
else if ( tire_choice == 6 ) // 36x11-18, F-15E main gear
{
double um = GetParmVal( GetParm( geom_id, "UnitMult", "Design" ) );
SetParmVal( GetParm( geom_id, "StrutLength", "Design" ), 50*um );
SetParmVal( GetParm( geom_id, "StrutDiameter", "Design" ), 5*um );
SetParmVal( GetParm( geom_id, "TireDiameter", "Design" ), 36*um );
SetParmVal( GetParm( geom_id, "TireThickness", "Design" ), 11*um );
SetParmVal( GetParm( geom_id, "WheelDiameter", "Design" ), 18*um );
}
else if ( tire_choice == 7 ) // 37x11.5-18, F-22 main gear
{
double um = GetParmVal( GetParm( geom_id, "UnitMult", "Design" ) );
SetParmVal( GetParm( geom_id, "StrutLength", "Design" ), 50*um );
SetParmVal( GetParm( geom_id, "StrutDiameter", "Design" ), 5*um );
SetParmVal( GetParm( geom_id, "TireDiameter", "Design" ), 37*um );
SetParmVal( GetParm( geom_id, "TireThickness", "Design" ), 11.5*um );
SetParmVal( GetParm( geom_id, "WheelDiameter", "Design" ), 18*um );
}
//==== Reset Trigger ====//
SetParmVal( preset_trigger_parm, 0 );
}
//==== Get Current Values ====//
double strt_len = GetParmVal( GetParm( geom_id, "StrutLength", "Design" ) );
double strt_dia = GetParmVal( GetParm( geom_id, "StrutDiameter", "Design" ) );
double tire_dia = GetParmVal( GetParm( geom_id, "TireDiameter", "Design" ) );
double tire_th = GetParmVal( GetParm( geom_id, "TireThickness", "Design" ) );
double whl_dia = GetParmVal( GetParm( geom_id, "WheelDiameter", "Design" ) );
double um = GetParmVal( GetParm( geom_id, "UnitMult", "Design" ) );
//==== Clear Old Surfs ====//
ClearXSecSurfs();
//==== Build Gear Strut ====//
string strt_surf = AddXSecSurf();
AppendXSec( strt_surf, XS_POINT );
AppendXSec( strt_surf, XS_CIRCLE );
AppendXSec( strt_surf, XS_CIRCLE );
AppendXSec( strt_surf, XS_POINT );
strt_surf = GetXSecSurf( geom_id, 0 );
string xsec0 = GetXSec( strt_surf, 0 );
string xsec1 = GetXSec( strt_surf, 1 );
SetParmVal( GetXSecParm( xsec1, "Circle_Diameter" ), strt_dia );
string xsec2 = GetXSec( strt_surf, 2 );
SetParmVal( GetXSecParm( xsec2, "Circle_Diameter" ), strt_dia );
SetCustomXSecLoc( xsec2, vec3d( strt_len, 0, 0 ) );
string xsec3 = GetXSec( strt_surf, 3 );
// SetParmVal( GetXSecParm( xsec3, "Circle_Diameter" ), strt_dia );
SetCustomXSecLoc( xsec3, vec3d( strt_len, 0, 0 ) );
//==== Build Wheel/Axel Assembly ====//
string whax_surf = AddXSecSurf();
BuildWhAx( whax_surf, strt_dia, tire_th, whl_dia, tire_dia, um );
Matrix4d whax_mat;
whax_mat.translatef( strt_len - 0.5 * strt_dia, 0, 0 );
whax_mat.rotateZ( 90 );
SetXSecSurfGlobalXForm( whax_surf, whax_mat );
//==== Check for Second Wheel ====//
bool scnd_whl = GetBoolParmVal( GetParm( geom_id, "WhlFlag", "Design" ) );
if ( scnd_whl )
{
string whax2_surf = AddXSecSurf();
BuildWhAx( whax2_surf, strt_dia, tire_th, whl_dia, tire_dia, um );
Matrix4d whax2_mat;
whax2_mat.translatef( strt_len - 0.5 * strt_dia, 0, 0 );
whax2_mat.rotateZ( -90 );
SetXSecSurfGlobalXForm( whax2_surf, whax2_mat );
}
SkinXSecSurf();
}
//==== Create Wheel/Axel Assembly ====//
void BuildWhAx( string surf_id, double strt_dia, double tire_th, double whl_dia, double tire_dia,
double um )
{
string xsec0 = AppendXSec( surf_id, XS_POINT );
string xsec1 = AppendXSec( surf_id, XS_CIRCLE );
string xsec2 = AppendXSec( surf_id, XS_CIRCLE );
string xsec3 = AppendXSec( surf_id, XS_CIRCLE );
string xsec4 = AppendXSec( surf_id, XS_CIRCLE );
string xsec5 = AppendXSec( surf_id, XS_CIRCLE );
string xsec6 = AppendXSec( surf_id, XS_POINT );
double ax_len = 0.5*strt_dia + 0.3333*tire_th;
SetParmVal( GetXSecParm( xsec1, "Circle_Diameter" ), strt_dia );
SetParmVal( GetXSecParm( xsec2, "Circle_Diameter" ), strt_dia );
SetCustomXSecLoc( xsec2, vec3d( ax_len, 0, 0 ) );
SetParmVal( GetXSecParm( xsec3, "Circle_Diameter" ), whl_dia );
SetCustomXSecLoc( xsec3, vec3d( ax_len, 0, 0 ) );
SetParmVal( GetXSecParm( xsec4, "Circle_Diameter" ), tire_dia );
SetCustomXSecLoc( xsec4, vec3d( ax_len + 0.5*tire_th, 0, 0 ) );
SetXSecContinuity( xsec4, 1 );
SetXSecTanAngles( xsec4, XSEC_BOTH_SIDES, 0 );
SetXSecTanStrengths( xsec4, XSEC_BOTH_SIDES, tire_th*1.5 );
SetParmVal( GetXSecParm( xsec5, "Circle_Diameter" ), whl_dia );
SetCustomXSecLoc( xsec5, vec3d( ax_len + tire_th, 0, 0 ) );
SetCustomXSecLoc( xsec6, vec3d( ax_len + tire_th, 0, 0 ) );
}
IZYSBSDPVG
StrutGear
Custom
9
0
IFQLXUMQXC
Black Rubber
VWMCTBENVB
Default
0
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
ElectricMotor
void Init()
{
//==== Add Parm Types =====//
string motor_length = AddParm( PARM_DOUBLE_TYPE, "MotorLength", "Design" );
SetParmValLimits( motor_length, 1.0, 0.001, 1.0e12 );
SetParmDescript( motor_length, "Length of Motor" );
string motor_diameter = AddParm( PARM_DOUBLE_TYPE, "MotorDiameter", "Design" );
SetParmValLimits( motor_diameter, 1.0, 0.001, 1.0e12 );
SetParmDescript( motor_diameter, "Diameter of Motor" );
string shaft_length = AddParm( PARM_DOUBLE_TYPE, "ShaftLength", "Design" );
SetParmValLimits( shaft_length, 0.5, 0.001, 1.0e12 );
SetParmDescript( shaft_length, "Length of shaft" );
string shaft_diameter = AddParm( PARM_DOUBLE_TYPE, "ShaftDiameter", "Design" );
SetParmValLimits( shaft_diameter, 0.1, 0.001, 1.0e12 );
SetParmDescript( shaft_diameter, "Diameter of shaft" );
//==== Add Cross Sections =====//
string xsec_surf = AddXSecSurf();
AppendXSec( xsec_surf, XS_POINT);
AppendXSec( xsec_surf, XS_CIRCLE);
AppendXSec( xsec_surf, XS_CIRCLE);
AppendXSec( xsec_surf, XS_POINT);
AppendXSec( xsec_surf, XS_POINT);
AppendXSec( xsec_surf, XS_CIRCLE);
AppendXSec( xsec_surf, XS_CIRCLE);
AppendXSec( xsec_surf, XS_POINT);
//==== Add A Default Point Source At Nose ====//
SetupCustomDefaultSource( POINT_SOURCE, 0, 0.1, 1.0, 1.0, 1.0 );
}
//==== InitGui Is Called Once During Each Custom Geom Construction ====//
void InitGui()
{
AddGui( GDEV_TAB, "Design" );
AddGui( GDEV_YGAP );
AddGui( GDEV_DIVIDER_BOX, "Design" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Motor Length", "MotorLength", "Design" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Motor Diameter", "MotorDiameter", "Design" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Shaft Length", "ShaftLength", "Design" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Shaft Diameter", "ShaftDiameter", "Design" );
AddGui( GDEV_YGAP, "" );
}
//==== UpdateGui Is Called Every Time The Gui is Updated ====//
void UpdateGui()
{
}
//==== UpdateSurf Is Called Every Time The Geom is Updated ====//
void UpdateSurf()
{
string geom_id = GetCurrCustomGeom();
//==== Set Motor Diameter ====//
string motor_dia_parm = GetParm( geom_id, "MotorDiameter", "Design" );
double motor_dia_val = GetParmVal( motor_dia_parm );
//==== Set Shaft Diameter ====//
string shaft_dia_parm = GetParm( geom_id, "ShaftDiameter", "Design" );
double shaft_dia_val = GetParmVal( shaft_dia_parm );
//==== Get The XSecs To Change ====//
string xsec_surf = GetXSecSurf( geom_id, 0 );
string xsec1 = GetXSec( xsec_surf, 1 );
string xsec2 = GetXSec( xsec_surf, 2 );
string xsec3 = GetXSec( xsec_surf, 3 );
string xsec4 = GetXSec( xsec_surf, 4 );
string xsec5 = GetXSec( xsec_surf, 5 );
string xsec6 = GetXSec( xsec_surf, 6 );
string xsec7 = GetXSec( xsec_surf, 7 );
//==== Set The Motor Base Diameter ====//
string xsec1_dia = GetXSecParm( xsec1, "Circle_Diameter" );
SetParmVal( xsec1_dia, motor_dia_val );
//==== Set The Motor End Diameter ====//
string xsec2_dia = GetXSecParm( xsec2, "Circle_Diameter" );
SetParmVal( xsec2_dia, motor_dia_val );
//==== Set The Shaft Base Diameter ====//
string xsec5_dia = GetXSecParm( xsec5, "Circle_Diameter" );
SetParmVal( xsec5_dia, shaft_dia_val );
//==== Set The Shaft End Diameter ====//
string xsec6_dia = GetXSecParm( xsec6, "Circle_Diameter" );
SetParmVal( xsec6_dia, shaft_dia_val );
//==== Set Motor Length ====//
double motor_length_val = GetParmVal( GetParm( geom_id, "MotorLength", "Design" ) );
SetCustomXSecLoc( xsec2, vec3d( motor_length_val, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( motor_length_val, 0, 0 ) );
//==== Set Shaft Length ====//
double shaft_length_val = GetParmVal( GetParm( geom_id, "ShaftLength", "Design" ) );
SetCustomXSecLoc( xsec4, vec3d( motor_length_val, 0, 0 ) );
SetCustomXSecLoc( xsec5, vec3d( motor_length_val, 0, 0 ) );
SetCustomXSecLoc( xsec6, vec3d( motor_length_val + shaft_length_val, 0, 0 ) );
SetCustomXSecLoc( xsec7, vec3d( motor_length_val + shaft_length_val, 0, 0 ) );
SkinXSecSurf();
}
WABDLIKWNW
ElecActuator
Custom
9
0
UPFBSYSIXS
VYOTQZAGRY
Turquoise
JDEQGVXELT
Default
0
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
VYOTQZAGRY
fwdTranslate
Hinge
12
0
WABDLIKWNW
KXIJLKZYAS
Default
FHGIFBSMPH
Default
0
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
KXIJLKZYAS
TopProp
Propeller
11
0
VYOTQZAGRY
SPKVCKFFMW
JFJZPUIFMD
CUJYJRSGVT
Black Plastic
UZXRBQFQFU
Default
0
1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
XXNMURIGLX
Default
IFJQXFTJHI
Default
4
XSec
EIGGCZRBNJ
Default
7
MXSXEBYGWU
Default
4
XSec
ZTRKGOLTAY
Default
7
DHHFAYFSBN
Default
4
XSec
AXJMOUUCTN
Default
7
PUCJKRCIDN
Default
4
XSec
VBTDOFVZRH
Default
7
7
MEMNQXPFAC
PCurve
3
UPYAXXWOAX
PCurve
4
FVHTXXSMLS
PCurve
2
KIXBCXTJDU
PCurve
2
AGRDQYJFOA
PCurve
SPKVCKFFMW
HalbachMotor
Fuselage
4
0
KXIJLKZYAS
Shiny Gold
YKXJBMXUCD
Default
0
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
SRAHDBRUUI
Default
VOEJIBHOEP
Default
0
XSec
NFNPLMRTKN
Default
0
VPNAPCASNJ
Default
0
XSec
MSJNRJNINX
Default
1
RSWRTTDKEK
Default
0
XSec
PZZQFHBAEE
Default
1
DXPUZOUYLU
Default
0
XSec
ORBFXEEKPS
Default
1
XTQEHLHKMM
Default
0
XSec
DULAWMAPAR
Default
0
JFJZPUIFMD
Hub
Fuselage
4
0
KXIJLKZYAS
Glass Dark
TKDCTBKKBS
Default
0
1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
RJDCOAJCWS
Default
MKHFAVHNCS
Default
0
XSec
SOVAFMQPCD
Default
0
JFTVZFLMHJ
Default
0
XSec
AKEDRPEXXW
Default
1
PIIQUNMVML
Default
0
XSec
FOTCPJKPQY
Default
1
SOOACSQOTW
Default
0
XSec
TDGEIKGBYB
Default
1
WMPGNUSSID
Default
0
XSec
MJXHRIJNZQ
Default
0
CUJYJRSGVT
BottomProp
Propeller
11
0
KXIJLKZYAS
LUVKUAMNCR
ESLJWTAFYL
Cyan Rubber
XMWULHUYIX
Default
0
1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
WEIMJOSNZK
Default
BZZKRZTLFY
Default
4
XSec
BXWIHPSCIT
Default
7
SZYAKXHGWF
Default
4
XSec
CMRLGGFPII
Default
7
SNMVTYIHJE
Default
4
XSec
NGOFGMWDAE
Default
7
NUTVHEQBEI
Default
4
XSec
GBVNFUTWCK
Default
7
7
XVVVSUHEEM
PCurve
3
TNWQIQTFLA
PCurve
4
MWXBGKCNAN
PCurve
2
CKWTQKDJWK
PCurve
2
PPIKLEHJDM
PCurve
LUVKUAMNCR
HalbachMotor
Fuselage
4
0
CUJYJRSGVT
Shiny Gold
CHXXFYGPJW
Default
0
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
HVTNUJZPKU
Default
CXYWKOVFTT
Default
0
XSec
OCWXROWPNA
Default
0
ARFWXAXFPH
Default
0
XSec
PQHKTVPGBV
Default
1
VOWTZSDDXB
Default
0
XSec
ZZQPKUQHCB
Default
1
XGYSVLKBPT
Default
0
XSec
ICOQLMMERS
Default
1
TSWNFBOCYW
Default
0
XSec
YBWMPFZCMB
Default
0
ESLJWTAFYL
Hub
Fuselage
4
0
CUJYJRSGVT
Glass Dark
MFSYNQNHYM
Default
0
1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
HESBTQAORO
Default
BPPAROMGMF
Default
0
XSec
PGHZXJOQPA
Default
0
HWNDFJCJXY
Default
0
XSec
ZBUSCWVUZG
Default
1
SSTMZLJOCR
Default
0
XSec
SLRVVLMWNE
Default
1
HPNVMKZAPW
Default
0
XSec
PLRLQEGHNB
Default
1
SLQTWAADSI
Default
0
XSec
AHWEDYYFBZ
Default
0
EZHROAYCSY
AftWing
Wing
5
0
NONE
APKYMZNUYE
SUUJDKJIVT
Aluminum
GPCIZXEEUR
Default
0
1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
DZPJHVOQZZ
SS_CONT_0
3
EXGITSTRHG
SS_CONT_1
3
BGSIUWUZLX
Default
LVNLICITZL
Default
2
XSec
8
3
1, 5, 6,
SURQHYKRBL
Default
8
CSIOQAMHPX
Default
2
XSec
8
3
1, 5, 6,
FERVCUURQF
Default
8
PTLQOVCLCA
Default
2
XSec
8
3
1, 5, 7,
BHDZYHANNE
Default
8
KZIWZMCZXB
Default
2
XSec
8
3
1, 6, 7,
ZLYXAUCNTB
Default
8
APKYMZNUYE
Vertical
Wing
5
0
EZHROAYCSY
YOGFSPXJWL
Aluminum
IOBLWKXVEX
Default
0
1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
KCVFWRLAGF
SS_CONT_0
3
RSIBINQYNF
Default
TLQNMCYCIO
Default
2
XSec
8
3
1, 5, 6,
PKSSCHPTRS
Default
7
BKLTLHISPT
Default
2
XSec
8
3
1, 5, 6,
RLCWSEZODH
Default
7
YOGFSPXJWL
CrzProp
Propeller
11
0
APKYMZNUYE
BFRWVIOLTN
ROFPUXLHLG
Default
JVOSZKQBMO
Default
0
1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
PXCIFFOLQD
Default
KWPKZEZRLY
Default
4
XSec
YSQOKKKCZF
Default
1
JYOVDQSVSY
Default
4
XSec
XXIZXHDHNF
Default
7
SGHTPNJCHT
Default
4
XSec
BWUMERQJML
Default
7
QIHGQZVXFM
Default
4
XSec
BWTIGENESA
Default
7
QPJQJBXVEJ
Default
4
XSec
ARRSZWMBDM
Default
7
3
NWGHBESDYO
PCurve
3
GUKVUKJAMK
PCurve
2
MOIWQWQSYM
PCurve
2
QDUKOBZBFO
PCurve
2
MZFSNIRGYV
PCurve
ElectricMotor
void Init()
{
//==== Add Parm Types =====//
string motor_length = AddParm( PARM_DOUBLE_TYPE, "MotorLength", "Design" );
SetParmValLimits( motor_length, 1.0, 0.001, 1.0e12 );
SetParmDescript( motor_length, "Length of Motor" );
string motor_diameter = AddParm( PARM_DOUBLE_TYPE, "MotorDiameter", "Design" );
SetParmValLimits( motor_diameter, 1.0, 0.001, 1.0e12 );
SetParmDescript( motor_diameter, "Diameter of Motor" );
string shaft_length = AddParm( PARM_DOUBLE_TYPE, "ShaftLength", "Design" );
SetParmValLimits( shaft_length, 0.5, 0.001, 1.0e12 );
SetParmDescript( shaft_length, "Length of shaft" );
string shaft_diameter = AddParm( PARM_DOUBLE_TYPE, "ShaftDiameter", "Design" );
SetParmValLimits( shaft_diameter, 0.1, 0.001, 1.0e12 );
SetParmDescript( shaft_diameter, "Diameter of shaft" );
//==== Add Cross Sections =====//
string xsec_surf = AddXSecSurf();
AppendXSec( xsec_surf, XS_POINT);
AppendXSec( xsec_surf, XS_CIRCLE);
AppendXSec( xsec_surf, XS_CIRCLE);
AppendXSec( xsec_surf, XS_POINT);
AppendXSec( xsec_surf, XS_POINT);
AppendXSec( xsec_surf, XS_CIRCLE);
AppendXSec( xsec_surf, XS_CIRCLE);
AppendXSec( xsec_surf, XS_POINT);
//==== Add A Default Point Source At Nose ====//
SetupCustomDefaultSource( POINT_SOURCE, 0, 0.1, 1.0, 1.0, 1.0 );
}
//==== InitGui Is Called Once During Each Custom Geom Construction ====//
void InitGui()
{
AddGui( GDEV_TAB, "Design" );
AddGui( GDEV_YGAP );
AddGui( GDEV_DIVIDER_BOX, "Design" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Motor Length", "MotorLength", "Design" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Motor Diameter", "MotorDiameter", "Design" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Shaft Length", "ShaftLength", "Design" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Shaft Diameter", "ShaftDiameter", "Design" );
AddGui( GDEV_YGAP, "" );
}
//==== UpdateGui Is Called Every Time The Gui is Updated ====//
void UpdateGui()
{
}
//==== UpdateSurf Is Called Every Time The Geom is Updated ====//
void UpdateSurf()
{
string geom_id = GetCurrCustomGeom();
//==== Set Motor Diameter ====//
string motor_dia_parm = GetParm( geom_id, "MotorDiameter", "Design" );
double motor_dia_val = GetParmVal( motor_dia_parm );
//==== Set Shaft Diameter ====//
string shaft_dia_parm = GetParm( geom_id, "ShaftDiameter", "Design" );
double shaft_dia_val = GetParmVal( shaft_dia_parm );
//==== Get The XSecs To Change ====//
string xsec_surf = GetXSecSurf( geom_id, 0 );
string xsec1 = GetXSec( xsec_surf, 1 );
string xsec2 = GetXSec( xsec_surf, 2 );
string xsec3 = GetXSec( xsec_surf, 3 );
string xsec4 = GetXSec( xsec_surf, 4 );
string xsec5 = GetXSec( xsec_surf, 5 );
string xsec6 = GetXSec( xsec_surf, 6 );
string xsec7 = GetXSec( xsec_surf, 7 );
//==== Set The Motor Base Diameter ====//
string xsec1_dia = GetXSecParm( xsec1, "Circle_Diameter" );
SetParmVal( xsec1_dia, motor_dia_val );
//==== Set The Motor End Diameter ====//
string xsec2_dia = GetXSecParm( xsec2, "Circle_Diameter" );
SetParmVal( xsec2_dia, motor_dia_val );
//==== Set The Shaft Base Diameter ====//
string xsec5_dia = GetXSecParm( xsec5, "Circle_Diameter" );
SetParmVal( xsec5_dia, shaft_dia_val );
//==== Set The Shaft End Diameter ====//
string xsec6_dia = GetXSecParm( xsec6, "Circle_Diameter" );
SetParmVal( xsec6_dia, shaft_dia_val );
//==== Set Motor Length ====//
double motor_length_val = GetParmVal( GetParm( geom_id, "MotorLength", "Design" ) );
SetCustomXSecLoc( xsec2, vec3d( motor_length_val, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( motor_length_val, 0, 0 ) );
//==== Set Shaft Length ====//
double shaft_length_val = GetParmVal( GetParm( geom_id, "ShaftLength", "Design" ) );
SetCustomXSecLoc( xsec4, vec3d( motor_length_val, 0, 0 ) );
SetCustomXSecLoc( xsec5, vec3d( motor_length_val, 0, 0 ) );
SetCustomXSecLoc( xsec6, vec3d( motor_length_val + shaft_length_val, 0, 0 ) );
SetCustomXSecLoc( xsec7, vec3d( motor_length_val + shaft_length_val, 0, 0 ) );
SkinXSecSurf();
}
BFRWVIOLTN
ElectricMotor
Custom
9
0
YOGFSPXJWL
Turquoise
RWTMPSBDOA
Default
0
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
ROFPUXLHLG
Nacelle
Stack
8
0
YOGFSPXJWL
Glass Dark
JWXZUPRUZJ
Default
0
1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
XMMILWYIZG
Default
BRNSHMNQUD
Default
1
XSec
MIRATMKJEH
Default
0
GTWMAADLJS
Default
1
XSec
JPPRJFAVBC
Default
1
TQFORQUUBE
Default
1
XSec
GTPQVLBHSU
Default
1
HDAKADPGRC
Default
1
XSec
FVHOOLRVRI
Default
0
SUUJDKJIVT
TipBoom
Fuselage
4
0
EZHROAYCSY
XJMJQRAOII
Glass Light
SVRYCYIZRD
Default
0
1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
MVJFEZBKHN
Default
DNVNUHKPPW
Default
0
XSec
SPZLPICCGY
Default
0
WZGKWAGIXW
Default
0
XSec
QVYVIRBBEP
Default
5
DRVYNNDOOF
Default
0
XSec
NPNXWDUSLS
Default
5
GQSOTDTBBF
Default
0
XSec
PRZWMHSJXC
Default
5
IUWSVQTGCX
Default
0
XSec
ILWJIEARZM
Default
0
ElectricMotor
void Init()
{
//==== Add Parm Types =====//
string motor_length = AddParm( PARM_DOUBLE_TYPE, "MotorLength", "Design" );
SetParmValLimits( motor_length, 1.0, 0.001, 1.0e12 );
SetParmDescript( motor_length, "Length of Motor" );
string motor_diameter = AddParm( PARM_DOUBLE_TYPE, "MotorDiameter", "Design" );
SetParmValLimits( motor_diameter, 1.0, 0.001, 1.0e12 );
SetParmDescript( motor_diameter, "Diameter of Motor" );
string shaft_length = AddParm( PARM_DOUBLE_TYPE, "ShaftLength", "Design" );
SetParmValLimits( shaft_length, 0.5, 0.001, 1.0e12 );
SetParmDescript( shaft_length, "Length of shaft" );
string shaft_diameter = AddParm( PARM_DOUBLE_TYPE, "ShaftDiameter", "Design" );
SetParmValLimits( shaft_diameter, 0.1, 0.001, 1.0e12 );
SetParmDescript( shaft_diameter, "Diameter of shaft" );
//==== Add Cross Sections =====//
string xsec_surf = AddXSecSurf();
AppendXSec( xsec_surf, XS_POINT);
AppendXSec( xsec_surf, XS_CIRCLE);
AppendXSec( xsec_surf, XS_CIRCLE);
AppendXSec( xsec_surf, XS_POINT);
AppendXSec( xsec_surf, XS_POINT);
AppendXSec( xsec_surf, XS_CIRCLE);
AppendXSec( xsec_surf, XS_CIRCLE);
AppendXSec( xsec_surf, XS_POINT);
//==== Add A Default Point Source At Nose ====//
SetupCustomDefaultSource( POINT_SOURCE, 0, 0.1, 1.0, 1.0, 1.0 );
}
//==== InitGui Is Called Once During Each Custom Geom Construction ====//
void InitGui()
{
AddGui( GDEV_TAB, "Design" );
AddGui( GDEV_YGAP );
AddGui( GDEV_DIVIDER_BOX, "Design" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Motor Length", "MotorLength", "Design" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Motor Diameter", "MotorDiameter", "Design" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Shaft Length", "ShaftLength", "Design" );
AddGui( GDEV_SLIDER_ADJ_RANGE_INPUT, "Shaft Diameter", "ShaftDiameter", "Design" );
AddGui( GDEV_YGAP, "" );
}
//==== UpdateGui Is Called Every Time The Gui is Updated ====//
void UpdateGui()
{
}
//==== UpdateSurf Is Called Every Time The Geom is Updated ====//
void UpdateSurf()
{
string geom_id = GetCurrCustomGeom();
//==== Set Motor Diameter ====//
string motor_dia_parm = GetParm( geom_id, "MotorDiameter", "Design" );
double motor_dia_val = GetParmVal( motor_dia_parm );
//==== Set Shaft Diameter ====//
string shaft_dia_parm = GetParm( geom_id, "ShaftDiameter", "Design" );
double shaft_dia_val = GetParmVal( shaft_dia_parm );
//==== Get The XSecs To Change ====//
string xsec_surf = GetXSecSurf( geom_id, 0 );
string xsec1 = GetXSec( xsec_surf, 1 );
string xsec2 = GetXSec( xsec_surf, 2 );
string xsec3 = GetXSec( xsec_surf, 3 );
string xsec4 = GetXSec( xsec_surf, 4 );
string xsec5 = GetXSec( xsec_surf, 5 );
string xsec6 = GetXSec( xsec_surf, 6 );
string xsec7 = GetXSec( xsec_surf, 7 );
//==== Set The Motor Base Diameter ====//
string xsec1_dia = GetXSecParm( xsec1, "Circle_Diameter" );
SetParmVal( xsec1_dia, motor_dia_val );
//==== Set The Motor End Diameter ====//
string xsec2_dia = GetXSecParm( xsec2, "Circle_Diameter" );
SetParmVal( xsec2_dia, motor_dia_val );
//==== Set The Shaft Base Diameter ====//
string xsec5_dia = GetXSecParm( xsec5, "Circle_Diameter" );
SetParmVal( xsec5_dia, shaft_dia_val );
//==== Set The Shaft End Diameter ====//
string xsec6_dia = GetXSecParm( xsec6, "Circle_Diameter" );
SetParmVal( xsec6_dia, shaft_dia_val );
//==== Set Motor Length ====//
double motor_length_val = GetParmVal( GetParm( geom_id, "MotorLength", "Design" ) );
SetCustomXSecLoc( xsec2, vec3d( motor_length_val, 0, 0 ) );
SetCustomXSecLoc( xsec3, vec3d( motor_length_val, 0, 0 ) );
//==== Set Shaft Length ====//
double shaft_length_val = GetParmVal( GetParm( geom_id, "ShaftLength", "Design" ) );
SetCustomXSecLoc( xsec4, vec3d( motor_length_val, 0, 0 ) );
SetCustomXSecLoc( xsec5, vec3d( motor_length_val, 0, 0 ) );
SetCustomXSecLoc( xsec6, vec3d( motor_length_val + shaft_length_val, 0, 0 ) );
SetCustomXSecLoc( xsec7, vec3d( motor_length_val + shaft_length_val, 0, 0 ) );
SkinXSecSurf();
}
XJMJQRAOII
ElecActuator
Custom
9
0
SUUJDKJIVT
OQESQDUXEZ
Turquoise
VTZVDZNNSC
Default
0
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
OQESQDUXEZ
aftTranslate
Hinge
12
0
XJMJQRAOII
VVTYQPIQXK
Default
KOLUGTZSXC
Default
0
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
VVTYQPIQXK
TopProp
Propeller
11
0
OQESQDUXEZ
DHSKYZBTRB
YLCZRXNBFT
TOHFIWWXXV
Black Plastic
AELCFKCZYC
Default
0
1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
DDPOUOKYXQ
Default
LXLGJACMPT
Default
4
XSec
NVTFNLSZMK
Default
7
WAMQXIOZLW
Default
4
XSec
ZIIFKEGURO
Default
7
ZDQGMXTUXS
Default
4
XSec
TIQSIQPFBY
Default
7
CUSUDSGOXV
Default
4
XSec
ERTJUZIMOL
Default
7
7
SGIEFDECGD
PCurve
3
TQBJMQAQZT
PCurve
4
WFPXNXNESX
PCurve
2
NSOOLYRTAP
PCurve
2
QDTLBDNUDA
PCurve
DHSKYZBTRB
HalbachMotor
Fuselage
4
0
VVTYQPIQXK
Shiny Gold
ZOMJXYJCOX
Default
0
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
IUCHJLXJAV
Default
IOICMGBQIB
Default
0
XSec
OUYJCCDLBI
Default
0
MOXFRIEPDC
Default
0
XSec
ZMQPFZKTIT
Default
1
DUZYCRCMQM
Default
0
XSec
HNMEKGVILM
Default
1
LUDHSXJPQE
Default
0
XSec
KRVTTMHPWN
Default
1
AHQEUPXGXA
Default
0
XSec
ANNODXHMEL
Default
0
YLCZRXNBFT
Hub
Fuselage
4
0
VVTYQPIQXK
Glass Dark
BXCXJRRELU
Default
0
1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
LVDAPGTFWU
Default
EQVREZMXGN
Default
0
XSec
XJKBRCQKCJ
Default
0
OBBQLARXGI
Default
0
XSec
VYRUTNWDJG
Default
1
QJPPYTECOH
Default
0
XSec
XQLRKXQRYV
Default
1
SWXRHHEEXK
Default
0
XSec
SVGVBBICPD
Default
1
KGEFLPZLGX
Default
0
XSec
QHSQAZIJSQ
Default
0
TOHFIWWXXV
BottomProp
Propeller
11
0
VVTYQPIQXK
QOWUGLFLBD
CGRDJLANWE
Cyan Rubber
TDRYIXOHNW
Default
0
1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
JRVXBBDQTG
Default
FQUWSHYOFC
Default
4
XSec
ECSXOHEGTU
Default
7
YMUVVWDGBO
Default
4
XSec
JCWJTKUSOX
Default
7
JWZYGKHMUJ
Default
4
XSec
UQUPEYUMZI
Default
7
FLWGSOJIHH
Default
4
XSec
QCXNHSSKOH
Default
7
7
DRQMDFHWKZ
PCurve
3
PIOXFKVQSJ
PCurve
4
NCUCKRQWBV
PCurve
2
BJLSTFIPRM
PCurve
2
LNIDXMJFCP
PCurve
QOWUGLFLBD
HalbachMotor
Fuselage
4
0
TOHFIWWXXV
Shiny Gold
ZPXTANQBOD
Default
0
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
JXJMIHQHEO
Default
GSSEQSAIJU
Default
0
XSec
PPPUTKKYOS
Default
0
UMPPAVLDVO
Default
0
XSec
DUXBIILAIJ
Default
1
JIYMKQTGUV
Default
0
XSec
IVZWQEXZYW
Default
1
RVBJFOMTCW
Default
0
XSec
VVKNVWQERW
Default
1
DOVLDHCBGU
Default
0
XSec
WKJRTMPUSS
Default
0
CGRDJLANWE
Hub
Fuselage
4
0
TOHFIWWXXV
Glass Dark
KXRBYPJBDA
Default
0
1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
NXGFSDRKOD
Default
LWLAZYJLQF
Default
0
XSec
KHJBHPLCAR
Default
0
BURSGNTPLY
Default
0
XSec
OXJJKYNCIB
Default
1
ZUGHSFJJUD
Default
0
XSec
TZGIUYOIHA
Default
1
IQAHLCRCCZ
Default
0
XSec
EOTQWCTBSC
Default
1
DWMZUROPXM
Default
0
XSec
IIHUXFLDMR
Default
0
ONDPLFIRGJ
CG
Ellipsoid
14
0
NONE
Ruby
ZYUBCMUFQO
Default
0
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Custom
2.000000000000000111e-01, 2.000000000000000111e-01, 2.000000000000000111e-01, 1.000000000000000000e+00,
8.000000000000000444e-01, 8.000000000000000444e-01, 8.000000000000000444e-01, 1.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 1.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 1.000000000000000000e+00,
1.280000000000000000e+02
OrangeGlass
2.700000000000000178e-01, 2.800000000000000266e-01, 2.300000000000000100e-01, 1.000000000000000000e+00,
6.099999999999999867e-01, 4.099999999999999756e-01, 2.700000000000000178e-01, 5.000000000000000000e-01,
9.686274509803921573e-01, 3.725490196078431460e-01, 2.784313725490196179e-01, 1.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 1.000000000000000000e+00,
1.000000000000000000e+01
400
RefWingArea = FrontWingArea + AftWingArea;
RefWingProjSpan = AftWingSpan;
RefWingArea = FrontWingArea + AftWingArea;
RefWingProjSpan = AftWingSpan;
ZALKMPHRYR
Default
0
0
0
FlightMode
Cruise
XEJBECIKFSE
FRZTUXBXWPB
HSUQXEECZVD
WLXEOOEOYVK
Cruise
0.000000000000000000e+00, 9.000000000000000000e+01, 0.000000000000000000e+00, 0.000000000000000000e+00,
VTOL
9.000000000000000000e+01, 0.000000000000000000e+00, 1.375000000000000000e+01, 1.375000000000000000e+01,
1
2,
4,
0
0
XZWRKILTEJ
CFDMeshSettings
TBUZXATCSA
SurfaceIntersectSettings
AHJRDTYZXX
CFDGridDensity
GZEYFIWIWG
DefaultShell
RKIEFMOXAJ
DefaultBeam
-1
NSCYFWEVSY
ClippingMgr
YEHDJUZNYN
WaveDragSettings
EDCTSVIPYF
ParasiteDragSettings
EZHROAYCSY
1
3
2.500000000000000000e+01
All
Shown
Not_Shown
AVL
Parasite
Airspace
Battery
Set_4
Set_5
Set_6
Set_7
Set_8
Set_9