POV-Ray : Newsgroups : povray.advanced-users : Too many nested Conditionals or macros Server Time
25 Dec 2024 01:44:08 EST (-0500)
  Too many nested Conditionals or macros (Message 1 to 3 of 3)  
From: Neddahk
Subject: Too many nested Conditionals or macros
Date: 23 Oct 2006 02:15:00
Message: <web.453c5d575286e49c5618b8990@news.povray.org>
I have been writing a complicated recursive macro that draws a tree.  I have
had some success with the project, but I am now running into a message
saying "Too many nested conditionals or macros."  I know the macro does not
create an infinite loop, and I'd be happy to wait another few minutes while
it parses.  Is there a way around this?  I read something about "while"
loops and arrays, but I haven't been able to achieve the same results.


Post a reply to this message

From: Warp
Subject: Re: Too many nested Conditionals or macros
Date: 23 Oct 2006 07:09:16
Message: <453ca2dc@news.povray.org>
Neddahk <Ned### [at] hotmailcom> wrote:
> I have been writing a complicated recursive macro that draws a tree.  I have
> had some success with the project, but I am now running into a message
> saying "Too many nested conditionals or macros."  I know the macro does not
> create an infinite loop, and I'd be happy to wait another few minutes while
> it parses.  Is there a way around this?

  Macros in POV-Ray have a very small stack for recursive calls, for some
reason. You can make about 100 recursive calls or so. I don't think there's
any way around that.
  You'll have to make an iterative version of your algorithm using a #while
loop. If it can't be made iterative you'll have to use #while and an array
as a stack.

-- 
                                                          - Warp


Post a reply to this message

From: David Wallace
Subject: Re: Too many nested Conditionals or macros
Date: 28 Oct 2006 14:22:01
Message: <45439fc9@news.povray.org>
Neddahk wrote:
> I have been writing a complicated recursive macro that draws a tree.  I have
> had some success with the project, but I am now running into a message
> saying "Too many nested conditionals or macros."  I know the macro does not
> create an infinite loop, and I'd be happy to wait another few minutes while
> it parses.  Is there a way around this?  I read something about "while"
> loops and arrays, but I haven't been able to achieve the same results.
> 
> 
How many levels of recursion do you need?  Gilles Trans' MakeTree gets excellent 
results with 5-6 levels.

I think some code text might be needed to weed the problem out.


Post a reply to this message

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