[metapost] envelope

Daniel H. Luecking luecking at uark.edu
Fri Sep 16 19:56:21 CEST 2016


I should have added that there has been a long-standing bug in 
 envelope  and the related  withpen  operator. A classical 
example is
    path P;
    pen A;
    A:=pensquare scaled 10;
    draw P withpen A;

That still seems to exhibit the bug (at least in metapost 1.9991 of TeX Live 2016).
Also, one needs to do
   fill (envelope A of P) .. (envelop A of reverse P)..cycle
to get the effect of 
   draw P withpen A.


Daniel H. Luecking [luecking at uark.edu]
Department of Mathematical Sciences
1 University of Arkansas
Fayetteville, AR, USA 72701-1201

From: metapost <metapost-bounces at tug.org> on behalf of Nicola <nvitacolonna at gmail.com>
Sent: Friday, September 16, 2016 5:41 AM
To: metapost at tug.org
Subject: Re: [metapost] envelope

On 2016-09-16 07:06:19 +0000, Hans Hagen said:

> On 9/15/2016 8:27 PM, Daniel H. Luecking wrote:
>> Nicola:
>> The syntax is
>> envelope <polygonal pen> of <path primary>
>> For example,
>> path p;
>> p := envelope pensquare of (up--left);
>> It returns the path which, when filled, produces the effect of stroking
>> the pen along the path. Elliptical pens (e.g., pencircle) produce an error.
>> Stroking an elliptical pen is simply passed on to PostScript. But polygonal
>> pens (inherited from metafont) require this as a workaround.
>> I deduced this by a little trial and error based on some descriptions in
>> the web source mp.w.
> Here's what happens in the result.
> [snip]

Thanks for the illuminating examples!


More information about the metapost mailing list