%#################################################################### /setdashes { [.06 .06] 0 setdash .5 72 div setlinewidth 0 0 0 setrgbcolor } def %#################################################################### /background { gsave newpath -50 -50 moveto -50 50 lineto 50 50 lineto 50 -50 lineto closepath .375 .75 .875 setrgbcolor fill grestore } def %#################################################################### %inputs: 1 - radius - 2 - xy location of circle center as array - %3 - angle of xy rotation - 4 - angle of 3d rotation %5 - array of start and ending angle of dashed section %6 - flag 2= blank section 1=dashed section, 0=nothing %7 - optional set color for fill %8 - flag 0 = stroke, 1 = fill /circle { 30 dict begin gsave gsave3d /FFlag exch def FFlag 1 eq {/rgb exch def}if /DBflag exch def DBflag 0 ne { /Adash exch def /Astart Adash 0 get def /Aend Adash 1 get def }{/Astart 0 def /Aend 0 def }ifelse /A3d exch def /Axy exch def /center exch def %array [x y] of location of center of circle /r exch def /theta Aend def /xo theta cos r mul def /yo theta sin r mul def center aload pop translate Axy rotate [0 1 0] A3d rotate3d %#### %draw solid portion xo yo 0 moveto3d Aend .1 Astart 360 add { /theta1 exch def /x1 theta1 cos r mul def /y1 theta1 sin r mul def x1 y1 0 lineto3d }for FFlag 0 eq{stroke}{rgb aload pop setrgbcolor fill}ifelse stroke %##### %now do dashed or blank portion DBflag 1 eq { setdashes /theta Astart def /xo theta cos r mul def /yo theta sin r mul def xo yo 0 moveto3d Astart .1 Aend { /theta1 exch def /x1 theta1 cos r mul def /y1 theta1 sin r mul def x1 y1 0 lineto3d }for stroke }if grestore3d grestore end} def %#################################################################### %inputs: 1 - radius - 2 - xy location of hemisphere center as array - %3 - angle of xy rotation 4 - flag 0=solid back, 1=dotted back, 2=no back %5 - flag 0=stroke, 1=fill /hemisphere{15 dict begin gsave /FFlag exch def FFlag 1 eq{/rgb exch def}if /BFlag exch def /Axy exch def /center exch def /r exch def center aload pop translate Axy rotate %#### %draw upper portion newpath r 0 0 moveto3d 0 .1 180 { /theta1 exch def /x1 theta1 cos r mul def /y1 theta1 sin r mul def x1 y1 0 lineto3d }for %##### %now do bottom of section gsave3d [0 1 0] 70 rotate3d 90 rotate r 90 cos mul r 90 sin mul 0 moveto3d 90 .1 270 { /theta1 exch def /x1 theta1 cos r mul def /y1 theta1 sin r mul def x1 y1 0 lineto3d }for FFlag 0 eq {stroke}{rgb aload pop setrgbcolor fill}ifelse BFlag 2 ne{ BFlag 1 eq{setdashes}if newpath r 270 cos mul r 270 sin mul 0 moveto3d 270 .1 450{ /theta1 exch def /x1 theta1 cos r mul def /y1 theta1 sin r mul def x1 y1 0 lineto3d }for FFlag 0 eq {stroke}{rgb aload pop setrgbcolor fill}ifelse }if grestore3d grestore end} def %#################################################################### /makestar { 10 dict begin gsave /center exch def /r exch def center aload pop translate 0 r moveto r 234 cos mul r 234 sin mul lineto r 18 cos mul r 18 sin mul lineto r 162 cos mul r 162 sin mul lineto r 306 cos mul r 306 sin mul lineto closepath [] 0 setdash .875 .875 0 setrgbcolor fill grestore end} def %#################################################################### /circtextdict 16 dict def circtextdict begin /findhalfangle { stringwidth pop 2 div 2 xradius mul pi mul div 360 mul } def %#################################################################### /outsideplacechar { /char exch def /halfangle char findhalfangle def gsave halfangle neg rotate radius 0 translate -90 rotate char stringwidth pop 2 div neg 0 moveto char show grestore halfangle 2 mul neg rotate } def /pi 3.1415923 def end %#################################################################### /outsidecircletext { circtextdict begin /radius exch def /centerangle exch def /ptsize exch def /str exch def /xradius radius ptsize add def gsave centerangle str findhalfangle add rotate str { /charcode exch def ( ) dup 0 charcode put outsideplacechar } forall grestore end } def %#################################################################### /dot {10 dict begin gsave /rgb exch def /center exch def /r exch def center aload pop translate /createdot{r 0 moveto 0 .1 360{ /theta1 exch def /x1 theta1 cos r mul def /y1 theta1 sin r mul def x1 y1 lineto }for } def rgb aload pop setrgbcolor createdot fill 0 0 0 setrgbcolor createdot stroke grestore end }def %#################################################################### /arrowhead { 10 dict begin /point exch def /r exch def gsave point aload pop translate 0 0 moveto r neg r neg lineto r r neg lineto closepath fill grestore end} def %####################################################################