consists of a free 'include' file that incorporates
A zip file containing the include file and numerous examples along with a second zip file containing this documentation can be downloaded from the home page. You should unzip these files to a location of your choice.
To test POV-Stairs, open one of the 'StairCaseExample' scene files in POV-Ray and render it. You should see a simple example of a staircase, though StairCaseExample3.pov is a little more complex as it contains a complete scene definition for the lobby of a hotel and therefore may take a couple of minutes to render.
To make the POV-Stairs include file available to any scene file you render using POV-Ray, copy the include file into your standard POV-Ray include directory (alternatively you can simply add a copy into the directory containing your scene). You are permitted to include POV-Stairs within code that you subsequently re-distribute in original or modified form in accordance with the POV-Stairs license.
To control where the staircase goes, you need to specify the 3D coordinates that define the positions of the newel posts (the posts supporting the corners of the handrail) and the width of the stairs. POV-Stairs draws newel posts at the positions you specify, joins them together with banister rails and a stringers and draws treads and risers off at right angles to the banister rails. It adds a parallelogram shaped landings to transition the flooring around the corners and, optionally adds a second banister rail on the opposite side of the stairs. Finally you can decide whether to carpet the stairs and whether the carpet should span the full width of the stairs or leave the edges bare.
There are about 50 different control variables that you can set to tailor the stairs to your needs, but that shouldn't put you off because all of them have sensible defaults, so that you can generate a staircase straight away. If you run the StairCase macro without changing anything, you get a staircase with three flights of stairs starting at the origin and rising up a total of about 3 POV-ray units at a scale where 1 POV-Ray unit = 1 Metre. You can assign the output of POV-Stairs to a variable or wrap it in an object definition so that you can transform it to be any scale you want.
POV-Stairs control variables are all specified with units of 1 POV-Ray unit = 1 Metre.
All POV-Stairs control variable and macro names start with the prefix 'SC' so as to reduce the likelihood that these names will conflict with variable names that you have used elsewhere in your scene file.
The most important control variable uses an array to specify a sequence of coordinates for the positions of the newel posts. This is the 'SCPostPositions' variable.
|
#include "staircase.inc"
The SCPositions variable is defined as an array containing 3 coordinates:
#declare SCPostPositions = array [3] {<0,0,0>,<0,2,2.5>,<-2.5,4,2.5>}; StairCase()
|
| |
If you specify adjacent newel post positions that have the same 'y' value, POV-Stairs adds more level sections of landing as in the following example:
|
camera {location <-6,5.2,2> look_at <0,0,1.2>}
The SCPositions variable is defined as an array containing 6 coordinates:
#include "StairCase.inc" #declare SCStairWidth = 1.5; #declare SCStairCarpetWidth = 1.2; #declare SCPostPositions = array [6] {<0,2,0>,<0,1,3>,<-1,1,3>,<-2,0,2>,<-2,0,1>,<-2,-1,-2>}; StairCase()
This example also illustrates the use of the SCStairWidth and SCStairCarpetWidth control variables to specify a stair width of 1.5 units and a carpet width of 1.2 units, leaving a bare section of timber on either side of the carpet. |
| |
Stairs can clearly go up or down. The following example illustrates the definition for a set of stairs that changes direction. It is normal to have a level section between any such changes.
|
camera {location <0,3,-5> look_at <0,0,0>}
The SCPositions variable is defined as an array containing 6 coordinates:
#include "StairCase.inc" #declare SCPostPositions = array [6] {<-3,0,0>,<-2,0,0>,<-1,-1,0>,<1,-1,0>,<2,0,0>,<3,0,0>}; StairCase()
|
| |
There are various ways to provide an opening in the banister rail in the middle. The following example illustrates one approach.
|
camera {location <0,3,-5> look_at <0,0,0>}
The SCPositions variable is redefined between successive StairCase macro calls:
#include "StairCase.inc" #declare SCPairedBanisterOn = 0; #declare SCPostPositions = array [6] {<-3,0,0>,<-2,0,0>,<-1,-1,0>,<1,-1,0>,<2,0,0>,<3,0,0>}; StairCase()
#declare SCPairedBanisterOn = 1;
#declare SCPostPositions = array [3] {<1,-1,0>,<2,0,0>,<3,0,0>};
#declare SCMainBanisterOn = 1;
|
| |
The following example creates three separate flights of stairs with no landing in between.
The positions specified don't have to define flights of stairs that are at right angles to one another. POV-Stairs calculates the coordinates of the landing in one of two ways depending upon the amount through which the staircase needs to turn at that landing. If it turns through an angle that is greater than the setting of SCLandingThreshold then it adds a fourth newel post and calculates a parallelogram. Otherwise it uses the existing 3 newel posts to define a triangular landing. This works fairly well, but may not provide the level of control that you need. If the automatically generated landings are not satisfactory, simply split the staircase into multiple sections and code landings of your own in your scene file.