% +AMDG  This document was begun on 4 August 11EX, the feast
% of St. Dominic, C, and it is humbly dedicated to him and
% to the Immaculate Heart of Mary for their prayers, and to
% the Sacred Heart of Jesus for His mercy.

beginchar(oct"000",cap#,cap#,0); "Six-petaled flower";

fill fullcircle scaled 2dotwid shifted (w/2,h/2);
z0 = (w/2,h/2) shifted (0,1.5dotwid);
z1 = (w/2,h);
z2 = z1 shifted (dotwid,-dotwid);
z3 = z1 shifted (-dotwid,-dotwid);
z4 = z0 shifted (dotwid/2,dotwid/2);
z5 = z0 shifted (-dotwid/2,dotwid/2);
path petal; petal = z0..z4---z2..z1..z3---z5..cycle;
fill petal;
fill petal rotatedaround ((w/2,h/2),60);
fill petal rotatedaround ((w/2,h/2),120);
fill petal rotatedaround ((w/2,h/2),180);
fill petal rotatedaround ((w/2,h/2),240);
fill petal rotatedaround ((w/2,h/2),300);

penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
endchar;

beginchar(oct"001",ex#,ex#,0); "Checkerboard";

z0 = (0,h);
z1 = (w/3,h);
z2 = (w/3,2h/3);
z3 = (0,2h/3);
path square; square = z0--z1--z2--z3--cycle;
fill square;
fill square shifted (w/3,-h/3);
fill square shifted (0,-2h/3);
fill square shifted (2w/3,0);
fill square shifted (2w/3,-2h/3);

penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
endchar;

beginchar(oct"002",ex#,ex#,0); "Inverse Checkerboard";
fill square shifted (w/3,0);
fill square shifted (0,-h/3);
fill square shifted (2w/3,-h/3);
fill square shifted (w/3,-2h/3);
endchar;

beginchar(oct"003",doubex#,doubex#,0); "Triple bar";

pickup semiextextthickpen;
top z0 = (0,h);
top z1 = (w,h);
bot z2 = (0,0);
bot z3 = (w,0);
draw z0--z1; draw z2--z3;
pickup extextthickpen;
z4 = (0,h/2);
z5 = (w,h/2);
draw z4--z5;

picture triplebarext; triplebarext := currentpicture;

penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
endchar;

beginchar(oct"004",doubex#+ex#,doubex#,ex#);
"Triple bar, upper left corner";

pickup semiextextthickpen;
top lft z0 = (0,h);
top rt z1 = (w,h);
bot rt z2 = (doubex,0);
bot rt z3 = (w,0);
draw z0--z1; draw z2--z3;
pickup extextthickpen;
z4 = ((x0+x2)/2,h/2);
rt z5 = (w,h/2);
draw z4--z5;
pickup semiextextthickpen;
z6 = (x0,-d);
draw z0--z6;
pickup extextthickpen;
z7 = (x4,-d);
draw z4--z7;
pickup semiextextthickpen;
z8 = (x2,-d);
draw z2--z8;

picture triplecorner; triplecorner := currentpicture;

penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
endchar;

beginchar(oct"005",doubex#+ex#,doubex#,ex#);
"Triple bar, upper right corner";
currentpicture := triplecorner reflectedabout 
	((w/2,h),(w/2,-d));
endchar;

beginchar(oct"006",doubex#+ex#,doubex#,ex#);
"Triple bar, lower right corner";
currentpicture := triplecorner reflectedabout
	((w/2,h),(w/2,-d)) reflectedabout
	((0,0),(w,0)) shifted (0,ex);
endchar;

beginchar(oct"007",doubex#+ex#,doubex#,ex#);
"Triple bar, lower left corner";
currentpicture := triplecorner reflectedabout
	((0,0),(w,0)) shifted (0,ex);
endchar;

beginchar(oct"010",doubex#,doubex#,ex#); "Triple bar, lowered";
currentpicture := triplebarext shifted (0,-d);
endchar;

beginchar(oct"011",doubex#,doubex#,0); "Triple bar, vertical, left";
currentpicture := triplebarext rotatedaround ((doubex/2,doubex/2),90);
endchar;

beginchar(oct"012",2doubex#,doubex#,0); "Triple bar, vertical, right";
currentpicture := triplebarext rotatedaround ((doubex/2,doubex/2),90)
	shifted (doubex,0);
endchar;

beginchar(oct"013",0.75doubex#,0.75doubex#,0); "Clam shell, upright";

z0 = (0,h/4);
z1 = (0,3h/4);
z2 = (w/2,h);
z3 = 0.5[z1,z2];
z4 = (w/4,0);
z5 = (w/3,h/8);
z6 = 0.5[z4,z5];
z10 = z0 reflectedabout ((w/2,h),(w/2,0));
z11 = z1 reflectedabout ((w/2,h),(w/2,0));
z13 = z3 reflectedabout ((w/2,h),(w/2,0));
z14 = z4 reflectedabout ((w/2,h),(w/2,0));
z15 = z5 reflectedabout ((w/2,h),(w/2,0));
z16 = z6 reflectedabout ((w/2,h),(w/2,0));
z7 = (z3--(w/2,0)) intersectionpoint (z5--z15);
z17 = z7 reflectedabout ((w/2,h),(w/2,0));

pickup extthickpen;
draw z4--z5--z15--z14--cycle;
draw z16---z11..{dir 210}z13{dir 150}..{left}z2{left}..
	{dir 210}z3{dir 150}..z1---z6;
pickup thickpen scaled 2;
draw z3--z7;
draw z13--z17;

penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17);
endchar;
