%!PS-Adobe-2.0 % % Geometric Information Field Technology [GIFT] % Triangle or Flower of Life grid with image at each node. % pni.ps - (postscript tiling pattern, network of indra) % % 2008-12-2 % % William J. Croft, Lightfield Systems, www.lightfield.com 2008 % Licensed under Creative Commons Attribution Share-Alike 3.0 License. % www.creativecommons.org/licenses/by-sa/3.0 % % % Adobe Distiller setup % %%BeginProlog /pdfmark where % ignore pdfmark if not Distiller {pop} {userdict /pdfmark /cleartomark load put} ifelse %%EndProlog [ /Rect [ 100 500 300 700 ] /Open true /Name /Help /Contents (Geometric Information Field Technology [GIFT] see www.lightfield.com Note: click PROPERTIES button for your printer in the Print (or Page Setup) dialog box. Confirm that you are printing at the highest resolution dpi available for your printer (e.g. 1200 or 2400 dpi). This may be listed via an ADVANCED button. Also in Print dialog, uncheck any: Shrink, Expand, Rotate, Center options. ) /Border [ 0 0 2 [ 3 ] ] /Color [ 1 1 0 ] /ANN pdfmark % [ /Rect [ 100 600 120 620 ] /Color [ 0 0 1 ] /Border [ 0 0 2 ] /Action << /Subtype /URI /URI (http://www.lightfield.com) >> /Subtype /Link /ANN pdfmark [ /Title (Jeweled Network of Indra) /Author (William J. Croft) /Subject (Geometric Information Field Technology or Field Of Light Device) /Keywords (geometric, light, field, information, network, chi, synergy, catalyst) /Creator (hand written PostScript) /DOCINFO pdfmark % % Recommended Distiller settings for Distiller/Acrobat 5.0 (PDF v.4) % % Settings/Job Options % Modify a "Print" template to your changes below, and save as Print(1) % General tab % Compatibility: Acrobat 5.0 (PDF 1.4) % no Optimize/Embed/Auto-Rotate checkboxes % Resolution: 4000 (see note in section below) % Default Page Size: default, will be overridden by Postscript below % Compression tab % Turn off Compress Text and Line Art checkbox (for ease in viewing pdf) % Color tab % Settings File: Color Management Off (otherwise adds useless bulk to pdf) % Advanced tab % uncheck boxes: Save Portable Job Ticket; % Illustrator overprint; Convert gradients % check: ASCII Format for ease in viewing pdf. % % % user adjustable constants ------------------------------------------------ % % Printer resolution comments. % % Distiller uses the 'resolution' dpi box in 'Job Options' to control % how closely the Bezier coordinates can match a clipped original curve. % Perhaps it is also used to control fine adjustments in font spacing. % (But we use no fonts in this program.) % % Even though our tiled patterns use very simple Bezier curves, Distiller % sees the curves cutoff by the clipping box. And therefore generates % many times that number of curveto's to match the filled node image % segments inside the clipbox. % % For accurate FOL curve fitting at 2400 dpi or above, the Distiller % resolution needs to be set to the highest value possible. The limit % on Acrobat / Distiller 5 seems to be 4000 dpi. Likely this was increased % in later editions. But whichever Distiller you use, choose a value % 4000 or above. That value is obtained either from the Job Options dialog % box, or an /HWResolution setpagedevice command inside this file. The % PostScript overrides the dialog box setting, if the setpagedevice % command exists. % % Historical: We (originally) used fine lines a fixed number of pixels in % width by interrogating device space. So setting a resolution below % allowed Distiller to return proper idtransform results, etc. % (See further comments in Device Pixels Alignment section below.) % % Set 'if' below to false to let Distiller Job Option dpi setting % determine the emulated printer inside Distiller. % false % true may sometimes be useful for sending PS direct to printer { << /HWResolution [1200 1200] >> setpagedevice % << /NumCopies 20 >> setpagedevice } if % tweek for Xerox 4110 @ 2400 dpi. Toner particles are not the same % as inkjet dots, since toner must attach via electrostatic force. /X24 false def % high density or low density, glyphs (tiles) per inch /pageHD false def % true for high density pageHD { /pagegpi 20 def % glyphs per inch, horiz /nodespace true def % leave some space around node image } { /pagegpi 10 def % glyphs per inch, horiz /nodespace true def % leave some space around node image } ifelse % paper size % there might be a better way of autosizing to paper dimensions, % using the device dictionary... true % true for U.S. Letter, false for A4 { % 8.5 by 11 inches << /PageSize [612 792] /ImagingBBox null >> setpagedevice /pagetop 10.5 def % top of page in inches /pageleft .25 def /pagewidth 8 def /pagehi 10 def } { % A4 is 210 x 297 mm, or 8.26 x 11.7 in. << /PageSize [595 842] /ImagingBBox null >> setpagedevice /pagetop 11.2 def % top of page in inches /pageleft .25 def /pagewidth 7.75 def /pagehi 10.7 def } ifelse % true to draw node image, false to omit /nodedraw false def % Node images, only set one of these true at a time. /nodedot false def % dot image at node /nodeheart true def % heart image at node /nodeground false def % ground symbol at node (needs nodespace also) /nodedawn1 false def % Dawn Clark, Gifts of the Soul image#1 /nodedawn12 false def % Dawn Clark, Gifts of the Soul image#12 % true for Flower of Life, false for Triangles /FOL true def FOL { /pagegpi 5 def } if % default noderadius, space around node image % node dot or heart image is approx 100 radius, scaled by iscale fn. /noderadius 150 def % adjustments for certain node images nodeground { % ground node image is more complex, needs fewer glyphs per inch % but smaller noderadius, since circle surrounds it. % we don't want to disrupt the triangle field energy too much. /noderadius 100 def /pagegpi 5 def } if nodedawn1 { /pagegpi 5 def } if nodedawn12 { /pagegpi 2.3 def } if % CMYK node color % (cyan, magenta, yellow, black subtractive color specification). % Magenta (red+violet) is used in color therapy to heal stubborn % emotional blocks. When used as the heart node color, this appears to % be a special purpose geometry that focuses on 5th chakra (throat) heart % expression issues. % For normal usage, the entire image is black. false % set false for normal black node, true for color { /nodecolor [ 0 1 0 0 ] def % magenta } { /nodecolor [ 0 0 0 1 ] def % black } ifelse % Device pixel alignment issues. (Define base resolution). % % Because we are using PostScript Tiling Patterns with TilingType=1 % (constant spacing at device pixel boundaries), and to avoid variations % in cell tiling -- we need to make the pattern cell an integral % number of device pixels in size (horizontal and vertical). % % However, pixel boundaries requires that we know the printer resolution. % This would be easy to do if every printer had a PostScript interpreter % and this was all computed at print-time inside the printer. % % But instead, all parameters are fixed when the PostScript is distilled % into pdf by Adobe Distiller. So rather than having many different % pdf files, one per resolution, we instead have only 2 or 3 versions for % the common resolution families. These are the common families: % % 600 1200 2400 4800 9600 ... dpi (most printers use these) % 720 1440 2880 5760 ... dpi (used by Epson) % 635 1270 2540 5080 ... dpi (50* dots/mm, metric based, small minority) % % If we set the user space units to one of the base resolutions: % 600, 720, or 635. Then we can "snap" into device space by simply % rounding the user units to an integer value, even if the end user % printer has a higher resolution -- the rounded coordinate will still % be on a pixel boundary. Note that the actual device pixel alignment % happens by virtue of the 'setstrokeadjust' operator at print time, % see TN#5111 (Emulation of the setstrokeadjust Operator). % Set the base resolution, 'units' per inch vs. 'points' per inch. % Choose one of the listed values here by the array index 0,1, or 2. /pageupi [ 600 720 635 ] 0 get def % units per inch % % end of (typical) user adjustable constants ------------------------------- % 0 setgray true setstrokeadjust % do automatic stroke adjustment % leave this false, we're no longer doing printer specific pixel positioning /pixelpos false def /snapwidth { % snap a user space width or size to device pixel grid pixelpos { % snap to nearest device pixel by transforming to and from dspace 0 exch dtransform round exch round exch idtransform exch pop } { round % simply round to nearest upi } ifelse } bind def % rescale user coordinates to pageupi 72 pageupi div dup scale % original scale 72 pt/in, now pageupi u/in % units per glyph, horizontal /trimid pageupi pagegpi div 2 div snapwidth def % midpoint of triangle base /pageupg trimid 2 mul def % units per glyph, horiz % Equilateral triangle with unit base /tribase pageupg def /trialth 3 sqrt 2 div tribase mul 2 div snapwidth def % 1/2 altitude /trialt trialth 2 mul def % altitude /trialt2 trialt 2 mul def /trialtn trialt neg def % negated version for convenience % units per glyph, vertical /pageupgv trialt 2 mul def /trialt2 pageupgv def % Device-space specific pixel size linewidths. % % This scheme is was previously used for high density printing. % This section no longer used but kept for reference. % See next section below for resolution independent linewidths. % % For lines only a few pixels wide, we want exact control of their % widths in pixels, as well as accurate placement on the pixel grid. % See TN#5111 (Emulation of the setstrokeadjust Operator). % % With actual pixel width lines at 1/4 pixel axis offsets, linewidth 1 % pixel will result in 2 pixel wide lines. Except the interpreter % assumes 1 pixel lines are the same as '0' pixel hairlines. % Thus 0 or 1 pixel linewidths appear poorly on hi dpi printers. % Using linewidth of 2 pixels will produce 3 pixel wide lines. % These look a little spotty on the 1200 dpi printers we tested with. % % With linewidth of 3 pixel wide will get 4 pixel wide lines. % This seems to be the best choice for both horiz and diagonal lines. % Originally we thought that diags should be a bit thinner because the % stairstepping has a thicker appearance, but PostScript factors this in. /onepixel 1 0 idtransform pop def % one device space pixel in user units % device space pixels, no longer used false % pageHD - this section previously switched on with pageHD { X24 { /trilwidth 8 onepixel mul def % horizontal line width } { /trilwidth 3 onepixel mul def % horizontal line width } ifelse } if % Resolution independent linewidths, in user space units % default linewidth for low density, e.g.: % 3 lw makes 4 px lines @ 600 dpi % 6 lw -> 7 px lines @ 1200 dpi, etc. /trilwidth 3 def % 3 lw makes 4 wide at lowest res % If high density, need thinner lines, just cut in half. % Note this only works at dpi higher than the minimum. pageHD { /trilwidth trilwidth 2 div def % just cut in half } if /trilwidthd trilwidth def % diagonal line width % testing shows best node height is approx 1/3 of triangle altitude % since heart (or dot) figure defined on ~100 radius basis, calc scale: /iscalef trialt .31 mul 200 div def % % iscale - image scale % % [n graphic operator stack args] n iscale graphicoperator % % Normal 'scale' operator doesnt work inside type 3 font def(!) % Scales the top n stack args by iscalef & ready for graphicoperator. % Assumes caller is using relative addressing with zero origin. /iscale { dup % need extra loop count for repeat operator /iscalen exch def % define number args, also n { iscalef mul % scale top of stack iscalen 1 roll % roll the top n elements of stack 1 time } repeat } def % % rt2xy - convert radius/theta polar coordinate to x,y coord % % r t rt2xy x y % % Leaves x,y coords on stack % /rt2xy { 2 copy cos mul % x = r * cos(t) 3 1 roll % get 2nd copy of r,t sin mul % y = r * sin(t) } bind def % % addxy - add a pair of x,y coords on the stack % % x1 y1 x2 y2 addxy x1+x2 y1+y2 % % Why is PostScript so obscure? % /addxy { 3 2 roll % stack now x1 x2 y2 y1 add % add y values 3 1 roll % stack now y12 x1 x2 add % y12 x12 exch % x12 y12 } bind def % a few temp arrays containing x,y coords /circtop 2 array def /circctr 2 array def % center of node point and circle % % conv2abs - convert relative coord pair to absolute % % x y conv2abs x y % % center of node point previously stored at circctr % /conv2abs { circctr aload pop addxy } bind def % % nodeimage - draw node image at x y % % x y nodeimage % % scaled the parameters of this (aspect ratio and size) from test results. % /nodeimage { % We tried painting white inside Tiling Pattern, but that apparently % kills the Pattern cache and causes print job to run EXCEEDINGLY slow! % So... Back to the donut clipping idea in linetoc. false % if true, clear some space around the node image { 2 copy % duplicate x,y 1 setgray newpath noderadius 1 iscale 0 360 arc closepath fill 0 setgray } if nodecolor aload pop setcmykcolor % set node color nodedot { % paint a dot, x&y on stack % scale the radius, then arc newpath 100 1 iscale 0 360 arc closepath fill } if nodeheart { % else paint heart bezier image % if space around node, drop image slightly to fit space nodespace { 25 1 iscale sub } if newpath moveto 0 -100 2 iscale rmoveto % original heart was a bit too tall and shallow top indent % -170 170 -50 250 0 200 6 iscale rcurveto % 0 -200 2 iscale rmoveto % 170 170 50 250 0 200 6 iscale rcurveto % new heart shape is fuller and centerpoint at center of gravity -180 180 -50 250 0 170 6 iscale rcurveto 0 -170 2 iscale rmoveto 180 180 50 250 0 170 6 iscale rcurveto closepath fill } if nodeground { % earth ground symbol at nodepoint with enclosing circle trilwidth 2 div setlinewidth % needs narrower lines, small space 2 copy % duplicate x,y 1 setlinecap 1 setlinejoin newpath noderadius 1 iscale 0 360 arc closepath stroke moveto /nodegtop 100 1 iscale def % top line width /nodegxleg nodegtop 2.5 div dup mul 2 div sqrt def % x&y leg coord nodegtop 3 div neg 0 rmoveto nodegtop 0 rlineto nodegtop neg 0 rmoveto /nodeglegs 3 def /nodegstep nodegtop nodeglegs 1 sub div def nodeglegs { nodegxleg neg dup rmoveto nodegxleg dup rlineto nodegstep 0 rmoveto } repeat stroke } if nodedawn1 { % Dawn Clark, Gifts of the Soul, image#1 trilwidth 2 div setlinewidth % needs narrower lines, small space 1 setlinecap 1 setlinejoin 2 copy % duplicate x,y; leave x,y for arc circctr astore pop % remember circle center /circrad 100 1 iscale def % scaled circle radius /circbary circrad .2 mul neg def % bar y coord newpath circrad 0 360 arc % draw circle % stack now empty circrad 90 38 sub rt2xy % top right coord, relative 2 copy circtop astore pop 0 circrad addxy % delta x,y of half v line slope % calc x coord @ bar ycoord = (bar_y + rad) * dx/dy div circbary circrad add mul % x coord of bar circbary % now form relative bar x,y 2 copy conv2abs moveto exch neg exch % other side of bar conv2abs lineto circtop aload pop 2 copy conv2abs moveto 0 circrad neg conv2abs lineto exch neg exch conv2abs lineto stroke } if nodedawn12 { % Dawn Clark, Gifts of the Soul, image#12 trilwidth 3.3 div setlinewidth % needs narrower lines, small space 1 setlinecap 1 setlinejoin 2 copy % duplicate x,y for 3 circles and a dot 2 copy 2 copy 2 copy circctr astore pop % remember circle center /circrad 100 1 iscale def % scaled circle radius /circr1 circrad 18 sin mul def % inner circle radius /circr2 circr1 36 cos div def % incremental circle radius newpath circrad 0 360 arc % draw outer circle circr1 0 rt2xy conv2abs moveto circr1 0 360 arc % draw inner circle circr2 0 rt2xy conv2abs moveto circr2 0 360 arc % draw incremental circle circrad 100 div 0 rt2xy conv2abs moveto circrad 100 div 0 360 arc % draw dot % stack now empty /circang 18 def % starting angle circrad circang rt2xy conv2abs moveto 5 { % draw arms of star circr2 circang 36 add rt2xy conv2abs lineto circrad circang 72 add rt2xy conv2abs lineto /circang circang 72 add def % increment angle } repeat stroke } if } bind def % % linetoc - lineto, clipped % % x y linetoc % % Called from inside the tile painting routine to stroke each line. % If nodespace false, just draw the line, if true, clip the end points. % % Originally we were doing the tiles as a Type 3 font definition, % so doing setgray to white to clear space didnt work since setgray % is prohibited in a font. So we used this doughnut clip idea instead. % % Then later when using Tiling Patterns to paint the cell, TP's do allow % painting a circle of white, but it kills the pattern cache. So this % clipping trick seems to be the only way to print with decent speed. /linetoc1 false def % flag, if true clip only starting point /linetoc { nodespace { currentpoint 2 copy % duplicate x y, for two clip arcs and line origin 2 copy newpath noderadius 1 iscale 0 360 arc tribase linetoc1 { 0 } { noderadius 1 iscale } ifelse sub 0 360 arc closepath gsave eoclip newpath moveto 2 copy lineto stroke grestore newpath moveto } { currentpoint newpath moveto 2 copy lineto stroke moveto } ifelse } def % % circ - circle (tribase radius) centered at r and theta (polar coords) % % r t circ % /circ { rt2xy % convert r,theta to x,y newpath tribase 0 360 arc stroke } bind def % % snapxy - snap a user space x,y coordinate to device space % % x y snapxy sx sy % % Uses the 1/4 pixel offset approach from Adobe TN# 5111 (Emulation of the % setstrokeadjust Operator). This concept is used internally by the % interpreter's setstrokeadjust code. /snapxy { pixelpos { transform .25 sub round .25 add exch .25 sub round .25 add exch itransform } { round exch round exch % simply round to nearest upi } ifelse } bind def % % Define the Tiling Pattern. % FOL { /trinew false def % if FOL, use old bounding box } { /trinew true def % if triangle, use new triangle scheme } ifelse trinew % set bounding box { /bboxarray [ 0 0 tribase trialt2 ] def } { /bboxarray [ 0 trialtn tribase trialt ] def } ifelse << /PatternType 1 % Tiling pattern /PaintType 1 % colored /TilingType 1 % 1 = constant spacing, 2 = no distortion /BBox bboxarray /XStep pageupg /YStep pageupgv /PaintProc { FOL { % Flower of Life true setstrokeadjust % do automatic stroke adjustment trilwidthd setlinewidth % draw each circle from 0 degrees on up 0 0 circ tribase 0 circ trialt2 30 circ tribase 60 circ 2 tribase mul 60 circ trialt2 90 circ tribase 120 circ tribase 240 circ trialt2 270 circ tribase 300 circ 2 tribase mul 300 circ trialt2 330 circ nodedraw { 0 0 nodeimage tribase 0 nodeimage trimid trialt nodeimage trimid trialtn nodeimage } if } { % TRIANGLES % Our original scheme drew half-width lines at top and bottom % of the cell. Which works the majority of times with most % printers and careful Print dialog box settings. (No shrink % or expand, etc.) However with the half width lines, there % are bound to be some cases where the image is scaled anyway. % So to get around the inconsistent horizontal linewidth problem, % we instead move the cell up 1/2 altitude, then cell top and % bottom boundaries are less critical. true setstrokeadjust % do automatic stroke adjustment true % use new scheme { trilwidth setlinewidth /trialth3 3 trialth mul def % 3 half altitudes /trialth5 5 trialth mul def % 5 half altitudes /trialthn trialth neg def /linetoc1 true def % clip only start point trimid trialth moveto 0 trialthn linetoc trimid trialth moveto tribase trialthn linetoc trimid trialth moveto 0 trialth linetoc trimid trialth moveto tribase trialth linetoc trimid trialth moveto /linetoc1 false def 0 trialth3 linetoc trimid trialth moveto tribase trialth3 linetoc 0 trialth3 moveto tribase trialth3 linetoc /linetoc1 true def 0 trialth3 moveto trimid trialth5 linetoc tribase trialth3 moveto trimid trialth5 linetoc % draw node image nodedraw { trimid trialth nodeimage 0 trialth3 nodeimage tribase trialth3 nodeimage } if } { % else use old scheme trilwidthd setlinewidth /linetoc1 false def % clip both end points 0 0 moveto trimid trialtn linetoc tribase 0 linetoc trimid trialt linetoc 0 0 linetoc trilwidth setlinewidth 0 0 moveto tribase 0 linetoc /linetoc1 true def % clip only start point % top line must come down a bit, else exceeds bbox % trialt trilwidthhalf sub /tritop trialt def % y coord trimid tritop moveto 0 tritop linetoc trimid tritop moveto tribase tritop linetoc % now bottom line /tritop trialtn def % y coord trimid tritop moveto 0 tritop linetoc trimid tritop moveto tribase tritop linetoc % draw node image nodedraw { 0 0 nodeimage tribase 0 nodeimage trimid trialt nodeimage trimid trialtn nodeimage } if } ifelse % old or new triangle scheme } ifelse % FOL or triangle } bind >> % End prototype pattern dictionary matrix % Identity matrix makepattern % Instantiate the pattern /Indra exch def % set color to this pattern /Pattern setcolorspace Indra setcolor % fill the page pageleft pageupi mul pagetop pagehi sub pageupi mul snapxy pagewidth pageupi mul pagehi pageupi mul rectfill showpage