4

It is useful to have most simple coordinates, to define picture primitives, such as the "fullcircle" expression.

When I define a 1x1 rectangle

prologues:=3;
outputtemplate:="%j-%c.png";
outputformat:="png";
hppp:=.03;
vppp:=.03;

beginfig(1);
pickup pencircle scaled .5;
p=(0,0)--(1,0)--(1,1)--(0,1)--cycle;
draw p scaled 3;
endfig;

and draw it with a thick pen, I get three rounded corners and one sharp corner.

The sharp corner

Of course I could "overdefine" the path with a mid-point

p=(.5,0)--(1,0)--(1,1)--(0,1)--(0,0)--cycle;

but now point 0 of p would be (.5,0). Are there other solutions to get the corners in a cyclic path rounded?

3
  • Interestingly, I obtain the round corner if I increase the scaling a bit: pickup pencircle scaled 0.7; Commented Oct 18, 2015 at 9:20
  • 1
    Right. This looks like a bug then... hmm. Actually this is a problem with scaling png. I will close this question and setup a bug report for metpost...
    – ikrabbe
    Commented Oct 18, 2015 at 10:26
  • 4
    I'm voting to close this question as off-topic because this is a bug in the PNG driver of Metapost
    – egreg
    Commented Oct 20, 2015 at 13:32

0

Browse other questions tagged .