summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Huwald <jh@sotun.de>2014-02-11 13:48:25 (GMT)
committerJan Huwald <jh@sotun.de>2014-02-11 13:48:25 (GMT)
commite738c99934571ed764cc4a376c68dbf3b9988e37 (patch)
tree4ce8e4f7e2b957076b8a62176e249d7bfb7771ca
parent5dea174c89d5b691a6a2e9a4e10ac490c260d44e (diff)
connector: improve thread holes
- add epsilon to prevent precise surface overlap (improves rendering) - add sink hole for nut and screw head
-rw-r--r--connector_front.scad16
-rw-r--r--parameters.scad8
-rw-r--r--screw_hole.scad17
3 files changed, 32 insertions, 9 deletions
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 <parameters.scad>
use <connector.scad>
use <nipple.scad>
use <rail.scad>
+use <screw_hole.scad>
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 <parameters.scad>
+
+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
contact: Jan Huwald // Impressum