I have installed Mathmap 1.3.4 alpha2 on a WinXP machine running Gimp
2.6.6, and I wanted to run the Kaleidoscope script. It gave a "Can not
parse" error, so I opened the Mathmap plugin and started inserting the
script one line at a time.
The error came on the line: rad=rad*min(X,Y);
I introduced two new variables (foo and bar) so that the section now
reads:
xr=r*rad;
foo=min(X,Y);
bar=foo*rad;
if xr<bar then
nr=xr;
else
ang=2*ang;
nr=bar*xr/R;
end;
This runs without error, and seems to generate a kaleidoscope image,
although I have no idea what one looked like originally.
My question is, why the error with rad=rad*min(X,Y); ?
Credit to Nathan deGargoyle for the original script, and to Photocomix
for making these scripts available on his deviantart page. Also to
everyone involved in making Mathmap available to us.
Here is the entire
kaleidoscope.mm script (after the change):
====================================
filter kaleidoscope (image in, int ng: 2-10, float rot: 0-6.28319, int
sx: 0-2000, int sy: 0-2000, float rad: 0-100)
intang=2*pi/ng;
na=a+pi/2;
ang=intang/2-na%intang;
ang=rot+(intang/2-sqrt(ang^2));
xr=r*rad;
foo=min(X,Y);
bar=foo*rad;
if xr<bar then
nr=xr;
else
ang=2*ang;
nr=bar*xr/R;
end;
nx=nr*cos(ang);
ny=nr*sin(ang);
nx=(nx+sx)%(W-1)-(X-1);
ny=(ny+sy)%(H-1)-(Y-1);
in(xy:[nx,ny])
end
====================================