Am 21.07.2011 23:21, schrieb Alan Braslau:
On Thu, Jul 21, 2011 at 05:39:48PM +0200, Peter Rolf wrote:
use
p2 := p0 & p1;
the reason for the 'unexpected' output is, that point 1 and 2 of the path p2 are equal. keep in mind that drawing with an asymmetrical pen has its own (complex) rules.
Thank you -- I forgot about the path operator &
same here (i had to browse the metapost manual for the operator) :-)
(Funny thing, though, that the problem shows up with point 0. I would also think that having two consecutive identical points, although poor style, should not cause problems as it does.)
i guess it has to do with the fact, that 'drawing' with non circular pens always results in a *filled* path. metapost is calculating new points for the shape, instead of just storing the given path points and the pen size (like in a normal pencircle draw). and if a filled path is intersecting with itself, funny things can happen. well, most times not that funny (because unwanted). probably not the best example (not drawn, no special pen), but it gives a first impression of what is going on. \startTEXpage \startMPcode path p[]; p0 := unitcircle scaled 10cm; p1 := p0 scaled .5; p2 := p0 -- reverse(p1) -- cycle; fill p2; \stopMPcode \stopTEXpage depending on their direction (clockwise or counter clockwise) and location (intersection or not) such path 'cycles' are cleared or filled. with this trick you are able to produce punches as in the glyphs of "O" or "e". if you like and have the time you can debug your example (simply add a loop that draws all points and labels them). you will then see the difference between a drawn (pencircle) and a 'drawn' (non circular pen) path. ;-)
And yes, the use of an asymmetrical pen is indeed the whole point of this figure -- I am using metapost to achieve very easily an effect, conceptually very simple, that a colleague has not been able to produce using Adobe Illustrator.
Thank you again for helping out.
my pleasure. Peter
Alan ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________