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

 
                               
These shape are definded in my include file "shapes3.inc" (former include file "shapes_lo.inc").
Egg
Egg
Egg_Shape
Egg_Shape
general syntax:
object{ Egg
        texture{ ... }
        scale 1
        rotate <0,0,0>
        translate < 0, 0, 0>
      } // end of object ----
general syntax:
object{ Egg_Shape( Lower_Scale,
                   Upper_Scale
                 ) //----------
        texture{ ... ... }
      } // end of object ------
Lower_Scale =
    y scale of the lower half of the shape,
Upper_Scale =
    y scale of the upper half of the shape.
The total height of these shapes is scaled to 2 units.
Example:
#include "shapes3.inc"
object{ Egg  // = Egg_Shape(1.15,1.55)
        texture{
          pigment{ color rgb<1,1,1>}
          normal { bumps 0.5 scale .002}
          finish { phong 0.5 }
        } // end of texture
        rotate < 0, 0, 0>
        translate < 0, 0, 0>
} // end of object --------------------
Example:
#include "shapes3.inc"
object{ Egg_Shape( 2.05, 0.65 )
        texture{
          pigment{ color rgb<1,1,1>}
          normal { bumps 0.5 scale .002}
          finish { phong 1 }
        } // end of texture
        rotate < 0, 0, 0>
        translate < 0, 0, 0>
} // end of object ---------------------
Here some variations:
Egg
Edd
"Egg object" "Egg object"

Macro in detail
This macro is a union of two intersection of ellipsoids with according boxes:
// -------------------------------------- macro Egg_Shape (...)
#macro Egg_Shape (Lower_Scale, Upper_Scale)                  //
// ------------------------------------------------------------
#local Egg_Lower_Part =
         difference {
                      sphere{<0,0,0>,1 scale<1,Lower_Scale,1>}
                      box{<-1,0,-1>,<1,Lower_Scale,1>}
                    } //---------------------------------------
#local Egg_Upper_Part =
         difference {
                      sphere {<0,0,0>,1 scale<1,Upper_Scale,1>}
                      box {<-1,-Upper_Scale,-1>,<1,0,1>}
                     }//---------------------------------------
//-------------------------------------------------------------
  union {
          object {Egg_Upper_Part}
          object {Egg_Lower_Part}
          translate<0,Lower_Scale,0>
          scale 2/(Lower_Scale+Upper_Scale)

        } // end of union -------------------------------------
#end //---------------------------------- end of the egg macro
The Egg object is made with this macro as follows:
// ---------------------------- shape of a simple egg
#declare Egg = object { Egg_Shape (1.15,1.55)}
// ------------------------------------- end of the egg object

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