###### Descriptions and Examples for the POV-Ray Raytracerby Friedrich A. Lohmüller     POV-Ray Examples - How To Make Objects for POV-Ray
Italiano
Français
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

# Egg Shape

###### The construction of an egg shape. Example for the using of the "intersection" and/or "difference". Objects:   "box", "sphere". Methods: "#declare", "union{...}", "intersection", "difference". Click here for an example!

The construction:

The common parts (= intersection) of a sphere respectivly of an ellipsoid (light gray) and a box (darkgray) form a hemisphere (lower half of the egg) respectivly a half ellipsoid (upper half of the egg). Both half parts are connected by a "union" to the complet shape of the egg.
The same effect you can get with the use of "difference" with the boxes mirrowed by the xz-plane.

#### ```//-------------------------------------- #declare Egg_Tex = // <--1 texture{ pigment{color White} normal {bumps 0.4 scale 0.01} finish {diffuse 0.9 phong 0.1} } // end of texture //---------------------------// <--2 #declare Egg_upperpart = intersection{ sphere{<0,0,0>,1 scale<1,1.75,1>} box{<-1,0,-1>,<1,1.75,1>} //Alternativly with "difference": // difference{ // sphere{<0,0,0>,1 scale<1,1.75,1>} // box{<-1,-1.75,-1>,<1,0,1>} }//------------------------------------ #declare Egg_lowerpart = intersection{ sphere{<0,0,0>,1 scale<1,1,1>} box{<-1,-1,-1>,<1,0,1>} //Alternativly with "difference": //difference{ // sphere{<0,0,0>,1 scale<1,1,1>} // box{<-1,0,-1>,<1,1,1>} }//------------------------------------ #declare Egg = union{ object{Egg_upperpart } object{Egg_lowerpart} texture{Egg_Tex} }//--------------------------// <--3 object{ Egg_upperpart translate<-1.1,1.1,0> texture{Egg_Tex}} object{ Egg_lowerpart translate<-1.1,0.9,0> texture{Egg_Tex}} object{ Egg translate< 1.1,1.0,0>} //-------------------------------- end```

This produces the following image:

### Variations on the theme:

Replacing the marked parts as follows:

```//----------------------------//from <--1
#declare Egg_Tex =
texture{pigment{color rgb<1,0.85,0.0>}
normal {bumps 0.75 scale 0.1}
finish {diffuse 0.9 phong 1}}
//to <--2
//--------------------------//from <--3
union{
object{ Egg scale 0.4 translate<-1,1,-1>}
object{ Egg scale 0.4 translate< 0,1,-1>}
object{ Egg scale 0.4 translate< 1,1,-1>}
object{ Egg scale 0.4 translate<-1,1, 0>}
object{ Egg scale 0.4 translate< 0,1, 0>}
object{ Egg scale 0.4 translate< 1,1, 0>}
object{ Egg scale 0.4 translate<-1,1, 1>}
object{ Egg scale 0.4 translate< 0,1, 1>}
object{ Egg scale 0.4 translate< 1,1, 1>}
rotate<-40,40,0>
translate<0.3,0.7,-0.1>
}//---------------------------------- end ```
We'll get the following image:

top

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