POV-Ray : Newsgroups : povray.general : Parsed SDL : Re: Parsed SDL Server Time
1 Aug 2024 06:25:52 EDT (-0400)
  Re: Parsed SDL  
From: Chambers
Date: 1 Feb 2006 13:02:54
Message: <43e0f7ce$1@news.povray.org>
POVMAN wrote:
> For instance, if I have a macro that generates 100 spheres, is there ever a 
> version of the SDL that contains 100 sphere definitions?

No.  You're probably used to other programming languages (C++, for 
instance) that have a separate preprocessor and compiler.  In POV-Ray, 
SDL files get "compiled" at the same time as being "preprocessed".  So, 
macro substitution occurs as the file is being evaluated.

It would be simple (but tedious) to insert #debug statements into your 
code to let you know what's going on.  For instance, in your macro that 
generates 100 spheres, you could do:

#debug "Macro generating 100 spheres...\n"

-or-

#local c_x = str(sphere_center.x, 0, 0);
#local c_y = str(sphere_center.y, 0, 0);
#local c_z = str(sphere_center.z, 0, 0);
#debug concat("Macro generated sphere at ", c_x, ", ", c_y, ", ", c_z, "\n"


...Chambers


Post a reply to this message

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