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 lathe

"lathe" = surface of revolution

"lathe"
- surface of revolution

general syntax:
lathe{
      Spline_Type
      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 not be closed ortogonally to the y-axis.
If we want to get a closed body we have to use as last point the first point. .
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 lathe
Sample left:
lathe{
  quadratic_spline // Spline_Type
  5,      // number of points,
  <2, 0>, // <x,y> points,
  <3, 0>,
  <3, 5>,
  <2, 5>,
  <2, 0>
  // sturm
  texture{
    pigment{ color rgb<0.4,0.2,1>}
    finish { phong 1 reflection 0.2}
  } // end of texture
  scale<1,1,1>*1
  rotate<0,0,0>
  translate<0,0.6,0>
} // end of lathe object
//-----------------------

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