[metapost] envelope

luigi scarso luigi.scarso at gmail.com
Fri Sep 16 20:14:19 CEST 2016


On Fri, Sep 16, 2016 at 7:56 PM, Daniel H. Luecking <luecking at uark.edu> wrote:
> Nicola,
>
> 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;
>     P:=(0,0){up}..(100,0){down}..cycle;
>     A:=pensquare scaled 10;
>     draw P withpen A;

I know, and it's not the only one :-(

I'm working on it, and on my local box the mpost patched
can give good results with binary, decimal and double numbersystem
but not with scaled.

if we introduce an eps "noise" :
%test.mp
%numberprecision:=200;
beginfig(1);
path P;
pen A;
P:=(0,0){dir (90+eps)}..(100,0){dir -90}..cycle;
A:=pensquare scaled 10;
draw P withpen A;
endfig;
end.

this is the result with
mpost  --numbersystem=binary test.mp

%!PS
%%BoundingBox: -6 -55 105 56
%%HiResBoundingBox: -5 -54.999786 105 55.000214
%%Creator: MetaPost 1.9991
%%CreationDate: 2016.09.16:2009
%%Pages: 1
%%BeginProlog
%%EndProlog
%%Page: 1 1
 0 0 0 setrgbcolor
newpath -5 -5 moveto
5 -5 lineto
5 5 lineto
5 5.00057 lineto
5 -4.99943 lineto
5 28.333594 29.999965 45.000214 54.999948 45.000214 curveto
44.999948 45.000214 lineto
69.999965 45.000214 95 28.333548 95 -5 curveto
95 5 lineto
95 5 lineto
95 -28.333119 70.000035 -44.999786 45.000052 -44.999786 curveto
55.000052 -44.999786 lineto
30.000177 -44.999786 5.000285 -28.333263 5 5 curveto
-5 5 lineto
-5 -5 lineto
-4.999715 -38.333263 20.000177 -54.999786 45.000052 -54.999786 curveto
55.000052 -54.999786 lineto
80.000035 -54.999786 105 -38.333119 105 -5 curveto
105 -5 lineto
105 5 lineto
105 38.333548 79.999965 55.000214 54.999948 55.000214 curveto
44.999948 55.000214 lineto
19.999965 55.000214 -5 38.333594 -5 5.00057 curveto
-5 -4.99943 lineto
 closepath fill
showpage
%%EOF

I think I will commit something this evening, or tomorrow.

Thank you for the test.

-- 
luigi


More information about the metapost mailing list