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 Tubes

Objects: cylinder, Hexagon.
Methods: #declare, #local, union, #macro, #while.
uses: #include "shapes.inc"
        #include "shapes_lo.inc"
A tube for pipelines with flanges.
Linear and bow versions.
All flanges also with nuts .

First we need some nuts:
#declare Nut_Scale = 0.055; // scale of the nuts 
//--------------------- Nut
#local Nut_Scale = 0.035;
#local Nut =
union{
 object{ Hexagon // from "shapes.inc"!
         scale <0.5,1,1>*Nut_Scale/2
         translate<Nut_Scale/4,0,0>
         texture { Nut_Texture_2 }}
 cylinder{ <0,0,0>,
           <Nut_Scale*1.1/2,0,0>,
           Nut_Scale/2*0.6
           texture { Nut_Texture_1 }}
}// end of union
nuts

Then we make a flange.
Here we need to declare some dimensions:
#declare T_R = 0.30; // tube radius
#declare F_R = 0.45; // flange radius
#declare F_D = 0.05; // flange thickness
#declare Nut_Scale = 0.055; // scale of the nuts 
#declare Number_of_Nuts = 16; // ....


//--------------------- Flange_Base
#local Flange_Base =
union{
 difference{
   union{
   cylinder{ <0,0,0>,<F_D  ,0,0>,F_R-D
             texture{Flanch_Texture_1} }
   cylinder{ <D,0,0>,<F_D-D,0,0>,F_R
             texture{Flange_Texture_2} }
       } // uni
   cylinder{ <-D,0,0>,<F_D+D,0,0>,T_R
             texture{Tube_Inside_Texture} }
 } // end of diff

}// end uni
//------------------Flange_with_Nuts
#local Flange_with_Nuts =
union{
 object{ Flange_Base }
 union{
  #local Nr = 0;     // start
  #local EndNr = Number_of_Nuts; // end
  #while (Nr < EndNr)
   object{ Nut
           translate<F_D,0,-T_R-(F_R-T_R)/2>
           rotate<Nr * 360/EndNr,0,0>}
  #local Nr = Nr + 1;    // next Nr
  #end // ---------------  end of loop
 } // end of union

}// end uni ------------------------------
flange

A linear pipeline tube with flanges:
#declare T_L = 1.00 // tube lenght
#declare T_D = 0.01 // tube material thickness   
//---------------------
union{
 // flanch at start
 object{ Flange_with_Nuts }
 // the tube
 difference{
   cylinder{< 0,0,0>,<T_L  ,0,0>,T_R
            texture{Tube_Texture} }
   cylinder{<-D,0,0>,<T_L+D,0,0>,T_R-T_D
            texture{Tube_Inside_Texture} }
 } // end of difference
 // flanch at end
 object{ Flange_with_Nuts
         scale <-1,1,1>
         translate<T_L,0,0>
       } //

} // end of union
linear pipeline tube

A pipeline tube bow with flanges:
(Here we use my #include "shapes_lo.inc"!)
#declare Tube_Angle = 60; // bow angle
#declare T_Rmaj = 1.00; // tube major radius 
// around z (lefthanded!) #declare T_D = 0.01 // tube material thickness //--------------------- tube bow union{ // flange at start object{ Flange_with_Nuts translate<0,-T_Rmaj,0> } // the tube difference{ object{ // (Rmaj, Rmin, Angle) Segment_of_Torus(T_Rmaj, T_R,-Tube_Angle) rotate<-90,0,-90> texture{ Tube_Texture } } // end of Torus_Segment(...) ------ object{ Segment_of_Torus(T_Rmaj,T_R-T_D,-Tube_Angle-2) rotate<0,1,0> rotate<-90,0,-90> texture{ Tube_Inside_Texture } } // end of Torus_Segment(...) ------ } // end of difference // flange at end object{ Flange_with_Nuts scale <-1,1,1> translate<0,-T_Rmaj,0> rotate<0,0, Tube_Angle> } // } // end of union
pipeline tube bow

Tubes

 
Ready-made POV-Ray objects as
include files and example files you'll find
at the POV-Ray Objects Page
top

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