Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
Geometric Shapes in POV-Ray
Italiano Italiano
Français français
Deutsch Deutsch

Home
- POV-Ray Tutorial
 
Geometric Shapes
   Overview

Objects in "shapes3.inc"
- Segment_of_CylinderRing
- Segment_of_Torus
- Segment_of_Object
- Egg
- Egg_Shape
- Facetted_Egg
- Facetted_Egg_Shape
- Facetted_Sphere
- Ring_Sphere
>Column_N
>Column_N_AB
>Pyramid_N
>Pyramid_N_AB
- Round_Pyramid_N_out
- Round_Pyramid_N_in
- Round_Cylinder_Tube
- Rounded_Tube_AB
- Rounded_Tube
- Round_N_Tube_Polygon
- Round_Conic_Torus
- Round_Conic_Prism
- Half_Hollowed_Rounded_Cyl1
- Half_Hollowed_Rounded_Cyl2

 
                               
Geometric object definded in my include file "shapes3.inc" (formerly "shapes_lo.inc").



Column_N





Column_N_AB
Column_N
A column with N edges
general syntax:
object{ Column_N( N,
                  Radius,
                  Height
                ) //------
        texture{ ... }
      } // end of object -

N >2 = the number of edges,
Radius = incircle radius,
Height = total height in y.

Column_N_AB
object{ Column_N_AB(
          N,
          Point_A, Point_B,
          Radius,
        ) //--------------
        texture{ ... }
      } // end of object -



Pyramid_N





Pyramid_N_AB
Pyramid_N
A pyramid with N edges
general syntax:
object{ Pyramid_N( N,
                   Radius1,
                   Radius2,
                   Height
                 ) //------
        texture{ ... }
      } // end of object --
N >2 = the number of edges,
Radius1 = base incircle radius,
Radius2 = top incircle radius,
Height = total height in y.
Pyramid_N_AB
object{ Pyramid_N_AB(
         N,
         Point_A, Radius_A,
         Point_B, Radius_B,
        ) //---------------
        texture{ ... }
      } // end of object --
Example:
#include "shapes3.inc"
object{ Column_N( 14, 1.8, 1.30 )
        texture{ pigment{color rgb<1,1,1>}
                 finish {phong 1}
               } // end of texture
      } // end of object ----------------
#include "shapes3.inc"
//------------------ N,Point_A,Point_B,R
object{ Column_N_AB(
        8,<0,0.5,-1>,<1.5,1.5,-0.5>,0.45)
        texture{
           pigment{ color rgbt<1,1,1,0.6>}
           normal { bumps 0.5 scale 0.005}
           finish { phong 1}
         } // end texture
         scale<1,1,1>
         rotate<0,0,0>
         translate<0,0,0>
      } // end of object ----------------
Example:
#include "shapes3.inc"
object{ Pyramid_N( 14, 1.8, 1.30, 1.00 )
        texture{ pigment{color rgb<1,1,1> }
                 finish {phong 1}
               } // end of texture
      } // end of object ----------------
#include "shapes3.inc"
//------------------ N,Point_A,Point_B,R
object{ Pyramid_N_AB(
        8,<0,1,-1>,0.5,<1.5,1.5,-0.5>,0.25)
        texture{
           pigment{ color rgbt<1,1,1,0.6>}
           normal { bumps 0.5 scale 0.005}
           finish { phong 1}
         } // end texture
         scale<1,1,1>
         rotate<0,0,0>
         translate<0,0,0>
      } // end of object ----------------


Macros in detail
//------------------------------------- Pyramid_N()
#macro Pyramid_N (N, Radius1, Radius2, Height)
//------------------------------------------------
#local D= 0.00001;
intersection{
 #local Nr = 0;    // start
 #local EndNr = N; // end
 #while (Nr < EndNr)
 // linear prism in z-direction:
 prism{ -2.00 ,2.00 , 5 //------------------------
     <-2.00, 0.00>, < 1.00,  0.00>,
     < 0.00+Radius2/Radius1,1.00>,
     <-2.00,1.00>, <-2.00, 0.00>
     //turns prism in z direction:
     rotate<-90,0,0> scale<1,1,-1>
     scale <Radius1+Nr*D,Height+Nr*D,Radius1+Nr*D>
     rotate<0,Nr * 360/EndNr,0>
   } // end of prism -----------------------------
 #local Nr = Nr + 1;    // next Nr
 #end // ----------------  end of loop
} // end of intersection
#end // ------------------------------ end of macro
If we start this macro with N = 1 the result will be a degenerated intersection out of just one prism.
So, all we have to do, is turn around the y axis these elements by 360/N and intersect them all:

Samples one prism Samples intersection of prisms
N = 1, Radius1 = 1.70, Radius2 = 1.10, Height= 1.50 N = 11, Radius1 = 1.70, Radius2 = 1.10, Height= 1.50

A Column with N edges is nothing else, than a truncated pyramid with top radius = base radius, so the following macro will work together with the above macro:

//----------------------------------- Column_N()
#macro Column_N  (N, Radius, Height )
//---------------------------------------------
object{ Pyramid_N (N, Radius, Radius, Height )}
#end //--------------------------- end of macro
Samples column Samples column
N = 3, Radius = 1.00, Height= 0.50 N = 14, Radius = 1.80, Height= 1.30
Samples column Samples column
N = 7, Radius = 2.00, Height= 1.00 N = 7, Radius1 = 2.00, Height= 1.00

© Friedrich A. Lohmüller, 2013
www.f-lohmueller.de