|
|
On Wed, 13 Mar 2002 14:36:39 +0100, Christoph Hormann <chr### [at] gmxde>
wrote:
> I fixed a few problems since i posted the first version in p.b.s-f. Also
> wrote some documentation and an add-on for the Povray 3.5 insert menu.
>
> http://www.tu-bs.de/~y0013390/pov/ic/index.html
Here is proposition of IC_Box macro with function returning linear distance to
the box shape.
#macro IC_Box( Start , End )
#local Start=Start+<0,0,0>;
#local End=End+<0,0,0>;
#local Cx=max(Start.x, End.x);
#local Cy=max(Start.y, End.y);
#local Cz=max(Start.z, End.z);
#local Dx=min(Start.x, End.x);
#local Dy=min(Start.y, End.y);
#local Dz=min(Start.z, End.z);
#local Inside=function{pattern{object{box{ Start , End }}}};
function(x, y, z){
select(
Inside(x,y,z),
0,
f_r(min(x-Dx,max(x-Cx,0)),min(y-Dy,max(y-Cy,0)),min(z-Dz,max(z-Cz,0))),
max(x-Cx, y-Cy, z-Cz, Dx-x, Dy-y, Dz-z)
)
}
#end
ABX
Post a reply to this message
|
|