Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #3713

I'm a blackstar

Newsgroups comp.lang.postscript
Date 2022-01-01 21:58 -0800
Message-ID <210de3e9-272a-45a6-b8e1-cf6ccb2bed16n@googlegroups.com> (permalink)
Subject I'm a blackstar
From luser droog <luser.droog@gmail.com>

Show all headers | View raw


<<
/ps { (stack:)= pstack }
/poly { % m
  [ 
    0 360 4 -1 roll div 360.0 {
      1 0 3 2 roll matrix rotate transform
    } for
  ] 0 1 index length 2 sub getinterval
}
/star { % m n
  exch poly exch
  [ 3 1 roll
    0 { % [ ... [] n i
      3 copy exch pop 2 getinterval aload pop % [ ... [] n i []_i
      5 2 roll % [ ... []_i [] n i
      1 index 2 mul add 2 index length mod % [ ... [] n i+n%#
      dup 0 eq { pop pop pop exit } if
    } loop
  ]
}
/fortuple { 1 dict begin {p n a}{exch def}forall
  0 n /a load length 1 sub
  [ /a load /exch cvx n /getinterval cvx /p load /exec cvx ] cvx
  end for
}
/draw {
  dup 0 2 getinterval aload pop moveto
  2 1 index length 2 sub getinterval
  2 {
      aload pop lineto
  } fortuple
  closepath
}
>> begin

2 poly ==
3 poly ==
5 poly ==
5 2 star ==
7 3 star ==
3 1 star ==
300 400 translate 100 dup scale
5 2 star dup == draw stroke
showpage
quit


Output:
$ gs star.ps
GPL Ghostscript 9.52 (2020-03-19)
Copyright (C) 2020 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
[1.0 0.0 -1.0 0.0]
[1.0 0.0 -0.5 0.866025388 -0.5 -0.866025388]
[1.0 0.0 0.309017 0.95105654 -0.809017 0.587785244 -0.809017 -0.587785244 0.309017 -0.95105654]
[1.0 0.0 -0.809017 0.587785244 0.309017 -0.95105654 0.309017 0.95105654 -0.809017 -0.587785244]
[1.0 0.0 -0.90096879 0.433883876 0.623489559 -0.781831682 -0.222520873 0.974927902 -0.222521 -0.974927902 0.623489797 0.781831443 -0.900968909 -0.433883637]
[1.0 0.0 -0.5 0.866025388 -0.5 -0.866025388]
[1.0 0.0 -0.809017 0.587785244 0.309017 -0.95105654 0.309017 0.95105654 -0.809017 -0.587785244]
>>showpage, press <return> to continue<<

Back to comp.lang.postscript | Previous | NextNext in thread | Find similar


Thread

I'm a blackstar luser droog <luser.droog@gmail.com> - 2022-01-01 21:58 -0800
  Re: I'm a blackstar luser droog <luser.droog@gmail.com> - 2022-01-04 14:55 -0800
    Re: I'm a blackstar jdaw1 <jdawiseman@gmail.com> - 2022-08-08 15:17 -0700

csiph-web