Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %!Postscript File
- %
- % % ------------------------------------------------------
- % % These are unit definitions. They define conversion factors for
- % % common units like mils, inches, millimeters, etc.
- % % ------------------------------------------------------
- /mil { 0.072 mul } def
- /in { 72 mul } def
- /mm { 2.83464567 mul } def
- %
- % ------------------------------------------------------
- % The Golden Ratio
- % ------------------------------------------------------
- /phi 1.618034 def
- % ------------------------------------------------------
- % 19mm tile width fits fairly well into an A4 sheet
- % and is a good size for fridge magnets. (20mm is just
- % a smidgin too big for A4)
- % ------------------------------------------------------
- /tilesize 19 mm def
- % ------------------------------------------------------
- % According to the theory of Penrose tiling, the
- % thick:thin tile ratio should be approximately 16:10
- % so here we have 99:63, making each sheet good for
- % making patterns with only a few tiles left over.
- % ------------------------------------------------------
- /thinrows 7 def
- /thincols 9 def
- /thickrows 11 def
- /thickcols 9 def
- % ------------------------------------------------------
- % This probably should be left as zero.
- % ------------------------------------------------------
- /tilegap 0 mm def
- % ------------------------------------------------------
- % If you increase this size you'll have to change the
- % radius of the arcs or they'll collide on the thin
- % tiles.
- % ------------------------------------------------------
- /linewidth 1 mm def
- % ------------------------------------------------------
- % Arc colours in RGB format
- % ------------------------------------------------------
- /colour1 {1 0 0} def % small radius
- /colour2 {0 0 1} def % large radius
- /colour3 {0 0 0} def % bisectors (not currently used
- % because they collide with the
- % arcs on the thin tile))
- %/colour2 {1 0.843 0} def % gold
- %/colour1 {0.753 0.753 0.753} def % silver
- % ------------------------------------------------------
- % ------------------------------------------------------
- % Little below here should need changing
- % ------------------------------------------------------
- % ------------------------------------------------------
- % draw a tile (args: <rotation> <x origin> <y origin>)
- % ------------------------------------------------------
- /tile {
- gsave
- translate
- 0 mm setlinewidth
- newpath
- 0 0 moveto
- tilesize 0 rlineto
- dup neg rotate
- %-54 rotate
- 0 tilesize rlineto
- rotate
- %54 rotate
- tilesize neg 0 rlineto
- closepath
- stroke
- grestore
- } def
- % ------------------------------------------------------
- % draw alignment arcs for thick tiles
- % (args: <x origin> <y origin>)
- % ------------------------------------------------------
- /thickarcs {
- gsave
- translate
- 36 rotate
- % arc 1
- linewidth setlinewidth
- colour1 setrgbcolor
- newpath
- 0 0
- tilesize 5 phi div div
- -36 36 arc
- stroke
- % outlines
- 0 mm setlinewidth
- colour3 setrgbcolor
- newpath
- 0 0
- tilesize 5 phi div div linewidth 2 div add
- -36 36 arc
- stroke
- newpath
- 0 0
- tilesize 5 phi div div linewidth 2 div sub
- -36 36 arc
- stroke
- % arc 2
- linewidth setlinewidth
- colour2 setrgbcolor
- newpath
- tilesize phi div tilesize add 0
- tilesize 0.75 mul
- 144 216 arc
- stroke
- 0 mm setlinewidth
- colour3 setrgbcolor
- newpath
- tilesize phi div tilesize add 0
- tilesize 0.75 mul linewidth 2 div add
- 144 216 arc
- stroke
- % outlines
- newpath
- tilesize phi div tilesize add 0
- tilesize 0.75 mul linewidth 2 div sub
- 144 216 arc
- stroke
- -36 rotate
- grestore
- } def
- %
- % ------------------------------------------------------
- % draw alignment arcs for tin tiles
- % (args: <x origin> <y origin>)
- % ------------------------------------------------------
- /thinarcs {
- gsave
- translate
- 18 rotate
- %newpath
- %0 0 moveto
- %0 10 lineto
- %stroke
- % ------------------------------------------------
- % arc 1
- linewidth setlinewidth
- colour1 setrgbcolor
- newpath
- 0 0
- tilesize 5 phi div div
- 18 162 arc
- stroke
- % outlines
- colour3 setrgbcolor
- 0 mm setlinewidth
- newpath
- 0 0
- tilesize 5 phi div div linewidth 2 div sub
- 18 162 arc
- stroke
- newpath
- 0 0
- tilesize 5 phi div div linewidth 2 div add
- 18 162 arc
- stroke
- % ------------------------------------------------
- % arc 2
- linewidth setlinewidth
- colour2 setrgbcolor
- newpath
- %tilesize 108 sin mul 0
- 0 tilesize phi div
- tilesize 4 div
- 198 -18 arc
- stroke
- % outlines
- colour3 setrgbcolor
- 0 mm setlinewidth
- newpath
- 0 tilesize phi div
- tilesize 4 div linewidth 2 div sub
- 198 -18 arc
- stroke
- newpath
- 0 tilesize phi div
- tilesize 4 div linewidth 2 div add
- 198 -18 arc
- stroke
- % ------------------------------------------------
- -18 rotate
- grestore
- } def
- % ------------------------------------------------------
- % % draw Robinson bisectors
- % % ------------------------------------------------------
- /bisector {
- gsave
- translate
- linewidth 2 div setlinewidth
- colour3 setrgbcolor
- tilesize 0 moveto
- 36 rotate
- tilesize 0 rmoveto
- -36 rotate
- 0 0 lineto
- stroke
- grestore
- } def
- % ------------------------------------------------------
- % draw tiles centred on A4 sheet
- % ------------------------------------------------------
- 210 mm tilesize 36 cos mul tilesize thincols mul add sub 2 div
- 297 mm tilesize 72 sin mul thickrows mul tilesize 36 sin mul thinrows mul add sub 2 div
- translate
- % ------------------------------------------------------
- % draw thin tiles
- % ------------------------------------------------------
- 0 1 thincols 1 sub {
- /xp exch tilesize tilegap add mul def
- 0 1 thinrows 1 sub {
- /yp exch tilesize 36 sin mul tilegap add mul def
- 18 xp tilesize add yp thinarcs
- 54 xp yp tile
- %xp yp bisector
- } for
- } for
- % ------------------------------------------------------
- % draw thick tiles
- % ------------------------------------------------------
- 0 thinrows tilesize 36 sin mul tilegap add thinrows mul translate
- 0 1 thickcols 1 sub {
- /xp exch tilesize tilegap add mul def
- 0 1 thickrows 1 sub {
- /yp exch tilesize 72 sin mul tilegap add mul def
- xp yp thickarcs
- 18 xp yp tile
- %xp yp bisector
- } for
- } for
- % ------------------------------------------------------
- % annotation
- % ------------------------------------------------------
- /Times-Roman findfont
- 12 scalefont
- setfont
- thincols tilesize 72 sin mul tilegap add mul tilesize 1.2 mul add tilesize 2 div moveto
- 90 rotate
- (Penrose P3 Tiles for the fridge. Print these on A4 magnetic sheet and cut them along the thin lines.) show
- 0 0 rmoveto
- /Times-Roman findfont
- 6 scalefont
- setfont
- ( [ChrisG 2017]) show
- showpage
- % that's all
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement