POV-Ray : Newsgroups : povray.newusers : Loop with logical expressions : Re: Loop with logical expressions Server Time
15 May 2024 05:05:19 EDT (-0400)
  Re: Loop with logical expressions  
From: Christian Froeschlin
Date: 19 Mar 2014 19:47:45
Message: <532a2ca1$1@news.povray.org>
On 19.03.2014 20:55, Bald Eagle wrote:

> I seem to be having difficulties predicting the results of this loop.

Note that for the case (Y=7 & (X<3 | X>5) ) you increase Y to "skip"
but still add the cylinder at Y = 8.

In general increasing a loop counter arbitrarily during the loop
is error-prone. A better way to write might be

  #if ( !( (Y=1 | Y=7) & (X<3 | X>5) ) &
      ( !( (Y=2 | Y=6) & (X=1 | X=7) ) )
   cylinder
  #end


Post a reply to this message

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