From 7bd1d6c069bfe92a73367984930e8d7333793513 Mon Sep 17 00:00:00 2001 From: Elena of Valhalla'' Grandi Date: Mon, 30 Mar 2015 10:46:39 +0200 Subject: Improved position for screw holes --- parts/shelf_support_below.scad | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) (limited to 'parts') diff --git a/parts/shelf_support_below.scad b/parts/shelf_support_below.scad index ed7a791..022751d 100644 --- a/parts/shelf_support_below.scad +++ b/parts/shelf_support_below.scad @@ -6,6 +6,13 @@ screw_radius = 1.5; screw_head_radius = 2.5; screw_head_h = 2; +screw_hole_pos = [ + [screw_radius+wall, -screw_radius-wall, 0], + [radius*2+wall-screw_radius, -screw_radius-wall, 0], + [radius*2+wall-screw_radius, len+screw_radius+wall, 0], + [screw_radius+wall, len+screw_radius+wall, 0], +]; + module screw_hole() { union() { translate([0, 0, -1])cylinder(r=screw_radius, h=wall+2); @@ -16,32 +23,23 @@ module screw_hole() { difference() { union() { - translate([wall, 0, 0]) - cube([len-wall*2, (radius+wall)*2, radius+wall]); + cube([(radius+wall)*2, len, radius+wall]); hull() { - translate([screw_radius+wall, -screw_radius-wall, 0]) - cylinder(r=screw_radius+wall, h=wall); - translate([len-screw_radius-wall, radius*2+wall*3+screw_radius, 0]) - cylinder(r=screw_radius+wall, h=wall); + translate(screw_hole_pos[0]) cylinder(r=screw_radius+wall, h=wall); + translate(screw_hole_pos[2]) cylinder(r=screw_radius+wall, h=wall); } hull() { - translate([screw_radius+wall, radius*2+wall*3+screw_radius, 0]) - cylinder(r=screw_radius+wall, h=wall); - translate([len-screw_radius-wall, -screw_radius-wall, 0]) - cylinder(r=screw_radius+wall, h=wall); + translate(screw_hole_pos[1]) cylinder(r=screw_radius+wall, h=wall); + translate(screw_hole_pos[3]) cylinder(r=screw_radius+wall, h=wall); } translate([screw_radius+wall, -screw_radius-wall, 0]) - cube([len-(screw_radius+wall)*2, screw_radius+wall, wall]); - translate([screw_radius+wall, (radius+wall)*2, 0]) - cube([len-(screw_radius+wall)*2, screw_radius+wall, wall]); + cube([(radius-screw_radius)*2, screw_radius+wall, wall]); + translate([screw_radius+wall, len, 0]) + cube([(radius-screw_radius)*2, screw_radius+wall, wall]); + } + translate([radius+wall, -1, radius+wall]) + rotate([-90, 0, 0]) cylinder(r=radius, h=len+2); + for (i = [0:3]) { + translate(screw_hole_pos[i]) screw_hole(); } - translate([-1, radius+wall, radius+wall]) rotate([0, 90, 0]) cylinder(r=radius, h=len+2); - translate([screw_radius+wall, -screw_radius-wall, 0]) - screw_hole(); - translate([len-screw_radius-wall, radius*2+wall*3+screw_radius, 0]) - screw_hole(); - translate([screw_radius+wall, radius*2+wall*3+screw_radius, 0]) - screw_hole(); - translate([len-screw_radius-wall, -screw_radius-wall, 0]) - screw_hole(); } -- cgit v1.2.3