POV-Ray : Newsgroups : povray.advanced-users : POVRay and XML : Re: POVRay and XML Server Time
28 Jul 2024 20:23:29 EDT (-0400)
  Re: POVRay and XML  
From: Patrick Elliott
Date: 31 Dec 2004 14:50:28
Message: <MPG.1c3f5b223e6fa028989c94@news.povray.org>
In article <37jat050gpl1jhjhfl290afmkdbivt0f7q@4ax.com>, abx### [at] abxartpl 
says...
> On 31 Dec 2004 07:54:35 -0500, ingo <ing### [at] tagpovrayorg> wrote:
> > > Can you point me an example of useful namespace application within
> > > POV-Ray scene from average unskilled user point of view?
> >
> > A problem I ran into several times is using multiple include files, where 
> > in two or more inc's objects are defined with the same name.
> 
> And usually how hard it is to solve such issue?
> 
> ABX
> 

Actually, that 'could' be solved with something as simply as treating the 
file itself as an object. I.e.:

File 1 (Fred.inc):

...
object Fred = {Sphere{<0,0,0>, 1}}
...

File 2 (MyBoxes.inc):

...
object Fred = {box{<-0.5,-0.5,-0.5>,<0.5,0.5,0.5>}
...

Instead of generating a parse error, you take any duplicates and make 
then sub objects:

Fred.Fred
MyBoxes.Fred

If however, you only use one of the includes, then 'Fred' would 
automatically resolve to the only one available. This would have no 
effect on most scenes, since it only effects cases where more than one 
definition is being used. Of course, it would need to ignore re-
definitions in the same file, so that only the 'final' state of the 
includes objects are considered. If Fred was redefined five times in the 
same include, only the last version would become valid, since that is all 
the main scene would see anyway. Same with local definitions, though you 
might need to include the concept of 'me.<object>' for clarity.

But really, just editing the names for your own purposes is not that big 
a deal. Well, unless it is one of those million object tree includes one 
of the tree maker utilities generates..... lol Just finding all the damn 
names to change them in those is a nightmare.

-- 
void main () {

    call functional_code()
  else
    call crash_windows();
}


Post a reply to this message

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