door_thick = 50; flap_w = 150; flap_h = 150; flap_thick = 20; angle = 10; bearing_inner_dia = 5; bearing_outer_dia = 10; bearing_h = 5; silver = [0.7,0.7,0.7]; red = [1,0,0]; $fn = 32; ry = [0,90,0]; // rotate 90 deg around y raise_stopper = -1; gap = 1; module door(){ translate([-450,0,0])cube([900,door_thick,2000]); } module flap(){ difference(){ translate([flap_w,flap_thick,0]/-2) cube([flap_w,flap_thick,flap_h]); translate([2*(10+gap)+bearing_h,bearing_outer_dia+gap,2]/-2) cube([bearing_h+2*(gap+10),bearing_outer_dia+gap,2*bearing_h+20+gap+1]); } translate([0,0,raise_stopper])stopper(); } module bearing(){ color(silver) rotate(ry) difference(){ cylinder(d=bearing_outer_dia,h=bearing_h,center=true); cylinder(d=bearing_inner_dia,h=bearing_h+2,center=true); } } module bearing_case(){ rotate(ry) cylinder(d=(bearing_inner_dia+gap)/2,h=bearing_h+gap); translate([(bearing_h+gap)/2,0,bearing_inner_dia/2]) rotate(ry) cylinder(d=bearing_outer_dia,h=10); translate([(bearing_h+1)/2,-bearing_outer_dia/2,0]) cube([10,bearing_outer_dia,bearing_h+20]); translate([0,bearing_outer_dia/-2,bearing_h+1]) cube([bearing_h,bearing_outer_dia,19]); } module stopper(){ color(red){ bearing_case(); rotate([0,0,180]) bearing_case(); } bearing(); } *door(); flap();