POV-Ray : Newsgroups : povray.general : inverse used in nested loop error Server Time
1 Nov 2024 06:19:20 EDT (-0400)
  inverse used in nested loop error (Message 1 to 10 of 16)  
Goto Latest 10 Messages Next 6 Messages >>>
From: Bob Hughes
Subject: inverse used in nested loop error
Date: 2 Sep 2000 17:23:00
Message: <39b16fb4@news.povray.org>
Anyone mind trying to confirm this error?  The DOC says up to 200 nested
loops should be possible but I think it's only related to the fact a
'inverse' is in the CSG.  I tried small variations and the thing outlined
here seems to be the key problem.  Reason I say "double loop" is because it
doesn't occur if the CSG object is placed in the outer loop (singular
loop?).
If it's memory being the problem it appears to bestopping at about a count
of 110 instances of the object, which I thought had nothing to do with
nested levels anyway.
Appreciate any feedback so it can be reported or skipped.
  TIA,  Bob

// Persistence of Vision Ray Tracer Bug Description File
// File: inverseindoubleloopbug.pov
// Vers: 3.1, MegaPov 0.5
// Desc: CSG using inverse in a loop
// Date: 2000.675
// Auth: Bob Hughes
// Mail: per### [at] aolcom?subject=pov-bug
// Note: possible bug when doing CSG with "inverse" in loop as follows:
// PIII 500MHz Win98SE 256M SDRAM
//         Rendering error.
//         Too many nested objects
//         libpng: No IDATS written into file
//
//         Rendering error.
//         Error writing PNG file.


//#version unofficial MegaPov 0.5; // official or not, same

camera {location <-20,7.5,-25> angle 40 look_at <20,7.5,0>}
light_source {<10,10,-100>,1}

#declare Object= // whatever
 union {sphere {0,2} box {-1.5,1.5}}

#declare Count=5; // number count

#declare xV=0;
#declare yV=0;
#declare zV=0;
#declare Var3=1; // the starting number

#while (Count>0)

#declare Var1=1; // the counting number

#while (Var1<22) // count of instances (errors when 22 or more)

// error object
#declare Ni= // possibly any object can cause the error
 cone {-y,1,y,0

  inverse // introduces too many nested objects error

 }

#declare No=
 cone {-y,1,y,0}

// final object
union {
difference {
 object {Object}
 object {No}
  pigment {rgb .5}
 }
difference {
 object {Ni}
 object {Object

        // inverse // put here instead it keeps error from happening

         }
  pigment {rgb 1.5}
 }
   translate <xV,yV,zV> // position each in a grid
}

#declare Var1=Var1+1;
#declare xV=xV+4;

#end // inner loop

#declare xV=0;
#declare yV=yV+4;
#declare zV=0;
#declare Count=Count-1;
#declare Var3=Var3+1;

#end // outer loop


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: inverse used in nested loop error
Date: 2 Sep 2000 19:26:07
Message: <39b18c8f$1@news.povray.org>
In article <39b16fb4@news.povray.org> , "Bob Hughes" 
<per### [at] aolcom?subject=PoV-News:> wrote:

> Anyone mind trying to confirm this error?  The DOC says up to 200 nested
> loops should be possible but I think it's only related to the fact a
> 'inverse' is in the CSG.  I tried small variations and the thing outlined
> here seems to be the key problem.  Reason I say "double loop" is because it
> doesn't occur if the CSG object is placed in the outer loop (singular
> loop?).
> If it's memory being the problem it appears to bestopping at about a count
> of 110 instances of the object, which I thought had nothing to do with
> nested levels anyway.
> Appreciate any feedback so it can be reported or skipped.
>   TIA,  Bob

Did you try creating a simple version of your messy code?  It is hard to
understand what you want to do in the first place.

Regarding the error, you are confusing multiple things here.  First, there
are no 22 nested loops.  As the error message says, you have "Too many
nested objects".  Now, as there is no line number given, just reduce you
code to a readable version and you should be able to find out where you are
nesting to many objects, which has nothing to do with the loop.


      Thorsten


PS: In general, when asking for a bug confirmation, try to provide a
_simple_ and _readable_ example.  You speculation about the source of the
problem together with the wrong terms trying to explain it will not help
others to reproduce it, instead it just creates confusion and it will take
longer until you get a useful answer/confirmation :-)


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Alan Kong
Subject: Re: inverse used in nested loop error
Date: 2 Sep 2000 20:37:33
Message: <9073rskc5i78fcs6knaa10srv2icsibnj3@4ax.com>
On Sat, 02 Sep 2000 18:25:15 -0500 "Thorsten Froehlich"
<tho### [at] trfde> wrote:

>PS: In general, when asking for a bug confirmation, try to provide a
>_simple_ and _readable_ example.

  Hi, Thorsten. I'm gonna assume partial blame for that one because I
heard from Bob first, then asked him to post it here in p.general,
neglecting to ask him to submit a simplified scene.

-- 
Alan - ako### [at] povrayorg - a k o n g <at> p o v r a y <dot> o r g
http://www.povray.org - Home of the Persistence of Vision Ray Tracer


Post a reply to this message

From: Warp
Subject: Re: inverse used in nested loop error
Date: 3 Sep 2000 12:54:28
Message: <39b28244@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
: Did you try creating a simple version of your messy code?  It is hard to
: understand what you want to do in the first place.

  A proper indentation could help a lot.

  I'm not trying to be funny nor rude, I'm serious.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Bob Hughes
Subject: Re: inverse used in nested loop error
Date: 3 Sep 2000 13:09:42
Message: <39b285d6@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:39b28244@news.povray.org...
| Thorsten Froehlich <tho### [at] trfde> wrote:
| : Did you try creating a simple version of your messy code?  It is hard to
| : understand what you want to do in the first place.
|
|   A proper indentation could help a lot.
|
|   I'm not trying to be funny nor rude, I'm serious.

Wow, if you guys think that was a mess...  I bet Ken doesn't mind it (maybe
not anyway).
I had cut it down to the basic working scene file that still does the error.
I really had thought it was simplified best it could be and still do what
was attempted without error as well.
If you meant that it should be as basic as it can get I guess I could still
remove a #declare or three and post it again here.  Thanks for letting me
know, and sorry about the script as is.
I'll see what I can do about that and return later.

Bob


Post a reply to this message

From: Warp
Subject: Re: inverse used in nested loop error
Date: 3 Sep 2000 15:19:16
Message: <39b2a434@news.povray.org>
I don't want to be picky, but your indentation could still be better.

  Firstly, you didn't indent the loop blocks and secondly in my opinion
you over-indented the objects.
  May I propose my own indentation style?

camera
{
    location -10*z
    look_at 0
}

light_source {-10,1}

#declare Count1=1; // first loop count
#while (Count1<6)
    #declare Count2=1; // second loop count
    #while (Count2<21) // errors if >=22, not <=21
        // CSG object
        union
        {
            difference
            {
                sphere {0,2}
                object {No}
                pigment {rgb .5}
            }
            difference
            {
                cone
                {
                    -y,1,y,0 // any object? (sphere, box, cylinder, etc.)
                    inverse // comment out if using other inverse below
                }
                cone {-y,1,y,0}
                // inverse // uncomment, no error (comment other out)
            }
            pigment {rgb 1.5}
        }

        #declare Count2=Count2+1;
    #end // inner loop
    #declare Count1=Count1+1;
#end // outer loop


-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: inverse used in nested loop error
Date: 3 Sep 2000 15:37:59
Message: <39b2a897$1@news.povray.org>
In article <39b2a434@news.povray.org> , Warp <war### [at] tagpovrayorg>  wrote:

>   I don't want to be picky, but your indentation could still be better.
>
>   Firstly, you didn't indent the loop blocks and secondly in my opinion
> you over-indented the objects.
>   May I propose my own indentation style?

Maybe you should have tested it before picking on the indenting style: It
does not run because "No" is undefined ;-)


     Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Warp
Subject: Re: inverse used in nested loop error
Date: 3 Sep 2000 15:51:47
Message: <39b2abd2@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
: Maybe you should have tested it before picking on the indenting style: It
: does not run because "No" is undefined ;-)

  I think that it also has one mismatched }
  I noticed this when indenting. Extremely hard to see in the non-indented
(or badly indented) code.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Bob Hughes
Subject: Re: inverse used in nested loop error
Date: 3 Sep 2000 15:57:31
Message: <39b2ad2b$1@news.povray.org>
"Thorsten Froehlich" <tho### [at] trfde> wrote in message
news:39b2a897$1@news.povray.org...
| In article <39b2a434@news.povray.org> , Warp <war### [at] tagpovrayorg>  wrote:
|
| >   I don't want to be picky, but your indentation could still be better.
| >   May I propose my own indentation style?
|
| Maybe you should have tested it before picking on the indenting style: It
| does not run because "No" is undefined ;-)

Oh crud.  I just can't win.  Don't know how that got left in there, I ran it
before posting too.
Nice scripting Warp, except I never understood the { on the next line type
of thing.  I use the POV-Ray language scope in the Codemax Editor but added
extra tabs and spaces for that last one.
I'll Cancel that post and try yet once again using Warps version.

Bob


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: inverse used in nested loop error
Date: 3 Sep 2000 15:58:05
Message: <39b2ad4d@news.povray.org>
In article <39b16fb4@news.povray.org> , "Bob Hughes" 
<per### [at] aolcom?subject=PoV-News:> wrote:

> Anyone mind trying to confirm this error?  The DOC says up to 200 nested
> loops should be possible but I think it's only related to the fact a
> 'inverse' is in the CSG.  I tried small variations and the thing outlined
> here seems to be the key problem.  Reason I say "double loop" is because it
> doesn't occur if the CSG object is placed in the outer loop (singular
> loop?).
> If it's memory being the problem it appears to bestopping at about a count
> of 110 instances of the object, which I thought had nothing to do with
> nested levels anyway.
> Appreciate any feedback so it can be reported or skipped.
>   TIA,  Bob

OK, the problem is in your scene - more or less.  As you may have noticed,
once you add "inverse" you get the "Camera is inside a non-hollow object.
Fog and participating media may not work as expected." warning.

Well, if you check your scenes, the camera is not inside one hollow object
or two, no, it is contained inside a few hundred non-hollow objects! And
POV-Ray has in internal limit of the maximum non-hollow objects a camera can
be contained in (100). This limit is set by the extension that allows you to
place cameras inside objects in the first place.

Your scene is unlikely to render in any way as you expect because of this
anyway (why should everything in your scene be inverse? - then there is no
difference between it and a non-inverse scene!).  The solution is not to use
"inverse" on infinite objects in your scene.

Further, if the POV-Ray documentation does not already contain a warning
about cameras in non-hollow objects, such a section should probably be
added...


      Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

Goto Latest 10 Messages Next 6 Messages >>>

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