Advertisement
Guest User

Gray-Code-Scheiben-Generator

a guest
Apr 7th, 2016
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /mm {72 25.4 div mul} def
  2.  
  3. 210 mm 2 div 297 mm 2 div translate %set origin to center of DinA4
  4. 1.00 1.00 scale
  5. 1 setlinewidth
  6. 0 0 20 0 360 arc  -20 -20 moveto  20 20 lineto  -20 20 moveto  20 -20 lineto  stroke
  7.  
  8. %14 setlinewidth
  9. /rad 100 def %inner radius (+1/2 width)
  10. /inc  10 def %width
  11. /bit  3 def %number of bits
  12. /num   3 def %internal variable
  13. inc setlinewidth
  14. 0 0 rad 180 360 arc stroke /rad rad inc add def /bit bit 1 sub def %inner arc is a special case
  15. bit{
  16.   /win 90 num div def /sta win def /sto win 3 mul def
  17.   num{0 0 rad sta sto arc stroke /sta sta win 4 mul add def /sto sto win 4 mul add def}repeat
  18.   /num num 2 mul def/rad rad 15 add def}repeat
  19.  
  20. showpage quit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement