|
|
Try dissecting this macro I wrote a couple of years ago. It basically
triangulates a sphere to 'n' iterations (like a geodesic sphere). The
limitation here is that you are restricted to the number of points related
to the iteration level 'n' (I don't know the formula off the top of my
head). I did this a long time ago and my brain isn't functioning properly
at the moment to be of any further help...
-tgq
#macro Geodesic(n,R,Obj)
union{
#if (n=0)
object{Obj}
#else
#local nL=2^(n-1);
#local i=-nL;
#while (i<=nL)
#local nS=4*(nL-abs(i));
#if (nS=0)
object{Obj translate<0,0,-R> rotate x*i*90/nL}
#else
#local j=0;
#while (j<nS)
object{Obj translate<0,0,-R> rotate x*i*90/nL rotate y*j*360/nS}
#local j=j+1;
#end
#end
#local i=i+1;
#end
#end
}
#end
Post a reply to this message
|
|