ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Peter Rolf <indiego@gmx.net>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: metapost question (bug?)
Date: Fri, 22 Jul 2011 11:35:25 +0200	[thread overview]
Message-ID: <4E29445D.3020504@gmx.net> (raw)
In-Reply-To: <20110721212156.GA20841@drec-ha-002479.extra.cea.fr>

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
> ___________________________________________________________________________________
> 

___________________________________________________________________________________
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
___________________________________________________________________________________


      reply	other threads:[~2011-07-22  9:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-21 14:39 Alan Braslau
2011-07-21 14:53 ` luigi scarso
2011-07-21 15:39   ` Peter Rolf
2011-07-21 21:21     ` Alan Braslau
2011-07-22  9:35       ` Peter Rolf [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E29445D.3020504@gmx.net \
    --to=indiego@gmx.net \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).