From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/75944 Path: news.gmane.org!not-for-mail From: Marco Newsgroups: gmane.comp.tex.context Subject: Re: drawarrow and transparency Date: Wed, 2 May 2012 21:42:24 +0200 Message-ID: <20120502214224.754fa3ab@Zewz> References: <20120502173518.604e1545@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 1335987766 28372 80.91.229.3 (2 May 2012 19:42:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 2 May 2012 19:42:46 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Wed May 02 21:42:45 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 1SPfRi-00026x-4o for gctc-ntg-context-518@m.gmane.org; Wed, 02 May 2012 21:42:42 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8A3C9101F6; Wed, 2 May 2012 21:42:41 +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 4axhbljOrOaj; Wed, 2 May 2012 21:42:39 +0200 (CEST) Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0570E101E8; Wed, 2 May 2012 21:42:39 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 08D85101E8 for ; Wed, 2 May 2012 21:42:38 +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 hh12NO4JdqIO for ; Wed, 2 May 2012 21:42:37 +0200 (CEST) Original-Received: from filter3-nij.mf.surf.net (filter3-nij.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id 50490101E6 for ; Wed, 2 May 2012 21:42:37 +0200 (CEST) Original-Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by filter3-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q42JgaHB008955 for ; Wed, 2 May 2012 21:42:36 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SPfRa-00020X-PF for ntg-context@ntg.nl; Wed, 02 May 2012 21:42:34 +0200 Original-Received: from 83.68.239.197 ([83.68.239.197]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 May 2012 21:42:34 +0200 Original-Received: from netuse by 83.68.239.197 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 May 2012 21:42:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 36 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 83.68.239.197 X-Newsreader: Claws Mail 3.7.8 (GTK+ 2.24.4; i686-pc-linux-gnu) X-Bayes-Prob: 0.9983 (Score 4.7, tokens from: @@RPTN) X-CanIt-Geo: ip=80.91.229.3; country=NO; latitude=62.0000; longitude=10.0000; http://maps.google.com/maps?q=62.0000,10.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0dH57GArh - 5ad25c28f094 - 20120502 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.154 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:75944 Archived-At: 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 ___________________________________________________________________________________ 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 ___________________________________________________________________________________