From 1fc75fd0bd92a6d87bf39b26aa4beb109c887a74 Mon Sep 17 00:00:00 2001 From: Ward Wouts Date: Tue, 21 Jan 2014 16:20:22 +0100 Subject: [PATCH] begin stekkerding --- stekkerding/stekkerding.scad | 108 +++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 stekkerding/stekkerding.scad diff --git a/stekkerding/stekkerding.scad b/stekkerding/stekkerding.scad new file mode 100644 index 0000000..904ce0a --- /dev/null +++ b/stekkerding/stekkerding.scad @@ -0,0 +1,108 @@ +// asdfadsf + +radius = product_of_the_triangle_side_lengths / area_of_the_triangle_multiplied_by_4; + +FN=80*1; + +width_shortest = 40; +width_longest = 60; +height = 40; +wall_thickness = 3; + +max_length = 30; + +// Gotta do some mathematics + +triangle_height = (width_longest - width_shortest) / 2; +triangle_width = height / 2; + +slanted_side = sqrt(pow(triangle_height, 2) + pow(triangle_width,2)); + +product_triangle_sides = slanted_side * slanted_side * height; +triangle_area = (height*triangle_height)/2; + +radius_side = product_triangle_sides / (4 * triangle_area); + +echo(str("Radius: ", radius_side)); + +module body(radius_sides, body_height, body_width, inner){ + intersection(){ + intersection(){ + translate([0,0,-body_height/2]){ + cube([body_width,100,body_height]); + } + union(){ + translate([radius_sides,0,0]){ + rotate([-90,0,0]){ + cylinder(h=100, r=radius_sides, $fn=FN); + } + } + translate([body_width-radius_sides,0,0]){ + rotate([-90,0,0]){ + cylinder(h=100, r=radius_sides, $fn=FN); + } + } + + } + } + union(){ + translate([0,radius_sides,-body_height/2]){ + cube([body_width,100,body_height]); + } + if (inner == 1) { + translate([0,radius_sides,0]){ + rotate([0,90,0]){ + cylinder(h=100, r=radius_sides, $fn=FN); + } + } + } else { + translate([0,0,-body_height/2]){ + cube([body_width,100,body_height]); + } + } + } + } +} + +module shell(){ + intersection(){ + difference(){ + body(radius_side + wall_thickness*2, height + wall_thickness*2, width_longest + wall_thickness*2); + translate([wall_thickness, wall_thickness, 0]){ + body(radius_side, height, width_longest, 1); + } + } + translate([0,0,-(height+wall_thickness*2)/2]){ + cube([width_longest+ wall_thickness*2,max_length,height+wall_thickness*2]); + } + } +} + +module screwdown(){ + difference(){ + cube([15+radius_side,15,wall_thickness]); + translate([7.5,7.5,0]){ + screw_hole(); + } + } +} + +module screw_hole() { + // screw head that I measured maxes at 7mm + // screw thread is 3.5 mm + head = 7; + thread = 3.5 + 0.5; + + translate([0,0,-20]){ + cylinder(h=30, r=thread/2, $fn=FN); + } + translate([0,0,btn-(thread/2)]){ + cylinder(h=head-(thread/2), r1=thread/2, r2=head); + } +} + + +shell(); +translate([-15,0,-(height+wall_thickness*2)/2]){ + screwdown(); +}