POV-Ray : Newsgroups : povray.general : Regular Polygons & Prisms : Re: Regular Polygons & Prisms Server Time
11 Aug 2024 07:16:14 EDT (-0400)
  Re: Regular Polygons & Prisms  
From: Remco de Korte
Date: 7 Oct 1999 22:08:10
Message: <37FD523E.F6734AD2@xs4all.nl>
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.