ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: MetaPost Animation
Date: Fri, 16 Apr 2010 09:54:47 +0200	[thread overview]
Message-ID: <4BC817C7.8070207@wxs.nl> (raw)
In-Reply-To: <j2t1ea4ae671004160036jad97638fv3b58a200a175b5ef@mail.gmail.com>

On 16-4-2010 9:36, Boštjan Vesnicer wrote:
> Hi Troy
>
> Here is a simple solution:
>
> \def\MyGraphics#1{%
> \startMPcode
> path p,q;
> p:=fullcircle scaled 72;
> L:=length p;
> N:=20;
> q:=subpath (0,#1/N*L) of p;
> draw q withcolor red;
> fill fullcircle scaled 3 shifted point length q of q withcolor blue;
> setbounds currentpicture to unitsquare shifted (-0.5,-0.5) scaled 75;
> \stopMPcode}
>
> \starttext
> \dostepwiserecurse{0}{20}{1}{%
> \startTEXpage
> \MyGraphics{\recurselevel}
> \stopTEXpage}
> \stoptext

or, if you want to fool yourself that you're not using tex ... put this 
in "somefile.cld":

-- --

local template = [[
     path p, q ;
     p := fullcircle scaled 72 ;
     L := length p ;
     N := 20 ;
     q:=subpath (0,%s/N*L) of p ;
     draw q withcolor red ;
     fill fullcircle scaled 3 shifted point length q of q withcolor blue ;
     setbounds currentpicture to unitsquare shifted (-0.5,-0.5) scaled 75 ;
]]

context.starttext()
     for i=0,20 do
         context.startMPpage()
             context(template,i)
         context.stopMPpage()
     end
context.stoptext()

-- --

and then run:

context somefile.cld




-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


  reply	other threads:[~2010-04-16  7:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-15 17:53 Troy Henderson
2010-04-16  7:36 ` Boštjan Vesnicer
2010-04-16  7:54   ` Hans Hagen [this message]
2010-04-16 12:51     ` Troy Henderson
2010-04-16 14:19       ` Boštjan Vesnicer
2010-04-16 14:43       ` Wolfgang Schuster
     [not found] <20050330203818.ADE29128CA@ronja.ntg.nl>
2005-03-31  1:48 ` Beginnner's question: fumbling with font finding failures Paul R Martin
2005-03-31 11:53   ` Thomas A.Schmitz
2005-03-31 12:50     ` Metapost animation Albrecht Kauffmann
  -- strict thread matches above, loose matches on Subject: below --
2004-09-13 16:57 Michal Kvasnicka
2004-09-13 17:14 ` Henning Hraban Ramm
2004-09-13 19:40 ` Patrick Gundlach
2004-09-14  8:27   ` Michal Kvasnicka
2004-09-14  8:21     ` Patrick Gundlach
2004-09-14 16:33 ` Hans Hagen
2004-09-14 19:18   ` Michal Kvasnicka
2004-09-15  8:22     ` Hans Hagen
2004-09-16 17:05       ` Michal Kvasnicka
2005-05-19 14:28       ` Mojca Miklavec
2005-05-19 14:39         ` luigi.scarso

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=4BC817C7.8070207@wxs.nl \
    --to=pragma@wxs.nl \
    --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).