ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Thomas A. Schmitz" <thomas.schmitz@uni-bonn.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: shading in metapost
Date: Thu, 24 Jan 2008 10:26:18 +0100	[thread overview]
Message-ID: <DE20F043-275E-40D7-918A-82044F20B951@uni-bonn.de> (raw)
In-Reply-To: <alpine.DEB.0.9999.0801240358570.19128@nqv-yncgbc>


On Jan 24, 2008, at 9:03 AM, Aditya Mahajan wrote:

> Hi Thomas,
>
> On Thu, 24 Jan 2008, Thomas A. Schmitz wrote:
>>

>>  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?
>
> 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
>

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
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2008-01-24  9:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-16 19:07 Thomas A. Schmitz
2008-01-16 22:22 ` John Luciani
2008-01-24  8:15   ` Thomas A. Schmitz
2008-01-24  8:03     ` Aditya Mahajan
2008-01-24  9:26       ` Thomas A. Schmitz [this message]
2008-01-24  9:59     ` Hans Hagen
2008-01-24  0:28 ` Mojca Miklavec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DE20F043-275E-40D7-918A-82044F20B951@uni-bonn.de \
    --to=thomas.schmitz@uni-bonn.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).