POV-Ray : Newsgroups : povray.advanced-users : too many nested macros error Server Time
1 Nov 2024 13:22:23 EDT (-0400)
  too many nested macros error (Message 1 to 4 of 4)  
From: Roman Reiner
Subject: too many nested macros error
Date: 16 Jan 2006 10:00:00
Message: <web.43cbb3c1ddd9fc03e3ad8c630@news.povray.org>
Hi there!

Not sure if this belongs to the advanced section.
I wrote a macro that takes a set of points randomly located in the xz-plane
and triangulates them. Works fine up to about 37 to 39 points (depends on
their arrangement) but when I use more I get the error "too many nested
conditions or macros" at parsing. Searching this newsgroup I found a post
where using while-loops instead of recursive macros had been recommended.
Unfortunately the recursion was linear in that case (the macro calls itself
once) while my macro calls itself twice what results in a treelike
structure. I have no idea how to solve that problem apart from making the

not half the fun isn't it? ;)
Any advices?

Regards
Roman


Post a reply to this message

From: Roman Reiner
Subject: Re: too many nested macros error
Date: 16 Jan 2006 10:05:00
Message: <web.43cbb5312ed5e975e3ad8c630@news.povray.org>
I forgot to mention that this is surely not caused by an infinite recursion.
Breaking conditions works fine!


Post a reply to this message

From: Florian Brucker
Subject: Re: too many nested macros error
Date: 16 Jan 2006 14:26:02
Message: <43cbf34a$1@news.povray.org>
I wrote a polygon triangulation code once. Out of interest I just 
checked if it could handle 1000 points. 3.5 minutes later I know it does 
:) It uses the remove ear technique and does not use recursion. You can 
find the macro in the package PolyFunctions at

http://www.wikipov.org/ow.asp?PolyFunctions

If you want to stick to your own code, anything done in a recursion can 
also be done using a while-loop and a stack (You can simulate a stack in 
POV-Ray using an array and keeping track of the last entry).


HTH,
Florian


Post a reply to this message

From: Roman Reiner
Subject: Re: too many nested macros error
Date: 17 Jan 2006 09:10:00
Message: <web.43ccf9f82ed5e97551381d6b0@news.povray.org>
Works great!

My marco needed 8m40s to triangulate the 1000 points ;-)

Thanks a lot!
Roman

Florian Brucker <tor### [at] torfboldcom> wrote:
> I wrote a polygon triangulation code once. Out of interest I just
> checked if it could handle 1000 points. 3.5 minutes later I know it does
> :) It uses the remove ear technique and does not use recursion. You can
> find the macro in the package PolyFunctions at
>
> http://www.wikipov.org/ow.asp?PolyFunctions
>
> If you want to stick to your own code, anything done in a recursion can
> also be done using a while-loop and a stack (You can simulate a stack in
> POV-Ray using an array and keeping track of the last entry).
>
>
> HTH,
> Florian


Post a reply to this message

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