Browse Source

Added support for different Sink versions

The bracket previously supported PD Buddy Sink versions 0.1 and 0.2,
which were similar enough in size and shape to be able to use the same
bracket.  The current development version of 0.3 is 1 mm narrower, so
the bracket needs a change to support it.  That change has been made,
and a `board` parameter has been added to allow setting the board
revision.  Valid values are `sink_0_1`, `sink_0_2`, and `sink_0_3`.
Clara Hobbs 7 years ago
parent
commit
9a7d162ace
1 changed files with 28 additions and 15 deletions
  1. 28
    15
      sink_bracket.scad

+ 28
- 15
sink_bracket.scad View File

@@ -4,37 +4,48 @@ include <MCAD/units.scad>;
4 4
 include <truncated_teardrop.scad>;
5 5
 
6 6
 
7
+sink_0_1 = [26*mm, 49*mm, 18*mm, 4*mm, 10*mm];
8
+sink_0_2 = [26*mm, 48*mm, 18*mm, 4*mm, 10*mm];
9
+sink_0_3 = [25*mm, 30*mm, 17*mm, 4*mm, 10*mm];
10
+
11
+function sink_width(board) = board[0];
12
+function sink_length(board) = board[1];
13
+function sink_screw_spacing(board) = board[2];
14
+function sink_screw_distance(board) = board[3];
15
+function sink_connector_cutout(board) = board[4];
16
+
17
+
7 18
 /*
8 19
  * A general-purpose mount for the PD Buddy Sink
9 20
  */
10 21
 module sink_mount(layer_thickness=0.25*mm, height=8*mm, nut_depth=4*mm,
11
-		cutout=0.5*mm, bolt_tolerance=0.3*mm, nut_tolerance=0.05*mm) {
12
-	/* Width of the PD Buddy Sink */
13
-	sink_width = 26*mm;
22
+		cutout=0.5*mm, bolt_tolerance=0.3*mm, nut_tolerance=0.05*mm,
23
+		board=sink_0_3) {
24
+	w = sink_width(board);
14 25
 
15 26
 	difference() {
16 27
 		/* Body of the mount */
17
-		cube([8*mm, sink_width, height]);
28
+		cube([8*mm, w, height]);
18 29
 
19 30
 		/* Bolt hole bottom height.  Leave one layer_thickness as a bridge. */
20 31
 		bhbot = nut_depth + layer_thickness;
21 32
 		/* Bolt holes */
22
-		translate([4*mm, 4*mm, bhbot])
33
+		translate([4*mm, (w - sink_screw_spacing(board))/2, bhbot])
23 34
 			polyhole(d=3*mm + bolt_tolerance, h=height - bhbot + epsilon);
24
-		translate([4*mm, sink_width-4*mm, bhbot])
35
+		translate([4*mm, (w + sink_screw_spacing(board))/2, bhbot])
25 36
 			polyhole(d=3*mm + bolt_tolerance, h=height - bhbot + epsilon);
26 37
 
27 38
 		/* Nut holes */
28
-		translate([4*mm, 4*mm, -epsilon])
39
+		translate([4*mm, (w - sink_screw_spacing(board))/2, -epsilon])
29 40
 			rotate([0, 0, 30])
30 41
 			cylinder(r=6.4*mm / 2 + nut_tolerance, h=nut_depth + epsilon, $fn=6);
31
-		translate([4*mm, sink_width - 4*mm, -epsilon])
42
+		translate([4*mm, (w + sink_screw_spacing(board))/2, -epsilon])
32 43
 			rotate([0, 0, 30])
33 44
 			cylinder(r=6.4*mm / 2 + nut_tolerance, h=nut_depth + epsilon, $fn=6);
34 45
 
35 46
 		/* Small cutout to clear any solder bulges under the USB connector */
36
-		translate([-epsilon, 8*mm, height - cutout])
37
-			cube([8*mm + 2*epsilon, sink_width - 2*8*mm, cutout + epsilon]);
47
+		translate([-epsilon, (w - sink_connector_cutout(board))/2, height - cutout])
48
+			cube([8*mm + 2*epsilon, sink_connector_cutout(board), cutout + epsilon]);
38 49
 	}
39 50
 }
40 51
 
@@ -42,10 +53,11 @@ module sink_mount(layer_thickness=0.25*mm, height=8*mm, nut_depth=4*mm,
42 53
  * A bracket for mounting the PD Buddy Sink on a panel
43 54
  */
44 55
 module sink_bracket(layer_thickness=0.25*mm, height=8*mm, nut_depth=4*mm,
45
-		cutout=0.5*mm, bolt_tolerance=0.3*mm, nut_tolerance=0.05*mm) {
46
-	sink_width = 26*mm;
56
+		cutout=0.5*mm, bolt_tolerance=0.3*mm, nut_tolerance=0.05*mm,
57
+		board=sink_0_3) {
58
+	w = sink_width(board);
47 59
 	halfend_width = 8*mm;
48
-	bracket_width = sink_width + 2*halfend_width;
60
+	bracket_width = w + 2*halfend_width;
49 61
 
50 62
 	mount_distance = 5*mm;
51 63
 
@@ -57,9 +69,10 @@ module sink_bracket(layer_thickness=0.25*mm, height=8*mm, nut_depth=4*mm,
57 69
 				sink_mount(layer_thickness=layer_thickness, height=height,
58 70
 						nut_depth=nut_depth, cutout=cutout,
59 71
 						bolt_tolerance=bolt_tolerance,
60
-						nut_tolerance=nut_tolerance);
72
+						nut_tolerance=nut_tolerance,
73
+						board=board);
61 74
 
62
-			translate([0, halfend_width + sink_width, 0])
75
+			translate([0, halfend_width + w, 0])
63 76
 				cube([8*mm, halfend_width, height]);
64 77
 		}
65 78
 

Loading…
Cancel
Save