User:Chrissy/projects/PostScript

From XPUB & Lens-Based wiki

14.01.2025 With Manetta in Prototyping we worked with PostScript & printed with the final results a Zine together.
That was mine, the the code for the fern I found here: https://www.pvv.org/~andersr/fractal/PostScript.html


Chrissy PostScript 01.pdf

code

newpath
170 70 moveto
0 72 rlineto
72 0 rlineto
0 -72 rlineto
-72 0 rlineto
closepath
1 0.75 0.8 setrgbcolor
4 setlinewidth
stroke

newpath
270 360 moveto
0 72 rlineto
72 0 rlineto
0 -72 rlineto
-72 0 rlineto
closepath
1 0.75 0.8 setrgbcolor
8 setlinewidth
stroke

newpath
70 30 moveto
0 100 rlineto
72 0 rlineto
0 -72 rlineto
-72 0 rlineto
closepath
0 0 0 setrgbcolor
4 setlinewidth
stroke

newpath
270 360 moveto
0 282 rlineto
164 0 rlineto
0 -94 rlineto
-164 0 rlineto
closepath
1 0.75 0.8 setrgbcolor
8 setlinewidth
stroke

newpath
270 360 moveto
0 282 rlineto
164 0 rlineto
0 -94 rlineto
-164 0 rlineto
0 0 0 setrgbcolor
2 setlinewidth
stroke

newpath
274 364 moveto
0 282 rlineto
164 0 rlineto
0 -94 rlineto
-164 0 rlineto
0 0 0 setrgbcolor
2 setlinewidth
stroke

newpath
278 368 moveto
0 282 rlineto
164 0 rlineto
0 -94 rlineto
-164 0 rlineto
1 0.75 0.8 setrgbcolor
2 setlinewidth
stroke

newpath
284 374 moveto
0 282 rlineto
164 0 rlineto
0 -94 rlineto
-164 0 rlineto
0 0 0 setrgbcolor
2 setlinewidth
stroke

newpath
100 100 moveto
0 20 rlineto
20 0 rlineto
0 -100 rlineto
-100 0 rlineto
0 0 0 setrgbcolor
closepath
7 setlinewidth
stroke

/Helvetica findfont 30 scalefont setfont

/square 
{ newpath    
0 0 moveto
90 0 lineto
90 90 lineto
0 90 lineto
0 0 0 setrgbcolor
closepath
2 setlinewidth
stroke
6 92 moveto 
(<3) show } def

square  
300 150 translate 
60 rotate  
square 
300 150 translate
60 rotate
square  


/depth 0 def

/maxdepth 10 def
/down {/depth depth 1 add def} def
/up {/depth depth 1 sub def} def

/DoLine
{ 0 144 rlineto currentpoint
stroke translate 0 0 moveto} def
/FractArrow
{ gsave .9 .6 scale
8 setlinewidth
down DoLine
depth maxdepth le
{ 180 rotate FractArrow
-200 rotate FractArrow} if
up grestore } def
0 0 0 setrgbcolor

100 100 moveto
1 1 scale
FractArrow
stroke


/depth 0 def

/maxdepth 10 def
/down {/depth depth 1 add def} def
/up {/depth depth 1 sub def} def

/DoLine
{ 0 144 rlineto currentpoint
stroke translate 0 0 moveto} def
/FractArrow
{ gsave .9 .6 scale
8 setlinewidth
down DoLine
depth maxdepth le
{ 80 rotate FractArrow
-170 rotate FractArrow} if
up grestore } def
1 0.75 0.8 setrgbcolor

200 200 moveto
0.5 0.5 scale
FractArrow
stroke


%!PS-Adobe-1.0
%%Title:Random Fern
%%Creator:Eric Wicklund
% Last modified: MLO 02 Jan 1993 11:24:14
% Changed: 'save' and 'restore' statements (incorrect grammar);
% length added, and set to 0.001 (0 does not work with Post 1.7).
/m1 [  0.00  0.00  0.00  0.16  0.00 0.00 ] def
/m2 [  0.85 -0.04  0.04  0.85  0.00 1.60 ] def
/m3 [  0.20  0.23 -0.26  0.22  0.00 1.60 ] def
/m4 [ -0.15  0.26  0.28  0.24  0.00 0.44 ] def
/point 72 def
%/length 0 def
/length 0.001 def
%%EndProlog
%%Page: 1 1
/zzz save def
% will draw inside a 8 inch square centered on 8.5 by 11 inch page
90 rotate
0 0 0 setrgbcolor

-5.00 point mul -4.5 point mul translate
0.8 point mul dup scale
% x coordinate ranges from -5 to 5
% y coordinate ranges from  0 to 10
1 setlinecap
0.005 setlinewidth
% First point at origin
0 0
150000 {
% Pick a transformation matrix probabilistically
   /r rand 100 mod def
   r  1 lt { /m m1 def }
 { r 86 lt { /m m2 def }
 { r 93 lt { /m m3 def }
           { /m m4 def } ifelse } ifelse } ifelse
% Make a linear transformation, then
% plot a point at current location
   m transform 2 copy moveto
   length length rlineto
   stroke
} repeat
zzz restore
%%Trailer

%Line 5
5 setlinewidth
2 setlinecap
[25 25 25 25] 0 setdash
200 300 moveto
400 200 lineto
1 0.75 0.8 setrgbcolor
15 setlinewidth
stroke

%Line 5
5 setlinewidth
2 setlinecap
[25 25 25 25] 0 setdash
200 300 moveto
300 600 lineto
0 0 0 setrgbcolor
15 setlinewidth
stroke


%Line 5
5 setlinewidth
2 setlinecap
[25 25 25 25] 0 setdash
-46 -200 moveto
-300 288 lineto
0 0 0 setrgbcolor
stroke


%Line 2
10 setlinewidth
[1 10] 0 setdash
0 150 moveto
400 150 lineto
stroke


%dotted thing

150 150 translate

7 {
-60 -60 moveto
0 250 rlineto
150 0 rlineto
0 -150 rlineto
-250 0 rlineto
2 setlinewidth  
stroke
2 rotate
1.1 1.1 scale

}repeat


showpage