POV-Ray : Newsgroups : povray.general : Regular Polygons & Prisms : Re: Regular Polygons & Prisms Server Time
11 Aug 2024 07:14:38 EDT (-0400)
  Re: Regular Polygons & Prisms  
From: Andrea Ryan
Date: 7 Oct 1999 23:11:46
Message: <37FD6004.A3A5944A@global2000.net>
I posted a image of a septagon prism in povray.binaries.images.

Andrea Ryan wrote:

> Finally! The finial comma vanished! I just declared comma_no before most of the
other stuff
> and moved the line that subtracted one form comma_no to the outside of a #if
statement. I
> think that the later is what fixed it.
> Brendan Ryan          Thank you Remco! :-)
>
> Remco de Korte wrote:
>
> > Andrea Ryan wrote:
> > >
> > > Now, the macro is nearly perfect. It can create whole prism statements but the
part that
> > > omits the comma after the last vector doesn't work. Here's the code:  (which is
inside a
> > > while loop)
> > > Brendan Ryan
> > >
> > > #write (data, "","\n")
> > > #write (data, "",vec,"")
> > > #ifndef (comma_no)
> > > #local comma_no = sides;
> > > #end
> > > #if (comma_no>0)
> > > #write (data, "",",")
> > > #else
> > > #local comma_no = comma_no-1
> > > #end
> > >
> >
> > I'm not sure how the rest looks but this seems a bit complicated.
> >
> > How about this:
> >
> > #write (data,"",vec,"")
> > #if (counter<sides)
> >   #write (data, "",",")
> > #end
> >
> > or something in that fashion.
> >
> > Another solution, which also relates to your problem with closing the prism
> > could be:
> > #while (counter<sides)
> >   // create a new vec for this value
> >   #write (data,"",vec,"")
> >   #write (data, "",",")
> > #end
> > #declare vec=first_vec;
> > #write (data,"",vec,"")
> >
> > I hope this makes sense.
> > Don't look too much at the write-stuff, I just copied it from your example.
> >
> > Good luck again :)
> >
> > Remco


Post a reply to this message

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