|
![](/i/fill.gif) |
On Thu, 14 Mar 2002 15:06:20 +0100, Christoph Hormann <chr### [at] gmx de> wrote:
> now you just need the same for cylinders
#macro IC_Cylinder (Start, End, Radius)
#local Center = <0,0,0>+(Start+End)/2;
#local Cx=Center.x;
#local Cy=Center.y;
#local Cz=Center.z;
#local Len=vlength(End-Center);
#if (Len=0)
#error "iso_csg.inc: Error: zero height cylinder"
#end
#local fn_T=function { Reorient_Trans(End-Center, x) }
#local fn_X=
function(x, y){
select(x,max(x,y),select(y,max(x,y),f_r(x,y,0)))
}
#local fn_Y=
function(x, y, z){
fn_X( abs(fn_T(x, y, z).x)-Len, f_r(0,fn_T(x, y, z).y,fn_T(x, y, z).z)-Radius)
}
function(x, y, z){
(fn_Y((x-Cx),(y-Cy),(z-Cz)))
}
#end
ABX
Post a reply to this message
|
![](/i/fill.gif) |