[metapost] cloudit

Troy Henderson thenders at gmail.com
Fri Apr 11 04:53:59 CEST 2008


>  I'd like to generalize this to work for arbitrary values of n, but I
>  don't see how to construct the pcloud path in general.
>
>  1) How can I generalize this?

You can replace

>  pcloud =
>  point t0 of pcirc{direction t0 of pcirc rotated -a}..
>  {v1 rotated a}point t1 of pcirc{v1 rotated -a}..
>  {v2 rotated a}point t2 of pcirc{v2 rotated -a}..
>  {v3 rotated a}point t3 of pcirc{v3 rotated -a}..
>  {v4 rotated a}point t4 of pcirc{v4 rotated -a}..
>  {v5 rotated a}point t5 of pcirc..cycle;

with

 pcloud =
  point t0 of pcirc{direction t0 of pcirc rotated -a}
  for i=1 upto n:
    ..{v[i] rotated a}point t[i] of pcirc{v[i] rotated -a}
  endfor ..cycle;

This should let you use whatever n you choose.

Troy


More information about the metapost mailing list