POV-Ray : Newsgroups : povray.newusers : Problem with recursion : Re: Problem with recursion Server Time
29 Jul 2024 06:13:47 EDT (-0400)
  Re: Problem with recursion  
From: MSAB
Date: 11 Jul 2006 05:45:00
Message: <web.44b3718ef80db1394e1457560@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> A short scene demonstrating the problem would be of great help
> answering your question.

Here's a simple scene, to see, where my problem is (my actual file is much
more complexer)
The main-file:

#macro Test (Art,P1,P2,n)

#local P3 = P1+ (P2-P1)/2 ;

#include "Obj_def.pov"
#include "Typ_def.pov"

union{

#if (n=0)

cylinder{P1,P2,0.5}
object{Ba}

#else

cylinder{P1,P2,0.5}
object{R}

#end
}
#end

Now, the Include-file "Obj_def.pov":

#if (Art = 1)
#declare B = box{1,1}
#end

#if (Art = 2)
#declare B = box{1.1,1.1}
#end

And this is the file "Typ_def.pov". I think there's the problem:

#if (Art = 1)

#declare Ba = union{
object{B translate P1}
object{B translate P2}
object{B translate P3}
}
#declare R = union{
object{Test (Art,P3,P3+vrotate(P2,<0,0, 45>),n-1)}
object{Test (Art,P2,P2+vrotate(P2,<0,0,-45>),n-1)}
}

#end

#if (Art = 2)

#declare Ba = union{
object{B translate P2}
object{B translate P3}
}
#declare R = union{
object{Test (Art,P1,P1+vrotate(P2,<0,0, 45>),n-1)}
object{Test (Art,P2,P2+vrotate(P2,<0,0,-45>),n-1)}
}

#end

Thanks for your answers.


Post a reply to this message

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