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.
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
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.