6 proofrulethickness 1pt#;
7 makegrid(0pt,0pt for i:=-5pt step 1pt until 5pt: ,i endfor)
8 (0pt,0pt for i:=-5pt step 1pt until 5pt: ,i endfor);
9 proofrulethickness .1pt#;
10 makegrid(0pt,0pt for i:=-4.8pt step .2pt until 4.8pt: ,i endfor)
11 (0pt,0pt for i:=-4.8pt step .2pt until 4.8pt: ,i endfor);
16 tracingequations := tracingonline := 1;
24 def scaledabout(expr point, scale) =
25 shifted -point scaled scale shifted point
30 % make a local (restored after endgroup) copy of t_var
32 def local_copy(text type, t_var)=
43 % Urgh! Want to do parametric types
46 def del_picture_stack=
47 save save_picture_stack, picture_stack_idx;
50 % better versions of Taupin/Egler savepic cmds
53 def make_picture_stack =
54 % override previous stack.
56 picture save_picture_stack[];
57 numeric picture_stack_idx;
58 picture_stack_idx := 0;
59 def push_picture(expr p) =
60 save_picture_stack[picture_stack_idx] := p ;
61 picture_stack_idx := picture_stack_idx + 1;
63 def pop_picture = save_picture_stack[decr picture_stack_idx] enddef;
64 def top_picture = save_picture_stack[picture_stack_idx] enddef;
69 % why can't I delete individual pens?
73 numeric pen_stack_idx;
75 def push_pen(expr p) =
76 save_pen_stack[pen_stack_idx] := p ;
77 pen_stack_idx := pen_stack_idx +1;
79 def pop_pen = save_pen_stack[decr pen_stack_idx] enddef;
80 def top_pen = save_pen_stack[pen_stack_idx] enddef;
83 save save_pen_stack, pen_stack_idx;
90 def simple_serif(expr p,q, a)=
91 p{dir(angle(q-p) -a)} .. q{ - dir(angle(p -q) + a)}
97 % err_x: drift of y axis at top
98 % err_y: drift of x axis at right
99 def distorted_ellipse(expr a,b,err_y,err_x,super) =
100 superellipse((a,err_x),(-err_y,b),(-a,-err_x),(err_y,-b),super);
103 def draw_brush(expr a,w,b,v) =
106 penpos3(w,angle(z2-z1)+90);
107 penpos4(w,angle(z2-z1));
108 penpos5(v,angle(z1-z2)+90);
109 penpos6(v,angle(z1-z2));
113 fill z3r{z3r-z5l}..z4l..{z5r-z3l}z3l..z5r{z5r-z3l}..z6l..{z3r-z5l}z5l..cycle;
116 def brush(expr a,w,b,v) =
123 def draw_rounded_path(expr p, thick) =
124 push_pen(currentpen);
126 pickup pencircle scaled thick;
128 currentpen := pop_pen;
134 def balled_crook(expr a, w, balldiam, stem) =
137 penpos1(balldiam/2,-90);
138 penpos2(balldiam/2,0);
139 penpos3(balldiam/2,90);
140 penpos4(balldiam/2,180);
141 x4r=xpart a-w; y3r=ypart a+balldiam/4;
145 x5=x4r+9/8balldiam; y5r=y1r;
147 x6l=xpart a; y6l=ypart a;
148 penstroke z1e..z2e..z3e..z4e..z1e..z5e{right}..z6e;
149 penlabels(1,2,3,4,5,6);
154 currentpicture := currentpicture yscaled -1;
155 set_char_box(charbp, charwd, charht, chardp);
160 currentpicture := currentpicture scaled -1;
161 set_char_box(charwd, charbp, charht, chardp);