|
|
Hi folks,
This is about using an array of data with the i_dat3d library functions.
From the documentation (the very last bit of ss5.2.11), given an array
defind as
#declare Size = <37,23,17>;
#declare Data = array [Size.x][Size.y][Size.z]
I would expect to use the "data_3d_1" function by declaring
#declare fn_Data = function {
"data_3d_1", <1>
library "i_dat3d",
Data, <Size.x,Size.y,Size.z>
}
and using it as
#declare O_Data = isosurface {
function { fn_Data }
threshold 0.1
sign -1
contained_by { box { 0, Size } }
eval
pigment { colour rgb 1 }
}
for instance. Unfortunately this just gives me a jumbled mess.
With a little experimentation I found that using
#declare fn_Data = function {
"data_3d_1", <1>
library "i_dat3d",
Data, <Size.z,Size.y,Size.x> // <- Reversed
}
#declare O_Data = isosurface {
function { fn_Data(z,y,x) } // <- Reversed
threshold 0.1
sign -1
contained_by { box { 0, Size } }
eval
pigment { colour rgb 1 }
}
gives the correct result. I seem to remember DF3 files are defined in
this reversed way internally, so that's probably where this reversal
comes from. The effect is easy to compensate for if you know about it,
so there's no real point delving into the source code to sort it out,
but the documentation could perhaps be updated to mention this?
I'll post a small test file in p.b.s-f.
Bye for now,
Mike Andrews.
Post a reply to this message
|
|