$fn=60;
module ringthing()
{
difference()
{
sphere(11);
sphere(10);
rotate(a=90, v=[0,1,0])
{
cylinder(r=7.5, h=25, center=true);
}
rotate(a=90, v=[1,0,0])
{
cylinder(r=6, h=25, center=true);
}
translate([0,-4.95,-13.5])
{
rotate(a=90, v=[1,0,0])
{
cylinder(r=10, h=1.1);
}
}
translate([0,6.05,-13.5])
{
rotate(a=90, v=[1,0,0])
{
cylinder(r=10, h=1.1);
}
}
rotate(a=180, v=[0,1,0])
{
translate([0,-4.95,-13.5])
{
rotate(a=90, v=[1,0,0])
{
cylinder(r=10, h=1.1);
}
}
translate([0,6.05,-13.5])
{
rotate(a=90, v=[1,0,0])
{
cylinder(r=10, h=1.1);
}
}
}
}
difference()
{
cylinder(r=10.75, h=2, center=true);
cylinder(r=9.75, h=2.1, center=true);
}
}
module pintake()
{
translate([7,9,7])
{
rotate(a=90, v=[1,0,0])
{
cylinder(h=4, r=.75);
}
}
translate([7,9,-7])
{
rotate(a=90, v=[1,0,0])
{
cylinder(h=4, r=.75);
}
}
rotate(a=180,v=[1,0,0])
{
translate([7,9,7])
{
rotate(a=90, v=[1,0,0])
{
cylinder(h=4, r=.75);
}
}
translate([7,9,-7])
{
rotate(a=90, v=[1,0,0])
{
cylinder(h=4, r=.75);
}
}
}
}
module horizcylinder()
{
rotate(a=90, v=[1,0,0])
{
cylinder(r=7.5,h=25,center=true);
}
}
module pitch_teeth()
{
intersection()
{
difference()
{
sphere(12);
scale([2,2/5,2]) {horizcylinder();}
horizcylinder();
}
translate([0,-7.5,0])
{
rotate(a=120, v=[0,1,0])
{
cube([15,15,5]);
}
}
}
intersection()
{
difference()
{
sphere(12);
scale([2,2/5,2]) {horizcylinder();}
horizcylinder();
}
translate([0,-7.5,0])
{
rotate(a=-120, v=[0,1,0])
{
translate([-15,0,0])
{
cube([15,15,5]);
}
}
}
}
intersection()
{
difference()
{
sphere(12);
scale([2,2/5,2]) {horizcylinder();}
horizcylinder();
}
translate([0,0,-9])
{
cube([4, 16, 5], center=true);
}
}
}
module thingy()
{
intersection()
{
pitch_teeth();
cube([25,12,25], center=true);
}
rotate(a=180, v=[0,1,0])
{
intersection()
{
pitch_teeth();
cube([25,12,25], center=true);
}
}
difference()
{
sphere(12.5);
horizcylinder();
rotate(a=90, v=[0,0,1]){ horizcylinder();}
sphere(11.5);
scale([2,2/5,2]){horizcylinder();}
}
}
module outerpart()
{
difference()
{
thingy();
sphere(10);
}
difference()
{
pintake();
sphere(12);
}
}
module layer2()
{
difference()
{
ringthing();
cylinder(r=10.5, h=1, center=true);
rotate(a=-90, v=[0,1,0])
{
cylinder(r=5, h=13);
}
rotate(a=90, v=[0,1,0])
{
cylinder(r=15/2, h=13);
}
}
}
module innerring()
{
union()
{
intersection()
{
difference()
{
cylinder(r=10.45, h=.95, center=true);
cylinder(r=9.45, h=1, center=true);
}
union()
{
mirror([1,0,0])
{
rotate(a=30, v=[0,0,1])
{
translate([0,0,-.5])
{
cube([8, 15, 1]);
}
}
}
rotate(a=30, v=[0,0,1])
{
translate([0,0,-.5])
{
cube([8, 15, 1]);
}
}
}
}
mirror([0,1,0])
{
intersection()
{
difference()
{
cylinder(r=10.45, h=.95, center=true);
cylinder(r=9.45, h=1, center=true);
}
union()
{
mirror([1,0,0])
{
rotate(a=30, v=[0,0,1])
{
translate([0,0,-.5])
{
cube([8, 15, 1]);
}
}
}
rotate(a=30, v=[0,0,1])
{
translate([0,0,-.5])
{
cube([8, 15, 1]);
}
}
}
}
}
difference()
{
rotate(a=90, v=[1,0,0])
{
cylinder(r=.475, h=20, center=true);
}
cube([5, 16, 1.5], center=true);
}
}
}
module retina()
{
union()
{
difference()
{
intersection()
{
rotate(a=90, v=[1,0,0])
{
cylinder(r=1.5, h=19, center=true);
}
difference()
{
sphere(9.4);
sphere(8.4);
}
}
rotate(a=90, v=[1,0,0])
{
cylinder(r=.5, h=19, center=true);
}
}
mirror([0,1,0])
{
translate([-.5,-8.25,-1.25])
{
rotate(a=145, v=[0,0,1])
{
cube([3,1,2.5,]);
}
}
}
translate([-.5,-8.25,-1.25])
{
rotate(a=145, v=[0,0,1])
{
cube([3,1,2.5,]);
}
}
translate([-1,0,0])
{
rotate(a=-90, v=[0,1,0])
{
difference()
{
cylinder(h=5, r1=7.75, r2=7);
translate([0,0,-.1])
{
cylinder(h=4.1, r1=6.75, r2=6);
}
cylinder(h=7, r=1.5);
}
}
}
}
}
module eyestalk()
{
translate([1,0,0])
{
rotate(a=-90, v=[0,1,0])
{
difference()
{
union()
{
difference()
{
cylinder(h=4, r1=6.5, r2=5.75);
translate([3.5,0,3.5])
{
cylinder(h=5, r=1.4, center=true);
}
translate([-3.5,0,3.5])
{
cylinder(h=5, r=1.4, center=true);
}
}
translate([0,0,5])
{
cylinder(h=7, r=1.4, center=true);
}
translate([0,0,-2])
{
cylinder(h=6, r=2, center=true);
}
}
rotate(a=90, v=[0,1,0])
{
translate([4.75,0,0])
{
cylinder(h=.5, r=5, center=true);
}
}
translate([0,0,-6.1])
{
cylinder(r=1.5, h=3);
}
}
difference()
{
translate([0,0,-6])
{
cylinder(r=2.5, h=2);
}
translate([0,0,-6.1])
{
cylinder(r=1.5, h=2.2);
}
translate([0,0,-6.1])
{
cylinder(r=2, h=1.1);
}
}
}
}
}
module iris()
{
intersection()
{
union()
{
difference()
{
sphere(11);
translate([-6,0,0])
{
cube(25, center=true);
}
rotate(a=90, v=[0,1,0])
{
cylinder(h=14.1, r=2.5, center=true);
}
translate([10,0,0])
{
rotate(a=90, v=[0,1,0])
{
cylinder(h=6.1, r=2.25, center=true);
}
}
}
translate([-.5,0,0])
{
difference()
{
sphere(11);
sphere(10.5);
translate([-2,0,0])
{
sphere(10.5);
}
translate([0,0,-.25])
{
cube([25,5,3], center=true);
}
}
}
}
rotate(a=90, v=[0,1,0])
{
cylinder(h=25, r=7.25, center=true);
}
}
}
module knob()
{
intersection()
{
difference()
{
union()
{
cylinder(r=10.75, h=2, center=true);
rotate(a=90, v=[1,0,0])
{
cylinder(r=10.75, h=2, center=true);
}
}
sphere(9.5);
}
rotate(a=90, v=[0,1,0])
{
translate([0,0,-4])
{
cylinder(r=4.75, h=24, center=true);
}
}
}
rotate(a=90, v=[0,1,0])
{
translate([0,0,-7.9])
{
difference()
{
cylinder(r=2.5, h=3.7, center=true);
translate([0,0,2.3])
{
cylinder(r=1.41, h=3.8, center=true);
}
}
}
}
}
//difference()
{
union()
{
outerpart();
rotate(a=0, v=[0,1,0]){layer2();}
rotate(a=0, v=[0,0,1]){innerring();}
retina();
eyestalk();
iris();
knob();
}
//translate([0,15,0]){cube(30, center=true);}
}