Skip to content

Instantly share code, notes, and snippets.

@kogcyc
Created June 28, 2014 19:06
Show Gist options
  • Save kogcyc/6a9636f56671066d4d2d to your computer and use it in GitHub Desktop.
Save kogcyc/6a9636f56671066d4d2d to your computer and use it in GitHub Desktop.
//povray sprocket.pov -w960 -h540 +a0.9
//povray sprocket.pov -w2732 -h1536 +a0.9
camera {
right 16/9*x
location <1,1,-1>*150
look_at <-4,23,0>
angle 10
//location <1,1,-1>*650
//look_at <0,0,0>
}
light_source {
<-2000,2000,-2000>
color rgb<1,1,1>*3
}
background { color rgb<1,1,1>*0 }
#declare teeth = 15;
#declare ang = 360/teeth;
#declare tang = 20;
#declare theight = 2;
#declare rdia = 12.7*teeth/pi/2;
#debug "\n"
#debug str(ang,0,3)
#debug "\n"
#declare kolor = rgb<1.05,1,0.95>*0.5;
#declare toothCut=
union {
box {<-7.75/2,0,-3> <7.75/2,15,5> pigment{kolor} rotate <0,0,tang>}
box {<-7.75/2,0,-3> <7.75/2,15,5> pigment{kolor} rotate <0,0,tang*-1>}
cylinder {<0,0,-3> <0,0,3> 7.75/2 pigment{kolor} }
}
//sprocket
difference {
union {
cylinder {<0,0,-1> <0,0,1> rdia+theight pigment{kolor}}
}
#declare Index = 0;
#while(Index < teeth)
object {
toothCut
translate <0,rdia,0>
rotate <0,0,ang*Index>
}
#declare Index = Index + 1;
#end
cylinder {<0,0,-3> <0,0,3> rdia-9 pigment{kolor}}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment