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
    - Pawn
    - Wireframe Cube
    - Octagon
    - Egg Shape
    - Star
    - Optical Lens
    - Chessboard
    - Round-bottom Mace
    - Erlenmeyer Shape
    - Two-Cylinder-Blob
    - Regular Tetrahedron
    - Penrose Triangle
    - Yin & Yang
    - Fishblob
    - Threefold
    - Trefoil
  - Architecture
  - Engineering
                                               
 
Two-Cylinder-Blob

Two cylinders melting together
- Two-Cylinder-Blob -

The construction of the shape of two cylinders melting smoothly together -
a combination of two cylinder with a rounded fillet between them.

Objects:   "box", "cylinder".
Methods: "#declare","union", "intersection" "#macro".
Click here for an example!

The Construction of two melting Cylinders.
A cross-section with the geometry of this construction you can see on the opposite image.
For more details on the elementary geometry
look here: Tangent Circles.

//---------------------------------------
#macro Two_Cylinder_Blob_0(
           Pitch, // distance of centers
           SD,    // slice thickness in z
           Cyl_R, // cylinder radius
           Fillet_R , // fillet radius
           Axis_R, // <Cyl_R, 0=non
        ) //-----------------------------
//---------------------------------------
#local D = 0.00001; // a little bit
// distance of fillet from centerline
// of right and left cylinder:
#local Fillet_Y  =
  sqrt( pow(Fillet_R+Cyl_R,2)
  - pow(Pitch/2,2));
// S = tangent point of the cylinders!
// proportional!
#local S_X =
 Fillet_R/(Cyl_R + Fillet_R)*Pitch;
#local S_Y =
Cyl_R/(Cyl_R + Fillet_R)*Fillet_Y;
//---------------------------------------
#if (Axis_R > 0)
difference{
#end //----------------------------------
union{
 cylinder{ <0,0,-SD/2>,<0,0,SD/2>,Cyl_R
           translate< Pitch/2,0,0>}
 cylinder{ <0,0,-SD/2>,<0,0,SD/2>,Cyl_R
           translate<-Pitch/2,0,0>}
 difference{ // 2
  box{<-S_X,-S_Y,-SD/2>,<S_X,S_Y,SD/2> }
  cylinder{ <0,0,-SD/2-D>,
            <0,0,SD/2+D>, Fillet_R
            translate<0, Fillet_Y,0>}
  cylinder{ <0,0,-SD/2-D>,
            <0,0,SD/2+D>, Fillet_R
            translate<0,-Fillet_Y,0>}
 } // end difference 2
} // end union -------------------------
#if (Axis_R > 0)
cylinder{<0,0,-SD-D>,<0,0,SD/2+D>,Axis_R
         translate< Pitch/2,0,0>}
cylinder{<0,0,-SD-D>,<0,0,SD/2+D>,Axis_R
         translate<-Pitch/2,0,0>}
} // end of difference or union
#end // of 'Axis_R > 0'
#end //--------------------- end of macro
//---------------------------------------

// example://----------------------------
object{ Two_Cylinder_Blob_0 (
          0.0127, // Pitch distance
          0.0009, // slice thickness
          0.0051, // cylinder radius
          0.0081, // fillet radius
          0.0022, // axis r,
           //< cylinder r, 0=non
         )//-----------------------------
        texture{
           pigment{ color rgb<1,1,1>}
           finish { phong 1.0}
        } // end of texture
        rotate<0,0,0>
        translate<0,0,0>
      } // end of sphere ----------------
//---------------------------------------
Two cylinders melting together
- Two-Cylinder-Blob.

Using Round_Cylinders and Torus_Segments
for the borders completes the construction to
object{Two_Cylinder_Blob_1( ...)}


This shape in a macro as a
ready made object: Two_Cylinder_Blob_1.inc



What is this good for?
Here an example:

Chain link for a bike chain

An application of this macro as a
ready made object: Bike_Chain_Link.inc

 

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