From bdd047f7d354db137149e60e0133949143d05285 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Mon, 16 Oct 2023 00:53:13 +0200 Subject: [PATCH] working on mechanism Signed-off-by: Stephan Richter --- catflap.scad | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/catflap.scad b/catflap.scad index 54197a1..fe32891 100644 --- a/catflap.scad +++ b/catflap.scad @@ -1,5 +1,61 @@ +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,50,2000]); + 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); + } } -door(); \ No newline at end of file +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(); +