POV-Ray : Newsgroups : povray.binaries.images : Involute curves W I P : Involute curves W I P Server Time
7 Nov 2024 09:30:09 EST (-0500)
  Involute curves W I P  
From: Bald Eagle
Date: 17 Mar 2016 12:10:01
Message: <web.56ead6a6f14b8acb5e7df57c0@news.povray.org>
Illustration re:
http://news.povray.org/povray.general/thread/%3Cweb.56ea1f7e7eb839c15e7df57c0%40news.povray.org%3E/

######################################################################


#version 3.7;


global_settings{ assumed_gamma 1.0 }

#include "debug.inc"
 Set_Debug (true)
#include "colors.inc"
#include "textures.inc"
#include "shapes.inc"
#include "shapes2.inc"
#include "functions.inc"
#include "math.inc"
#include "transforms.inc"


light_source { <0, 150, 0>  color rgb <1, 1, 1>}


#declare Camera_Top = camera {
                            location  <0, 4, -0.01>
                            //right    x*image_width/image_height
                            look_at   <0, 0, 0>}

#declare Camera_Front = camera {
                            location  <5, 20, -20>
                            //right    x*image_width/image_height
                            look_at   <5, 10, 0>}

camera {Camera_Top}

plane {y, 0 pigment {White}}

#declare T1 = 0.01;   // Line widths
#declare T2 = 0.005;
#declare MarkerCircle = 0.012;


#declare Teeth = 36;     #declare N = Teeth;   // Number of teeth on gear (N)
#declare Pitch = 24;     #declare P = Pitch;   // Gear pitch (P)

#declare RootCircle = (Teeth-2)/Pitch;  #declare RD = RootCircle; // Root circle
diameter (RD)
#declare PitchCircle = Teeth/Pitch;  #declare D = PitchCircle; // Pitch circle
diameter (D)
#declare OutsideCircle= (Teeth+2)/Pitch; #declare OD = OutsideCircle; // Outside
circle diameter (OD)

#declare Hub = 0.9;
#declare Hole = 0.25;

torus {RootCircle,    T2  translate <0, T1, 0> texture {pigment {color Blue}
finish {phong 0.1}} }  // RootCircle Circle
torus {PitchCircle,   T2  translate <0, T1, 0> texture {pigment {color Red}
finish {phong 0.1}} }  // RootCircle Circle
torus {OutsideCircle, T2  translate <0, T1, 0> texture {pigment {color Green}
finish {phong 0.1}} }  // OutsideCircle Circle

torus {Hub, T1  translate <0, T1, 0> texture {pigment {color Black} finish
{phong 0.1}} }  // Recessed Hub Circle
torus {Hole, T1  translate <0, T1, 0> texture {pigment {color Black} finish
{phong 0.1}} }  // Shaft hole
// Center marker
cylinder {<-OutsideCircle, T1, 0>, <OutsideCircle, T1, 0> T2 texture {pigment
{color Black} finish {phong 0.1}} }
cylinder {<0, T1, -OutsideCircle>, <0, T1, OutsideCircle> T2 texture {pigment
{color Black} finish {phong 0.1}} }
cylinder {<-OutsideCircle*2, T1, RootCircle>, <OutsideCircle*2, T1, RootCircle>
T2 texture {pigment {color Black} finish {phong 0.1}} }

#declare CircularThicknessAngle = (360/N)*0.5;      // Circular Thickness Angle
0.5 because teeth AND spaces

#declare Degrees = 90;     // Degrees to rotate through involute
#declare Radians = Degrees * pi/180;  // Radians to rotate through involute

#declare AngularSpacing = 360/Teeth;  // How many degrees to rotate involute
curves for next tooth



#for (Tooth1, 0, Teeth)
 #declare Tooth2 = Tooth1 + 0.5;

 #for (theta, 0, Radians, 0.001)
  #declare X = RootCircle * (cos(theta) + theta*sin(theta));
  #declare Z1 = RootCircle * (sin(theta) - theta*cos(theta));
  #declare Z2 = -RootCircle * (sin(theta) - theta*cos(theta));     // Opposite
side of involute tooth
  sphere{ <X, T1, Z1>, T1 pigment {Blue} rotate -y*Tooth1*AngularSpacing}
  sphere{ <X, T1, Z2>, T1 pigment {Blue} rotate -y*Tooth2*AngularSpacing}

  #declare Distance1 = sqrt (pow (X,2) + pow (Z1,2));  // radius at this point
in the plotting of the gear tooth
  // check if at RootCircle Circle
  #if (  theta = sqrt (abs ((Distance1 / RootCircle) - 1) )   )
  sphere{ <X, T1, Z1>, MarkerCircle pigment {Green} rotate
-y*Tooth1*AngularSpacing}
  sphere{ <X, T1, Z2>, MarkerCircle pigment {Green} rotate
-y*Tooth2*AngularSpacing}
  #end

  // check if at OutsideCircle Circle
  #if (  theta > sqrt ((pow (OutsideCircle, 2) - pow (RootCircle, 2)) /
RootCircle)   ) // Seems broken.  Thanks, M.I.T  :|
  sphere{ <X, T1, Z1>, MarkerCircle pigment {Yellow} rotate
-y*Tooth1*AngularSpacing}
  sphere{ <X, T1, Z2>, MarkerCircle pigment {Yellow} rotate
-y*Tooth2*AngularSpacing}
  #end

  /* check if involutes cross
  #declare NegInvolute = transform {rotate <0, -AngularSpacing, 0>};
  #declare NI_Point = vtransform (<X, T1, Z2>, NegInvolute);
  #if ( abs(NI_Point.z) - abs(Z1) < 0.1)
  sphere{ <X, T1, Z1>, MarkerCircle pigment {Gray50} rotate
-y*Tooth1*AngularSpacing}
  //sphere{ <X, T1, Z2>, MarkerCircle pigment {Green} rotate
-y*Tooth2*AngularSpacing}
  #end
  */
 #end


#end // end for


Post a reply to this message


Attachments:
Download 'involute.png' (120 KB)

Preview of image 'involute.png'
involute.png


 

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