From e738c99934571ed764cc4a376c68dbf3b9988e37 Mon Sep 17 00:00:00 2001 From: Jan Huwald Date: Tue, 11 Feb 2014 14:48:25 +0100 Subject: connector: improve thread holes - add epsilon to prevent precise surface overlap (improves rendering) - add sink hole for nut and screw head diff --git a/connector_front.scad b/connector_front.scad index 5d9c796..5b17a86 100644 --- a/connector_front.scad +++ b/connector_front.scad @@ -3,6 +3,7 @@ include use use use +use module front_connector_half( border_side = false, @@ -18,16 +19,13 @@ module front_connector_half( cube([bar_thickness, bar_thickness, bar_thickness]); } - // holes for thread rods (horizontal, vertical) + // Hole for horizontal thread rods. A dimple for a scew is added at the bottom. translate([0, bar_thickness / 2, 0]) - cylinder(h = tray_height, r = (rod_diameter + pla_epsilon) / 2, $fs=0.1); - translate([0, bar_thickness * 1.5, tray_height - bar_thickness / 2]) rotate([0, 90, 0]) - cylinder(h = tray_width / 2, r = (rod_diameter + pla_epsilon) / 2, $fs=0.1); - - // hole for nut on the bottom of the vertical rod - if (border_bottom) - translate([0, bar_thickness / 2, 0]) - cylinder(h=nut_height, r=nut_diameter/2 + pla_epsilon, $fs=0.1); + screw_hole(nut_depth = border_bottom ? (nut_height + pla_epsilon) : 0); + + // vertical screw hole + translate([tray_width/2 - bar_thickness, bar_thickness * 1.5, tray_height - bar_thickness / 2]) rotate([0, 90, 0]) + # screw_hole(nut_depth = nut_height); } module front_connector( diff --git a/parameters.scad b/parameters.scad index 6fad0e7..388be89 100644 --- a/parameters.scad +++ b/parameters.scad @@ -51,4 +51,12 @@ pla_epsilon = 0.1; tray_height = hdd_height + max(cooling_height, 2 * bar_thickness + 10 * pla_epsilon); tray_width = hdd_width + bar_thickness; +/// OPENSCAD HACKS +// a length larger than any constructed feature; use to simulate +// infinitely long structures (for difference operations) +large = 1000; + +// A small quantity that does not change the print results. Use to +// displace surfaces of CSG operations to prevent them from overlapping. +epsilon = 0.0001; diff --git a/screw_hole.scad b/screw_hole.scad new file mode 100644 index 0000000..aebaa0e --- /dev/null +++ b/screw_hole.scad @@ -0,0 +1,17 @@ +include + +module screw_hole( + screw_diameter = rod_diameter, + nut_diameter = nut_diameter, + nut_depth=0 +) { + translate([0, 0, nut_depth - epsilon]) { + // thread + cylinder(h=large, r=screw_diameter / 2 + pla_epsilon, $fs=0.1); + + // nut or screw head + mirror([0, 0, 1]) cylinder(h=large, r=nut_diameter / 2 + pla_epsilon, $fs=0.1); + } +} + +screw_hole(nut_depth=1); \ No newline at end of file -- cgit v0.10.1