|
|
#macro RBox(xdim,ydim,zdim,er)
#local xd=xdim/2;
#local yd=ydim/2;
#local zd=zdim/2;
union{
box{<-xd,-yd+er,-zd+er>,<xd,yd-er,zd-er>}
box{<-xd+er,-yd,-zd+er>,<xd-er,yd,zd-er>}
box{<-xd+er,-yd+er,-zd>,<xd-er,yd-er,zd>}
#local j=-1;#while (j<2)
#local i=pi/4;#while (i<2*pi)
#local cy=(yd-er)*j;
#local cx=(xd-er)*(cos(i)>0 ? 1 : -1);
#local cz=(zd-er)*(sin(i)>0 ? 1 : -1);
sphere{<cx,cy,cz>,er}
cylinder{<cx,cy,cz>,<(xd-er)*(cos(i+pi/2)>0 ? 1 :
-1),cy,(zd-er)*(sin(i+pi/2)>0 ? 1 : -1)>,er}
#if (j=1)
cylinder{<cx,cy,cz>,<cx,-yd+er,cz>,er}
#end
#local i=i+pi/2;#end
#local j=j+2;#end
bounded_by{box{<-xd,-yd,-zd>,<xd,yd,zd>}}
#end
}
#end
______________________________________________________________________
Kari Kivisalo http://www.kivisalo.net
Post a reply to this message
|
|