-
Notifications
You must be signed in to change notification settings - Fork 1
/
FRACTAL2.PS
executable file
·134 lines (132 loc) · 2.83 KB
/
FRACTAL2.PS
1
%!PS-Adobe-2.0%%Title: fractal2.ps%%Creator: Rhea Myers%%EndComments:%%Prolog:/defaults save def%Basic variables and operations for redefining drawing commands /modify { %def dup 0 eq { pop 1 } if rand 4294967294 div .75 add mul cvi %multiplies integer by 75-125% } bind def /2modify { %def 2 { modify 1 2 roll } repeat %modifies top 2 numbers on stack } bind def/5modify { %def 5 { modify 1 5 roll } repeat %modifies top 5 numbers on stack} bind def/6modify { %def 6 { modify 1 6 roll } repeat %modifies top 6 numbers on stack} bind def %Rename drawing functions /*moveto /moveto load def /*lineto /lineto load def /*arcto /arcto load def /*curveto /curveto load def /*arc /arc load def /*rmoveto /rmoveto load def /*rlineto /rlineto load def /*rcurveto /rcurveto load def /*arcn /arcn load def%Redefine drawing functions/moveto { %def 2modify *moveto } bind def/lineto { %def 2modify *lineto} bind def/arcto { %def 5modify *arcto}bind def/curveto { %def 6modify *curveto} bind def/arc { %def 5modify *curveto} bind def/rmoveto { %def 2modify *rmoveto} bind def/rlineto { %def 2modify *rlineto} bind def/rcurveto { %def 6modify *rcurveto} bind def/arcn { %def 5modify *arcn} bind def %Rename text commands/*show /show load def %rename show%Redefine text commands/show { %def %redefine show for filled characters only { %forall /charcode exch def /thischar ( ) dup 0 charcode put def gsave currentpoint %store stating point for character /starty exch def /startx exch def thischar false charpath %get character outline /thispath [ %cvx -simulate upath for level 1- exch {/ucache cvx} if pathbbox /setbbox cvx {/moveto cvx} {/lineto cvx} {/curveto cvx} {/closepath cvx} pathforall ] cvx def /thispath load flattenpath pathbbox setbbox startx starty moveto thispath currentfont begin PaintType 2 eq { %ifelse stroke }{ %else fill end } ifelse grestore thischar stringwidth pop ( ) rmoveto } forall} bind def%%EndProloggsave% --------- Variables & Procedures ---------/depth 0 def/maxdepth 10 def/down { /depth depth 1 add def } def/up { /depth depth 1 sub def } def/DoLine { %def-print a vertical line 0 600 rlineto currentpoint stroke translate 0 0 moveto} bind def/FractArrow { %def gsave .6 .6 scale %reduce scale 10 setlinewidth %set line width down DoLine %print line depth maxdepth le %depth<maximum depth? { %if 135 rotate FractArrow -270 rotate FractArrow }if up grestore } bind def% ---------- Begin Program ----------300 300 movetoFractArrowstroke grestore%%Trailer:showpagedefaults restore