

Hi all,
Just curious, is there a way to have Povray call an external C or C++ (compiled)
function? I have a series of functions used in an isosurface, that get layered
so many times that they are extremely slow. I'm sure they can be written in C or
C++ and run a lot faster, if Povray can call C functions...
Here are all the functions just for fun ;) ...
#declare Q = function(x,y,z,Rx,Ry,Rz) {sqrt( pow(max(abs(x)Rx,0),2) +
pow(max(abs(y)Ry,0),2) + pow(max(abs(z)Rz,0),2) )}
#declare QX = function (x, Rx) {max(abs(x)Rx, 0)}
#declare QY = function (y, Ry) {max(abs(y)Ry, 0)}
#declare QZ = function (z, Rz) {max(abs(z)Rz, 0)}
#declare BOX = function (x,y,z,Rx,Ry,Rz) {Q (x,y,z, Rx/2, Ry/2, Rz/2) + min(max(
QX(x, Rx/2), max(QY(y, Ry/2), QZ(z, Rz/2)) ), 0)}
#declare ASTER = function {min(BOX(x0*Sz,y0*Sz,z0*Sz,Sz,Sz,Sz),
BOX(x1*Sz,y0*Sz,z0*Sz,Sz,Sz,Sz), BOX(x2*Sz,y0*Sz,z0*Sz,Sz,Sz,Sz),
BOX(x2*Sz,y1*Sz,z0*Sz,Sz,Sz,Sz), BOX(x2*Sz,y0*Sz,z1*Sz,Sz,Sz,Sz),
BOX(x2*Sz,y1*Sz,z1*Sz,Sz,Sz,Sz), BOX(x2*Sz,y+1*Sz,z0*Sz,Sz,Sz,Sz),
BOX(x+2*Sz,y0*Sz,z0*Sz,Sz,Sz,Sz), BOX(x+1*Sz,y0*Sz,z0*Sz,Sz,Sz,Sz),
BOX(x+2*Sz,y1*Sz,z0*Sz,Sz,Sz,Sz), BOX(x+2*Sz,y0*Sz,z1*Sz,Sz,Sz,Sz),
BOX(x+1*Sz,y+1*Sz,z0*Sz,Sz,Sz,Sz))}
Josh
Post a reply to this message

