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
   Index
Basic Shapes
  - sphere
  - cylinder
  - cone
  - torus
  - box
  - prism
  - plane
  > sor
  - lathe
  - superellipsoid
  - ovus

Shapes by macro + CSG
Shapes in "shapes3.inc"
Other Shapes by macros
3D text shapes
other Shapes
Non CSG Shapes
height_field + HF macros
Isosurfaces
                                   
Sample sor

"sor" = surface of revolution

"sor"
= surface of revolution

general syntax:
sor{ n,
      < x1, y1 >,
      < x2, y2 >,
      < x3, y3 >,
               ...
      < xn, yn >
      texture{ ... }
      }

Here "n" points < xi, yi >( i = 1 to n ) are used to define a outline of a body in the xy-plane. These points are conected by a spline curve. The body appears by a rotation of this line arround the y-axis.
By default this curve will be closed ortogonally to the y-axis, if we want to get an open body we have to add the statement "open".
Sometimes errors occure by the limited caculating accuracy, shown by holes in the surface of revolution. By adding the statement "sturm" it is sometimes possibe to reduce them (this forces POV-Ray to use the slower but more accurate algorithm of Sturm when calculating square roots).

To get another position and/or orientation of the surface of revolution you have to use "rotate<  ,   ,   >" and "translate< , , >" .
Sample 1 sor 600x450
Sample left:
// sor
// at zero (closed, cut off a box):
sor{ 8, // n = 8 points!
     < 0.00, 0.00>,
     < 0.60, 0.00>,
     < 0.72, 0.44>,
     < 0.31, 0.93>,
     < 0.49, 1.26>,
     < 0.48, 1.35>,
     < 0.43, 1.56>,
     < 0.16, 1.60>
     texture{
       pigment{color White}
       finish { phong 0.5}}
  }// end of sor


//-------------------------
Sample right:
// sor
// right (open):
sor{ 8, // n = 8 points!
     < 0.00, 0.00>,
     < 0.60, 0.00>,
     < 0.72, 0.44>,
     < 0.31, 0.93>,
     < 0.49, 1.26>,
     < 0.48, 1.35>,
     < 0.43, 1.56>,
     < 0.16, 1.60>
     open // <--------!!!
     translate<2,0,0>
     texture{
       pigment{color White}
       finish {phong 0.5}}
  }// end of sor
//-------------------------

Hint: Why "sor" instead of "lathe" ?(the last one seems most times to be more flexible!)
By calculating intersections with "sor"-objects quadratic equations are necessary, by intersection tests with "lathe"-objects you need to calculate with equations of the 6th order. Quadratic equations are much faster and accurate to solve! Because of such objects have many parts of surfaces this is very important!


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