reino@cs.eur.nl (Reino de Boer) (06/29/90)
Here is a version of the recycle symbol in METAFONT. Maybe someone feels
the need to convert this to postscript.
input localdevice; mode=localfont; mag=4;
font_size 10pt#;
numeric d[];
wd#=11pt#; % width of bounding box
u#:=1wd#/35; % arbitrary unit
px#:=2/3pt#; % 1/4u#; % pen thickness in x-direction
mode_setup;
py#:=.9px#; % pen thickness in y-direction
define_pixels(u);
define_blacker_pixels(px,py);
% generic code for recycle symbol
%
% parameters:
% code = letter-code for this symbol
% gap = distance between the tip of one arrow and the tail of another
% hgt = height of an arrow-tip
% wdt = width of an arrow at its widest
% bnd = width of arrow-band
% dis = distance of center of symbol to outer curve
%
def generic(expr code,gap,hgt,wdt,bnd,dis) =
d1#:=gap*u#;
d2#:=hgt*u#;
d3#:=wdt*u#;
d4#:=bnd*u#;
d5#:=dis*u#;
dp#:=(d3#-d4#)/2;
define_pixels(d1,d2,d3,d4,d5);
beginchar(code,wd#,wd#,dp#); "The recycle symbol";
pair a[], b[], c[], center;
numeric ax;
transform t;
pickup pencircle xscaled px yscaled py;
% define the three triangles
a1=(0,0); b1=(w,0);
xpart(c1)=xpart(c2)=xpart(c3)=xpart(center)=.5w;
ypart(c1)/w=sind 60;
ypart(a3)=ypart(b3)=d4;
xpart(a3)/ypart(a3)=ypart(c1)/xpart(c1);
xpart(b3)=w-xpart(a3);
(ypart(c3)-d4)/(xpart(c3)-xpart(a3))=ypart(c1)/xpart(c1);
a2=.5[a1,a3]; b2=.5[b1,b3]; c2=.5[c1,c3];
ypart(center)/xpart(center)=xpart(c1)/ypart(c1);
% makelabel("a1",a1);
% makelabel("a2",a2);
% makelabel("a3",a3);
% makelabel("b1",b1);
% makelabel("b2",b2);
% makelabel("b3",b3);
% makelabel("c1",c1);
% makelabel("c2",c2);
% makelabel("c3",c3);
ax=length(center-a1);
% define control-points for one arrow
x1=x2=.5w-.5d1; y1=0; y2=d4; % z1, z2
z10=((ax-d5)/ax)[a1,center]; % z10
(x9-x10)/(.5d4)=.5w/length(c1-a1);
(y10-y9)/(.5d4)=ypart(c1)/length(c1-a1); % z9
z3=2[z9,z10]; % z3
z6=((.5length(c2-a2)-.5d1)/length(c2-a2))[a2,c2]; % z6
z11=((.5length(c2-a2)-.5d1-d2)/length(c2-a2))[a2,c2]; % z11
z4=((.5length(c1-a1)-.5d1-d2)/length(c1-a1))[a1,c1]; % z4
z8=((.5length(c3-a3)-.5d1-d2)/length(c3-a3))[a3,c3]; % z8
z5=((d4+d3)/(2d4))[z8,z4]; % z5
z7=((d4+d3)/(2d4))[z4,z8]; % z7
% draw one arrow
draw z1..z2;
draw z4..z5;
draw z5..z6;
draw z6..z7;
draw z7..z8;
draw z3..z9;
draw z2{left}..tension 3..z3{z3-z9}..tension 3..{c1-a1}z4;
unfill z9..tension 3..{c3-a3}z8--z4{a1-c1}..tension 3..{z9-z3}z3--z9..cycle;
draw z9--z3..tension 3..{c1-a1}z4;
draw z1{a1}..tension 3..{z3-z9}z9..tension 3..{c3-a3}z8;
draw z1{a1}..tension 3..{z3-z9}z9..tension 3..{c3-a3}z8;
t=identity rotatedaround(center,-120);
% rotate the arrow
draw (z1..z2) transformed t;
draw (z4..z5) transformed t;
draw (z5..z6) transformed t;
draw (z6..z7) transformed t;
draw (z7..z8) transformed t;
draw (z3..z9) transformed t;
draw (z2{left}..tension 3..z3{z3-z9}..tension 3..{c1-a1}z4)
transformed t;
unfill (z9..tension 3..{c3-a3}z8--z4{a1-c1}..tension 3..{z9-z3}z3--z9..cycle)
transformed t;
draw (z9--z3..tension 3..{c1-a1}z4) transformed t;
draw (z1{a1}..tension 3..{z3-z9}z9..tension 3..{c3-a3}z8) transformed t;
draw (z1{a1}..tension 3..{z3-z9}z9..tension 3..{c3-a3}z8) transformed t;
% and: the third arrow
draw (z1..z2) transformed (t transformed t);
draw (z4..z5) transformed (t transformed t);
draw (z5..z6) transformed (t transformed t);
draw (z6..z7) transformed (t transformed t);
draw (z7..z8) transformed (t transformed t);
draw (z3..z9) transformed (t transformed t);
draw (z2{left}..tension 3..z3{z3-z9}..tension 3..{c1-a1}z4)
transformed (t transformed t);
unfill (z9..tension 3..{c3-a3}z8--z4{a1-c1}..tension 3..{z9-z3}z3--z9..cycle)
transformed (t transformed t);
draw (z9--z3..tension 3..{c1-a1}z4) transformed (t transformed t);
draw (z1{a1}..tension 3..{z3-z9}z9..tension 3..{c3-a3}z8)
transformed (t transformed t);
draw (z1{a1}..tension 3..{z3-z9}z9..tension 3..{c3-a3}z8)
transformed (t transformed t);
% penlabels(1,2,3,4,5,6,7,8,9,10,11);
endchar; enddef;
% To test various recycle symbols, try to vary the parameters according
% to the following scheme:
% asc:=0;
% for pa = 3 step 1 until 4:
% for pb = 3 step 1 until 3:
% for pc = 8 step 1 until 8:
% for pd = 4 step 1 until 4:
% for pe = 13 step 1 until 14:
% generic(asc,pa,pb,pc,pd,pe);
% asc:=asc+1;
% endfor;
% endfor;
% endfor;
% endfor;
% endfor;
% one particular symbol (which pleased us enough for the experiment)
generic("R",4,3,8,4,14);
end
--
Reino R. A. de Boer "We want to build the right product right, right?"
Erasmus University Rotterdam ( Informatica )
e-mail: reino@cs.eur.nl