Hi all, I have a somewhat silly question about metapost/metafun. To emphasize parts of a picture, I place a bright red arrow or circle/ellipse on top of the picture. I would like to make this arrow more visible by putting a shade beneath it (I attach a jpg that will hopefully show the desired effect). Right now, I simply draw the arrow twice with a transparent black color, once with a smaller pencircle, so the effect is like a shadow that is darker in the center than at the edges. However, I think the effect would be more dramatic if I could have a transparent area with a smooth grading. Is this possible at all in metapost? filling a path with a transparent AND shaded color? All best Thomas
There is some information on doing transparencies in METAPOST at http://www-math.univ-poitiers.fr/~phan/metalpha.html Using the code at the above link you should be able to produce the effect in your jpeg. (* jcl *) -- http://www.luciani.org
On Jan 16, 2008, at 11:22 PM, John Luciani wrote:
John, I never thanked you for your message; sorry about that! Unless I'm missing something, this page is just about transparency, but that works quite well in metafun; it was the combination of transparency and shading which I couldn't get right. On Jan 24, 2008, at 1:28 AM, Mojca Miklavec wrote:
Thanks, Mojca, that's what I suspected. For the time being, I prefer metafun just because I know a little bit about it (and almost nothing about tikz). I have solved the problem at hand by drawing ten instances of a very transparent black circle on top of each other and increasing the scale of the pencircle slightly at every run. Which leads me to one last question: I wanted to be clever and do it in a for-loop like this: for i=1 upto 10: pickup pencircle scaled (i*0.5) pt ; draw fullcircle scaled 5mm withcolor transparent (1,0.04,black) ; endfor ; Is this because the expression "pencircle scaled" expects a "numeric primary" as argument? And is there any way around this? All best, and thanks to all Thomas
Hi Thomas, On Thu, 24 Jan 2008, Thomas A. Schmitz wrote:
TikZ has a nice interface. The only drawback right now is the speed. Hopefully sometime in the near future, some of the backend of tikz will be written in lua and mplib, which will make things much faster.
scaled expects a dimension. (i*0.5)pt is not a dimension. You need to either write (i*0.5pt) or ((i*0.5)*1pt). The extra parenthesis are needed to keep the metapost parser happy. Aditya
On Jan 24, 2008, at 9:03 AM, Aditya Mahajan wrote:
Hi Thomas,
On Thu, 24 Jan 2008, Thomas A. Schmitz wrote:
Hi Aditya, arrrrgh. So easy - and I had no idea how to do it. Works perfectly! I'm glad I'm in the humanities and not in engineering; my bridges would collapse real soon... Thanks so much; this loop looks so much nicer than having ten lines of code doing the same circle all over again! All best Thomas
Thomas A. Schmitz wrote:
in mkiv at some point this may work because there transparency and color are separated, but there will be no changes to metafun till mplib is around 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 -----------------------------------------------------------------
On Jan 16, 2008 8:07 PM, Thomas A. Schmitz wrote:
In theory possible, but in practice not implemented in metafun. But see http://www.fauskes.net/media/pgf/pgfmanualCVS2008-01-23.pdf It might satisfy your needs. (Impressive!) Mojca
participants (5)
-
Aditya Mahajan
-
Hans Hagen
-
John Luciani
-
Mojca Miklavec
-
Thomas A. Schmitz