POV-Ray : Newsgroups : povray.unofficial.patches : Error in Megapov documentation. Server Time
1 Nov 2024 09:22:28 EDT (-0400)
  Error in Megapov documentation. (Message 1 to 2 of 2)  
From: Michael Andrews
Subject: Error in Megapov documentation.
Date: 14 Feb 2001 13:24:39
Message: <3A8ACD35.6258304@reading.ac.uk>
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

From: david sharp
Subject: Re: Error in Megapov documentation.
Date: 14 Feb 2001 21:47:34
Message: <3a8b4346@news.povray.org>
> This is about using an array of data with the i_dat3d library functions.
>
[ ... ]

Thanks for pointing this out.
I have almost always used symmetrical arrays
(array[A][A][A])  so this bug never showed in
my personal use. Even sometimes I have used
asymmetical arrays, but then purposefully rendering
with different dimension sizes  in order to "fold" a
surface (big fun).
Point being that I never even noticed it was
backwards!
And now I suddenly understand why some have
complained that they get unexpected results
using those functions.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.