|  |  | "Ranj" <nomail@nomail> wrote in message
news:web.425be4b2825a36abc40f76ea0@news.povray.org...
> Hi, does anyone know a shortcut or macro for building spiral staircases?
> Thanx
>
Hi Ranj,
You just need to define your step, then use a while loop to position a bunch
of copies of it in a spiral.
Here's a very simple example:
//  Spiral Staircase
#include "colors.inc"
#include "stones.inc"
camera {location <-2, 5, -2> look_at  <0, 3,  0>}
light_source { <0, 50, -10> color White}
light_source { <-100, 5, -10> color White}
#declare StepArc       = 20;
#declare StepHeight    =  0.075;
#declare StepRise      =  0.15;
#declare StepWidth     =  1;
#declare NumberOfSteps = 45;
#declare Step = difference {
  cylinder {0,StepHeight*y,1}
  plane {-z,0}
  plane { z,0 rotate StepArc*y}
}
#declare Rail = union {
  cylinder {0,y,0.01 translate <StepWidth*0.95,StepHeight,0> rotate
0.5*StepArc*y}
  sphere   {y,0.02   translate <StepWidth*0.95,StepHeight,0> rotate
0.5*StepArc*y}
  pigment  {color Gold}
}
#local i=0;
#while (i<NumberOfSteps)
  object {Step
    rotate -i*StepArc*y
    translate i*StepRise*y
    texture {T_Stone1 scale 0.05 rotate 2*i*StepArc*y}
  }
  object {Rail
    rotate -i*StepArc*y
    translate i*StepRise*y
  }
  #local i = i + 1;
#end
Chris B.
Post a reply to this message
 |  | 
|  |  | Hi Chris,
"Chris B" <c_b### [at] btconnect com> wrote:
> "Ranj" <nomail@nomail> wrote in message
> news:web.425be4b2825a36abc40f76ea0@news.povray.org...
> > Hi, does anyone know a shortcut or macro for building spiral staircases?
> > Thanx
>
> Hi Ranj,
>
> You just need to define your step, then use a while loop to position a bunch
> of copies of it in a spiral.
> Here's a very simple example:
>
> //  Spiral Staircase
>
Thanks for the inspiration, Chris. I've often thought of doing a spiral
staircase, but I'd never gotten around to it until your example gave me
something to get started with. See p.b.i. "Spiral Stairs" for my .pov and a
couple of jpegs.
<web.42732bc8d4c71a05e1f4d92c0@news.povray.org> Post a reply to this message
 |  | 
|  |  | "PM 2Ring" <nomail@nomail> wrote in message
news:web.427332351d5010d5e1f4d92c0@news.povray.org...
> Hi Chris,
>
> "Chris B" <c_b### [at] btconnect com> wrote:
> > "Ranj" <nomail@nomail> wrote in message
> > news:web.425be4b2825a36abc40f76ea0@news.povray.org...
> > > Hi, does anyone know a shortcut or macro for building spiral
staircases?
> > > Thanx
> >
> > Hi Ranj,
> >
> > You just need to define your step, then use a while loop to position a
bunch
> > of copies of it in a spiral.
> > Here's a very simple example:
> >
> > //  Spiral Staircase
> >
>
> Thanks for the inspiration, Chris. I've often thought of doing a spiral
> staircase, but I'd never gotten around to it until your example gave me
> something to get started with. See p.b.i. "Spiral Stairs" for my .pov and
a
> couple of jpegs.
>
> <web.42732bc8d4c71a05e1f4d92c0@news.povray.org>
>
You're very welcome.
I think your staircase looks very smart.
I'm working on some people models at the moment, so I might see how they
look in your scene when I'm done.
Regards,
Chris B. Post a reply to this message
 |  |