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


Groups > comp.lang.postscript > #2334

Re: Anticlip

From Carlos <angus@quovadis.com.ar>
Newsgroups comp.lang.postscript
Subject Re: Anticlip
Date 2015-09-01 22:38 +0200
Organization A noiseless patient Spider
Message-ID <20150901223833.219fe870@samara.DOMA> (permalink)
References (5 earlier) <gJednQ-2MPAgDejfRVn-iw@forethought.net> <1115151731.278776.216660@z14g2000cwz.googlegroups.com> <d58ukh$7cb$1$8300dec7@news.demon.co.uk> <1115213639.623011.169930@z14g2000cwz.googlegroups.com> <9bb78240-1232-4a4e-b5b0-0f3dc7a6fc56@googlegroups.com>

Show all headers | View raw


[jdaw1 <jdawiseman@gmail.com>, 2015-08-31 15:55]
> Because I still want it, please allow me to re-ask this 10¼ years
> later. 
> 
> The Problem
> 
> • There is a background that cannot be re-painted. Just assume that
> it cannot be re-painted.
> 
> • There a currentpath, easily regeneratable. Or, equivalently, there
> is accessible code that generates the currentpath.
> 
> • What is wanted is to do the partial stroke of this path that is
> ≤6pt from the path, but >5pt.
> 
> • To make matters worse, the path is typically generated by charpath,
> so might be complicated, and its strokepath is sure to be nastily
> self-intersecting.
> 
> ◊ If the background were certain to be empty white (but it isn’t),
> this could be done with gsave 12 setlinewidth 0 setgray stroke
> grestore 10 setlinewidth 1 setgray stroke which is how it is
> currently done, quite unsatisfactorily. 
> 
> ◊ If there were an anticlip operator (but there isn’t), it could be
> done with gsave 10 setlinewidth strokepath anticlip regeneratepath 12
> setlinewidth 0 setgray stroke grestore newpath 
> 
> ••• But, neither of these cases applies. Please, have you any ideas
> as to how to achieve this over a non-repaintable background?

Ghostscript supports PDF transparency. Here is an example; it requires
the background to be painted after the foreground.

HTH

%!

/W 200 def
/H 150 def

<< /PageSize [ W H ] >> setpagedevice

/draw-bg {
    4 20 H {
        10 20 W {
            2 copy  mul  W H mul  div  0.5 0.6 sethsbcolor
            1 index
            8 0 360 arc
            fill
        } for
    } for
} def

/draw-fg {
    30 30 moveto  W 30 sub  H 30 sub  lineto
    W  H 2 div   W  0   W 2 div  H 2 div  curveto
    0  H   0  H 2 div   30  30  curveto
    closepath
} def

% no transparency
gsave
    draw-bg
    draw-fg
    gsave 12 setlinewidth  0 setgray  stroke  grestore
    10 setlinewidth 1 setgray stroke
grestore

showpage

% transparency
gsave
    draw-fg
    gsave 12 setlinewidth  0 setgray  stroke  grestore
    10 setlinewidth 1 setgray stroke
    /Darken .setblendmode
    draw-bg
grestore

showpage


-- 

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


Thread

Re: Anticlip jdaw1 <jdawiseman@gmail.com> - 2015-08-31 15:55 -0700
  Re: Anticlip jdaw1 <jdawiseman@gmail.com> - 2015-08-31 16:27 -0700
  Re: Anticlip Carlos <angus@quovadis.com.ar> - 2015-09-01 22:38 +0200

csiph-web