% dots in TR and BL corners
pips 7 := pips 2 rotatedabout ((.5,.5), 90);
% 3 dots on TL to BR diagonal
pips 3 := pips 2;
addto pips 3 also pips 1;
% 3 dots on BL to TR diagonal
pips 8 := pips3 rotatedabout ((.5,.5),90);
% Dots in all 4 corners
pips 4 := pips 2;
addto pips 4 also pips 7;
% dots in all four corners and center
pips 5 := pips 4;
addto pips 5 also pips 1;
% 6 dots, 3 dots on top and three on bottom
pips 6 := pips 4;
addto pips 6 contour dot shifted die_face 2;
addto pips 6 contour dot shifted die_face 4;
% 6 dots, 3 at left and 3 at right
pips 11 := pips6 rotatedabout ((.5,.5),90);
% When three faces are showing, alternates 7, 8 and 11 for 2, 3 and 6 are
% used when the total of the pips is odd (). This is an ad hoc rule that
% matches what I see on my reference die.
vardef pips_sel_iii (expr X)=
X if odd pips_total: if (X=2) or (X=3) or (X=6): + 5 fi fi
enddef;
%
% Choices are less easy when only two faces show:
vardef pips_sel_ii (expr X,Y)=
X if ((X=2) and ((Y=3) or (Y=4))) or
((X=3) and ((Y=1) or (Y=6))) or
((X=6) and ((Y=2) or (Y=5))): + 5
fi
enddef;
if known outputtemplate:
outputtemplate := "die3d-%c.mps";
elseif known mpversion:
filenametemplate "die3d-%c.mps";
fi
% The 8 permissible views (up to rotation) with three faces equally
% visible of a right handed die:
beginfig(123);
die_three(1,2,3) scaled die_size;
endfig;
% The 12 permissible views (up to rotation) with only two faces equally
% visible of a right handed die:
beginfig(12);
die_two(1,2) scaled die_size;
endfig;