From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/11591 Path: main.gmane.org!not-for-mail From: Emil Hedevang Lohse Newsgroups: gmane.comp.tex.context Subject: Re: Re[2]: MetaPost/Fun question Date: 23 Mar 2003 00:35:28 +0100 Organization: Gul and Sender: ntg-context-admin@ntg.nl Message-ID: References: <5.1.0.14.1.20030322222005.026b1b68@server-1> <12815828760.20030322223256@iol.it> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1048376294 6500 80.91.224.249 (22 Mar 2003 23:38:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 22 Mar 2003 23:38:14 +0000 (UTC) Original-X-From: ntg-context-admin@ntg.nl Sun Mar 23 00:38:13 2003 Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18wsZ2-0001ga-00 for ; Sun, 23 Mar 2003 00:38:12 +0100 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id B7FF110B6F; Sun, 23 Mar 2003 00:38:19 +0100 (MET) Original-Received: from imf.au.dk (radagast.imf.au.dk [130.225.20.9]) by ref.ntg.nl (Postfix) with ESMTP id 79D5B10AE8 for ; Sun, 23 Mar 2003 00:35:12 +0100 (MET) Original-Received: (from emil@localhost) by imf.au.dk (8.11.6/8.11.6) id h2MNZSn04799; Sun, 23 Mar 2003 00:35:28 +0100 Original-To: ntg-context@ntg.nl In-Reply-To: <12815828760.20030322223256@iol.it> Original-Lines: 49 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:11591 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:11591 Giuseppe Bilotta writes: > Saturday, March 22, 2003 Hans Hagen wrote: > > >>I would like to know if it is possible in MetaPost (in particular > >>MetaFun) to get all the possible intersection points of the paths, > > [snip] > > >>Anything like this? > > HH> not that i know, but assuming that those path have some distance, i can > HH> imagine dividing a path in parts and determining the intersectionpoints iof > HH> the pieces; > > HH> delta := .25 ; > > HH> for i=0 step delta upto length(p)-delta : > HH> if intersection_found(1,subpath(i,i+.1) of p) : > HH> store point > HH> fi ; > HH> endfor ; > > I'll see if I can make something of this ... (wow, looks like I'm > gonna need to learn MetaPost too ...) I implemented it by finding some intersectiontime and the recursively finding the intersectionstimes of the two subpaths (each with some neighbourhood of the first intersection point cut off). For the time being I cannot find my code, but here it is in pseude code. let p and q be paths; let (s,t) be a pair of intersection times of p and q; recursively find the intersection times of the subpath (0, s - small number) of p and q; store (s,t); recursively find the intersection times of the subpath (s + small number, infinity) of p and q; feel happy; When done this way, the intersection times will be sorted according to the first path. -- Emil Hedevang Lohse Alle spørgsmål er lige dumme. Og spørgsmålet "Kan ænder flyve?" er ikke dumt.