POV-Ray : Newsgroups : povray.newusers : "Extruded" polygon? Server Time
28 Jul 2024 16:32:53 EDT (-0400)
  "Extruded" polygon? (Message 1 to 4 of 4)  
From: David E Nedrow
Subject: "Extruded" polygon?
Date: 27 Jan 2009 20:25:00
Message: <web.497fb3983a7db7ff5f83ce310@news.povray.org>
I have an object that can be easily described as a 6-sided polygon, but I need
it to have depth as well. I've seen a couple of suggestions that a polygon
can't be used for this, but a prism can.

This could also be done by differencing multiple cubes, but that seems less than
elegant.

Suggestions? If prism IS the way to go, could someone provide a simple example?

-David


Post a reply to this message

From: alphaQuad
Subject: Re: "Extruded" polygon?
Date: 27 Jan 2009 23:30:00
Message: <web.497fde1f75453fb114042c770@news.povray.org>
"David E Nedrow" <dne### [at] mecom> wrote:
> I have an object that can be easily described as a 6-sided polygon, but I need
> it to have depth as well. I've seen a couple of suggestions that a polygon
> can't be used for this, but a prism can.
>
> This could also be done by differencing multiple cubes, but that seems less than
> elegant.
>
> Suggestions? If prism IS the way to go, could someone provide a simple example?
>
> -David


You should be able to place cursor on the word prism and hit F1.
If thats too complex, here's another problem, POV needs a bezier spline editor
with very little to nothing available 'til now.

Import SVG, read pov-bezier files, edit bezier spline, export lathe and prism:
http://home.earthlink.net/~openuniverse/

If you know nothing of mirc you may still have no bezier editor.


Post a reply to this message

From: Chris B
Subject: Re: "Extruded" polygon?
Date: 28 Jan 2009 04:01:28
Message: <49801ee8@news.povray.org>
"David E Nedrow" <dne### [at] mecom> wrote in message 
news:web.497fb3983a7db7ff5f83ce310@news.povray.org...
>I have an object that can be easily described as a 6-sided polygon, but I 
>need
> it to have depth as well. I've seen a couple of suggestions that a polygon
> can't be used for this, but a prism can.

Yes. That's correct. The POV-Ray polygon primitive is really just a 2D 
surface.

> This could also be done by differencing multiple cubes, but that seems 
> less than
> elegant.
> Suggestions? If prism IS the way to go, could someone provide a simple 
> example?

Correct on both counts, you could, but it's not elegant. The prism object is 
the one to use and it's really straight-forward for linear splines. I've 
pasted in a short scene description below showing 2 different ways to do the 
same sort of thing. The first lets you specify coordinates by hand, the 
second calculates them programmatically.

The first prism uses a 4-sided linear spline. The line '0,1,5,' just tells 
POV-Ray to extrude the shape from y=0 to y=1 and to expect 5 coordinates. 
The following lines specify 5, 2D coordinates on the XZ plane, with the 
first coordinate being the same as the last.

The second example is a little more complex, but allows you to easily create 
a regular figure with any number of sides. It interweaves some POV-Ray 
directives to build the prism object definition using a loop, so that the 
positions of the corners are calculated programmatically.  In this case it 
loops round 7 times to give you 6 sides. The variable 'I' changes from '0' 
to '7' during the loop. The coordinates are calculated by rotating the 
vector 'z' (which is shorthand for <0,0,1>) around the 'y' axis by an amount 
that is a multiple of 60. The 'x' and 'z' components of the MyPosition 
variable are then used to define the prism.

Hope this helps.

Regards,
Chris B.

camera {location <-1,3,-3> look_at y }
light_source {<-10,20,50>, rgb 1}

prism {
  linear_spline
  0, 1, 5,
  <0,0>, <0.6,0>, <0.6,0.8>, <0,0.8>, <0,0>
  pigment {rgb <1,0,0>}
  translate <1,0,0>
}

#local Sides = 6;
#local I = 0;
prism {
  0,1,Sides+1,
  #while (I<=Sides)
    #local MyPosition = vrotate(z,I*y*360/Sides);
    <MyPosition.x,MyPosition.z>
    #if (I<Sides-1)  ,  #end
    #local I = I + 1;
  #end
  pigment {rgb <1,1,0>}
  translate <-0.5,0,0>
}


Post a reply to this message

From: David E Nedrow
Subject: Re: "Extruded" polygon?
Date: 28 Jan 2009 12:55:00
Message: <web.49809be975453fb1b973fa1d0@news.povray.org>
"alphaQuad" <alp### [at] earthlinknet> wrote:
> You should be able to place cursor on the word prism and hit F1.

Hmmm, no F1 feature in VIM. ;)

In any case, I don't know what the heck I was looking at, but it wasn't the
prism doc, which tells me exactly what I need.

In fact, the very first example at ...

http://www.povray.org/documentation/view/3.6.1/62/

is nearly the shape I'm after. Kismet.

-David


Post a reply to this message

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