Descrizioni et esempi per il raytracer POV-Ray di Friedrich A. Lohmüller
English English English
Français français
Deutsch Deutsch

macro "Segment_of_Object (...)" overview my macro objects macro "Column_N (...)"

Quest'oggetto è definito con una macro nel mio include file "shapes_lo.inc":

Round_Tube_Ring_N

Round_Tube_Ring_N
= Anello in tubo rotondo


   Round_Tube_Ring_N = Anello in tubo rotondo
 
Sintassi generale:
object{ Round_Tube_Ring_N (N, Tube_R, Base_Width, Edge_R)
        texture{ ... ... }
      } // end of object ------------------------
con N = il numero di segmenti del tubo,
Tube_R = raggio del tubo,
Base_Width = distanze delle sezioni lineare del tubo sections del centro,
Edge_R = raggio majore dei segmenti di toro nei angoli.
Esempio:
#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 ---------------------------------- 


La macro nel dettaglio

Questa macro usa la macro "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 (...)

Qui qualche variazione di questa macro:
 
Facetted_Spheres
Qualche variazione di "Round_Tube_Ring_N(...)"





macro "Segment_of_Object (...)" overview my macro objects macro "Column_N (...)"

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