POV-Ray : Newsgroups : povray.newusers : caterpillar/cam belt : caterpillar/cam belt Server Time
2 Jul 2024 12:32:06 EDT (-0400)
  caterpillar/cam belt  
From: Tops
Date: 3 Jun 2011 03:50:00
Message: <web.4de8918cca2e9f0ac0abfa3e0@news.povray.org>
Hi all

I am trying to draw a simple small-to-large gear mechanism, driven by a cam
belt.

I have trawled the web, modified what I found and got so far with the gear:

#version 3.6;
global_settings {  assumed_gamma 1.3 }
global_settings { max_trace_level 10 }//(1...20) [default = 5]

//--------------------------------------------------------------------------
#include "colors.inc"
#include "textures.inc"
#include "golds.inc"
#include "metals.inc"
//--------------------------------------------------------------------------
// camera ------------------------------------------------------------------

camera {
        location <-5, 7, -10>
    look_at <0, -0, 0>
    angle 30

    }



// sun ---------------------------------------------------------------------
light_source{< 1500,2500,- 3500> color White}
// sky ---------------------------------------------------------------------
sky_sphere { pigment {
                       color  rgb <1.0,1.0,1.0>
                     } // end of pigment
           } //end of skysphere
/*
// fog ---------------------------------------------------------------------
fog{fog_type   2
    distance   50
    color      White
    fog_offset 0.1
    fog_alt    2.0
    turbulence 0.8}
*/
//--------------------------------------------------------------------------
//---------------------------- objects in scene ----------------------------
//--------------------------------------------------------------------------














#macro Gear (Cog_Number, Cog_Distance, Gear_Z) // around the y axis

#local D = 0.0001;

#local Gear_Circumference = Cog_Distance*Cog_Number;
#local Gear_Radius_ = Gear_Circumference/(2*pi);

union{
 // kernel of the gear minus notches
difference{
 cylinder { <0,0,0>,<0,Gear_Z,0>,Gear_Radius_
           scale <1,1,1> rotate<0,0,0> translate<0,0,0>
         } // end of cylinder


cylinder { <0,-0.05,0>,<0,Gear_Z+0.05,0>,Gear_Radius_/5
           scale <1,1,1> rotate<0,0,0> translate<0,0,0>
         } // end of cylinder








 #local Nr = 0;     // start
 #local EndNr = Cog_Number; // end
 #while (Nr< EndNr)
    cylinder { <0,0-D,0>,<0,Gear_Z+D,0>,Cog_Distance/4
               scale<1.5,1,1>
               translate<Gear_Radius_,0,0>
               rotate<0,(Nr+0.5) * 360/EndNr,0>
               } // end of cylinder -----------------------------------
 #local Nr = Nr + 1;    // next Nr
 #end // ---------------  end of loop
          } // end of difference ---------------






 // adding the cogs
 #local Nr = 0;     // start
 #local EndNr = Cog_Number; // end
 #while (Nr< EndNr)
    cylinder { <0,0,0>,<0,Gear_Z,0>,Cog_Distance/4
               scale<1.3,1,1>
               translate<Gear_Radius_,0,0>
               rotate<0,Nr * 360/EndNr,0>
               } // end of cylinder -----------------------------------
 #local Nr = Nr + 1;    // next Nr
 #end // ---------------  end of loop


difference {

cylinder { <0,0,0>,<0,Gear_Z*2,0>,Gear_Radius_*0.8
           scale <1,1,1> rotate<0,0,0> translate<0,0,0>
         } // end of cylinder

cylinder { <0,-0.05,0>,<0,(Gear_Z*2)+0.05,0>,Gear_Radius_/5
           scale <1,1,1> rotate<0,0,0> translate<0,0,0>
         } // end of cylinder


torus { Gear_Radius_*1.595,Gear_Radius_*0.8
         scale <1,0.5,1> translate<0,Gear_Z*2,0>
       } // end of torus  -------------------------------


} // end of difference






difference {

cylinder { <0,-0.05,0>,<0,0,0>,Gear_Radius_*1.15
           scale <1,1,1> rotate<0,0,0> translate<0,0,0>
         } // end of cylinder

cylinder { <0,-0.05-D,0>,<0,0+D,0>,Gear_Radius_/5
           scale <1,1,1> rotate<0,0,0> translate<0,0,0>
         } // end of cylinder


} // end of difference




difference {

cylinder { <0,Gear_Z,0>,<0,Gear_Z+0.05,0>,Gear_Radius_*1.15
           scale <1,1,1> rotate<0,0,0> translate<0,0,0>
         } // end of cylinder

cylinder { <0,Gear_Z-D,0>,<0,Gear_Z+0.05+D,0>,Gear_Radius_/5
           scale <1,1,1> rotate<0,0,0> translate<0,0,0>
         } // end of cylinder


} // end of difference







} #end // end of union and end of macro -------------------------------

#macro Gear_Radius (Cog_Number, Cog_Distance)  //----------------------
  Cog_Distance*Cog_Number/(2*pi)
#end //----------------------------------------------------------------


union{
object{ Gear ( 36, 0.15, 0.5)
        texture { T_Silver_4C
                  finish { ambient 0.15 diffuse 0.85 phong 0.5 reflection 0.40}
                } // end of texture
        rotate<0,0,0>
        rotate<0,0,-clock*360/36>
        translate<0,1,0>} // end of cog 1


 rotate<0,0,0>
 rotate<0,0,0>
 translate<0,0,0>
 scale <0, 0, 0>
 }






However, I have no idea how I am going to draw the cam belt which will link this
gear with another larger one. I can sort out distances and sizes of the gears,
no problem, but the belt I have no idea.

To add to this, I need the belt to at least appear to be moving as the gears
move. Is this possible?

Any help would be great!!!!

Cheers


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.