POV-Ray : Newsgroups : povray.general : A problem with HF macros in shapes.inc Server Time
2 Aug 2024 08:17:38 EDT (-0400)
  A problem with HF macros in shapes.inc (Message 1 to 4 of 4)  
From: Jellby
Subject: A problem with HF macros in shapes.inc
Date: 1 Jan 2005 10:09:59
Message: <41d6bd46@news.povray.org>
When creating a *large* heightfield with these macros (I was using HF_Sphere
with 750*750 points) and writing the data to a file, an error can be
triggered. There are two issues here.

a) Since the file is created with almost no "newlines", when there's an
error povray tries to output the last 5 lines before the problem, which are
endless lines, so this takes forever. I had to include a newline (",\n")
after each data to be able to see where the error actually was.

b) The real error is due to high numbers being written as floats, in
exponential format (1.22e+06, for example). So, when the number of points,
faces or whatever is very large, this leads to problems, as this number
needs to be an integer.

I solved this replacing "xRes*zRes" with "str(xRes*zRes,0,0)" and similarly
for "(xRes-1)*(zRes-1)*2" in the macro HFCreate_().

Still, there's a problem when the size is too large, the vertex indices are
too large too, so the way the face_indices are written should be changed
too. I replaced "F1+A" with:
  "<",str((F1+A).x,0,0),",",str((F1+A).y,0,0),",",str((F1+A).z,0,0),">"
and "F2+A" accordingly.

I think these changes are enough (and harmless).

-- 
light_source{9+9*x,1}camera{orthographic look_at(1-y)/4angle 30location
9/4-z*4}light_source{-9*z,1}union{box{.9-z.1+x clipped_by{plane{2+y-4*x
0}}}box{z-y-.1.1+z}box{-.1.1+x}box{.1z-.1}pigment{rgb<.8.2,1>}}//Jellby


Post a reply to this message

From: Rune
Subject: Re: A problem with HF macros in shapes.inc
Date: 2 Jan 2005 11:44:28
Message: <41d824ec$1@news.povray.org>
Jellby wrote:
> I think these changes are enough (and harmless).

I'm a co-creator of the macros, and I agree your fixes are sensible and 
correct.

I'm no longer in a position to make sure that they'll be included in the 
next version of POV-Ray, so I hope someone else takes note here. I don't 
know if a post to povray.bugreports is appropriate when it's not a bug in 
the POV-Ray engine itself... Anyone?

I do not speak on behalf of the POV-Team or TAG-Team (since I'm a member of 
neither).

Rune
-- 
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

From: Christoph Hormann
Subject: Re: A problem with HF macros in shapes.inc
Date: 7 Jan 2005 15:45:02
Message: <crms8d$4av$1@chho.imagico.de>
Rune wrote:
> 
> I'm a co-creator of the macros, and I agree your fixes are sensible and 
> correct.
> 
> I'm no longer in a position to make sure that they'll be included in the 
> next version of POV-Ray, so I hope someone else takes note here.

Heh, if you send an updated version of those macros to any team member 
it will for sure be changed (not in any case of course but for these 
obviously correct fixes for sure).

> I don't 
> know if a post to povray.bugreports is appropriate when it's not a bug in 
> the POV-Ray engine itself... Anyone?

Any bug in the POV-Ray distribution files is appropriate there (after 
being confirmed of course).  So go ahead and post it (with instructions 
how to fix at best).

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 23 Sep. 2004 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Jellby
Subject: Re: A problem with HF macros in shapes.inc
Date: 8 Jan 2005 08:19:46
Message: <41dfddf2@news.povray.org>
Among other things, Christoph Hormann saw fit to write:

> Any bug in the POV-Ray distribution files is appropriate there (after
> being confirmed of course).  So go ahead and post it (with instructions
> how to fix at best).

I've already posted a brief description to povray.bugreports

-- 
light_source{9+9*x,1}camera{orthographic look_at(1-y)/4angle 30location
9/4-z*4}light_source{-9*z,1}union{box{.9-z.1+x clipped_by{plane{2+y-4*x
0}}}box{z-y-.1.1+z}box{-.1.1+x}box{.1z-.1}pigment{rgb<.8.2,1>}}//Jellby


Post a reply to this message

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