ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Marco <netuse@lavabit.com>
To: ntg-context@ntg.nl
Subject: Re: Metapost: union test of two paths
Date: Sun, 4 Jul 2010 01:11:27 +0200	[thread overview]
Message-ID: <20100704011127.277ee6ac@vorbis> (raw)
In-Reply-To: <4C2F3C7A.1020603@elvenkind.com>

Hi Taco!

> That is hard. The main problem is the word 'arbitrary'.
Sorry, I was too general. The paths are a outline of a relatively
simple shape (so border cases should rarely occur) with area >0k, not
selfintersecting.

> * is a point *on* the path in or out?
It doesn't matter in my case.

> This one seems ok at first glance (extensive testing will probably
> show border cases that are not covered).
I did run some tests. It works like a charm, exactly the way I expect.
Thank you very much for this piece of code. If I got it right, your
basic idea is to count the times the point inside the boundingbox
crosses the border of the shape. And the subpath stuff results of the
fact that intersectionpoint/times returns only one intersection even if
there are more. Very smart.


I'm grateful for your support.

Kind regards
Marco


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


  parent reply	other threads:[~2010-07-03 23:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-02 17:01 Marco
2010-07-03  8:03 ` Taco Hoekwater
2010-07-03 10:19   ` Taco Hoekwater
2010-07-03 13:34     ` Taco Hoekwater
2010-07-03 14:54       ` Marco
2010-07-03 23:11       ` Marco [this message]
2010-07-04  6:47         ` Taco Hoekwater
2010-07-04  8:09           ` Marco
2010-07-04  8:21             ` Taco Hoekwater
2010-07-03 10:33   ` Alan BRASLAU
2010-07-03 13:36     ` 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=20100704011127.277ee6ac@vorbis \
    --to=netuse@lavabit.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).