7 proofrulethickness 1pt#;
8 makegrid(0pt,0pt for i:=-5pt step 1pt until 5pt: ,i endfor)
9 (0pt,0pt for i:=-5pt step 1pt until 5pt: ,i endfor);
10 proofrulethickness .1pt#;
11 makegrid(0pt,0pt for i:=-4.8pt step .2pt until 4.8pt: ,i endfor)
12 (0pt,0pt for i:=-4.8pt step .2pt until 4.8pt: ,i endfor);
19 def scaledabout(expr point, scale) =
20 shifted -point scaled scale shifted point
24 % Urgh! Want to do parametric types
27 def del_picture_stack=
28 save save_picture_stack, picture_stack_idx;
31 % better versions of Taupin/Egler savepic cmds
34 def make_picture_stack =
35 % override previous stack.
37 picture save_picture_stack[];
38 numeric picture_stack_idx;
39 picture_stack_idx := 0;
40 def push_picture(expr p) =
41 save_picture_stack[picture_stack_idx] := p ;
42 picture_stack_idx := picture_stack_idx + 1;
44 def pop_picture = save_picture_stack[decr picture_stack_idx] enddef;
45 def top_picture = save_picture_stack[picture_stack_idx] enddef;
50 % why can't I delete individual pens?
54 numeric pen_stack_idx;
56 def push_pen(expr p) =
57 save_pen_stack[pen_stack_idx] := p ;
58 pen_stack_idx := pen_stack_idx +1;
60 def pop_pen = save_pen_stack[decr pen_stack_idx] enddef;
61 def top_pen = save_pen_stack[pen_stack_idx] enddef;
64 save save_pen_stack, pen_stack_idx;
73 % err_x: drift of y axis at top
74 % err_y: drift of x axis at right
75 def distorted_ellipse(expr a,b,err_y,err_x,super) =
76 superellipse((a,err_x),(-err_y,b),(-a,-err_x),(err_y,-b),super);
79 def brush(expr a,w,b,v) =
83 penpos3(w,angle(z2-z1)+90);
84 penpos4(w,angle(z2-z1));
85 penpos5(v,angle(z1-z2)+90);
86 penpos6(v,angle(z1-z2));
90 fill z3r{z3r-z5l}..z4l..{z5r-z3l}z3l..z5r{z5r-z3l}..z6l..{z3r-z5l}z5l..cycle;
95 def draw_rounded_path(expr p, thick) =
98 pickup pencircle scaled thick;
100 currentpen := pop_pen;
106 def balled_crook(expr a, w, balldiam, stem) =
109 penpos1(balldiam/2,-90);
110 penpos2(balldiam/2,0);
111 penpos3(balldiam/2,90);
112 penpos4(balldiam/2,180);
113 x4r=xpart a-w; y3r=ypart a+balldiam/4;
117 x5=x4r+9/8balldiam; y5r=y1r;
119 x6l=xpart a; y6l=ypart a;
120 penstroke z1e..z2e..z3e..z4e..z1e..z5e{right}..z6e;
121 penlabels(1,2,3,4,5,6);
126 currentpicture := currentpicture yscaled -1;
127 set_char_box(charbp, charwd, charht, chardp);