POV-Ray : Newsgroups : povray.bugreports : problem with HF macros in shapes.inc Server Time
22 Nov 2024 09:26:48 EST (-0500)
  problem with HF macros in shapes.inc (Message 1 to 1 of 1)  
From: bugreports moderator
Subject: problem with HF macros in shapes.inc
Date: 8 Jan 2005 22:37:31
Message: <gk91u0h8lh17tscq6hplsijdfpcsmdt5j5@4ax.com>
From: Jellby <jel### [at] yahoocom>
Date: Sat, 08 Jan 2005 12:59:12 +0100

See the thread:
http://news.povray.org/povray.general/thread/%3C41d6bd46%40news.povray.org%3E/

The problem is, when writing the hf-mesh to an external field, some
numbers (number of vertices, indices...) should be written as
integers, but, when they're very large, they're actually written as
floats (1.22e+06, for example), which leads to errors.

The problem is relatively easy to fix. In the macro HFCreate_(), in
shapes.inc, make the following changes:

- Use "str(xRes*zRes,0,0)" instead of just "xRes*zRes" (3 places)

- Similarly, "str((xRes-1)*(zRes-1)*2,0,0)" instead of
"(xRes-1)*(zRes-1)*2"

- When face_indices are written, instead of "F1+A, F2+A," use the more
complex:

"<",str((F1+A).x,0,0),",",str((F1+A).y,0,0),",",str((F1+A).z,0,0),">",

"<",str((F2+A).x,0,0),",",str((F2+A).y,0,0),",",str((F2+A).z,0,0),">",
(perhaps there's an easier way)

There might be more macros with similar problems, I experimented only
with HF_Sphere, actually


Post a reply to this message

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