home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / SourceCode / Tutorial / Cookbook / 34.RandomShapes / shapes.psw < prev   
Encoding:
Text File  |  1993-01-18  |  1.2 KB  |  90 lines

  1. defineps drawSquare()
  2. 0.0 setgray
  3.     newpath
  4.         25 25 moveto
  5.         50 0 rlineto
  6.         0 50 rlineto
  7.         -50  0 rlineto
  8.     closepath
  9.     fill
  10. endps
  11.  
  12. defineps drawHeart()
  13.     0.0 setgray
  14.     newpath
  15.         50 50 moveto
  16.         30 100 0.0 50 50.0 10 curveto
  17.         50 50 moveto    
  18.         70 100 100 50 50 10 curveto
  19.         closepath
  20.     fill
  21. endps
  22.  
  23. defineps drawCircle()
  24.     0.0 setgray
  25.     0 0 30 0 360 arc fill
  26. endps
  27.  
  28. defineps drawDiamond()
  29.     0.0 setgray
  30.     newpath
  31.         50 10 moveto
  32.         80 50 lineto
  33.         50 90 lineto
  34.         20 50 lineto
  35.     closepath
  36.     fill
  37. endps
  38.  
  39. defineps drawFlower()
  40.     gsave
  41.         0.0 setgray
  42.         50 50 translate
  43.         newpath
  44.             0 0 moveto
  45.             40 50 -40 50 0 0 curveto
  46.             60 rotate
  47.             40 50 -40 50 0 0 curveto
  48.             60 rotate
  49.             40 50 -40 50 0 0 curveto
  50.             60 rotate
  51.             40 50 -40 50 0 0 curveto
  52.             60 rotate
  53.             40 50 -40 50 0 0 curveto
  54.             60 rotate
  55.             40 50 -40 50 0 0 curveto
  56.         closepath
  57.         fill
  58.     grestore
  59. endps
  60.  
  61. defineps drawTriangle()
  62.     0 setgray
  63.     newpath
  64.         90 10 moveto
  65.         50 90 lineto
  66.         10 10 lineto
  67.     closepath
  68.     fill
  69. endps
  70.  
  71. defineps drawRectangle()
  72.     0 setgray
  73.     newpath
  74.         10 25 moveto
  75.         80 0 rlineto
  76.         0 50 rlineto
  77.         -80  0 rlineto
  78.         closepath
  79.       fill
  80. endps
  81.  
  82. defineps drawLine()
  83.     0 setgray
  84.     20 setlinewidth
  85.     newpath
  86.         50 0 moveto
  87.         0 100 rlineto
  88.     stroke
  89. endps
  90.