Beschreibungen und Beispiele zum Raytracer POV-Ray von Friedrich A. Lohmüller
English English English
Italiano Italiano
Français français

Home
- POV-Ray Tutorial
 
Geometrische Körper
   Inhaltsübersicht
 

Objekte 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

 
                                       
Geometrische Körper aus meiner Include-Datei "shapes3.inc" ( ehemals "shapes_lo.inc"):
Ring_Sphere
Here some variations of that macro:
Ring_Sphere
Ring_Sphere, Kugel aus Ringen
Syntax:
object{ Ring_Sphere(
          Rmaj_H, Rmaj_V,
          Rmin_H, Rmin_V,
          Number_of_Rings_horizontal,
          Number_of_Rings_vertical
        ) //------------------------
        texture{ ... ... }
      } // end of object -----------
Rmaj_H, Rmaj_V
= Hauptradius der horizontalen und vertikalen Ringe,
Rmin_H, Rmin_V
= Nebenradius der horizontalen und vertikalen Ringe,
Number_of_Rings_horizontal
= Anzahl der horizontalen Ringe,
Number_of_Rings_vertical
= Anzahl der vertikalen Ringe.
Beispiel:
#include "shapes3.inc"
object{Ring_Sphere
        (1.00,1.02, 0.025,0.025, 12, 16)
        texture{ pigment{color<1,1,1>}
                 finish{phong 1
                        reflection 0.25}
               } // end of texture
        scale <1,1,1>
        rotate <-20,0,-7>
        translate <0,1.00,0>
      } // end of object ---------------
Ring_Sphere
Ring_Sphere
"Ring_Sphere(1.00, 1.02, 0.005, 0.005, 32, 46)" "Ring_Sphere(1.03, 1.00, 0.015, 0.005, 30, 15)"

Das Makro im Detail:
Zwei while-Schleifen von Ringen, deren Radien mittels der Kosinus-Funktion berechnet werden:
//----------------------------  macro Ring_Sphere()
#macro Ring_Sphere (Rmaj_H, Rmaj_V,
                    Rmin_H, Rmin_V,
                    Number_of_Rings_horizontal,
                    Number_of_Rings_vertical
                  ) //----------------------------
#if((Rmin_H>0)&(Number_of_Rings_horizontal>0))
#declare RingsH1 =
union{
#local AngleD = 180/(Number_of_Rings_horizontal+1);
#local Nr = -90+AngleD; #local EndNr = 90;

#while (Nr < EndNr)
 #local RingR = Rmaj_H*cos(radians(Nr));
 #local RingH = Rmaj_H*sin(radians(Nr));
 torus{RingR,Rmin_H
       translate<0, RingH,0>}
#local Nr = Nr + AngleD;
#end // --------------- end of loop
}// end union
#end // of "#if((Rmin_H>0)&(Number_of_Rings_horizontal>0))"

#if((Rmin_V > 0) & (Number_of_Rings_vertical > 0))
#local RingsV1 =          // vertical
union{
#local Nr = 0;
#declare EndNr = Number_of_Rings_vertical
#while (Nr < EndNr)
 torus{Rmaj_V-Rmin_V,Rmin_V
       rotate<90,0,0>
       rotate<0, Nr*360/EndNr,0>}
#local Nr = Nr + 1;
#end // --------------- end of loop
}//---------------------------------
#end // of "#if((Rmin_V>0)&(Number_of_Rings_vertical>0))"

union{
  #if (Rmin_H > 0) object{ RingsH1} #end
  #if (Rmin_V > 0) object{ RingsV1} #end
  sphere{<0, Rmaj_H,0>,Rmin_H}
  sphere{<0,-Rmaj_H,0>,Rmin_H}
} // end of union
#end //---------- end of macro Ring_Sphere()

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