Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
    POV-Ray Examples - How To Make Objects for POV-Ray
Italiano Italiano
Français français
Deutsch Deutsch

Home
- POV-Ray Tutorial
  - POV-Ray Examples
     Index of Content
  - Geometry
  - Architecture
  - Engineering
    - Ladder
    - Pylons
    - Railing
    - Bridge
    - Tubes
    - Tube Fork
    - Tube Stopcock
    - Chain
    - Coil of Wire
    - Torpedo
    - Cruise Missile
    - Rocket
    - Wheel
    - Truck
    - Propeller
    - Airplanes
    - Canoe
    - Guitar Body
    - 7-Segment Display
    - Ribbon Cable
    - Cable Harness
                                       
 
Tubes

Pipeline Tube Stopcock

Objects: isosurface, cylinder, Hexagon, sphere.
Methods: #macro, #declare, #local, union, difference, #while.
uses: #include "shapes.inc" (a standard include file!)
          macro "Tube_Fork_000"
          #include "shapes_lo.inc"
A macro for a stopcock with wheel for pipeline tubes with flanges and nuts.

Here at first all sizes and textures are leaved "undeclared" because they will be declared in the final macro which puts all these things together!
R1 = main tube radius, R2 = side tube radius,
F_Add = width of flange over tube radius.
F_D = flange thickness,
FB_R = flange border radius,

  First we build a flange similar to the flange in the example Tubes but this time as a macro with the variables of tube radius "Tube_Rad" and the flange width "Flange_Add":
We do this because we have to adapt the flanges to tube ends with two different radi R1 and R2.

#macro Flange ( Tube_Rad, Flange_Add )
  ... see scene file for details ...
#end //-------- end submacro -----------------

  Now we build a cover for the tube end using the above macro:
#declare Side_Cover =
union{ // flange + cover plate
 object{ Flange( R2, F_Add ) }
 object{ Round_Cylinder(
         <0,0,0>,<F_D/2,0,0>,R2+F_Add,FB_R,0)
         texture{Flange_Texture_1}}
} // end of union ----------------------------

  Now we need a stopcock wheel:
Wheel sizes: Wheel_Axis_Len = length of the axis
Wheel_Rmin and Wheel_Rmaj the to radi of the wheel.

#declare Wheel =
union{
 // axis holder
 object{ Round_Cylinder(
         <-FB_R,0,0>,<Wheel_Axis_Len/2,0,0>,
         2*Wheel_Rmin, FB_R, 0)
         texture{Flange_Texture_1}}
 object{ Round_Cylinder(
         <-FB_R,0,0>,<Wheel_Axis_Len/5,0,0>,
         2.5*Wheel_Rmin, FB_R, 0)
         texture{Flange_Texture_1}}
 // wheel + axis
 union{ //2
  cylinder{<0,0,0>,
           <Wheel_Axis_Len,0,0>,
           Wheel_Rmin}
   union{ //3
    torus{ Wheel_Rmaj, Wheel_Rmin
           rotate<0,0,90> }
    cylinder{<0,0,-Wheel_Rmaj>,
             <0,0,Wheel_Rmaj>,
             Wheel_Rmin*2/3 }
    cylinder{<0,0,-Wheel_Rmaj>,
            <0,0,Wheel_Rmaj>,
            Wheel_Rmin*2/3 rotate<90,0,0>}
    sphere{<0,0,0>,Wheel_Rmin*1.75
           scale<0.67,1,1> }
    scale<0.8,1,1>
    translate<Wheel_Axis_Len,0,0>
   } // uni3
  texture{Wheel_Texture_1}
 } // uni2
} // end of union ----------------------------


  And last but not least we use my tube fork macro from "Tube_Fork_000"
flange with nuts
A flange with nuts
flange with tube end cover
A flange with tube end cover
stopcock wheel
A flange with tube end cover and stopcock wheel
tube fork macro
The tube fork macro

To complete this we use put all in a macro
here called Tube_Stopcock_000
Beside of the dimensions there are also installed some switches, most of them are self-declaring!
object{
  Tube_Stopcock_000(
   0.50, // R1, // main tube radius: 1~0.25
   0.35, // R2, // side tube radius: 1.5~0.20
   0.05, // Tube_D, // tube material thickness
   0.15, // Blobfactor; // 0.1~0.002 ; max0.20
   0.05, // isosurface radius correction,
   0, // Test_End_Cylinders_ON, 1=on, 0=off

   0.14, // F_Add, // flanch radius add
   0.05, // F_D,   // flanch thickness
   0.01, // FB_R, // Flanch_Border_Radius

   1, // Nuts_ON, // 0 = no nuts but holes;
                  // 1 = nuts - no holes
   0.085, // Nut_Scale, // ~0.035
   12, // Number_of_Nuts, // ~ 16,

   1,// Side_End_Cover_ON,
   1,// Stopcock_wheel_ON,
   20,// Stopcock_wheel_Rotation_Angle,
   // wheel sitzes
   0.05, //  Wheel_Rmin,
   0.45, //  Wheel_Rmaj,
   0.35, //  Wheel_Axis_Len,
      ) // ------------------------------------
 rotate <0,0,90>
} // ------------------------------------------
Scenery description file of this scene for POV-Ray:
"Tube_Stopcock_000_2.txt" or
"Tube_Stopcock_000_2.pov"
tube stopcock macro
The tube fork with flanges and side cover
rotated by "rotate <0,0,90>"
tube stopcock macro
The tube fork with flanges and stopcock
rotated by "rotate <0,0,90>"
For Download of this shape as a Ready-made POV-Ray object
in an include file with macro and for example files look at the
POV-Ray Objects Page - Tube_Stopcock
top

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