ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Peter Rolf <indiego@gmx.net>
To: ntg-context@ntg.nl
Subject: Re: metapost question (bug?)
Date: Thu, 21 Jul 2011 17:39:48 +0200	[thread overview]
Message-ID: <4E284844.6050709@gmx.net> (raw)
In-Reply-To: <CAG5iGsAA+xZzcpkP7Bvae_2e1++heo-P14xSQKzF0k+1Gwrt3A@mail.gmail.com>

Am 21.07.2011 16:53, schrieb luigi scarso:
> On Thu, Jul 21, 2011 at 4:39 PM, Alan Braslau <alan.braslau@cea.fr> wrote:
>> Hello,
>>
>> I have a question for metapost specialists:
>>
>> I am looking for some sort of effect, built upon a zig-zag line.
>> The first graphic in the minimal example below is as I would expect.
>> The second graphic seems to be drawn without the point at (0,0).
>> (Ignore the asymmetry at the end of the path in the 2nd, this
>> is to be expected in this minimal example.)
>>
>> Is the result correct or is this a bug?
>>
>> Alan
>>
>>
>>
>> \starttext
>>
>> \startTEXpage
>> \startMPcode
>>        u := 1mm ;
>>
>>        path p[] ;
>>        p0 := ((0,0)--(1,0)) rotated 45 scaled 20u ;
>>        pickup pensquare scaled 10u rotated 45 ;
>>        draw p0 withcolor blue ;
>>        pickup pensquare yscaled 2u xscaled 5u rotated 45 ;
>>        draw p0 withcolor yellow ;
>>        pickup pencircle scaled .1u ;
>>        draw p0 ;
>> \stopMPcode
>> \stopTEXpage
>>
>> \startTEXpage
>> \startMPcode
>>        p1 := ((0,0)--(sqrt(2),0)) rotated -30 scaled 20u
>>                shifted point infinity of p0 ;
>>        p2 := p0--p1 ;
>>
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.


>>        pickup pensquare scaled 10u rotated 45 ;
>>        draw p2 withcolor blue ;
>>        pickup pensquare yscaled 2u xscaled 5u rotated 45 ;
>>        draw p2 withcolor yellow ;
>>        pickup pencircle scaled .1u ;
>>        draw p2 ;
>> \stopMPcode
>> \stopTEXpage
>>
>> \stoptext
> You are shifting by a certain amount : what is the net effect of
> shifted point infinity of p0 ?
> 
afaik simply the last point of p0.
___________________________________________________________________________________
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-21 15:39 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 [this message]
2011-07-21 21:21     ` Alan Braslau
2011-07-22  9:35       ` Peter Rolf

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=4E284844.6050709@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).