POV-Ray : Newsgroups : povray.programming : Re: Pains in rendering complex polygons : Re: Pains in rendering complex polygons Server Time
5 Jul 2024 16:10:52 EDT (-0400)
  Re: Pains in rendering complex polygons  
From: Mike Williams
Date: 28 Jul 2003 01:15:35
Message: <G8iNxGAT7KJ$EwOO@econym.demon.co.uk>
Wasn't it Warp who wrote:
>Jake McDowell <McN### [at] techiecom> wrote:
>>     dSpline(blah),
>
>  You don't need a comma there.

Alternatively you could move the comma so that it comes before the
dSpline(blah) and remove the hard-coded one after the 80.

polygon {
  80
  #declare blah=80;
  #while(blah>0)
    ,dSpline(blah)
    #declare blah = blah-1;
  #end
}


There are some situations where commas are required and that trick
doesn't work (I can't think of a situation off hand, but I've met one in
the past). In such a case you could process the first or last item
outside the loop

polygon {
  80,
  dSpline(80)           // out of loop, no comma
  #declare blah=79;
  #while(blah>0)
    ,dSpline(blah)
    #declare blah = blah-1;
  #end
}

or put an #if statement round the comma.

polygon {
  80,
  #declare blah=80;
  #while(blah>0)
    dSpline(blah)
    #if (blah > 1) , #end
    #declare blah = blah-1;
  #end
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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