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


Groups > comp.lang.postscript > #2356

Origami Like Output

From Bogus@Embarq.com (Steve)
Newsgroups comp.lang.postscript
Subject Origami Like Output
Date 2015-09-30 12:19 +0000
Organization Aioe.org NNTP Server
Message-ID <c1.2b8.3nQxTk$05R@NOVOSAD3.EMBARQ.COM> (permalink)

Show all headers | View raw


Hi,

   Found an old PostScript program, and spent some time
analyzing it and commenting some of the findings.  If
you delete the new code indicated by lines near %+ marks,
you get black and white output of a quarter of the full
pattern.  Which can be folded to get a result.  The color
version can be modified to print on both sides.  304 as
opposed to 306 in the translate, my printer is a bit off.
It may be too small to fold up easily.  8.5 by 8.5 inch
output.

   I have forgotten why I was interested in this.  Some
sort of folding problem.  Probably from "Scientific
American", "American Scientist", a computer magazine, or
their ilk.  Map folding?  Does not seem to fit.  Origami?
Of what?  Plane folding?  Maybe, it does reduce the area
by two.  Ring any bells?

   However it is a cute folding problem that, in its simple
version, is a bit of fun.

Regards,

Steve N

%! Test page
%+ 28 September 2015
%+ Original file 7 March 1995.
%+    Try and find out what this was for.  And lose all of the
%+ edits...  Original written for a four way symmetry that was
%+ not used.  That explains the negative coordinates and the
%+ 2 2 scale.  Translate to center and .5 .5 scale to show the
%+ entire drawing.  Negate X scale and swap up and down labels
%+ for two sided printing.  Add color for good measure.
 
% 8.5 x 11 = 612 x 792

% Lock x y position to machine pixel

/LPixel { transform round itransform exch
          transform round itransform exch } def

%+ 16 x 16 grid on 612 x 612 point area.

/XYUnit { 38.25 mul exch 38.25 mul exch } bind def % Define grid spacing
/Unit { 38.25 mul } bind def % Define grid spacing

%+ Straight forward diagonal line routines.

/Diag-u { dup 1 add % x y y'
        3 1 roll   % y' x y
   exch dup 1 add  % y' y x x'
        3 1 roll   % y' x' y x
exch XYUnit moveto
exch XYUnit lineto stroke } bind def

/Diag-d { dup 1 sub % x y y'
        3 1 roll   % y' x y
   exch dup 1 add  % y' y x x'
        3 1 roll   % y' x' y x
exch XYUnit moveto
exch XYUnit lineto stroke } bind def

/Diag-U { dup 2 add % x y y'
        3 1 roll   % y' x y
   exch dup 2 add  % y' y x x'
        3 1 roll   % y' x' y x
exch XYUnit moveto
exch XYUnit lineto stroke } bind def

/Diag-D { dup 2 sub % x y y'
        3 1 roll   % y' x y
   exch dup 2 add  % y' y x x'
        3 1 roll   % y' x' y x
exch XYUnit moveto
exch XYUnit lineto stroke } bind def

/Box { XYUnit moveto  0 2 XYUnit rlineto  2 0 XYUnit rlineto
     0 -2 XYUnit rlineto  closepath stroke } bind def

% Origami Test 612 รท 16 = 38.25

 1 1 idtransform pop abs setlinewidth
%+ 16 x 16 degug grid.
% 38.25 38.25 LPixel 577.55 { dup 0 moveto 612 lineto stroke } for
% 38.25 38.25 LPixel 612.5 { dup 0 exch moveto 612 exch lineto stroke } for

   2 2 idtransform pop abs setlinewidth

gsave
%   8 8 XYUnit translate
%+
304 304 translate .5 .5 scale % Show four way symmetry.

2 2 scale
   newpath -8 -8 XYUnit moveto  -8 8 XYUnit lineto  8 8 XYUnit lineto
   8 -8 XYUnit lineto  closepath clip  newpath

   [10 3 3 3 3 3 ] 0 setdash
%+
0 1 0 setrgbcolor

   -6 Unit 4 Unit 6 Unit { dup -8 Unit moveto 8 Unit lineto stroke } for
   -6 Unit 4 Unit 6 Unit { dup -8 Unit exch moveto 8 Unit exch lineto stroke } for

   -3 7 Diag-u  5 7 Diag-u
   -5 7 Diag-d  3 7 Diag-d
   -1 5 Diag-u  7 5 Diag-u
   -7 5 Diag-d  1 5 Diag-d
   -2 4 Diag-d  6 4 Diag-d
   -8 2 Diag-u  0 2 Diag-u
   -4 2 Diag-d  4 2 Diag-d
   -6 0 Diag-u  2 0 Diag-u

   180 rotate
   -3 7 Diag-u  5 7 Diag-u
   -5 7 Diag-d  3 7 Diag-d
   -1 5 Diag-u  7 5 Diag-u
   -7 5 Diag-d  1 5 Diag-d
   -2 4 Diag-d  6 4 Diag-d
   -8 2 Diag-u  0 2 Diag-u
   -4 2 Diag-d  4 2 Diag-d
   -6 0 Diag-u  2 0 Diag-u

   180 rotate
   [10 4 ] 0 setdash
%+
1 0 0 setrgbcolor

   -2 8 Diag-D 6 8 Diag-D
   -3 7 Diag-D 5 7 Diag-D
   -7 5 Diag-U 1 5 Diag-U
   -6 4 Diag-U 2 4 Diag-U
   -7 3 Diag-D 1 3 Diag-D
   -8 2 Diag-D 0 2 Diag-D
   -4 2 Diag-U 4 2 Diag-U
   -3 1 Diag-U 5 1 Diag-U

   -5 7 Box 3 7 Box
   -9 3 Box -1 3 Box 7 3 Box
   -5 -1 Box
   180 rotate
   -2 8 Diag-D 6 8 Diag-D
   -3 7 Diag-D 5 7 Diag-D
   -7 5 Diag-U 1 5 Diag-U
   -6 4 Diag-U 2 4 Diag-U
   -7 3 Diag-D 1 3 Diag-D
   -8 2 Diag-D 0 2 Diag-D
   -4 2 Diag-U 4 2 Diag-U
   -3 1 Diag-U 5 1 Diag-U

   -5 7 Box 3 7 Box
   -9 3 Box -1 3 Box 7 3 Box
   -5 -1 Box
grestore

/Helvetica findfont 12 scalefont setfont

   [10 3 3 3 3 3 ] 0 setdash
%+
0 1 0 setrgbcolor

   4 19 XYUnit moveto 8 19 XYUnit lineto stroke
   9 19 XYUnit moveto (Fold down) show

   [10 4 ] 0 setdash
%+
1 0 0 setrgbcolor

   4 17 XYUnit moveto 8 17 XYUnit lineto stroke
   9 17 XYUnit moveto (Fold up) show

showpage

Back to comp.lang.postscript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Origami Like Output Bogus@Embarq.com (Steve) - 2015-09-30 12:19 +0000
  Re: Origami Like Output jdaw1 <jdawiseman@gmail.com> - 2015-09-30 12:40 -0700
    Re: Origami Like Output Bogus@Embarq.com (Steve) - 2015-10-01 13:17 +0000
      Re: Origami Like Output jdaw1 <jdawiseman@gmail.com> - 2015-10-03 16:03 -0700
        Re: Origami Like Output Bogus@Embarq.com (Steve) - 2015-10-04 14:26 +0000
          Re: Origami Like Output mawisegirl@gmail.com - 2015-10-04 08:29 -0700
          Re: Origami Like Output jdaw1 <jdawiseman@gmail.com> - 2015-10-04 09:38 -0700
            Re: Origami Like Output Bogus@Embarq.com (Steve) - 2015-10-04 17:13 +0000
          Re: Origami Like Output Bogus@Embarq.com (Steve) - 2015-10-08 11:50 +0000

csiph-web