|
|
Could it be that it does not like the lines arrowed below? You are fiddling
with variables used to call your macro, declared outside the macro's scope.
Better try giving XX and YY a different name within the macro. They are
local variables, and you avoid a lot of confusion by naming them
differently.
I am not certain whether a macro is called by value or by reference. Calling
by value would mean that any changes to the value of the local variables
will not be found in the calling body.
Frans
.......
some code
.....
>#macro point (xx,yy)
> #local ro=max((1-3*sin(2*yy)*sin(5*xx+pi/2)),0);
> #declare zn=-ro*sin(yy)*cos(xx);
> #declare xn=ro*sin(yy)*sin(xx);
> #declare yn=ro*cos(yy);
====> #declare xx=xx+deltax; <============ this may be ambiguous !!!
> #local ro=max((1-3*sin(2*yy)*sin(5*xx+pi/2)),0);
> #local zp=-ro*sin(yy)*cos(xx);
> #local xp=ro*sin(yy)*sin(xx);
> #local yp=ro*cos(yy);
====> #declare xx=xx-deltax; <============ So for this !!
====> #declare yy=yy+deltay; <============ and this !!
> #local ro=max((1-3*sin(2*yy)*sin(5*xx+pi/2)),0);
> #local zq=-ro*sin(yy)*cos(xx);
> #local xq=ro*sin(yy)*sin(xx);
> #local yq=ro*cos(yy);
=====> #declare yy=yy-deltay; <============ another
> #declare vn=vcross(<xp-xn,yp-yn,zp-zn>,<xq-xn,yq-yn,zq-zn>);
>#end // end of macro
>#declare etoile = mesh {
> #declare xx = xmin; <================
> #while (xx<xmax) //outer loop
> #declare yy = ymin;
> #while (yy<ymax) //inner loop
>//POINTS
> point(xx,yy) <================
______________________________________________________________________
Post a reply to this message
|
|