[metapost] Cannot fill sector

Yasir Malik ymalik at stevens.edu
Sun Nov 14 17:55:09 CET 2010


> So in my opinion MetaPost does fill the path, but the path is so
> small that you can't see it.
>
Yes, when I only display "area", I see a black dot.

Out of desparation, I decided to insert a control point p2 half way 
between p0 and p1, which allowed me to create the sector; this works:

beginfig(1);

u = 1cm;

pair o, p[];
path halfcirc, triangle, curve;
numeric diam;

diam = 10u;

o := (0, 0);
p0 := (diam/2, 0);
p0 := p0 rotated 72;
p1 := p0 rotated 72;
p2 := p0 rotated 36;
triangle = p0--o--p1;
curve = o--p0..p2..p1--cycle;

halfcirc = halfcircle scaled diam;

draw halfcirc;
%draw triangle;
draw curve;

fill curve withgreyscale .7;

endfig;


I still do not know Metapost cannot find a common path between the two 
lines and the halfcircle.

As a aside, from my original post, Metapost would generate a compilation 
error when I chose to rotate p0 by 10 degrees instead of 72.  Maybe this 
is an issue of floating point arithmetic being off (could be related to 
my original question of not being able to fill the sector)?


Thanks,
Yasir


More information about the metapost mailing list