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

macro "Segment_of_Object (...)" Übersicht meine Macro-Objekte macro "Column_N (...)"

Dieses Objekt ist in meiner Include_Datei "shapes_lo.inc" als Makro definiert:

Round_Tube_Ring_N

Round_Tube_Ring_N


   Round_Tube_Ring_N
 
Syntax:
object{ Round_Tube_Ring_N (N, Tube_R, Base_Width, Edge_R)
        texture{ ... ... }
      } // end of object ------------------------
Mit N = die Anzahl der Rohrsegmente,
Tube_R = der Radius des Rohres,
Base_Width = der Abstand der linearen Rohreabschnitte vom Zentrum,
Edge_R = der Hauptradius der Torussegmente in den Ecken.
Beispiel:
#include "shapes_lo.inc"
//#macro Round_Tube_Ring_N (N, Tube_R, Base_Width, Edge_R)
object{ Round_Tube_Ring_N (3, 0.05, 0.40, 0.25)
        texture { pigment{ color rgb<1,0.7,0.2>}
                  finish { ambient 0.15 diffuse 0.85
                           phong 1 reflection 0.4}
                } // end of texture
        scale <1,1,1>
        rotate <0,0,0>
        translate<0.4,1.5,0>
      } // end of object ---------------------------------- 


Das Makro im Detail:

Dieses Makro verwendet das Makro "Torus_Segment":
//--------------------------------- Round_Tube_Ring_N (...) macro
#macro Round_Tube_Ring_N (N, Tube_R, Base_Width, Edge_R)
#if (Edge_R > Base_Width) #declare Edge_R=Base_Width; #end
#if (N < 3 ) #declare N = 3; #end
#declare Edge_Angle = 360/N ;
#declare Linear_Half_Len =
         (Base_Width-Edge_R)*tan(radians(Edge_Angle/2));

#declare Edge_Part =
object{ Torus_Segment( Edge_R, Tube_R, Edge_Angle)
        rotate <-90,0,0>
        translate <Base_Width-Edge_R,Linear_Half_Len,0>
      } // end of Torus_Segment(...) ----------------------------

#if (Edge_R != Base_Width)
#declare Linear_Part =
cylinder { <0,-Linear_Half_Len,0>, <0,Linear_Half_Len,0>, Tube_R
           translate <Base_Width,0,0>
         } // end of cylinder -----------------------------------
#end

#if (Edge_R != Base_Width)
 #declare One_Segment =
 union{
        object {Linear_Part}
        object {Edge_Part}
      }
#else
 #declare One_Segment =
        object {Edge_Part}
#end

union{
 #local Nr = 0;     // start
 #local EndNr = N; // end
 #while (Nr < EndNr)
   object{One_Segment rotate <0,0,Nr * 360/EndNr>}

 #local Nr = Nr + 1;    // next Nr
 #end // ---------------  end of loop
}
#end // --------------------- end of macro Round_Tube_Ring_N (...)

Hier einige Variationen des Objektes aus diesem Makro:
 
Facetted_Spheres
Variationen von "Round_Tube_Ring_N(...)"





macro "Segment_of_Object (...)" Übersicht meine Macro-Objekte macro "Column_N (...)"

© Friedrich A. Lohmüller, 2010
email email: (legacy email redacted)
homepage:www.f-lohmueller.de