From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/60029 Path: news.gmane.org!not-for-mail From: Taco Hoekwater Newsgroups: gmane.comp.tex.context Subject: Re: Metapost: union test of two paths Date: Sun, 04 Jul 2010 08:47:21 +0200 Message-ID: <4C302E79.3060708@elvenkind.com> References: <20100702190137.35aeab6b@vorbis> <4C2EEED4.1010300@elvenkind.com> <4C2F0EB2.1020508@elvenkind.com> <4C2F3C7A.1020603@elvenkind.com> <20100704011127.277ee6ac@vorbis> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1278226105 27494 80.91.229.12 (4 Jul 2010 06:48:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 4 Jul 2010 06:48:25 +0000 (UTC) Cc: Marco To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Jul 04 08:48:23 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OVJ03-0005Y0-OA for gctc-ntg-context-518@m.gmane.org; Sun, 04 Jul 2010 08:48:23 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0DC46C9AFD; Sun, 4 Jul 2010 08:48:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 0C9IOW3qVn7i; Sun, 4 Jul 2010 08:48:20 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 641F0C9AD9; Sun, 4 Jul 2010 08:48:20 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E0907C9AD9 for ; Sun, 4 Jul 2010 08:48:18 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 5apAPGcT+hCY for ; Sun, 4 Jul 2010 08:48:16 +0200 (CEST) Original-Received: from smtp-vbr6.xs4all.nl (smtp-vbr6.xs4all.nl [194.109.24.26]) by balder.ntg.nl (Postfix) with ESMTP id 5926EC9AC7 for ; Sun, 4 Jul 2010 08:48:16 +0200 (CEST) Original-Received: from boo.fritz.box (boo.demon.nl [83.163.247.99]) (authenticated bits=0) by smtp-vbr6.xs4all.nl (8.13.8/8.13.8) with ESMTP id o646lXuU011982; Sun, 4 Jul 2010 08:47:38 +0200 (CEST) (envelope-from taco@elvenkind.com) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100614 Mandriva/3.0.4-11mdv2010.1 (2010.1) Thunderbird/3.0.4 In-Reply-To: <20100704011127.277ee6ac@vorbis> X-Virus-Scanned: by XS4ALL Virus Scanner X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:60029 Archived-At: On 07/04/2010 01:11 AM, Marco wrote: > 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. That helps. First test whether the paths insersect, that is easy. If they do insersect, they may still be touching each other only. Still, perhaps that is good enough (depends on what you want to do). But if they do not intersect, then you know for sure that either one is inside the other, or they are totally disjunct. In the fully overlapping case, the boundingboxes of the two paths will most likely likewise overlap perfectly, and that could be good enough for you. Alternatively, if you are certain that both the paths are convex hulls, then just testing for the boundingboxes could be good enough in practice. When the two paths P and Q touch at time A, you could test whether the two points that are time(A+epsilon) and time(A-epsilon) are both inside() both paths. But the hardest thing with doing all this in metapost is that you cannot trust metaposts results in the mathematical sense: rounding errors creep in easily in the internal routines, which is one the problems I hope to solve with metapost 2. 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 ___________________________________________________________________________________