From: daniel watson Date: Wed, 11 Apr 2018 03:48:45 +0000 (-0700) Subject: clarify code by moving nubs into their own modules X-Git-Url: http://challenge-bot.com/repos/?p=ozzloy%40gmail.com%2F3d-printables;a=commitdiff_plain;h=293dbe2df1cd0d41c76901a7a65355cf0ddc9bfd clarify code by moving nubs into their own modules --- diff --git a/3030-dampener-feet.scad b/3030-dampener-feet.scad index 944b258..a5abfce 100644 --- a/3030-dampener-feet.scad +++ b/3030-dampener-feet.scad @@ -27,12 +27,15 @@ corner_rounding_radius = : maximum_corner_rounding_radius; +// the printed nubs did not fit into the extrusion gap perfectly. +// we can change the model just a little bit to accomodate printing +// imperfections. fudge = 0.1; //fudge = 0.0; // 3030 dimensions -x = 30; // adding a little because printers aren't perfect -y = 30; // adding a little because printers aren't perfect +x = 30; +y = 30; opening_width = 8; outer_block = (30 - 16.5) / 2; @@ -51,6 +54,19 @@ module fillet(r) { module round_corners(r) { fillet(r) { fillet(-r) { children(); } } } +module side_nub() { + // side nub, goes into side 3030 openings + a = opening_width; + b = foot_height + wall_width - (y - opening_width) / 2; + side_nub_length = (a < b) ? a : b; + translate([0, (y - opening_width) / 2 + fudge]) { + square([nub_depth, side_nub_length - fudge]); } } + +module bottom_nub() { + // bottom nub, goes into bottom 3030 opening + translate([(x - opening_width) / 2, 0]) { + square([opening_width / 2, nub_depth]); } } + module half_foot_2d() { // outer ring difference() { @@ -68,15 +84,8 @@ module half_foot_2d() { translate([cos(45) * foot_height, -(sin(45) * foot_height + wall_width)]) { square([x / 2 - cos(45) * foot_height, wall_width]); } - // bottom nub, goes into bottom 3030 opening - translate([(x - opening_width) / 2, 0]) { - square([opening_width / 2, nub_depth]); } - // side nub, goes into side 3030 openings - a = opening_width; - b = foot_height + wall_width - (y - opening_width) / 2; - side_nub_length = (a < b) ? a : b; - translate([0, (y - opening_width) / 2 + fudge]) { - square([nub_depth, side_nub_length - fudge]); } } + bottom_nub(); + side_nub(); } module foot_2d() { round_corners(corner_rounding_radius) {