4
//== Uber Elevate eCRM-001 ==//
//== May 2018 ==//
//== This tilt-rotor 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-001
8
AFFIUHTFEG
Default
JMXVQBKACK
Default
QNDYDDBEGC
Default
ZPHWRUCMDQ
Default
TOVLNNLPXW
Default
ZFIUZCNOVV
Default
FFKIYXRDLD
Default
LHHONOWCMA
Default
0
0
TCZFITCZEU
Fuselage
Fuselage
4
0
NONE
ETNZGHBOGW
WFWKRQIMCA
GTGADWKRDI
NRVFJDJLDM
MMKWGZCZOD
QNTYANRDTA
NYZYYIKCDR
OKTSOGRANO
Glass Light
CVSYBVNULY
Default
0
1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
ERDIDVQXLW
SS_ELLIP_0
2
BTZAESYPLN
SS_RECT_1
1
HRHMQDQFWK
SS_RECT_2
1
TMSEUDOBSM
Default
PFKEDPJWTH
Default
0
XSec
DZWKNPZYTH
Default
0
ZUXENQTJLO
Default
0
XSec
HZFEKNIVZA
Default
5
PRRAXZRTCI
Default
0
XSec
JGKKODQOWC
Default
5
CBTYKGBZOK
Default
0
XSec
DUDUDXHGEW
Default
5
ARDPQTYFYD
Default
0
XSec
VQYQIPYMZI
Default
5
IRUSHJTLYX
Default
0
XSec
DJDZHUJRRV
Default
5
TOANETXGQM
Default
0
XSec
WZAALLGVGN
Default
5
IMSOKNFXBK
Default
0
XSec
FGVLHTTAQA
Default
5
CHHSUMXQAS
Default
0
XSec
RQLVDYCZLY
Default
0
ETNZGHBOGW
FloorBattery
Fuselage
4
0
TCZFITCZEU
Emerald
EIWGWWOBYB
Default
0
1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
PSZHLERJLZ
Default
EAYOYDQARY
Default
0
XSec
XICBQXBVTC
Default
0
TKQBLHDMNN
Default
0
XSec
RIRJPCJUHE
Default
4
XDZYRGHGOG
Default
0
XSec
MUCCGPCTEZ
Default
4
UJZTAJXXID
Default
0
XSec
KBZRRTXOSJ
Default
4
RHNDHZMFVY
Default
0
XSec
SMEBRZYQQY
Default
0
WFWKRQIMCA
Wing
Wing
5
0
TCZFITCZEU
YBUOPQNXKO
UDGVFNAFWJ
XASXNISLBW
ZCBWZTMZWO
Glass Light
MMBXKSEIBX
Default
0
1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
LXDQZDCSCH
SS_CONT_0
3
LTXUGVQQEK
SS_CONT_1
3
MJAWTFMPHS
Default
WMQSUOJZHJ
Default
2
XSec
8
3
1, 5, 6,
PCCEZCRCHL
Default
7
PPQETCRNLI
Default
2
XSec
8
3
1, 5, 6,
SQCDCIXQNV
Default
7
ATBBUDALMN
Default
2
XSec
8
3
1, 5, 6,
OHFMILROLU
Default
7
LFJLPEUYOU
Default
2
XSec
8
3
1, 5, 6,
GQZNNDFAAX
Default
7
YBUOPQNXKO
InnerLiftNacelles
Fuselage
4
0
WFWKRQIMCA
GNOCIHDSTY
WLDASYPLYN
Glass Dark
AAARNCYCFT
Default
0
1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
VXPCTRYZYT
Sideslip blown flaps
1
EWTOFWSXLD
Default
EOTWANORPW
Default
0
XSec
DWQCBEVSSH
Default
0
RIIUHHZIGX
Default
0
XSec
DNRVADFVNH
Default
5
NQIVAZGRVK
Default
0
XSec
XRXBQSXMHZ
Default
5
AOXZBIOGYR
Default
0
XSec
YHKIVUKRZT
Default
5
XFZDQHAIHR
Default
0
XSec
IRAYNONABR
Default
2
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();
}
GNOCIHDSTY
ElectricActuator
Custom
9
0
YBUOPQNXKO
CSHWNHECMH
Turquoise
YJBWSTCTCX
Default
0
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
CSHWNHECMH
Raise
Hinge
12
0
GNOCIHDSTY
AHIWGERJEG
ZYXQWQSHCG
Default
SZLJJPJZAV
Default
0
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
AHIWGERJEG
LiftProp
Propeller
11
0
CSHWNHECMH
ALXBAXMYTO
Default
JTVFASNXUE
Default
0
1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
CDZHCIVUOS
Default
YQQARIBPMU
Default
4
XSec
NTGKYCIUJO
Default
7
RBDJFUBJBJ
Default
4
XSec
ENKFWFGYCT
Default
7
30
HVTANLDXXF
PCurve
30
BEVNBOPIYN
PCurve
2
WLTOMLIYGN
PCurve
2
EKDNVVXTOS
PCurve
2
APMJFRFGHH
PCurve
ALXBAXMYTO
Hub
Stack
8
0
AHIWGERJEG
Default
AUVUGHYVPX
Default
0
1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
URONDGFGTJ
Default
VFEGJQDWYD
Default
1
XSec
USSVYBCHLT
Default
0
LSYQFAZBNU
Default
1
XSec
ZXXNGMPSPK
Default
1
HUIIXGVPZS
Default
1
XSec
OHTVDRIGSA
Default
1
GFAZTQGQEY
Default
1
XSec
BHRKQDGAHQ
Default
1
SEEBDFBHDN
Default
1
XSec
HDBKVRMUVW
Default
0
ZYXQWQSHCG
LiftProp
Propeller
11
0
CSHWNHECMH
ZJSMICBLUR
Default
YMXMQFWMVR
Default
0
1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
ADSNDCODPH
Default
FMWVSECETY
Default
4
XSec
RBFQCFEIHM
Default
7
FULCMXZUFU
Default
4
XSec
GACQSMHXSS
Default
7
30
WSWYVJOTMS
PCurve
30
ERRTKULSTJ
PCurve
2
GXCJRJHOJV
PCurve
2
VGMXVQPLSY
PCurve
2
FNQIFKWWSZ
PCurve
ZJSMICBLUR
Hub
Stack
8
0
ZYXQWQSHCG
Default
ZERCQDVVAL
Default
0
1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
VMYYRWFCYM
Default
YBRAHQYCFH
Default
1
XSec
IIKPSZVVDK
Default
0
GDFJNLHVVE
Default
1
XSec
GCUPILUYYY
Default
1
CPJWKRCMCH
Default
1
XSec
OEWCPYHEAQ
Default
1
IXXUDKVILU
Default
1
XSec
UGRJRPGFLN
Default
1
SMVCBQGKGW
Default
1
XSec
NXGZTVFWMX
Default
0
WLDASYPLYN
FloorBattery
Fuselage
4
0
YBUOPQNXKO
Emerald
ATGBBKNWZP
Default
0
1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
HTGRNDYMDI
Default
RQEFGZLXPQ
Default
0
XSec
CAEPUPYOXR
Default
0
RRAHXSGFMO
Default
0
XSec
ZSYTHROGQN
Default
4
CLRINCKOEW
Default
0
XSec
QERBVDDDZV
Default
4
QKORMNIPBX
Default
0
XSec
YBKHLGSDTE
Default
4
EQHROTKYAL
Default
0
XSec
BXCEOEHOUG
Default
0
UDGVFNAFWJ
Rotate
Hinge
12
0
WFWKRQIMCA
NKILHRXDGW
Default
MJACCUXZGI
Default
0
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
NKILHRXDGW
OuterLiftNacelles
Fuselage
4
0
UDGVFNAFWJ
MTEFDAUKYS
Glass Dark
TRZXTNFUSS
Default
0
1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
GOCQAVESPQ
Default
JUGVZXSFYF
Default
0
XSec
PSOUALAZLJ
Default
0
MSXNVHUZEG
Default
0
XSec
TVWDEYJCVW
Default
1
IZXEFZYBFS
Default
0
XSec
PLPZPDGXVX
Default
1
CBQPULNBWJ
Default
0
XSec
OLZDMLUNCZ
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();
}
MTEFDAUKYS
ElectricMotor
Custom
9
0
NKILHRXDGW
BNTFOHBZLF
Turquoise
HDBKVSEZMD
Default
0
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
BNTFOHBZLF
Prop
Propeller
11
0
MTEFDAUKYS
Default
UVAYNCGKFR
Default
0
1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
GLGXCVBVFO
Default
UTYHJDRAYP
Default
4
XSec
WAZYBYRLKS
Default
1
AHTUVSHCFR
Default
4
XSec
HCELTXJWRP
Default
7
KMUTVQNANB
Default
4
XSec
PEYOWUHSSV
Default
7
FCFUKLYUMH
Default
4
XSec
WYJENVZDKT
Default
7
MVZMRLAFLQ
Default
4
XSec
NEOGRHEYCQ
Default
7
3
GQUTHDKPZB
PCurve
3
PWPOGYBDWO
PCurve
2
MYXEWFFZCZ
PCurve
2
BQVRCMNAOK
PCurve
2
SWYZWVFAAD
PCurve
XASXNISLBW
WingBatteryInbd
Conformal
13
0
WFWKRQIMCA
Emerald
YPBPELXWCR
Default
0
1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
ZCBWZTMZWO
WingBatteryRoot
Conformal
13
0
WFWKRQIMCA
Emerald
OHRPJGWCLY
Default
0
1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
GTGADWKRDI
VerticalTail
Wing
5
0
TCZFITCZEU
NVWYQJDDOH
Aluminum
XCJHHASNJR
Default
0
1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
PRRPWHPVOP
SS_CONT_0
3
GXHBZQAGUQ
Default
QDHSRTHUZN
Default
2
XSec
8
3
1, 5, 6,
ZXQFQGHZZI
Default
7
VTNFCKZEVS
Default
2
XSec
8
3
1, 5, 6,
SFQYXJGPTC
Default
7
NVWYQJDDOH
Tail
Wing
5
0
GTGADWKRDI
Aluminum
SZDKXZDQRC
Default
0
1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
IYEBTZABKO
Default
IDHFQFDYPR
Default
2
XSec
8
3
1, 5, 6,
JOTCDSQZUX
Default
7
ZFWPVSVQNK
Default
2
XSec
8
3
1, 5, 6,
JMUZFXOGPT
Default
7
NRVFJDJLDM
AftCorotating1
Blank
6
0
TCZFITCZEU
SRYWHYREHE
Default
YVGZBICRKP
Default
0
1, 0, 1, 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();
}
SRYWHYREHE
ElectricActuator
Custom
9
0
NRVFJDJLDM
CLVCRLYEMM
Turquoise
WNKEIUWLJO
Default
0
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
CLVCRLYEMM
Raise
Hinge
12
0
SRYWHYREHE
JCTLQGSPIC
ZKPMHJHXLK
Default
GWWJFMJICF
Default
0
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
JCTLQGSPIC
LiftProp
Propeller
11
0
CLVCRLYEMM
DYSQHJUDZH
Default
OGDGLAROED
Default
0
1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
QVAJXZLYYZ
Default
YMKVJEDVMO
Default
4
XSec
BRGQSZOONB
Default
7
AWBTEKMIMK
Default
4
XSec
DEXTPOTGMP
Default
7
30
WEDHKWLMUA
PCurve
30
QOYQYLDJCI
PCurve
2
WMCZRTWWJF
PCurve
2
KDYSSCVJCL
PCurve
2
PPVNLVSJKY
PCurve
DYSQHJUDZH
Hub
Stack
8
0
JCTLQGSPIC
Default
GPVVJCXNMC
Default
0
1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
OBHUEBWLVZ
Default
QWABJMYKPX
Default
1
XSec
WRQKANZJJV
Default
0
KPNHFBYTWS
Default
1
XSec
LABEAAXHRV
Default
1
ESDTMLQEAX
Default
1
XSec
DDRWQPHEXE
Default
1
IETSGMJJEK
Default
1
XSec
BSMNITXJFQ
Default
1
SMWGDZOFIQ
Default
1
XSec
OIBFIUJASL
Default
0
ZKPMHJHXLK
LiftProp
Propeller
11
0
CLVCRLYEMM
JRJZRSEANV
Default
NBFRJFXWEY
Default
0
1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
JWXXQMJQQD
Default
ZYRHDEPPTC
Default
4
XSec
HMSITKMMNE
Default
7
NWQDNOATKI
Default
4
XSec
CEQOXPTJCL
Default
7
30
CMZURVDIGK
PCurve
30
GSZDMUVRKX
PCurve
2
XZWKBNNDYF
PCurve
2
UXEJCSUWRV
PCurve
2
LNKHYTDPYE
PCurve
JRJZRSEANV
Hub
Stack
8
0
ZKPMHJHXLK
Default
LLMTOXDKZE
Default
0
1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
SDDCCYZUOD
Default
QOGKVVZOJU
Default
1
XSec
NCSFANGLLA
Default
0
KKSTCWFTDR
Default
1
XSec
BSISRGQKSI
Default
1
DEXMUBPVWN
Default
1
XSec
GFXEPSBVQH
Default
1
BUSUTVXRUO
Default
1
XSec
GTFIIHUQIZ
Default
1
OPBAHGRYPX
Default
1
XSec
LQGPCSUPWN
Default
0
MMKWGZCZOD
AftCorotating2
Blank
6
0
TCZFITCZEU
NORCMQJINJ
Default
EWUSQMJLPY
Default
0
1, 0, 1, 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();
}
NORCMQJINJ
ElectricActuator
Custom
9
0
MMKWGZCZOD
QVHDMRBAWC
Turquoise
NQFPLPUKLX
Default
0
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
QVHDMRBAWC
Raise
Hinge
12
0
NORCMQJINJ
TAIVALWAAZ
MROWTMEDZK
Default
GKLIPAXUQS
Default
0
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
TAIVALWAAZ
LiftProp
Propeller
11
0
QVHDMRBAWC
MREBXJBEZO
Default
TPIBZVRKUF
Default
0
1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
SNWMQJWWGY
Default
QYPZPHGLRD
Default
4
XSec
JMPWVZINXL
Default
7
KQFIQNBHSJ
Default
4
XSec
MJNWNCFNVW
Default
7
30
LLURMOQWCR
PCurve
30
PQLCHYBAVR
PCurve
2
PHTVKBZCQV
PCurve
2
JWQHWHFEXC
PCurve
2
MSRESGWFYF
PCurve
MREBXJBEZO
Hub
Stack
8
0
TAIVALWAAZ
Default
MXICCOHANH
Default
0
1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
BDHISYPTYI
Default
VOIFFNECLD
Default
1
XSec
HFEQNDXYGJ
Default
0
KRNPIFFWMN
Default
1
XSec
MCQUJIOKLK
Default
1
WAPDMEDWTI
Default
1
XSec
AWOFHXAZPH
Default
1
PPXVMTFUFN
Default
1
XSec
OXPKHDVOEM
Default
1
LHEELAPWHB
Default
1
XSec
ZCHCTYZSHL
Default
0
MROWTMEDZK
LiftProp
Propeller
11
0
QVHDMRBAWC
KQKKURTGNP
Default
ZNFZCIJKUX
Default
0
1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
WDQIKVPIXM
Default
UJKNWFJQCR
Default
4
XSec
QOZMTLAQGP
Default
7
HSTEZLSWVZ
Default
4
XSec
XREVXWJVQX
Default
7
30
RTLCMGDCGW
PCurve
30
SSTVXPGSWW
PCurve
2
VDUXJPZHOY
PCurve
2
UVENTCKIBL
PCurve
2
YIDDNPANWR
PCurve
KQKKURTGNP
Hub
Stack
8
0
MROWTMEDZK
Default
UQBKFMIRWH
Default
0
1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
QBWVYWTBFA
Default
LBZXHNDRHD
Default
1
XSec
RWUPTWWYZN
Default
0
DBURELEKCI
Default
1
XSec
NUCODGGXAC
Default
1
JKLFTLLVTA
Default
1
XSec
AJGJGYUBYU
Default
1
XMFPAFBBWY
Default
1
XSec
CNZQMDFHPW
Default
1
TSMXIOKCYX
Default
1
XSec
PTUWAYMRJX
Default
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() );
}
}
QNTYANRDTA
Pilot
Custom
9
0
TCZFITCZEU
Pearl
MQUPIFIMHV
Default
0
1, 0, 1, 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() );
}
}
NYZYYIKCDR
Row1
Custom
9
0
TCZFITCZEU
Pearl
BUWTMIXGYN
Default
0
1, 0, 1, 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() );
}
}
OKTSOGRANO
Row2
Custom
9
0
TCZFITCZEU
Pearl
KSMWDMELIX
Default
0
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
MNPXLVNYAY
NoseLG
Blank
6
0
NONE
CNOEJRBOGE
IKYBYGLVMP
UPOSATISZR
Default
XGWPMIAGCG
Default
0
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
CNOEJRBOGE
Strut
Wing
5
0
MNPXLVNYAY
Default
DDPXXQJAYC
Default
0
1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
YRGTJGUNVB
Default
HSLSWEWBVO
Default
2
XSec
8
3
1, 5, 6,
NVSWAFWOEH
Default
7
LGWVJYUOMY
Default
2
XSec
8
3
1, 5, 6,
JSNKNDJHGN
Default
7
IKYBYGLVMP
Pant
Fuselage
4
0
MNPXLVNYAY
Default
INAFLXUSEG
Default
0
1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
UZIFAOASVK
Default
SBACMJQHHN
Default
0
XSec
NXTAMXBYBW
Default
0
NEUENVQLLA
Default
0
XSec
NOCEAPNPDE
Default
3
WBLRJJTMXJ
Default
0
XSec
FGITBHAPVQ
Default
3
DPGALPRKLJ
Default
0
XSec
WXUGELMMCP
Default
2
UPOSATISZR
NoseGear
Stack
8
0
MNPXLVNYAY
Black Rubber
TDDIGKNOUK
Default
0
1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
VQEUWBQNSG
Default
XBRYGZQUPI
Default
1
XSec
ZPETVQHGSC
Default
0
RNGDTQTKPQ
Default
1
XSec
RYSNAOEMIA
Default
1
LSXSVJNJWS
Default
1
XSec
RWMLNZRHDH
Default
1
WEGBQPXTFW
Default
1
XSec
YAUPRGUYFA
Default
0
BOOHDQMOFP
MainLG
Blank
6
0
NONE
ZITKPBPKHQ
BVQNXPEHHA
YIJTYPAOJW
Default
VBUGRXFAGE
Default
0
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
ZITKPBPKHQ
Struts
Wing
5
0
BOOHDQMOFP
Default
VERCGUPJNQ
Default
0
1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
HWVLKVDMEX
Default
SJSDLSSXOX
Default
2
XSec
8
3
1, 5, 6,
ISVLPYKPKB
Default
7
JLVTRVESZG
Default
2
XSec
8
3
1, 5, 6,
RGMPRWOSEZ
Default
7
BVQNXPEHHA
Pant
Fuselage
4
0
BOOHDQMOFP
Default
JTEJETPRHR
Default
0
1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
FBCBZTKYCY
Default
AQNQZQZJHF
Default
0
XSec
INTGWTTACU
Default
0
AWITFKGAGE
Default
0
XSec
MFGOGWPVXU
Default
3
EWXRXTKRET
Default
0
XSec
DMBPHUTCXX
Default
3
GOKDIAEKBJ
Default
0
XSec
PWXNTRYWQG
Default
2
YIJTYPAOJW
MainGear
Stack
8
0
BOOHDQMOFP
Black Rubber
HCQLRVXUFT
Default
0
1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
JZNNSISUBL
Default
VNZBJCEISL
Default
1
XSec
ZACYXRDNPU
Default
0
XKRELIABYM
Default
1
XSec
LCOSILFXFU
Default
1
SFQTVXFZOL
Default
1
XSec
OGDYRDAJYJ
Default
1
XODGZNXBPV
Default
1
XSec
PDTUMBYHQM
Default
0
RBSYGAJMKV
CG
Ellipsoid
14
0
NONE
Ruby
SQULQFPTMH
Default
0
1, 0, 1, 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
46
ZALKMPHRYR
Default
0
0
0
FlightMode
Cruise
YYYLCSNYXHS
WGKGSCASEDL
RMYQMOLYULN
AVXGCRZWGWN
VTOL
0.000000000000000000e+00, 9.000000000000000000e+01, 0.000000000000000000e+00, 0.000000000000000000e+00,
Cruise
-1.200000000000000000e+01, 0.000000000000000000e+00, -1.200000000000000000e+01, -1.200000000000000000e+01,
1
2,
4,
0
1
EMBHOAUILM
CFDMeshSettings
MFOIKZDVNU
SurfaceIntersectSettings
AHJRDTYZXX
CFDGridDensity
CTHFSDUJBP
DefaultShell
MSXIAGQEOY
DefaultBeam
-1
NSCYFWEVSY
ClippingMgr
YEHDJUZNYN
WaveDragSettings
EDCTSVIPYF
ParasiteDragSettings
WFWKRQIMCA
1
3
2.000000000000000000e+01
All
Shown
Not_Shown
AVL
Parasite
Airspace
Battery
Set_4
Set_5
Set_6
Set_7
Set_8
Set_9