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"):
|
Segment_of_Torus,
Segment eines Torus.
Syntax:
object{ Segment_of_Torus( R_major,
R_minor,
Segment_Angle
) //------------
texture{ ... }
scale<1,1,1>
rotate<0,0,0>
translate<0,0,0>
} // end of object --------------- |
R_major = Hauptradius des Torus,
R_minor = Nebenradius des Torus,
Segment_Angle = Winkel des Torussegments,
links-händig orientiert!
|
Syntax:
#include "shapes3.inc"
object{ Segment_of_Torus( 1.00, 0.25, -145)
texture { pigment{color rgb<1,0.7,0>}
finish { phong 1 }
} // end of texture
rotate<-90,0,0> translate<0,1,0>
} // end of Segment_of_Torus(...) ----
object{ Segment_of_Torus( 0.60, 0.25, -275)
texture { pigment{color rgb<1,0.4,0>}
finish { phong 1 }
} // end of texture
rotate<0,30,0> translate<0.5,0.3,-0.5>
} // end of Segment_of_Torus(...) ----
object{ Segment_of_Torus( 0.60, 0.50, -60)
texture { pigment{color rgb<1,0.2,0>}
finish { phong 1 }
} // end of texture
rotate<-90,0,-190> translate<0,1,0>
} // end of Segment_of_Torus(...) ---- |
|
Das Makro im Detail:
Dafür müssen wir zwei Fälle betrachten:
1. abs(Segment_Angle) <= 180 Grad (Nur die Schnittmenge von Torus und den zwei Quadern) und
2. abs(Segment_Angle) > 180 Grad (Eine Schnittmenge (intersection) des Torus mit einer
Vereinigungsmenge (union) der beiden Quader):
Die folgenden Bilder zeigen wie dieses Makro arbeitet
(Die Quader wurden in Textur "glass" verdeutlicht):
|
abs(Segment_Angle) <= 180 degrees R_major = 1.00, R_minor = 0.25, Angle = -145
|
abs(Segment_Angle) > 180 degrees R_major = 1.00, R_minor = 0.25, Angle = -215
|
//------------------------- Segment_of_Torus macro()
#macro Segment_of_Torus ( R_major, R_minor, Segment_Angle)
//--------------------------------------------------------
#local D = 0.00001;
#if (Segment_Angle < 0)
#local Negativ_Flag = 1;
#local Segment_Angle = -Segment_Angle;
#else
#local Negativ_Flag = 0;
#end
#if (Segment_Angle > 360)
#local Segment_Angle = mod(Segment_Angle,360);
#end
intersection{
torus { R_major, R_minor }
#if (Segment_Angle > 180)
union{
#end // use union!
box{ <-1,-1,0>,<1,1,1>
scale< R_major+R_minor+D,R_minor+D,R_major+R_minor+D>
} // end of box
box{ <-1,-1,-1>,<1,1,0>
scale< R_major+R_minor+D,R_minor+D,R_major+R_minor+D>
rotate< 0,-Segment_Angle,0 >
} // end of box
#if (Segment_Angle > 180)
}
#end // end of union, if union is used!
#if (Negativ_Flag = 0) rotate<0, Segment_Angle,0>
#end
} // end of intersection
#end // ----------------- end of macro Segment_of_Torus() |
|
|