Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
    3D Animation with POV-Ray
        Some Basics and Examples on 3D Animation.
Italiano Italiano
Français franšais
Deutsch Deutsch
- 3D Animations Gallery
- POV-Ray Tutorial

  3D Animation Tutorial
   Index of Content
  0. Basic Knowledge
     1. Basic Example
     2. Example 2
     3. Images to Animated Gif
     4. From Images to Video
     5. Basic Terms
     6. Animation Commands  
  I. Cyclic Animations
     1. Rotating Objects
     1.2. Planets in Orbit
     1.3. Clock Animation
     2. Rotating Camera
     2.1. Straight Moving Camera
     3. Western Wheel
     3.1. Rolling Wheels
     4. Gears
  > 4.1. Roller Chain
     4.2. Bike Chain
     5. Swinging Pendulum
     5.1. Newton's Cradle
     5.2: Rock the Rocker
     6. Spiral Pendulum
     7. Coupling Rods
     7.1. Connecting Rods
     8. Psychedelic + Op-Art
     9. Counters + Countdowns
    10. Folding of a Cube
  II. Non-linear Movements
     1.0 Speed Up/Slow Down 1
     1.1 Speed Up/Slow Down 2
     2. Fall + Bounce
     3. Acceleration by
          physical Formulas
     4. Speed Controll by
          Spline Functions
  III. Animation Paths
      with Spline Curves
     1. Spline Curves
     2. Closed Splines
     3. Animation Paths

The Rolling    
of a Roller Chain    
How to animate a rolling chain for bikes, conveyor belts and other engines.    

How to roll a roller chain?
First we have to understand the geometry of two circles with their externel tangents.
For more detailed information see here:
    External Tangents to two Circles

By given radii r1 > r2 and the distance d of the axes
with ri = r2-r1 we'll have for the chain belt:
The length of the linear parts:
2·t = 2·sqrt( d2 - ri2).
The angle of the chain:     α = asin(ri/d).
The segment of circle 1:  l1 = 2π·r1 ·(180+2·α)/360.
The segment of circle 2:  l2 = 2π·r2 ·(180-2·α)/360.

For placing the chain links equidistant on the belt line we have to divide the lenght by the number of chain links (for bike chains we have 2 different types of links, so we need an even number of chain links !).

For the animation of the rolling chain we have to move the links on the 4 different parts of the belt in 4 different ways depending on the position where a link currently is! We can do this by using conditional command: '#if'

// -------------- dimensions -----------
#local R1 = 0.15;  // big wheel radius
#local R2 = 0.075; // small wheel radius
#local Dist = 0.30;// axis distance
#local Link_N = 30;// number of links
// -------------- calculations ---------
#local Ri = R1-R2;
#local C_Angle = degrees(asin(Ri/Dist));
// chain linear length
#local LLen=sqrt(pow(Dist,2)-pow(Ri,2));
// segment angle and length
#local Ang1 = 180+2*C_Angle;
#local Ang2 = 180-2*C_Angle;
#local Len1 = Ang1/360*2*pi*R1;
#local Len2 = Ang2/360*2*pi*R2;
// total length
#local C_Len = 2*LLen+Len1+Len2;
#local Link_L  = C_Len / Link_N;
#declare Link =        // the chain link
#local Ani=clock*Link_Len;// animation!
union{ //-------------------------------
#local Nr = 0; // start loop
#while (Nr < Link_N)
 #local Pos = mod(Nr*Link_L+Ani,C_Len);
 #if(Pos< Len1 ) // front down
  #local Rot1 = Pos/Len1*Ang1;
  object{Link translate<0,R1,0>
         rotate<0,0,-Rot1 +C_Angle>}
 #end //--------------------------------
 #if((Pos>Len1) & (Pos<=Len1+LLen))
  #local LPos = Pos-Len1; // base side
  object{Link translate<-LPos,-R1,0>
 #end //--------------------------------
 #if((Pos>Len1+LLen )       // back up
      & (Pos<= Len1+LLen+Len2))
  #local Rot2 =
  object{Link translate<0,R2,0>
 #end //--------------------------------
 #if((Pos>Len1+LLen+Len2) // up forward
      & (Pos <= Len1+LLen+Len2+LLen))
  #local LPos = Pos-(Len1+LLen+Len2);
  object{Link translate<LPos,R2,0>
 #end //--------------------------------
#local Nr = Nr + 1;  // next Nr
#end // --------------- end of loop
} // end of union ----------------------
externel tangents
The geometry of 2 circles with externel tangents!
The positions for the links of a roller chain.

roller chain links ani
Animated positions for the links of a roller chain!
Scene description
for POV-Ray:
"Roller_Chain_1.ini" and
Another roller chain animated

Continue with two diffent kind of chain links here: Bike Chain.
For animations on rolling bike chains look here:
    3D-Animations - Engineering.

© Friedrich A. Lohmüller, 2010