[metapost] Filling complex paths

Tobias Columbus tobias.columbus at gmail.com
Mon Oct 20 09:18:01 CEST 2014


On Sat, Oct 18, 2014 at 11:18:48AM +0200, Hans Hagen wrote:
> On 10/17/2014 5:40 PM, Daniel H. Luecking wrote:
> >Tobias,
> >
> >I think you have to wrap the drawing in withprescript/withpostscript code that
> >redefines the PS operators fill and newpath.
> 
> It's not too hard to do in the pdf backend code (only a few lines needed) so
> I've added it to the context metafun macros (eofill and eoclip).
> 
> Hans
> 

Hi Hans,
This was exactly what I was looking for! Thank you very much!

Tobias

> 
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                              | www.pragma-pod.nl
> -----------------------------------------------------------------


> % after a question on the metapost list eofill was added:
> 
> \starttext
> 
> \startMPpage
> 
>     fill
>                 fullcircle scaled 10cm --
>                 fullcircle scaled  8cm --
>                 fullcircle scaled  4cm -- cycle
>         withcolor red/4
>         withtransparency (1,.5) ;
> 
>     currentpicture := currentpicture shifted (-5cm,0) ;
> 
>     fill
>                 fullcircle scaled 10cm --
>         reverse fullcircle scaled  8cm --
>         reverse fullcircle scaled  4cm -- cycle
>         withcolor green/4
>         withtransparency (1,.5) ;
> 
>     currentpicture := currentpicture shifted (-5cm,0) ;
> 
>     eofill
>                 fullcircle scaled 10cm --
>                 fullcircle scaled  8cm --
>                 fullcircle scaled  4cm -- cycle
>         withcolor blue/4
>         withtransparency (1,.5) ;
> 
>     currentpicture := currentpicture shifted (-5cm,0) ;
> 
> \stopMPpage
> 
> \stoptext
> 


-- 


More information about the metapost mailing list