Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Carlos Newsgroups: comp.lang.postscript Subject: Re: Anticlip Date: Tue, 1 Sep 2015 22:38:33 +0200 Organization: A noiseless patient Spider Lines: 91 Message-ID: <20150901223833.219fe870@samara.DOMA> References: <1114446133.473394.163500@o13g2000cwo.googlegroups.com> <426d3ecd.809318318@read.news.uk.uu.net> <1114456154.181295.211860@o13g2000cwo.googlegroups.com> <1114476474.211676.285770@o13g2000cwo.googlegroups.com> <1115151731.278776.216660@z14g2000cwz.googlegroups.com> <1115213639.623011.169930@z14g2000cwz.googlegroups.com> <9bb78240-1232-4a4e-b5b0-0f3dc7a6fc56@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: mx02.eternal-september.org; posting-host="82e0b2bf4c14e7be33ce915a2d173c51"; logging-data="3004"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19IraJooZuCoPcSZq9xNRGfBvN2nWO1xI8=" X-Newsreader: Claws Mail 3.12.0 (GTK+ 2.24.28; x86_64-pc-linux-gnu) Cancel-Lock: sha1:AFumaBNoKsiiGAsYS83B4ZsSCew= Xref: csiph.com comp.lang.postscript:2334 [jdaw1 , 2015-08-31 15:55] > Because I still want it, please allow me to re-ask this 10=C2=BC years > later.=20 >=20 > The Problem >=20 > =E2=80=A2 There is a background that cannot be re-painted. Just assume th= at > it cannot be re-painted. >=20 > =E2=80=A2 There a currentpath, easily regeneratable. Or, equivalently, th= ere > is accessible code that generates the currentpath. >=20 > =E2=80=A2 What is wanted is to do the partial stroke of this path that is > =E2=89=A46pt from the path, but >5pt. >=20 > =E2=80=A2 To make matters worse, the path is typically generated by charp= ath, > so might be complicated, and its strokepath is sure to be nastily > self-intersecting. >=20 > =E2=97=8A If the background were certain to be empty white (but it isn=E2= =80=99t), > 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.=20 >=20 > =E2=97=8A If there were an anticlip operator (but there isn=E2=80=99t), i= t could be > done with gsave 10 setlinewidth strokepath anticlip regeneratepath 12 > setlinewidth 0 setgray stroke grestore newpath=20 >=20 > =E2=80=A2=E2=80=A2=E2=80=A2 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 --=20