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
29 % Urgh! Want to do parametric types
32 def del_picture_stack=
33 save save_picture_stack, picture_stack_idx;
36 % better versions of Taupin/Egler savepic cmds
39 def make_picture_stack =
40 % override previous stack.
42 picture save_picture_stack[];
43 numeric picture_stack_idx;
44 picture_stack_idx := 0;
45 def push_picture(expr p) =
46 save_picture_stack[picture_stack_idx] := p ;
47 picture_stack_idx := picture_stack_idx + 1;
49 def pop_picture = save_picture_stack[decr picture_stack_idx] enddef;
50 def top_picture = save_picture_stack[picture_stack_idx] enddef;
55 % why can't I delete individual pens?
59 numeric pen_stack_idx;
61 def push_pen(expr p) =
62 save_pen_stack[pen_stack_idx] := p ;
63 pen_stack_idx := pen_stack_idx +1;
65 def pop_pen = save_pen_stack[decr pen_stack_idx] enddef;
66 def top_pen = save_pen_stack[pen_stack_idx] enddef;
69 save save_pen_stack, pen_stack_idx;
78 % err_x: drift of y axis at top
79 % err_y: drift of x axis at right
80 def distorted_ellipse(expr a,b,err_y,err_x,super) =
81 superellipse((a,err_x),(-err_y,b),(-a,-err_x),(err_y,-b),super);
84 def draw_brush(expr a,w,b,v) =
87 penpos3(w,angle(z2-z1)+90);
88 penpos4(w,angle(z2-z1));
89 penpos5(v,angle(z1-z2)+90);
90 penpos6(v,angle(z1-z2));
94 fill z3r{z3r-z5l}..z4l..{z5r-z3l}z3l..z5r{z5r-z3l}..z6l..{z3r-z5l}z5l..cycle;
97 def brush(expr a,w,b,v) =
104 def draw_rounded_path(expr p, thick) =
105 push_pen(currentpen);
107 pickup pencircle scaled thick;
109 currentpen := pop_pen;
115 def balled_crook(expr a, w, balldiam, stem) =
118 penpos1(balldiam/2,-90);
119 penpos2(balldiam/2,0);
120 penpos3(balldiam/2,90);
121 penpos4(balldiam/2,180);
122 x4r=xpart a-w; y3r=ypart a+balldiam/4;
126 x5=x4r+9/8balldiam; y5r=y1r;
128 x6l=xpart a; y6l=ypart a;
129 penstroke z1e..z2e..z3e..z4e..z1e..z5e{right}..z6e;
130 penlabels(1,2,3,4,5,6);
135 currentpicture := currentpicture yscaled -1;
136 set_char_box(charbp, charwd, charht, chardp);
141 currentpicture := currentpicture scaled -1;
142 set_char_box(charwd, charbp, charht, chardp);