From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/75954 Path: news.gmane.org!not-for-mail From: Peter Rolf Newsgroups: gmane.comp.tex.context Subject: Re: drawarrow and transparency Date: Thu, 03 May 2012 16:09:35 +0200 Message-ID: <4FA2919F.6090906@gmx.net> References: <20120502173518.604e1545@sole.extra.cea.fr> <20120502214224.754fa3ab@Zewz> <20120503123247.7592251f@sole.extra.cea.fr> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1336054194 13000 80.91.229.3 (3 May 2012 14:09:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 3 May 2012 14:09:54 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Thu May 03 16:09:51 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SPwj6-0004Hj-FP for gctc-ntg-context-518@m.gmane.org; Thu, 03 May 2012 16:09:48 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3DB4A101E5; Thu, 3 May 2012 16:09:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id z1mR22bwR74r; Thu, 3 May 2012 16:09:44 +0200 (CEST) Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D988F101E0; Thu, 3 May 2012 16:09:44 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 13335101E0 for ; Thu, 3 May 2012 16:09:43 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id VhnHEegK-bdz for ; Thu, 3 May 2012 16:09:39 +0200 (CEST) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id 36745101CF for ; Thu, 3 May 2012 16:09:39 +0200 (CEST) Original-Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with SMTP id q43E9c2l011032 for ; Thu, 3 May 2012 16:09:38 +0200 Original-Received: (qmail invoked by alias); 03 May 2012 14:09:38 -0000 Original-Received: from ip-178-200-48-212.unitymediagroup.de (EHLO [192.168.178.3]) [178.200.48.212] by mail.gmx.net (mp012) with SMTP; 03 May 2012 16:09:38 +0200 X-Authenticated: #24293357 X-Provags-ID: V01U2FsdGVkX18CpDZeaRcCdLPwGAR2f+dyBwLU8z1TEwn9Rkfkk5 y2yIdkIOEtZF9A User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 In-Reply-To: <20120503123247.7592251f@sole.extra.cea.fr> X-Enigmail-Version: 1.4.1 X-Y-GMX-Trusted: 0 X-Bayes-Prob: 0.0003 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.165.64.22; country=DE; latitude=51.0000; longitude=9.0000; http://maps.google.com/maps?q=51.0000,9.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0RH5q9Ct6 - a0ee78d988ab - 20120503 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 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:75954 Archived-At: Hi Alan, Am 03.05.2012 12:32, schrieb Alan BRASLAU: > On Wed, 2 May 2012 21:42:24 +0200 > Marco wrote: > >> On 2012-05-02 Alan BRASLAU wrote: >> >>> For example, in the minimal example below, how can one obtain >>> a transparent arrow without getting an X-ray vision of the >>> arrowhead? >> >> Maybe I'm reinventing the wheel here, but you can write a small >> macro that only draws the lines you want. Here is an idea: >> >> \starttext >> \startMPpage >> >> linecap := squared; >> penscale := .5bp; >> pickup pencircle scaled penscale; >> >> def drawmyarrow expr p = _apth:=p; _myfinarr enddef; >> def _myfinarr text t = >> draw _apth cutafter point (-ahlength+.1penscale) on >> _apth t; fill arrowhead _apth t >> enddef; >> >> drawarrow origin -- (1cm,0) withtransparency(1,.5) ; >> drawarrow origin -- (0,1cm) withtransparency(1,.5) ; >> drawmyarrow (1.5cm,0) -- (2.5cm,0) withtransparency(1,.5) ; >> drawmyarrow (1.5cm,0) -- (1.5cm,1cm) withtransparency(1,.5) ; >> >> \stopMPpage >> \stoptext >> >> The (-ahlength+.1penscale) are of course empiric. You should find >> the correct formula to always have a nice match of line and arrow >> whatever ahlength and ahangle values are in use. >> >> Marco > > Yes, this is somewhat reinventing the wheel. > > I believe that this is somewhat a bug with transparency under MetaFun. > For I tried the following: > > \startMPcode > picture pic ; pic := image(drawarrow origin--(1cm,0)) ; > isn't 'image()' a fixed graphic? the only difference from normal drawing is, that the stuff is not added to 'currentpicture'. think of it more like a stamp, that is used to create identical copies. anyhow, it's probably better and cleaner to use a macro here... > draw pic withtransparency(1,.5) ; > draw pic rotated 90 withtransparency(1,.5) ; > \stopMPcode > > Here, the arrowhead is totally opaque and only the "stem" > has transparency. Something is fishy. > > Alan what you want (if i understand you right) is a non-isolated 'knockout group'. see 'PLATE 17'**, page 1147, in the pdf reference 1.7 for an example. currently no grouping (objects are in the same transparency group) is supported in metafun. the only possible way to create such a graphic is to use the tikz module (search for 'transparency group' in the tikz manual). hope that helps, Peter ** the complete graphic is a fake, because all of its parts are opaque, pixel based graphics; not a single vector graphic, no transparency at all! what a joke :-D maybe adobe doesn't trust other (or their own) pdf viewers to show the right result!? ___________________________________________________________________________________ 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 ___________________________________________________________________________________