Jason (jcreed) wrote,
Jason
jcreed

Heh. dfontaine was hacking a postscript sierpinski triangle as an exercise, and wrote it up on the whiteboard. Intentionally tweaking the rotations makes %!PS-Adobe 3.0

20 dict begin
280 280 scale
newpath
/tri{
dup 0 gt
{ 1 sub 0.5 0.5 scale 120 rotate
1 0 rlineto tri
1 0 rlineto -118 rotate 1 0 rlineto tri
1 0 rlineto -120 rotate 1 0 rlineto tri
1 0 rlineto 120 rotate 2 2 scale 1 add} if
} def
1.1 0.1 moveto
-1 0 rlineto 60 rotate 2 0 rlineto -120 rotate
2 0 rlineto 60 rotate -1 0 rlineto 7 tri

1 480 div dup scale
stroke
end
showpage
. I love how errors in graphics are as often as not not all that erroneous.
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 4 comments