%!PS-Adobe % universal constants /mm { 72 mul 25.4 div } bind def /pi 3.14159 def /radians { 180 mul pi div } bind def /awl { currentpoint gsave newpath 1.5 0 360 arc fill grestore } def /mark { currentpoint gsave newpath 5 0 360 arc stroke grestore } def % begin configuration /D 65 mm def /theta 0.3039 def % by experiment, theta=0.35458 gave an eggness of 1.156 % theta=0.3039 seems to equalise the two orthogonal circumferences /clearance 2.5 mm def /holespacing 4.0 mm def % end configuration % derived stuff, see www.pjb.com.au/jug/two_peice_balls.html % /D D 0.97 mul def % fudge factor to compensate for stretching /r_over_d 0.5 0.25 pi mul theta div add def /cos_theta theta radians cos def /alpha cos_theta 2.0 r_over_d mul 1.0 cos_theta sub mul sub def /d D pi mul 4.0 div cos_theta div def /r d r_over_d mul def /d_over_2 d 0.5 mul def /l r theta radians sin mul 2.0 mul d theta radians sin mul add def /n d pi 0.5 mul theta add mul holespacing div round def % num of points per arc /d_theta pi theta add theta add n div radians def /d_phi theta 2.0 mul n div radians def % display and layout stuff /dx d 1.2 mul def /xinst 70 mm def /yinst 15 mm def /stagger 0.05 def /strip { % scissor lines newpath l 0.5 mul 0 d_over_2 clearance add 270 theta radians sub 90 theta radians add arc stroke newpath 0 r d_over_2 add cos_theta mul r clearance sub 270 theta radians sub 270 theta radians add arc stroke newpath l -0.5 mul 0 d_over_2 clearance add 90 theta radians sub 270 theta radians add arc stroke newpath 0 r d_over_2 add cos_theta mul -1 mul r clearance sub 90 theta radians sub 90 theta radians add arc stroke % awl dots along the sides gsave 0 r d_over_2 add cos_theta mul translate /t d_phi theta radians sub def /i 2 def { r t sin mul r t cos mul -1 mul moveto awl i n ge { exit } if /t t d_phi add def /i i 1 add def } loop grestore gsave 0 r d_over_2 add cos_theta mul -1 mul translate /t d_phi theta radians sub def /i 2 def { r t sin mul r t cos mul moveto awl i n ge { exit } if /t t d_phi add def /i i 1 add def } loop grestore % awl dots round the semicircles gsave l 0.5 mul 0 translate /t d_theta theta radians sub def /i 2 def { d_over_2 t sin mul d_over_2 t cos mul moveto awl i n ge { exit } if /t t d_theta add def /i i 1 add def } loop % awl dots and marks at the joins d_over_2 theta radians sin mul -1.0 mul d_over_2 theta radians cos mul moveto mark awl d_over_2 theta radians sin mul -1.0 mul d_over_2 theta radians cos mul -1.0 mul moveto mark awl grestore gsave l -0.5 mul 0 translate /t d_theta theta radians sub def /i 2 def { d_over_2 t sin mul -1 mul d_over_2 t cos mul moveto awl i n ge { exit } if /t t d_theta add def /i i 1 add def } loop % awl dots and marks at the joins d_over_2 theta radians sin mul d_over_2 theta radians cos mul moveto mark awl d_over_2 theta radians sin mul d_over_2 theta radians cos mul -1.0 mul moveto mark awl grestore } bind def % print instructions ... /Times-Roman findfont 10 scalefont setfont xinst yinst 12 mm add moveto (Two_piece juggling ball) show xinst yinst 6 mm add moveto (approx 65mm diam, 115 grams) show xinst yinst moveto (see http://www.pjb.com.au/jug) show 105 mm dx stagger mul 0.5 mul sub dx translate strip dx stagger mul dx translate strip dx stagger mul -1.0 mul dx translate strip dx stagger mul dx translate strip showpage