These shape are definded
in my include file "shapes3.inc"
(former include file "shapes_lo.inc").
Egg
|
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 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 |
|
|