Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
    POV-Ray Examples - How To Make Objects for POV-Ray
Italiano Italiano
Français français
Deutsch Deutsch

Home
- POV-Ray Tutorial

  - POV-Ray Examples
   Index of Content
  - Geometry
    - Pawn
    - Wireframe Cube
    - Octagon
    - Egg Shape
    - Star
    - Optical Lens
    - Chessboard
    - Regular Tetrahedron
    - Penrose Triangle
    - Yin & Yang
    - Fishblob
    - Threefold
    - Trefoil
  - Architecture
  - Engineering
                                       
 
octogonal prism

Octagon - Octagonal Prism

The Construction of an Octagon (a nut or an octagonal column)
Example for the using of the "intersection"-statement.
Objects:   "box", "cylinder".
Methods: "intersection", "inverse"
Click here for an example!

The construction:

The common parts (= intersection) of a shape with quadratic shape and the same shape rotated by 45 degrees forms a shape with an octagonal outline.

View from top (view against y-direction)

The text:

//==================== Octagon ===============
intersection{
  box {<-1, 0.0,-1>,< 1,1.0,1> rotate<0, 0,0>}
  box {<-1,-0.1,-1>,< 1,1.1,1> rotate<0,45,0>}
  scale <1,0.5,1>
  texture{Polished_Brass
          normal{bumps 0.3 scale 0.02}
          finish{diffuse 0.9 phong 1}
         }
  translate<1.1,0.00,0>}
//============================================


//================= Octagon hollow ===========
intersection{
  box {<-1, 0.0,-1>,< 1,1.0,1> rotate<0, 0,0>}
  box {<-1,-0.1,-1>,< 1,1.1,1> rotate<0,45,0>}
  cylinder{<0,-0.1,0>,<0,1.1,0>,0.5 inverse
  scale <1,0.5,1>
  texture{Polished_Chrome
          normal{bumps 0.3 scale 0.2}
          finish{diffuse 0.9 phong 1}
         }
  translate<-1.1,0.50,0.5>}
//---------------------------------------- end
We'll get the following images:
example octagon 600x450
Scene description
for POV-Ray:
"povoct0.txt" or "povoct0.pov"
example octagon 600x450
Scene description
for POV-Ray:
"povoct1.txt" or "povoct1.pov"
top

© Friedrich A. Lohmüller, 2009
http://www.f-lohmueller.de