From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/17910 Path: main.gmane.org!not-for-mail From: h h extern Newsgroups: gmane.comp.tex.context Subject: Re: shading in meta[post/play] & PDF Date: Fri, 21 Jan 2005 21:55:32 +0100 Message-ID: <41F16C44.4020106@wxs.nl> References: <20050115210457.24F53127CC@ronja.ntg.nl> <41EE2FA8.4080002@guest.arnes.si> <41EE4903.4060705@wxs.nl> <41F04319.2070402@guest.arnes.si> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1106345239 2719 80.91.229.6 (21 Jan 2005 22:07:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 21 Jan 2005 22:07:19 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Jan 21 23:07:10 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Cs6vt-0007YC-00 for ; Fri, 21 Jan 2005 23:07:09 +0100 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 25CFF127A4; Fri, 21 Jan 2005 23:07:09 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13163-01-3; Fri, 21 Jan 2005 23:07:07 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 79940127A6; Fri, 21 Jan 2005 23:07:07 +0100 (CET) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id EB7ED127A6 for ; Fri, 21 Jan 2005 23:07:06 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13163-01-2 for ; Fri, 21 Jan 2005 23:07:04 +0100 (CET) Original-Received: from mailrelay01.solcon.nl (unknown [212.45.32.200]) by ronja.ntg.nl (Postfix) with ESMTP id 9EC7C1279A for ; Fri, 21 Jan 2005 23:07:04 +0100 (CET) Original-Received: from server-1.pragma-net.nl (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by mailrelay01.solcon.nl (8.12.11/SQL-8.12.11-5/8.12.11) with ESMTP id j0LM6w1n009557 for ; Fri, 21 Jan 2005 23:06:58 +0100 Original-Received: by server-1.pragma-net.nl (Postfix, from userid 65534) id 5E54B17B63; Fri, 21 Jan 2005 23:00:23 +0100 (CET) Original-Received: from [127.0.0.1] (unknown [10.100.1.1]) by server-1.pragma-net.nl (Postfix) with ESMTP id CE8EA17B58 for ; Fri, 21 Jan 2005 22:00:19 +0000 (UTC) User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <41F04319.2070402@guest.arnes.si> X-Virus-Scanned: ClamAV 0.80/540/Tue Oct 19 14:59:23 2004 clamav-milter version 0.80j on mailrelay01 X-Virus-Status: Clean X-Virus-Scanned: by amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 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 X-Virus-Scanned: by amavisd-new at ntg.nl Xref: main.gmane.org gmane.comp.tex.context:17910 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:17910 Mojca Miklavec wrote: > Problem description: > I have a computer program, which carries the data about the grid points > on a sphere (possibly with different colors defined in these points) and > how the points are connected with each other to form a grid. I would > take these triangles (or quadrilaterals), draw them transformed on the > plane (with curves, not with straight lines) and fill them with the > appropriate shading pattern (colors defined in corners of the triangles > (darker according to normal vector) simply interpolated between the > three points). Yet another possibility would probably be to use > function-based shading and define a function which knows how the points > have to be shaded on the sphere, but the latter seems more complicated > and less universal. > > Problem reduction: > Fill a mp closed path with any more complex shading. > > So I would probably need Type 6 or 7 shading (Type 4 would be OK as the > picture can be clipped within metapost, so that the resulting sphere > borders are not composed of straight lines; the articles on > http://www.math.ubc.ca/people/faculty/cass/graphics/text/www/ which > inspired me to do something so crazy actually use Type 4 shading). Type > one is probably the most general one, so it should be OK too, just > complicated to do. > > However: I'm not sure if, say, a (sampled) function to be passed to PDF > can be specified in metapost elegantly. i searched my machine extensively but it seems that i lost some code that could be used as starting point for that; > Page 746 of PDF Reference, version 1.6 also defines an interesting new > feature: 3D objects (3D Artwork as they call it), but I haven't found > anything else about that. there is a section about shading, the function numbers differ; > In dvipdfm there's an example of using: > \special{pdf: bt rotate 90 xscale 2.0 } > > These lines are to be used in TeX. MetaPost also knows a "special" > command, I just don't know how to use it. (This is probably the > "communication channel" to PDF when trying to implement some more exotic > shadings.) take a look at supp-mpe.tex, all we need is some variant on \defineMPspecial{31} {\startMPshading{16}% type 3 \setMPshadingcolors{4}{5}{6}{10}{11}{12}% \immediate\pdfobj {<>}% \immediate\pdfobj {<>}% \stopMPshading} (plus some more depending on what parameters need to be passed) > I glimpsed the mp-spec.mp file, but I didn't yet understand how the > parameters are passed to PDF. > >> [more a context mailing list issue than a metapost list issue] > > So I left the metapost group out. Actually, 90% on the people here > probably think I posted that to the wrong group anyway (in the sense of > "Are you sure you didn't want to post that question to the 3D studio max > mailing list?" :) The example above is probably not the most descriptive > one, but having the possibility to add some more advanced shading > patterns would be great. if you can locate the right stuff in the pdf ref manual we can see what can be done (off list); i can add more 'special' handlers to the mp to pdf converted Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------