%
% Very simple model of my hand
%
% Gene Ressler
%
% In particular, this completely ignores the carpal joints.
%
% Try this with various options to sketch.
%
% -D fist \
% -D ok > none or one of these
% -D spread /
%
% -D topview \
% -D frontview > none or one of these
% -D sideview /
%
% -D repeated
%
% I am not responsible for modifications to draw
% obscene gestures.
% parameterization of model
% for fingers, 0 is thumb, 1 is index,
% 2 is middle, 3 is ring, 4 is little
% lateral angle between fingers
def spread_rot
<fist> 0
<ok> 5
<spread>10
<> 0
% and between thumb and index finger
def spread_rot_0
<fist> 40
<ok> 55
<spread> 55
<> 25
% rotations of finger parts
% distal is the finger tip
% middle is below that
% meta is the knuckle
def distal_0_rot
<fist> 60
<ok> 45
<> -10
def middle_0_rot
<fist> 50
<ok> 40
<spread> 0
<> 10
def meta_0_rot
<fist> 40
<ok> 33
<> 0
% useful stuff
def O (0,0,0)
def I [1,0,0]
def J [0,1,0]
def K [0,0,1]
% dependent rotations
% fingers have the last two joints wired together
def middle_1_rot distal_1_rot
def middle_2_rot distal_2_rot
def middle_3_rot distal_3_rot
def middle_4_rot distal_4_rot
% thumb has an extra rotation for opposable-ness!
def opposition_rot rotate(-50, [J])
def thk_scale_0 1.2
put { scale([thk_scale_0,.9,thk_scale_0]) % this distorts a little; oh well
then translate((joint_gap * joint_rad) * [J])
then [[opposition_rot]]
then rotate(meta_0_rot, [I])
then rotate(-spread_rot_0, [K])
then translate((proximal_0_loc) - (O)) }
{finger_0}
put { scale(thk_scale_0 * proximal_distal_ratio^2)
then [[opposition_rot]]
then rotate(meta_0_rot / 2, [I])
then rotate(-spread_rot_0, [K])
then translate((proximal_0_loc) - (O)) }
{joint_sphere}
% index finger
def scale_1 .85
put { scale(scale_1)
then translate((joint_gap * joint_rad) * [J])
then rotate(meta_1_rot, [I])
then rotate(-spread_rot, [K])
then translate((proximal_1_loc) - (O)) }
{finger_1}
put { scale(scale_1 * proximal_distal_ratio^2)
then rotate(meta_1_rot / 2, [I])
then rotate(-spread_rot, [K])
then translate((proximal_1_loc) - (O)) }
{joint_sphere}
% middle finger
put { % no scale then
translate((joint_gap * joint_rad) * [J])
then rotate(meta_2_rot, [I])
% no spread rotation
then translate((proximal_2_loc) - (O)) }
{finger_2}
put { scale(proximal_distal_ratio^2)
then rotate(meta_2_rot / 2, [I])
then translate((proximal_2_loc) - (O)) }
{joint_sphere}
% ring finger
def scale_3 .85
put { scale(scale_3)
then translate((joint_gap * joint_rad) * [J])
then rotate(meta_3_rot, [I])
then rotate(spread_rot, [K])
then translate((proximal_3_loc) - (O)) }
{finger_3}
put { scale(scale_3 * proximal_distal_ratio^2)
then rotate(meta_3_rot / 2, [I])
then rotate(spread_rot, [K])
then translate((proximal_3_loc) - (O)) }
{joint_sphere}
% little finger
def scale_4 .7
put { scale(scale_4)
then translate((joint_gap * joint_rad) * [J])
then rotate(meta_4_rot, [I])
then rotate(2 * spread_rot, [K])
then translate((proximal_4_loc) - (O)) }
{finger_4}
put { scale(scale_4 * proximal_distal_ratio^2)
then rotate(meta_4_rot / 2, [I])
then rotate(2 * spread_rot, [K])
then translate((proximal_4_loc) - (O)) }
{joint_sphere}
% palm is built by sweeping a polygon through a small
% angle in order to make it thicker at the wrist
put { translate(joint_gap * joint_rad * -[J]) } % drop polytope to expose knuckles
sweep { 1, rotate(6, (0,15,0), [I]) }
put { rotate(-3, (0,15,0), [I]) } {
% need two polygons for convexity; the desired shape is concave at the thumb
polygon(proximal_1_loc)(proximal_2_loc)(proximal_3_loc)(proximal_4_loc)
(h5)(h6)(h6a)(h9)(h10)
polygon(h6a)(h7)(h8)(h9)
}
}
% a few views
def viewxf
<frontview> view((0,0,10))
<sideview> view((10,0,0))
<topview> view((0,10,0), (O), -[K])
<> view((7,3,10))
% either a single copy or a repeat to show different angles
def scene
<repeated>
put { [[viewxf]] then scale(.25) } {
def N 4
repeat { N, rotate(270/N, [3,2,1]), translate(14*[I]) } {hand}
}
<> put { [[viewxf]] then scale(.3) } {hand}