From: Taco Hoekwater <taco@elvenkind.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Metapost - Seems like weird behavior. Is it a bug?
Date: Wed, 25 Nov 2009 08:41:03 +0100 [thread overview]
Message-ID: <4B0CDF8F.30404@elvenkind.com> (raw)
In-Reply-To: <fe8d59da0911242313s3d614edt9f6c1a25aa4b6cf7@mail.gmail.com>
luigi scarso wrote:
> On Wed, Nov 25, 2009 at 5:45 AM, Curiouslearn <curiouslearn@gmail.com> wrote:
>> The code below shows a cyclic path that I am interested in creating
>> (it is in red if you run the code). The example works fine as long as
>> I have, u:=1cm, as in the code below. But if I replace it by ,
>> u:=0.6cm, there is no output. There is an error saying that paths 4
>> and 3 do not intersect. Is this a bug?
More a 'known limitation': intersection point calculations are not
perfect because of the fixed precision calculus.
Lint[4] is the culprit. With u=0.6cm it has these coordinates:
(170.07976,0.00014). Notice how the y coordinate is not actually
on the xaxis? That is because the actual intersection between
stLine and xaxis does not fit nicely into a scaled pair, so
metapost takes the 'closest approximation', which in this case
is slightly off both lines.
The solution is to add an explicit fix to Lint[4] just after its
current assignment:
Lint[4]:=(xpart Lint[4], 0);
This is not pretty, and one of the problems we hope to solve
with metapost 2.0.
Best wishes,
Taco
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2009-11-25 7:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-25 4:45 Curiouslearn
2009-11-25 7:13 ` luigi scarso
2009-11-25 7:41 ` Taco Hoekwater [this message]
2009-11-25 7:47 ` Taco Hoekwater
2009-11-25 16:24 ` Curiouslearn
2009-11-25 16:58 ` Taco Hoekwater
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=4B0CDF8F.30404@elvenkind.com \
--to=taco@elvenkind.com \
--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).